/* Junior Qur'an page-only polish. */
main#main-content:has(.ba-qj) > .ba-page-intro,
body.ba-qj-page main#main-content > .ba-page-intro {
  display: none;
}
main#main-content:has(.ba-qj),
body.ba-qj-page main#main-content {
  padding-top: 0 !important;
}

.ba-qj {
  --qj-ink: #1e2933;
  --qj-muted: #62717d;
  --qj-ivory: #f7f3ee;
  --qj-paper: #fffdf9;
  --qj-clay: #df6f57;
  --qj-apricot: #f3a36a;
  --qj-teal: #4a7a7f;
  --qj-brass: #c8aa64;
  --qj-line: rgba(30, 41, 51, .13);
  --qj-shadow: 0 22px 60px rgba(30, 41, 51, .10);
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, #f6efe8 0, var(--qj-ivory) 320px, #fff 100%);
  color: var(--qj-ink);
  padding: clamp(26px, 4vw, 64px) max(18px, calc((100vw - 1380px) / 2));
  transition: background .25s ease, color .25s ease;
}

.ba-qj[data-theme="sunrise"] {
  --qj-ivory: #f7f3ee;
  --qj-paper: #fffdf9;
  --qj-clay: #df6f57;
  --qj-apricot: #f3a36a;
  --qj-teal: #4a7a7f;
  background: linear-gradient(180deg, #f8eee4 0, #fff6ec 280px, #fff 100%);
}
.ba-qj[data-theme="ocean"] {
  --qj-ivory: #eef7f8;
  --qj-paper: #fbfeff;
  --qj-clay: #3d7ea6;
  --qj-apricot: #8fd5e5;
  --qj-teal: #2f6f78;
  background: linear-gradient(180deg, #e9f6fb 0, #f3fbfd 280px, #fff 100%);
}
.ba-qj[data-theme="garden"] {
  --qj-ivory: #f2f7ed;
  --qj-paper: #fffef8;
  --qj-clay: #7c9254;
  --qj-apricot: #c9d88f;
  --qj-teal: #537565;
  background: linear-gradient(180deg, #edf5e6 0, #f7faef 280px, #fff 100%);
}
.ba-qj[data-theme="starlight"] {
  --qj-ivory: #f1f0f8;
  --qj-paper: #fffefe;
  --qj-clay: #6f63a8;
  --qj-apricot: #c4b5fd;
  --qj-teal: #536d8a;
  background: linear-gradient(180deg, #eeedf8 0, #f7f5fd 280px, #fff 100%);
}
.ba-qj[data-theme="rainbow"] {
  --qj-ivory: #fff8fb;
  --qj-paper: #fffefe;
  --qj-clay: #e85d75;
  --qj-apricot: #f6c453;
  --qj-teal: #2f8f83;
  background:
    radial-gradient(circle at 12% 8%, rgba(244,114,182,.18), transparent 24%),
    radial-gradient(circle at 86% 10%, rgba(96,165,250,.18), transparent 26%),
    linear-gradient(180deg, #fff8e8 0, #f7fbff 280px, #fff 100%);
}
.ba-qj[data-theme="bubblegum"] {
  --qj-ivory: #fff1f7;
  --qj-paper: #fffafd;
  --qj-clay: #d9468f;
  --qj-apricot: #ff9fc8;
  --qj-teal: #6d63c7;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,159,200,.23) 0 4px, transparent 5px),
    radial-gradient(circle at 80% 9%, rgba(167,139,250,.20) 0 6px, transparent 7px),
    linear-gradient(180deg, #fff0f8 0, #f8f3ff 280px, #fff 100%);
  background-size: 52px 52px, 70px 70px, auto;
}

.ba-qj *, .ba-qj *::before, .ba-qj *::after { box-sizing: border-box; }
.ba-qj button, .ba-qj select { font: inherit; }
.ba-qj button { cursor: pointer; }
.ba-qj button:focus-visible, .ba-qj select:focus-visible {
  outline: 3px solid rgba(74, 122, 127, .36);
  outline-offset: 3px;
}

.ba-qj__hero {
  position: relative;
  scroll-margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, .55fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  max-width: 1380px;
  margin: 0 auto clamp(28px, 4vw, 48px);
}
.ba-qj__hero::after {
  content: '';
  position: absolute;
  inset: auto 8% -18px auto;
  width: 72px;
  height: 26px;
  pointer-events: none;
  opacity: .55;
  background:
    radial-gradient(circle at 8px 13px, var(--qj-apricot) 0 4px, transparent 4.5px),
    radial-gradient(circle at 34px 7px, var(--qj-teal) 0 3px, transparent 3.5px),
    radial-gradient(circle at 60px 15px, var(--qj-clay) 0 4px, transparent 4.5px);
}

.ba-qj__kicker, .ba-qj__eyebrow, .ba-qj__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--qj-teal);
}

.ba-qj__hero h2 {
  margin: 0;
  max-width: 900px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(34px, 5vw, 66px);
  line-height: .98;
  letter-spacing: -.035em;
}

.ba-qj__lede {
  max-width: 760px;
  margin: 18px 0 0;
  color: #51606b;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.55;
}

.ba-qj__hero-arabic {
  color: rgba(74, 122, 127, .94);
  font-family: 'Geeza Pro', 'Noto Naskh Arabic', serif;
  font-size: clamp(58px, 7vw, 96px);
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.ba-qj__shell { max-width: 1380px; margin: 0 auto; }

.ba-qj__modes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.ba-qj__modes button {
  min-height: 56px;
  border: 1px solid var(--qj-line);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  color: #53616c;
  font-weight: 760;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}

.ba-qj__modes button:hover { transform: translateY(-1px); border-color: rgba(74, 122, 127, .34); }
.ba-qj__modes button span {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #edf1f0;
  color: #52646a;
  font-size: 13px;
}
.ba-qj__modes button[aria-current="step"] {
  background: var(--qj-ink);
  color: white;
  border-color: var(--qj-ink);
}
.ba-qj__modes button[aria-current="step"] span { background: var(--qj-apricot); color: #2b2520; }

.ba-qj__progress-wrap { margin: 0 2px 18px; }
.ba-qj__progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--qj-muted);
  font-size: 14px;
  margin-bottom: 8px;
}
.ba-qj__progress-copy strong { color: var(--qj-ink); }
.ba-qj__progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(30, 41, 51, .09);
}
.ba-qj__progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--qj-clay), var(--qj-apricot));
  transition: width .28s ease;
}

.ba-qj__lesson {
  background: var(--qj-paper);
  border: 1px solid rgba(30, 41, 51, .11);
  border-radius: 28px;
  box-shadow: var(--qj-shadow);
  padding: clamp(22px, 4vw, 52px);
  overflow: hidden;
}

.ba-qj__lesson-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(24px, 4vw, 46px);
}
.ba-qj__lesson-head h3 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.08;
}

.ba-qj__settings-button {
  flex: 0 0 auto;
  border: 1px solid var(--qj-line);
  border-radius: 999px;
  background: white;
  color: var(--qj-ink);
  min-height: 44px;
  padding: 0 16px;
  font-weight: 760;
}
.ba-qj__settings-button span { color: var(--qj-teal); }

.ba-qj__settings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin: -18px 0 30px;
  padding: 16px 18px;
  background: #f2f3ef;
  border-radius: 16px;
  border: 1px solid rgba(30, 41, 51, .08);
}
.ba-qj__settings[hidden] { display: none; }
.ba-qj__settings label { color: #52616b; font-size: 14px; font-weight: 650; }
.ba-qj__settings select {
  margin-left: 7px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--qj-line);
  background: white;
  padding: 0 30px 0 10px;
}
.ba-qj__themes {
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ba-qj__themes legend {
  margin-bottom: 8px;
  color: #52616b;
  font-size: 14px;
  font-weight: 700;
}
.ba-qj__theme-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ba-qj__theme-choices button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--qj-line);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  color: var(--qj-ink);
  font-size: 13px;
  font-weight: 760;
}
.ba-qj__theme-choices button span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(243,163,106,.18);
  color: var(--qj-clay);
  font-size: 15px;
}
.ba-qj__theme-choices button[data-qj-theme-choice="ocean"] span { background: #dff2f8; color: #3d7ea6; }
.ba-qj__theme-choices button[data-qj-theme-choice="garden"] span { background: #edf5df; color: #6f8648; }
.ba-qj__theme-choices button[data-qj-theme-choice="starlight"] span { background: #eeeafd; color: #6f63a8; }
.ba-qj__theme-choices button[data-qj-theme-choice="rainbow"] span { background: linear-gradient(135deg,#ffd2df,#ffe6a7,#c9f1df,#cfe1ff); color: #74405b; }
.ba-qj__theme-choices button[data-qj-theme-choice="bubblegum"] span { background: #ffe0ef; color: #c7357f; }
.ba-qj__theme-choices button.is-active {
  border-color: var(--qj-teal);
  box-shadow: inset 0 0 0 1px var(--qj-teal);
  background: var(--qj-paper);
}
.ba-qj__toggle { display: inline-flex; gap: 8px; align-items: center; }
.ba-qj__toggle input { width: 18px; height: 18px; accent-color: var(--qj-teal); }

.ba-qj__arabic {
  direction: rtl;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 13px 10px;
  padding: 24px 6px 34px;
  min-height: 132px;
  font-family: 'Geeza Pro', 'Noto Naskh Arabic', serif;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 1.65;
  color: #18232b;
}

.ba-qj__word {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  border-radius: 12px;
  padding: 0 .08em .08em;
  font: inherit;
  line-height: inherit;
  transition: background .14s ease, transform .14s ease;
}
.ba-qj__word:hover { background: rgba(243, 163, 106, .11); }
.ba-qj__word.is-active {
  background: rgba(243, 163, 106, .17);
  transform: translateY(-2px);
}
.ba-qj__word.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--qj-clay);
  box-shadow: 0 5px 12px rgba(223, 111, 87, .35);
  animation: ba-qj-bounce .72s cubic-bezier(.37,0,.63,1) infinite alternate;
}
.ba-qj[data-guide="off"] .ba-qj__word.is-active { background: transparent; transform: none; }
.ba-qj[data-guide="off"] .ba-qj__word.is-active::after { display: none; }
@keyframes ba-qj-bounce { from { transform: translateY(0) scale(1); } to { transform: translateY(-7px) scale(.93); } }

.ba-qj__pronunciation, .ba-qj__meaning {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}
.ba-qj__pronunciation p {
  margin: 7px 0 0;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.42;
  font-weight: 760;
  color: #32424d;
  overflow-wrap: anywhere;
}
.ba-qj__meaning {
  border-top: 1px solid var(--qj-line);
  margin-top: 26px;
  padding-top: 22px;
}
.ba-qj__meaning[hidden] { display: none; }
.ba-qj__meaning p {
  margin: 7px 0 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(17px, 1.65vw, 22px);
  line-height: 1.55;
  color: #55626b;
}

.ba-qj__word-card {
  max-width: 650px;
  margin: 24px auto 0;
  padding: 14px 18px;
  border-radius: 16px;
  background: #eef3f1;
  border: 1px solid rgba(74, 122, 127, .16);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: 'arabic pronunciation' 'arabic meaning';
  gap: 2px 14px;
  align-items: center;
  color: #41515a;
}
.ba-qj__word-card[hidden] { display: none; }
.ba-qj__word-arabic { grid-area: arabic; font-family: 'Geeza Pro','Noto Naskh Arabic',serif; font-size: 34px; color: var(--qj-ink); }
.ba-qj__word-card [data-qj-word-pronunciation] { grid-area: pronunciation; font-size: 14px; color: var(--qj-muted); }
.ba-qj__word-card [data-qj-word-meaning] { grid-area: meaning; font-size: 15px; }

.ba-qj__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 4vw, 44px);
}
.ba-qj__actions button {
  min-height: 52px;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 820;
  border: 1px solid transparent;
}
.ba-qj__primary { background: var(--qj-ink); color: white; }
.ba-qj__primary:hover { background: #293844; }
.ba-qj__secondary { background: white; color: var(--qj-ink); border-color: var(--qj-line) !important; }
.ba-qj__lesson.is-playing .ba-qj__primary { background: var(--qj-teal); }
.ba-qj__lesson.is-your-turn {
  box-shadow: 0 22px 60px rgba(74, 122, 127, .16), inset 0 0 0 2px rgba(74, 122, 127, .16);
}

.ba-qj__status {
  min-height: 24px;
  margin: 14px 0 0;
  text-align: center;
  color: var(--qj-muted);
  font-size: 14px;
}

.ba-qj__nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin: 20px 0 0;
}
.ba-qj__nav > button {
  min-height: 46px;
  border: 0;
  background: transparent;
  color: var(--qj-ink);
  font-weight: 800;
  padding: 0 4px;
}
.ba-qj__nav > button:first-child { justify-self: start; }
.ba-qj__nav > button:last-child { justify-self: end; }
.ba-qj__nav > button:disabled { opacity: .3; cursor: default; }
.ba-qj__dots { display: flex; gap: 7px; justify-content: center; }
.ba-qj__dots button {
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(30, 41, 51, .18);
  overflow: hidden;
  text-indent: -999px;
}
.ba-qj__dots button[aria-current="true"] { background: var(--qj-clay); transform: scale(1.25); }

.ba-qj__safety-note, .ba-qj__credit {
  max-width: 960px;
  margin: 18px auto 0;
  text-align: center;
  color: #69757e;
  font-size: 13px;
  line-height: 1.55;
}
.ba-qj__credit { margin-top: 8px; font-size: 12px; color: #7a858c; }

@media (max-width: 760px) {
  .ba-qj { padding-inline: 14px; }
  .ba-qj__hero { grid-template-columns: 1fr; gap: 18px; align-items: start; }
  .ba-qj__hero-arabic { text-align: left; font-size: 54px; }
  .ba-qj__modes {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .ba-qj__modes::-webkit-scrollbar { display: none; }
  .ba-qj__modes button {
    min-width: max-content;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 999px;
  }
  .ba-qj__lesson { border-radius: 22px; padding: 20px 16px 24px; }
  .ba-qj__lesson-head { align-items: center; margin-bottom: 20px; }
  .ba-qj__lesson-head h3 { font-size: 26px; }
  .ba-qj__settings-button { width: 44px; padding: 0; font-size: 0; }
  .ba-qj__settings-button span { font-size: 18px; }
  .ba-qj__settings { align-items: stretch; flex-direction: column; margin-top: -8px; }
  .ba-qj__settings label { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .ba-qj__theme-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ba-qj__arabic { font-size: clamp(36px, 12vw, 52px); gap: 9px 6px; min-height: 118px; padding: 12px 0 30px; }
  .ba-qj__pronunciation p { font-size: 21px; }
  .ba-qj__word-card { grid-template-columns: auto 1fr; margin-top: 18px; }
  .ba-qj__actions { display: grid; grid-template-columns: 1fr; gap: 9px; }
  .ba-qj__actions button { width: 100%; }
  .ba-qj__nav { grid-template-columns: 1fr 1fr; }
  .ba-qj__dots { grid-column: 1 / -1; grid-row: 1; margin-bottom: 3px; }
  .ba-qj__nav > button:first-child { grid-column: 1; grid-row: 2; }
  .ba-qj__nav > button:last-child { grid-column: 2; grid-row: 2; }
}

@media (max-width: 360px) {
  .ba-qj__hero h2 { font-size: 34px; }
  .ba-qj__lede { font-size: 16px; }
  .ba-qj__hero-arabic { font-size: 48px; }
  .ba-qj__lesson-head { gap: 12px; }
  .ba-qj__lesson-head h3 { font-size: 23px; }
  .ba-qj__arabic { font-size: 37px; }
  .ba-qj__word-card { grid-template-columns: 1fr; grid-template-areas: 'arabic' 'pronunciation' 'meaning'; text-align: center; }
  .ba-qj__word-arabic { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .ba-qj *, .ba-qj *::before, .ba-qj *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* J2 learning activities, progress and helper surfaces. */
@media (min-width: 761px) {
  .ba-qj__modes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.ba-qj__modes button.is-complete:not([aria-current="step"]) {
  border-color: rgba(74, 122, 127, .28);
  background: rgba(238, 243, 241, .86);
  color: #385d61;
}
.ba-qj__modes button.is-complete:not([aria-current="step"]) span {
  background: var(--qj-teal);
  color: white;
}
.ba-qj__modes button.is-complete:not([aria-current="step"]) span::after {
  content: '✓';
  font-size: 11px;
  margin-left: 1px;
}

.ba-qj__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 0;
  margin-top: 10px;
}
.ba-qj__badges:empty { display: none; }
.ba-qj__badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(200, 170, 100, .14);
  border: 1px solid rgba(200, 170, 100, .30);
  color: #695827;
  font-size: 12px;
  font-weight: 780;
}

.ba-qj__activity {
  max-width: 820px;
  margin: 28px auto 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(74, 122, 127, .17);
  border-radius: 20px;
  background: #f5f7f4;
  text-align: center;
}
.ba-qj__activity[hidden] { display: none; }
.ba-qj__activity h4 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.2;
}
.ba-qj__match-target {
  margin: 18px 0;
  font-family: 'Geeza Pro', 'Noto Naskh Arabic', serif;
  font-size: clamp(42px, 6vw, 62px);
  line-height: 1.5;
  color: #18232b;
}
.ba-qj__match-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ba-qj__match-options button,
.ba-qj__review-complete,
.ba-qj__review-word,
.ba-qj__helper button {
  min-height: 48px;
  border: 1px solid var(--qj-line);
  border-radius: 14px;
  background: white;
  color: var(--qj-ink);
  font-weight: 740;
  padding: 10px 14px;
}
.ba-qj__match-options button:hover,
.ba-qj__review-word:hover,
.ba-qj__helper button:hover { border-color: rgba(74, 122, 127, .42); }
.ba-qj__match-options button.is-correct {
  border-color: rgba(74, 122, 127, .52);
  background: #e7f1ec;
  color: #28564f;
}
.ba-qj__match-options button.is-try-again {
  border-color: rgba(223, 111, 87, .42);
  background: #fff4f0;
}
.ba-qj__activity-feedback {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--qj-muted);
  font-size: 14px;
}

.ba-qj__review > p:not(.ba-qj__label) {
  max-width: 620px;
  margin: 10px auto 0;
  color: var(--qj-muted);
  line-height: 1.55;
}
.ba-qj__review-words {
  display: flex;
  flex-wrap: wrap;
  direction: rtl;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
}
.ba-qj__review-word {
  display: grid;
  min-width: 76px;
  gap: 2px;
  padding: 8px 12px;
}
.ba-qj__review-word span {
  font-family: 'Geeza Pro', 'Noto Naskh Arabic', serif;
  font-size: 30px;
  line-height: 1.4;
}
.ba-qj__review-word small {
  direction: ltr;
  font-size: 10px;
  color: var(--qj-muted);
  font-weight: 650;
}
.ba-qj__review-complete {
  border-color: var(--qj-ink);
  background: var(--qj-ink);
  color: white;
}
.ba-qj__review-complete.is-complete {
  border-color: var(--qj-teal);
  background: var(--qj-teal);
}

.ba-qj__helper {
  max-width: 920px;
  margin: 24px auto 0;
  border: 1px solid var(--qj-line);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  overflow: hidden;
}
.ba-qj__helper summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 800;
  color: var(--qj-ink);
}
.ba-qj__helper summary::-webkit-details-marker { display: none; }
.ba-qj__helper summary::after {
  content: '+';
  margin-left: auto;
  font-size: 22px;
  color: var(--qj-teal);
}
.ba-qj__helper[open] summary::after { content: '−'; }
.ba-qj__helper-body {
  border-top: 1px solid var(--qj-line);
  padding: 16px 18px 18px;
  color: #56636c;
  line-height: 1.55;
}
.ba-qj__helper-body p { margin: 0 0 10px; }
.ba-qj__privacy { font-size: 13px; }
.ba-qj__helper button {
  min-height: 44px;
  margin-top: 4px;
  font-size: 13px;
}
.ba-qj__helper summary:focus-visible {
  outline: 3px solid rgba(74, 122, 127, .36);
  outline-offset: -3px;
}

@media (max-width: 760px) {
  .ba-qj__progress-copy { align-items: baseline; }
  .ba-qj__match-options { grid-template-columns: 1fr; }
  .ba-qj__match-options button,
  .ba-qj__review-complete { width: 100%; min-height: 50px; }
  .ba-qj__activity { padding: 18px 14px; border-radius: 16px; }
  .ba-qj__review-word { min-width: 70px; }
  .ba-qj__helper { border-radius: 16px; }
}

@media (max-width: 360px) {
  .ba-qj__progress-copy { font-size: 12px; }
  .ba-qj__badge { font-size: 11px; }
  .ba-qj__match-target { font-size: 40px; }
  .ba-qj__activity h4 { font-size: 20px; }
}

/* J3-J5 guided-reading library and cross-sūrah resume. */
.ba-qj__library {
  max-width: 1380px;
  margin: 0 auto clamp(34px, 5vw, 64px);
  padding: clamp(20px, 2.5vw, 30px);
  border: 1px solid var(--qj-line);
  border-radius: 28px;
  background: rgba(255,255,255,.68);
  box-shadow: 0 14px 44px rgba(30,41,51,.055);
  backdrop-filter: blur(8px);
}
.ba-qj__library-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.ba-qj__library-heading h1 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -.025em;
}
.ba-qj__library-heading p:not(.ba-qj__kicker) {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--qj-muted);
  line-height: 1.5;
}
.ba-qj__resume {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--qj-ink);
  color: #fff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}
.ba-qj__resume[hidden] { display: none; }
.ba-qj__library-grid {
  display: grid;
  gap: 12px;
}
.ba-qj__library-grid--starter { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.ba-qj__library-grid--all { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); padding-top: 14px; }
.ba-qj__library-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 142px;
  grid-template-columns: minmax(0,1fr) auto;
  grid-template-areas: 'number arabic' 'title title' 'progress progress';
  align-content: start;
  gap: 4px 10px;
  padding: 15px;
  border: 1px solid var(--qj-line);
  border-radius: 18px;
  background: rgba(255,255,255,.8);
  color: var(--qj-ink) !important;
  text-decoration: none !important;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.ba-qj__library-card:hover,
.ba-qj__library-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--qj-teal) 45%, transparent);
  box-shadow: 0 12px 28px rgba(30,41,51,.09);
}
.ba-qj__library-card.is-current {
  border-color: var(--qj-teal);
  background: color-mix(in srgb, var(--qj-paper) 76%, var(--qj-teal) 24%);
}
.ba-qj__library-card.has-progress::after {
  content: '';
  position: absolute;
  top: 11px;
  right: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--qj-clay);
}
.ba-qj__library-number { grid-area: number; color: var(--qj-muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.ba-qj__library-card strong { grid-area: title; align-self: end; overflow: hidden; text-overflow: ellipsis; font-size: 15px; line-height: 1.2; }
.ba-qj__library-arabic { grid-area: arabic; align-self: center; color: var(--qj-teal); font-family: 'Geeza Pro', 'Noto Naskh Arabic', serif; font-size: 27px; line-height: 1.25; }
.ba-qj__library-card small { grid-area: progress; align-self: end; margin-top: auto; padding-top: 12px; color: var(--qj-teal); font-size: 11px; font-weight: 780; }
.ba-qj__library-more {
  margin-top: 16px;
  border-top: 1px solid var(--qj-line);
  padding-top: 4px;
}
.ba-qj__library-more > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  cursor: pointer;
  color: var(--qj-ink);
  font-size: 13px;
  font-weight: 820;
  list-style: none;
}
.ba-qj__library-more > summary::-webkit-details-marker { display: none; }
.ba-qj__library-more > summary::after { content: '+'; margin-left: auto; color: var(--qj-teal); font-size: 24px; font-weight: 500; }
.ba-qj__library-more[open] > summary::after { content: '−'; }
.ba-qj__lesson { scroll-margin-top: 24px; }

@media (max-width: 760px) {
  .ba-qj__library { border-radius: 20px; padding: 18px 14px; }
  .ba-qj__library-heading { display: grid; align-items: start; gap: 14px; }
  .ba-qj__resume { width: 100%; justify-content: center; }
  .ba-qj__library-grid--starter,
  .ba-qj__library-grid--all { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ba-qj__library-card { min-height: 128px; padding: 13px; }
  .ba-qj__library-arabic { font-size: 24px; }
}
@media (max-width: 360px) {
  .ba-qj__library-grid--starter,
  .ba-qj__library-grid--all { grid-template-columns: 1fr; }
  .ba-qj__library-card { min-height: 112px; }
}



/* Child-facing explanation layer: editorial learner aid, separate from translation. */
.ba-qj__kid-meaning {
  margin: 18px 0 12px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--qj-teal) 28%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--qj-paper) 86%, var(--qj-apricot) 14%);
}
.ba-qj__kid-meaning p { margin: 7px 0 5px; font-size: 17px; line-height: 1.6; color: var(--qj-ink); }
.ba-qj__kid-meaning small, .ba-qj__meaning small { display:block; margin-top:8px; color:var(--qj-muted); font-size:12px; line-height:1.5; }
.ba-qj__meaning { margin: 10px 0 18px; padding: 12px 16px; border: 1px solid var(--qj-line); border-radius: 14px; background: rgba(255,255,255,.68); }
.ba-qj__meaning summary { cursor:pointer; font-weight:760; color:var(--qj-teal); }
.ba-qj__meaning p { margin:10px 0 0; line-height:1.6; }

/* Junior responsive control polish: icon-only settings through tablet widths. */
@media (max-width: 900px) {
  .ba-qj__settings-button {
    width: 44px !important;
    min-width: 44px;
    padding-inline: 0 !important;
    font-size: 0 !important;
    line-height: 1;
  }
  .ba-qj__settings-button span {
    font-size: 18px !important;
    line-height: 1;
  }
}

/* Junior library usability pass: search, mobile swipe cards, quieter learner notes. */
.ba-qj__library-search { margin: 0 0 18px; }
.ba-qj__library-search > label { display:block; margin-bottom:7px; color:var(--qj-muted); font-size:12px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.ba-qj__library-search-field { display:flex; align-items:center; gap:9px; min-height:48px; padding:0 14px; border:1px solid var(--qj-line); border-radius:14px; background:rgba(255,255,255,.88); }
.ba-qj__library-search-field > span { color:var(--qj-teal); font-size:21px; line-height:1; }
.ba-qj__library-search-field input { width:100%; min-width:0; border:0; outline:0; box-shadow:none; background:transparent; color:var(--qj-ink); font:inherit; }
.ba-qj__search-results { display:grid; margin-top:8px; overflow:hidden; border:1px solid var(--qj-line); border-radius:14px; background:#fff; }
.ba-qj__search-results[hidden] { display:none; }
.ba-qj__search-result { display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:58px; padding:9px 13px; color:var(--qj-ink) !important; text-decoration:none !important; border-bottom:1px solid var(--qj-line); }
.ba-qj__search-result:last-child { border-bottom:0; }
.ba-qj__search-result:hover,.ba-qj__search-result:focus-visible { background:color-mix(in srgb,var(--qj-paper) 82%,var(--qj-teal) 18%); }
.ba-qj__search-result > span:first-child { display:grid; gap:1px; }
.ba-qj__search-result small { color:var(--qj-muted); font-size:10px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
.ba-qj__search-result strong { font-size:14px; }
.ba-qj__search-result-arabic { color:var(--qj-teal); font-family:'Geeza Pro','Noto Naskh Arabic',serif; font-size:23px; }
.ba-qj__search-empty { margin:0; padding:14px; color:var(--qj-muted); font-size:13px; }
.ba-qj__kid-meaning small { font-size:10px; line-height:1.35; opacity:.76; }
.ba-qj__status { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
.ba-qj__language-control { min-width:190px; }

@media (max-width:760px) {
  .ba-qj__library-grid--starter {
    display:flex;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    scroll-padding-inline:14px;
    gap:10px;
    margin-inline:-14px;
    padding:0 14px 10px;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .ba-qj__library-grid--starter::-webkit-scrollbar { display:none; }
  .ba-qj__library-grid--starter .ba-qj__library-card { flex:0 0 min(78vw,290px); width:min(78vw,290px); scroll-snap-align:start; }
  .ba-qj__library-grid--all { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ba-qj__library-search { margin-bottom:14px; }
}
@media (max-width:360px) {
  .ba-qj__library-grid--starter { display:flex; }
  .ba-qj__library-grid--starter .ba-qj__library-card { flex-basis:82vw; width:82vw; }
  .ba-qj__library-grid--all { grid-template-columns:1fr; }
}
