/* Maqraa v7 public pages layer (stage 2). Ported from design/v7/public: page header A (hbox), empty state C (bes), form card C (bcard), zigzag A, step spine A, list spines A.
   Tokens only (T1), no font-family here except var(--font-*) (T2), no pattern, arch, gradient (P1), motion is transform and opacity (P4). Loads after v7-site.css. */

/* ---------- shared bits from base.css ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (max-width: 520px) { .btn-row .btn { flex: 1 1 auto; } }

/* ---------- Page head: a forest ground panel, the same material as the landing hero ---------- */
.phead {
  background: var(--color-ground); color: var(--color-on-ground);
  border-end-start-radius: var(--radius-sheet); border-end-end-radius: var(--radius-sheet);
  padding-block: calc(var(--bar-height) + var(--bar-float) + clamp(28px, 5vw, 64px)) clamp(40px, 6vw, 80px);
}
.phead--tight { padding-block-end: clamp(32px, 4vw, 56px); }
.phead__in { display: grid; gap: var(--space-5); max-width: 62rem; }
.phead h1 {
  font-family: var(--font-display); font-weight: 400; font-size: min(var(--text-display), 4rem);
  line-height: var(--text-display-lh); letter-spacing: var(--tracking-display); text-wrap: balance; overflow-wrap: anywhere;
}
html[lang='ar'] .phead h1 { font-size: min(var(--text-display), 4.5rem); }
.phead .lead { font-size: var(--text-lead); line-height: var(--text-lead-lh); color: var(--color-on-ground-soft); max-width: 46rem; text-wrap: pretty; }
.eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-label); font-weight: 600; color: var(--color-gold); }
.eyebrow::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
:root[data-theme='dark'] .eyebrow { color: var(--maqraa-gold-300); } /* dark paper: plain gold was 3.80:1, the paler gold passes 4.5:1 */
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .eyebrow { color: var(--maqraa-gold-300); } }
.crumb { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); width: fit-content; font-size: var(--text-label); font-weight: 600; color: var(--color-on-ground-soft); text-decoration: none; }
.crumb:hover { color: var(--color-on-ground); }
.crumb svg { width: 18px; height: 18px; transform: scaleX(var(--dir)); }
.phead__stats { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-block-start: var(--space-2); }

.phead__grid { display: grid; gap: var(--space-6); align-items: center; }
.phead__text { display: grid; gap: var(--space-5); max-width: 62rem; min-width: 0; align-content: start; }
.phead__text > * { min-width: 0; }
.pw { display: grid; justify-items: center; align-content: center; gap: var(--space-3); min-width: 0; color: var(--color-gold); }
.pw__svg { display: block; width: 100%; max-height: 112px; fill: currentColor; }
.pw__en { display: none; font-family: var(--font-display); font-size: var(--text-h3); line-height: 1.1; color: var(--color-on-ground-soft); }
html[lang='en'] .pw__en { display: block; }
.pw--art { color: inherit; }
.pw--art .obj { width: 100%; max-width: 300px; max-height: 190px; }
@media (min-width: 900px) {
  .phead__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8); }
  .pw__svg { max-height: 240px; }
  .pw--art .obj { max-width: 440px; max-height: 300px; }
}

/* ---------- Sections ---------- */
.sect { padding-block: clamp(40px, 6vw, 88px); }
.sect--panel { background: var(--color-panel); }
.sect__h { font-family: var(--font-display); font-weight: 400; font-size: min(var(--text-h2), 2.75rem); line-height: var(--text-h2-lh); letter-spacing: var(--tracking-heading); text-wrap: balance; overflow-wrap: anywhere; margin-block-end: var(--space-4); }
.sect__lead { font-size: var(--text-lead); line-height: var(--text-lead-lh); color: var(--color-ink-soft); max-width: 46rem; margin-block-end: var(--space-6); text-wrap: pretty; }
.sect__h + .grid, .sect__h + .rows, .sect__h + .facts, .sect__h + .chain { margin-block-start: var(--space-5); }
.prose { max-width: 46rem; font-size: var(--text-body); line-height: var(--text-body-lh); text-wrap: pretty; }
.prose + .prose { margin-block-start: var(--space-4); }
.note { max-width: 46rem; color: var(--color-ink-soft); font-size: var(--text-small); }

/* ---------- Reveal: a block rises and fades in, once (transform and opacity only) ---------- */
html.js .rv { opacity: 0; transform: translateY(var(--rise)); transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); }
html.js .rv.is-in { opacity: 1; transform: none; }
.split { display: grid; gap: var(--space-7); align-items: start; }
.split .help { display: grid; gap: var(--space-4); justify-items: start; padding: var(--space-6); border-radius: var(--radius-panel); background: var(--color-tint); min-width: 0; }
.split .help__obj { width: 100%; max-width: 260px; margin-inline: auto; }
.split .help__t { font-family: var(--font-display); font-size: var(--text-h3); line-height: var(--text-h3-lh); text-wrap: balance; }
.split .help__n { display: grid; gap: var(--space-1); }
.split .help__n b { font-family: var(--font-display); font-weight: 400; font-size: min(var(--text-h2), 3rem); line-height: 1; color: var(--color-green); }
.split .help__n > span { color: var(--color-ink-soft); }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8); }
  .split__main .formcard { margin-inline: 0; max-width: none; }
  .split .help { position: sticky; inset-block-start: calc(var(--bar-height) + var(--bar-float) + var(--space-5)); }
}

/*
 * Maqraa v7 public pages, helper B: page header A (swap tile), empty state C (find your way), form card C (live card).
 * Values come from tokens.css only (rule T1); no font is declared here (T2). No pattern, arch, gradient, glass or line art (P1).
 * Motion is transform and opacity only, taken from the transitions-dev recipes 04 (text swap), 07 (panel reveal) and 02 (number pop-in)
 * without their blur. It is off with reduced motion, and anything that repeats has a Pause motion button and stops off screen.
 * The markup comes from _build/b_pieces.py, the behaviour from js/v7-b.js.
 */

/* ---------- Header A: the word of the page and its English name on one tile ---------- */
.hbox { display: grid; gap: var(--space-2); justify-items: center; min-width: 0; container-type: inline-size; }
.htile {
  all: unset; box-sizing: border-box; position: relative; display: grid; place-items: center; overflow: hidden; cursor: pointer; width: 100%;
  min-height: calc(var(--space-9) * 1.9); padding: var(--space-5) var(--space-5) calc(var(--space-5) + var(--space-6));
  border-radius: var(--radius-card); background: var(--color-ground-2); color: var(--color-gold); text-align: center;
  transition: transform var(--dur-fast) var(--ease-out);
}
.htile:active { transform: scale(var(--press)); }
.htile:focus-visible { outline: 3px solid var(--color-focus-on-ground); outline-offset: 3px; }
.htile__w {
  grid-area: 1 / 1; min-width: 0; max-width: 100%; text-wrap: balance; overflow-wrap: anywhere;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.htile__w--ar { font-family: var(--font-arabic); font-size: min(calc(var(--text-display) * 1.9), 25cqi); line-height: 1.5; }
.htile__w--en { font-family: var(--font-display); font-size: min(calc(var(--text-display) * 1.15), 14cqi); line-height: 1.1; letter-spacing: 0; }
/* the face that matches the page language is the first one; .is-alt brings the other */
html[lang='ar'] .htile__w--en, html[lang='en'] .htile__w--ar { opacity: 0; transform: translateY(calc(var(--rise) * 0.5)); }
html[lang='ar'] .htile.is-alt .htile__w--ar, html[lang='en'] .htile.is-alt .htile__w--en { opacity: 0; transform: translateY(calc(var(--rise) * -0.5)); }
html[lang='ar'] .htile.is-alt .htile__w--en, html[lang='en'] .htile.is-alt .htile__w--ar { opacity: 1; transform: none; }
.htile__hint {
  position: absolute; inset-inline: var(--space-4); inset-block-end: var(--space-4); font-size: var(--text-small); line-height: 1.4;
  color: var(--color-on-ground-soft); transition: opacity var(--dur-base) var(--ease-out);
}
.hbox.is-used .htile__hint { opacity: 0; }
.hbox__pause {
  all: unset; box-sizing: border-box; cursor: pointer; min-height: var(--tap); min-width: var(--tap); display: inline-flex; align-items: center; justify-content: center;
  padding-inline: var(--space-4); border-radius: var(--radius-pill); font-size: var(--text-small); font-weight: 600; color: var(--color-on-ground-soft);
  text-decoration: underline; text-underline-offset: 3px;
}
.hbox__pause:hover { color: var(--color-on-ground); }
.hbox__pause:focus-visible { outline: 3px solid var(--color-focus-on-ground); outline-offset: 2px; }
.hbox__pause[hidden] { display: none; }
.hbox__pause .p-on, .hbox__pause[aria-pressed='true'] .p-off { display: none; }
.hbox__pause[aria-pressed='true'] .p-on { display: inline; }
@media (min-width: 900px) { .htile { min-height: calc(var(--space-9) * 3); } }

/* ---------- Empty state C: a forest panel with a search that filters the real pages ---------- */
.bes { display: grid; gap: var(--space-5); padding: clamp(var(--space-5), 5vw, var(--space-8)); max-width: 48rem; margin-inline: auto; border-radius: var(--radius-panel); min-width: 0; background: var(--color-ground); color: var(--color-on-ground); }
.bes > * { min-width: 0; }
.bes__tag { font-size: var(--text-label); font-weight: 600; color: var(--color-gold); }
.bes__h { font-family: var(--font-display); font-weight: 400; font-size: min(var(--text-statement), 2.75rem); line-height: var(--text-statement-lh); text-wrap: balance; }
.bes__lead { color: var(--color-on-ground-soft); max-width: 46ch; text-wrap: pretty; }
.bes__soon { display: grid; gap: var(--space-4); justify-items: start; padding-block: var(--space-4); border-block: 1px solid var(--color-ground-2); }
.bes__soon p { max-width: 46ch; text-wrap: pretty; }
.bes__find { position: relative; display: grid; }
.bes__lab { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bes__in {
  box-sizing: border-box; width: 100%; min-height: 56px; padding-inline: var(--space-5) calc(var(--tap) + var(--space-3)); border-radius: var(--radius-input);
  border: 2px solid var(--color-on-ground-soft); background: var(--color-ground-2); color: var(--color-on-ground); font-size: var(--text-lead); line-height: 1.3;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.bes__in::placeholder { color: var(--color-on-ground-soft); opacity: 1; }
.bes__in:focus-visible { outline: 3px solid var(--color-focus-on-ground); outline-offset: 3px; border-color: var(--color-on-ground); }
.bes__in::-webkit-search-cancel-button { display: none; }
.bes__clr {
  all: unset; box-sizing: border-box; cursor: pointer; position: absolute; inset-inline-end: var(--space-2); inset-block-start: 50%; margin-block-start: calc(var(--tap) / -2);
  min-width: var(--tap); min-height: var(--tap); display: grid; place-items: center; border-radius: var(--radius-pill); color: var(--color-on-ground-soft);
  font-size: var(--text-small); font-weight: 600;
}
.bes__clr[hidden] { display: none; }
.bes__clr:hover { color: var(--color-on-ground); }
.bes__clr:focus-visible { outline: 3px solid var(--color-focus-on-ground); outline-offset: 2px; }
.bes__ans { min-height: 1.6em; color: var(--color-on-ground-soft); }
.bes__ans > span[hidden] { display: none; }
.bes__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.bes__list li[hidden] { display: none; }
.bes__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 56px; padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-card); background: var(--color-ground-2); color: var(--color-on-ground); text-decoration: none; font-size: var(--text-lead);
  transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.bes__row svg { flex: none; width: 20px; height: 20px; transform: scaleX(calc(-1 * var(--dir))); transition: transform var(--dur-base) var(--ease-out); }
.bes__t { display: grid; min-width: 0; }
.bes__n { color: var(--color-on-ground-soft); font-size: var(--text-small); }
.bes__row:hover { background: color-mix(in srgb, var(--color-on-ground) 10%, var(--color-ground-2)); }
.bes__row:active { transform: scale(var(--press)); }
.bes__row:focus-visible { outline: 3px solid var(--color-focus-on-ground); outline-offset: 2px; }
/* panel reveal (07): the rows rise in once, one after another; the script adds .is-in when the list is seen */
html.js .bes:not(.is-in) .bes__list li { opacity: 0; transform: translateY(var(--rise)); }
html.js .bes__list li { transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); transition-delay: calc(var(--i, 0) * var(--dur-fast) * 0.25); }
@media (hover: hover) { .bes__row:hover svg { transform: scaleX(calc(-1 * var(--dir))) translateX(4px); } }

/* ---------- Form card C: a solid card that fills as you type ---------- */
.bcard-wrap { display: grid; gap: var(--space-3); justify-items: center; width: 100%; min-width: 0; }
.bcard {
  box-sizing: border-box; display: grid; align-content: space-between; gap: var(--space-4); width: 100%; max-width: calc(var(--space-9) * 4.4); aspect-ratio: 1.586;
  padding: clamp(var(--space-4), 6vw, var(--space-6)); border-radius: var(--radius-panel); background: var(--color-ground); color: var(--color-on-ground); min-width: 0;
}
.bcard > * { min-width: 0; }
.bcard__top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.bcard__tag { color: var(--color-gold); font-weight: 600; font-size: var(--text-small); line-height: 1.4; overflow-wrap: anywhere; }
.bcard-wrap[data-role='student'] [data-r]:not([data-r='student']), .bcard-wrap[data-role='guardian'] [data-r]:not([data-r='guardian']),
.bcard-wrap[data-role='sponsor'] [data-r]:not([data-r='sponsor']) { display: none; }
.bcard-wrap:not([data-role]) [data-r]:not([data-r='student']) { display: none; }
.bcard__no { font-family: var(--font-body); font-variant-numeric: tabular-nums; direction: ltr; color: var(--color-gold); font-weight: 600; font-size: var(--text-lead); line-height: 1.2; min-width: 4ch; }
.bcard__d { display: inline-block; }
.bcard__no:empty::after { content: ''; display: block; height: 1em; width: 4ch; border-radius: var(--space-1); background: var(--color-ground-2); }
.bcard__nm { min-height: 1.4em; font-family: var(--font-display); font-size: var(--text-h3); line-height: 1.25; overflow-wrap: anywhere; text-wrap: balance; }
.bcard__nm[dir='ltr'] { text-align: start; }
html[dir='rtl'] .bcard__nm[dir='ltr'] { text-align: right; }
.bcard__ml { min-height: 1.2em; color: var(--color-on-ground-soft); direction: ltr; text-align: start; overflow-wrap: anywhere; font-size: var(--text-small); }
html[dir='rtl'] .bcard__ml { text-align: right; }
.bcard__ph { display: block; height: 0.9em; width: 60%; border-radius: var(--space-1); background: var(--color-ground-2); }
.bcard__ml .bcard__ph { width: 45%; height: 0.8em; }
.bcard__seal { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 50%; background: var(--color-gold); color: var(--color-on-gold); }
.bcard__seal svg { width: 22px; height: 22px; }
.bcard__code { display: flex; align-items: center; gap: var(--space-1); direction: ltr; font-family: var(--font-mono); font-size: var(--text-h3); line-height: 1.2; color: var(--color-on-ground); }
.bcard__pre { color: var(--color-gold); }
.bcard__sep { color: var(--color-on-ground-soft); }
.bcard__ch { display: inline-block; min-width: 0.9em; min-height: 1.1em; text-align: center; }
.bcard__ch:empty { border-radius: var(--space-1); background: var(--color-ground-2); }
.bcard__cap { color: var(--color-ink-soft); font-size: var(--text-small); }
.split .help .bcard-wrap { justify-items: stretch; }
@media (min-width: 900px) { .v1 > .bcard-wrap { grid-column: 8 / span 5; } }

@media (prefers-reduced-motion: reduce) {
  .htile, .htile__w, .htile__hint, .bes__in, .bes__row, .bes__row svg { transition: none; }
  .htile:active, .bes__row:active { transform: none; }
  html.js .bes:not(.is-in) .bes__list li { opacity: 1; transform: none; }
  html.js .bes__list li { transition: none; }
}

/* Helper C: zigzag panel A (word mosaic), step diagram A (scroll spine), list card A (book-spine shelf).
   Ported from design/v6/options/public. Tokens only (RULES.md T1/T2); motion is transform and opacity only (P4); no drawn objects (P1). */

/* ============ Zigzag panel A: word mosaic (.mz) ============ */
.mz { container: mz / inline-size; display: grid; gap: var(--space-6); padding: clamp(var(--space-5), 4vw, var(--space-8)); border-radius: var(--radius-panel); background: var(--color-ground); color: var(--color-on-ground); }
.mz__head { display: grid; gap: var(--space-3); max-width: 52ch; }
.mz .sect__h { margin-block-end: 0; }
.mz__lead { color: var(--color-on-ground-soft); max-width: 46rem; text-wrap: pretty; }
.mos { display: grid; gap: var(--space-4); list-style: none; margin: 0; padding: 0; grid-template-columns: minmax(0, 1fr); }
@container mz (min-width: 700px) {
  .mos { grid-template-columns: 1.25fr 1fr; grid-template-rows: repeat(var(--r), auto); }
  .mos > li:first-child { grid-row: span var(--r); }
  .mos > li:first-child .mos__t { min-height: calc(var(--space-9) * 2 + var(--space-5)); }
}
.mos > li { display: grid; min-width: 0; }
.mos__t { display: grid; gap: var(--space-3); align-content: space-between; min-width: 0; min-height: calc(var(--space-9) + var(--space-5)); padding: var(--space-5) var(--space-6); border-radius: var(--radius-card); background: var(--color-ground-2); color: var(--color-on-ground); text-decoration: none; transition: transform var(--dur-base) var(--ease-out); }
.mos__w { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 4.5cqi, 2.5rem); line-height: 1.25; padding-block-end: var(--space-1); color: var(--color-gold); overflow-wrap: anywhere; text-wrap: balance; }
.mos > li:first-child .mos__w { font-size: clamp(2rem, 6cqi, 3.5rem); }
html[lang='ar'] .mos__w { line-height: 1.7; }
.mos__d { display: block; max-width: 34ch; color: var(--color-on-ground-soft); font-size: var(--text-small); line-height: 1.6; }
html[lang='ar'] .mos__d { line-height: 1.9; }
.mos__k { display: block; color: var(--color-on-ground); font-weight: 600; }
.mos__go { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); font-weight: 600; }
.mos__go svg { width: 18px; height: 18px; flex: none; transform: scaleX(var(--dir)); transition: transform var(--dur-base) var(--ease-out); }
a.mos__t:focus-visible { outline: 3px solid var(--color-focus-on-ground); outline-offset: 3px; }
@media (hover: hover) {
  a.mos__t:hover { transform: translateY(-6px); }
  a.mos__t:hover .mos__go svg { transform: translateX(calc(4px * var(--dir))) scaleX(var(--dir)); }
}
a.mos__t:active { transform: scale(var(--press)); }
.mos__t.lift { animation: c-lift 1.4s var(--ease-out); }
/* the calmer variant that sits on a light section */
.mz--light { background: var(--color-tint); color: var(--color-ink); }
.mz--light .mz__lead, .mz--light .mos__d { color: var(--color-ink-soft); }
.mz--light .mos__t { background: var(--color-card); color: var(--color-ink); border: 1px solid var(--color-edge); }
.mz--light .mos__w { color: var(--color-green); }
.mz--light .mos__k { color: var(--color-ink); }
.mz--light a.mos__t:focus-visible { outline-color: var(--color-focus); }
@keyframes c-lift { 0%, 100% { transform: none; } 35% { transform: translateY(-8px); } }

/* ============ Step diagram A: scroll spine (.stp) ============ */
.stp { --node: calc(var(--tap) + var(--space-2)); list-style: none; margin: 0; padding: 0; display: grid; }
.stp__i { position: relative; display: grid; grid-template-columns: var(--node) minmax(0, 1fr); gap: var(--space-4); align-items: start; padding-block-end: var(--space-5); }
.stp__i:last-child { padding-block-end: 0; }
/* one segment per step, from its node to the next: grey track, green fill */
.stp__i:not(:last-child)::before, .stp__i:not(:last-child)::after { content: ''; position: absolute; inset-block-start: calc(var(--node) / 2); inset-block-end: calc(var(--node) / -2); inset-inline-start: calc(var(--node) / 2 - 3px); width: 6px; border-radius: 3px; }
.stp__i:not(:last-child)::before { background: var(--color-edge); }
.stp__i:not(:last-child)::after { background: var(--color-green); transform-origin: top; }
/* filled for reduced motion and for browsers without scroll timelines; the scroll fill runs only where both are fine */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .stp__i:not(:last-child)::after { transform: scaleY(0); animation: c-fill linear both; animation-timeline: view(); animation-range: entry 15% entry 100%; }
  }
}
@keyframes c-fill { to { transform: scaleY(1); } }
.stp__n { position: relative; z-index: 1; width: var(--node); height: var(--node); border-radius: 50%; display: grid; place-items: center; background: var(--color-green); color: var(--color-on-green); font-weight: 600; font-size: var(--text-lead); line-height: 1; font-variant-numeric: tabular-nums; transition: transform var(--dur-base) var(--ease-out); }
.stp__b { display: grid; gap: var(--space-1); min-width: 0; padding: var(--space-4) var(--space-5); border-radius: var(--radius-card); background: var(--color-card); border: 1px solid var(--color-edge); transition: transform var(--dur-base) var(--ease-out); }
.stp__h { font-family: var(--font-display); font-weight: 400; font-size: var(--text-h3); line-height: var(--text-h3-lh); overflow-wrap: anywhere; }
.stp__who { color: var(--color-green); font-size: var(--text-small); font-weight: 600; }
.stp__b p { color: var(--color-ink-soft); max-width: 62ch; }
.stp__b p.stp__lead { color: var(--color-ink); font-size: var(--text-body); }
.stp__b .kvs { margin-block: var(--space-2); }
.stp__i:last-child .stp__b { background: var(--color-tint); border-color: var(--color-green); }
.stp__i.cur .stp__n { transform: scale(1.14); }
@media (hover: hover) {
  .stp__i:hover .stp__n { transform: scale(1.14); }
  .stp__i:hover .stp__b { transform: translateX(calc(6px * var(--dir))); }
}

/* ============ List card A: book-spine shelf (.shf) ============ */
.shf { container: shf / inline-size; display: grid; gap: var(--space-6); padding: clamp(var(--space-5), 4vw, var(--space-8)); border-radius: var(--radius-panel); background: var(--color-ground); color: var(--color-on-ground); }
.shf__row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; padding-block: var(--space-4) var(--space-3); border-block-end: var(--space-3) solid var(--color-ground-2); }
.shf__sp { appearance: none; border: 0; margin: 0; font: inherit; cursor: pointer; box-sizing: border-box; width: var(--tap); min-height: calc(var(--space-9) + var(--space-8) + var(--h) * var(--space-3)); display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-3) 0 var(--space-4); border-radius: var(--space-3) var(--space-3) var(--space-1) var(--space-1); background: var(--color-ground-2); color: var(--color-on-ground); transition: transform var(--dur-base) var(--ease-out); }
.shf__sp:focus-visible { outline: 3px solid var(--color-focus-on-ground); outline-offset: 3px; }
.shf__c { min-height: 0; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--color-gold); }
.shf__t { flex: 1; min-height: 0; writing-mode: vertical-rl; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-small); font-weight: 600; line-height: 1.4; }
html[lang='ar'] .shf__t { line-height: 1.8; }
.shf__sp[aria-pressed='true'] { background: var(--color-gold); color: var(--color-on-gold); }
.shf__sp[aria-pressed='true'] .shf__c { color: var(--color-on-gold); }
.shf__sp[aria-pressed='true'], .shf__sp:focus-visible { transform: translateY(calc(var(--space-3) * -1)); }
@media (hover: hover) { .shf__sp:hover { transform: translateY(calc(var(--space-3) * -1)); } }
.shf__sp:active { transform: translateY(calc(var(--space-1) * -1)) scale(var(--press)); }
.shf__sp.lift { animation: c-lift-s 1.2s var(--ease-out); }
@keyframes c-lift-s { 0%, 100% { transform: none; } 35% { transform: translateY(calc(var(--space-3) * -1)); } }
.shf--few .shf__sp { width: calc(var(--tap) * 1.5); min-height: calc(var(--space-9) + var(--space-6) + var(--h) * var(--space-1)); }
.shf--few .shf__t { font-size: var(--text-body); }
/* readout: with script one panel at a time; without script every panel is listed */
.shf__rd { display: grid; gap: var(--space-5); min-height: calc(var(--space-9) + var(--space-4)); }
html.js .shf__p { display: none; }
html.js .shf__p.on { display: grid; }
.shf__p { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-5); align-items: center; }
.shf__p:not(:has(.shf__big)) { grid-template-columns: minmax(0, 1fr); }
.shf__big { font-family: var(--font-display); font-weight: 400; font-size: clamp(3.5rem, 14cqi, 6rem); line-height: 1; min-width: 1.2ch; text-align: center; color: var(--color-gold); font-variant-numeric: tabular-nums; }
.shf__txt { display: grid; gap: var(--space-2); justify-items: start; min-width: 0; }
.shf__k { color: var(--color-on-ground-soft); font-size: var(--text-small); font-weight: 600; }
.shf__h { font-family: var(--font-display); font-weight: 400; font-size: var(--text-h3); line-height: var(--text-h3-lh); overflow-wrap: anywhere; }
.shf__cnt { color: var(--color-gold); font-weight: 600; }
.shf__d { color: var(--color-on-ground-soft); max-width: 50ch; }
.shf__d:empty { display: none; }
.shf .badge { background: var(--color-ground-2); color: var(--color-on-ground); }
@container shf (max-width: 520px) { .shf__p { grid-template-columns: minmax(0, 1fr); justify-items: start; } .shf__big { text-align: start; } }

@media (prefers-reduced-motion: reduce) {
  .mos__t, .mos__go svg, .stp__n, .stp__b, .shf__sp { transition: none; }
  .mos__t.lift, .shf__sp.lift { animation: none; }
}

/* ---------- glue for the Django pages ---------- */
/* a page that opens with the ground header takes the bar space inside the header, not above it */
main.has-spacer:has(> .phead:first-child) { padding-block-start: 0; }
.phead + .section, .phead + .container { margin-block-start: var(--space-7); }
.phead h1 { color: var(--color-on-ground); }
.phead .crumb { color: var(--color-on-ground-soft); }
/* ---------- N1: sticky stack (About, the four non-negotiables) ---------- */
.n1 { display: grid; gap: var(--space-5); }
.n1__card {
  --i: 0; position: sticky; inset-block-start: calc(var(--bar-height) + var(--bar-float) + var(--space-3) + var(--i) * 22px);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-5); align-items: start;
  min-block-size: 0; padding: var(--space-6); border-radius: var(--radius-panel);
  background: var(--color-card); border: 1px solid var(--color-edge); box-shadow: 0 18px 40px -28px rgba(var(--color-shadow), 0.5);
}
.n1__card:nth-child(2) { background: var(--color-tint); border-color: transparent; }
.n1__card:nth-child(3) { background: var(--color-panel); }
.n1__card:nth-child(4) { background: var(--color-ground); color: var(--color-on-ground); border-color: transparent; }
.n1__no { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--color-green); color: var(--color-on-green); font-family: var(--font-display); font-size: 1.75rem; }
.n1__card:nth-child(4) .n1__no { background: var(--color-gold); color: var(--color-on-gold); }
.n1__card h3 { font-family: var(--font-display); font-weight: 400; font-size: min(var(--text-h2), 2.25rem); line-height: 1.2; text-wrap: balance; }
.n1__card p { margin-block-start: var(--space-3); font-size: 1.1875rem; max-width: 38rem; text-wrap: pretty; }
@media (max-width: 560px) { .n1__card { grid-template-columns: 1fr; padding: var(--space-5); } }
@media (max-width: 560px) { .n1 { overflow-wrap: anywhere; } }


/* ---------- Form card, links, short note (design pages.css 202-220, v5.css 101-103). One solid card, no art (P1). ---------- */
.formcard { max-width: 34rem; margin-inline: auto; display: grid; gap: var(--space-5); padding: clamp(var(--space-5), 4vw, var(--space-7)); border-radius: var(--radius-panel); background: var(--color-card); border: 1px solid var(--color-edge); min-width: 0; }
.formcard--wide { max-width: 46rem; }
.formcard > * { min-width: 0; }
.formcard .btn { width: 100%; }
.formcard .check { min-block-size: var(--tap); }
.formcard .radio-cards label { min-block-size: var(--tap); }
.formlinks { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-items: center; margin: 0; }
.formlinks a { color: var(--color-green); font-weight: 600; min-block-size: var(--tap); display: inline-flex; align-items: center; }
.formcard--verify input[name="code"] { direction: ltr; text-align: start; }
.formcard--verify ~ .verify-result, .formcard--verify ~ .alert, .formcard--verify ~ .verify-result { max-inline-size: 34rem; margin-inline: auto; margin-block-start: var(--space-5); }
.short { display: grid; gap: var(--space-3); padding: var(--space-6); border-radius: var(--radius-panel); background: var(--color-tint); max-inline-size: 52rem; }
.short__k { font-weight: 600; color: var(--color-green); margin: 0; }
.short__t { font-size: var(--text-lead); line-height: var(--text-lead-lh); text-wrap: pretty; margin: 0; }
.short > p[lang="en"] { font-size: var(--text-lead); line-height: var(--text-lead-lh); text-wrap: pretty; margin: 0; }
.bes__tag .wordmark { font-size: var(--text-h3); color: var(--color-on-ground); }
.split .help .bcard-wrap { max-inline-size: 100%; }
@media (max-width: 899px) { .split .help { position: static; } }

/* Headings take the panel's own colour: dark ground panels carry cream text (P2 contrast 4.5:1). */
.mz :is(h2, h3, h4), .n1__card :is(h2, h3, h4), .bes :is(h1, h2, h3, h4) { color: inherit; }
.bes__h { font-size: var(--text-h3); line-height: var(--text-h3-lh); margin: 0; }

/* Old app pages keep their .container under the new header: give them the same air above the footer (S1). */
.phead ~ .container { padding-block-end: var(--space-8); }

/* ---------- v7 night fix 2 (H2) ----------
 * Fault 16: the page-header tile stays (his pick, public page header A), a word never breaks in the middle (overflow-wrap normal, smaller size so the longest word fits),
 * and its own pause button is gone: the home page has the one pause control (Esslam's rule: one pause control).
 */
.htile__w { overflow-wrap: normal; word-break: keep-all; hyphens: none; }
.htile__w--ar { font-size: min(calc(var(--text-display) * 1.5), 17cqi); }
.htile__w--en { font-size: min(calc(var(--text-display) * 1.05), 10cqi); }
.hbox__pause { display: none !important; }

/* Fault 14: search highlight. One pair from the palette in both themes (tint ground, ink text, a green underline), so it never falls to 1.3:1 in dark.
   Rule: v7-tokens.css colours only (T1); the corpus.css and mushaf.css gold pair is overridden here because it has no dark value. */
body mark.hit, body mark { background: var(--color-tint); color: var(--color-ink); border-radius: 4px; padding-inline: .15em; box-shadow: inset 0 -2px 0 var(--color-link); }

/* ---------- v7 night fix 2 (H2): the rest of the audit faults, all from palette tokens (T1), no pattern, gradient or line art (P1) ---------- */

/* 9: a wide table keeps a readable width and scrolls sideways inside its own box, never squeezes a word per line. Rule: break-ui 400px check. */
.table-wrap { position: relative; } /* contains the visually-hidden spans so they cannot widen the page */
.table-wrap > .table { min-inline-size: 46rem; }
.table td .badge { white-space: nowrap; }
.table td:first-child { min-inline-size: 9rem; }

/* 12: an empty library never shows as a card (the index template only prints libraries with items); the line below shows only if none has any */
.libs-none { display: none; }
.libs-home:not(:has(article)) + .libs-none { display: block; }

/* 13: the skeleton-bar preview card on sign in, create account and reset is gone; the short real line under it stays */
.split .help .bcard-wrap { display: none; }

/* 23, 24: the light-blue notice is the palette notice (tint ground, ink text, edge line), in light and dark */
.alert-info, .ai-suggestion, .badge-info, .badge-ai {
  background: var(--color-tint); color: var(--color-ink); border: 1px solid var(--color-edge);
}
.alert-info a, .ai-suggestion a { color: var(--color-link); }

/* 27: mushaf page. Space between the header tile and the toolbar, underline only on hover or focus, tafsir book buttons a real 48px target with a 22px icon */
body .mushaf-reader { padding-block-start: var(--space-6); }
body .reader-toolbar input.goto-input, body .reader-toolbar form .btn { min-block-size: var(--tap); }
body .mushaf-reader:not(.gh-off) .w.gh-has { text-decoration: none; }
body .mushaf-reader:not(.gh-off) .w.gh-has:hover, body .mushaf-reader:not(.gh-off) .w.gh-has:focus-visible { text-decoration: underline dotted var(--color-link); text-decoration-thickness: 2px; }
body .gh-verse-btn { inline-size: 48px; block-size: 48px; margin-block: -16px; }
body .gh-verse-btn svg { inline-size: 22px; block-size: 22px; }

/* 31: 44px touch boxes for table links and citation links */
.table td.nums a, .citation a, .mushaf-page-head a {
  display: inline-flex; align-items: center; justify-content: center; min-block-size: var(--tap); min-inline-size: var(--tap);
}
.citation a { justify-content: flex-start; }

/* 38: the corpus fan cards all carried the same award icon; no icon is better than one repeated (the sameness check) */
.feature-card:has(use[href='#i-award']) .icon { display: none; }

/* 39: the filter buttons are one row you scroll sideways, not four full-width rows */
@media (max-width: 700px) {
  .lib-jump { flex-wrap: wrap; }
  .lib-jump .lib-btn { flex: 0 1 auto; }
}

/* 40: audio players take the accent colour and sit at one height at the foot of their card */
audio { accent-color: var(--color-green); inline-size: 100%; min-block-size: var(--tap); }
.lib-audio { display: block; margin-block-start: auto; }
.libs-grid { align-items: stretch; }
.libs-grid > .libs-card { block-size: 100%; }

/* ---------- 21 Nov UI audit fixes (CSS only, palette tokens, logical properties, light and dark) ---------- */

/* A2 tables on a phone: the box scrolls sideways and says so. A permanent tinted scroll bar (not the overlay one that hides itself),
   and the first column stays in view so each row keeps its name while the rest slides. One rule for every .table-wrap. Rule: KIT A, phone layout; no gradient shadow (T3). */
.table-wrap { scrollbar-color: var(--color-green) var(--color-panel); scrollbar-width: auto; }
.table-wrap::-webkit-scrollbar { block-size: 12px; }
.table-wrap::-webkit-scrollbar-track { background: var(--color-panel); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--color-green); border-radius: var(--radius-pill); border: 3px solid var(--color-panel); }
@media (max-width: 560px) {
  .table-wrap > .table { min-inline-size: 38rem; }
  .table-wrap .table thead th:first-child, .table-wrap .table tbody > tr > :first-child {
    position: sticky; inset-inline-start: 0; z-index: 1; background: var(--color-card);
    box-shadow: inset -1px 0 0 var(--color-edge);
  }
  html[dir='rtl'] .table-wrap .table thead th:first-child, html[dir='rtl'] .table-wrap .table tbody > tr > :first-child { box-shadow: inset 1px 0 0 var(--color-edge); }
  .table-wrap .table thead th:first-child { background: var(--color-panel); }
}

/* A4 mushaf: juz and hizb cards keep the number and its label apart, the ayah number and the follow-on tick get a 44px hit area (the drawing stays the same size). */
.division-card { gap: var(--space-2); align-items: center; }
.division-card > span { display: block; inline-size: 100%; }
.division-number { margin-block-end: var(--space-1); }
.ayah-number { position: relative; }
.ayah-number::after { content: ''; position: absolute; inset: -9px; }
.check { min-block-size: var(--tap); }
.check input[type='checkbox'] { inline-size: 24px; block-size: 24px; flex: none; accent-color: var(--color-green); }
:root[data-theme='dark'] .page-divider { color: var(--gold-300); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .page-divider { color: var(--gold-300); } }

/* A5 register: a hint is plain small text under its field, never a mint box; the empty side panel is gone and the form takes the row. */
.split .field .help {
  display: block; padding: 0; margin: 0; background: none; border-radius: 0; text-align: start;
  font-size: var(--text-small); line-height: 1.5; color: var(--color-ink-soft);
}
.split > aside.help:has(> .bcard-wrap:only-child) { display: none; }
@media (min-width: 900px) { .split:has(> aside.help > .bcard-wrap:only-child) { grid-template-columns: minmax(0, 1fr); } }

/* A8 dark contrast: the summary label reads 4.5:1 or more on the tint panel */
.short__k { color: var(--color-link); }

/* A9 breadcrumbs: links are 44px boxes to hit (fault 8, 21 Nov fix 2); devices list buttons never wrap */
.breadcrumbs a { display: inline-flex; align-items: center; min-block-size: var(--tap); min-inline-size: var(--tap); }
.card:has(.session-current) .list .btn { white-space: nowrap; }

/* 21 Nov fix 2, fault 6: nothing is wider than a 320 screen. A long email or IP wraps, the card header wraps its danger button under the title, and a button may wrap its label. KIT A (phone layout), design/decisions.md 21 Nov. */
.ltr { overflow-wrap: anywhere; }
.kv dd { min-inline-size: 0; overflow-wrap: anywhere; }
.card-header { flex-wrap: wrap; }
.card-header .btn { max-inline-size: 100%; text-align: center; }

/* 21 Nov fix 2, fault 8: every link, field and tick a finger can hit is a 44 x 44 box (v5 RULES P4). The drawing stays the size it was; only the hit box grows. */
a.small, .card-header > a:not(.btn), .lm-section-title > a:not(.btn), .alert > a:not(.btn), .pagination a, .list li > a, .session-row a {
  display: inline-flex; align-items: center; min-block-size: var(--tap); min-inline-size: var(--tap);
}
.pref-cell { display: flex; align-items: center; justify-content: center; min-block-size: var(--tap); min-inline-size: var(--tap); cursor: pointer; }
body input.surah-filter { min-block-size: var(--tap); }

/* fault 9: an ayah range next to its badge never breaks mid-number; the pair wraps as two lines instead (it overlapped the badge at 320). */
.badge + .ltr { white-space: nowrap; }
/* fault 9: a value and its badge in a kv row: the badge drops below the value instead of sitting inside a wrapped email. */
.kv dd:has(> .badge) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }

/* 21 Nov fix 3, fault 1: a long option text never pushes a form wider than the screen. A grid item will not shrink below its content unless told to; the field and the select now may. KIT A (phone layout). */
.field, .form > *, .form-row > * { min-inline-size: 0; }
input:not([type="checkbox"], [type="radio"]), select, textarea { max-inline-size: 100%; min-inline-size: 0; }
select { text-overflow: ellipsis; }

/* 21 Nov fix 3, fault 5: the surah list fits the phone. No 38rem floor, no sticky "#" column (it ate 145 to 200px); the names wrap and the cell padding is tighter. KIT A (phone layout). */
@media (max-width: 560px) {
  .table-wrap > .table.surah-table { min-inline-size: 0; }
  html .table-wrap .table.surah-table thead th:first-child, html .table-wrap .table.surah-table tbody > tr > :first-child { position: static; box-shadow: none; }
  html .table-wrap .table.surah-table tbody > tr > :first-child { background: transparent; }
  .surah-table { font-size: var(--text-small); }
  .surah-table th, .surah-table td { padding-inline: 4px; white-space: normal; }
  .surah-table th { font-size: .7rem; }
  .surah-table td .badge { padding-inline: 4px; font-size: .7rem; }
}
.table.surah-table td:first-child { min-inline-size: 0; }

/* 21 Nov fix 3, fault 8: the rubric table (three short columns) is sized by its content inside its card; the 46rem floor pushed the weight and max-score columns out of view in a half-width card. On a phone it still scrolls with a sticky name column. */
@media (min-width: 561px) {
  .table-wrap > .table.rubric { min-inline-size: 0; }
}

/* 21 Nov fix 3, fault 7: every thing a finger hits is 44px (v5 RULES P4; KIT A, phone layout). A few shared rules, no one-offs. The drawing keeps its size; the hit box grows. */
/* controls: fields, selects, summaries */
select, textarea, input:not([type='checkbox'], [type='radio'], [type='hidden'], [type='range'], [type='file']) { min-block-size: var(--tap); }
details > summary:not(.btn) { display: list-item; box-sizing: border-box; min-block-size: var(--tap); padding-block: .7rem; cursor: pointer; }
/* a filter row wraps instead of squeezing every field to a sliver */
.input-group { flex-wrap: wrap; }
.input-group > input { flex: 1 1 10rem; }
.input-group > select { flex: 1 1 8rem; }
/* cells in a table keep a finger-wide floor */
.table td select, .table td input:not([type='checkbox'], [type='radio']) { min-inline-size: 5.5rem; }
/* tick rows: the whole pill is the hit box, tall enough and wide enough */
body .att-choices label { display: inline-flex; align-items: center; gap: .4rem; min-block-size: var(--tap); min-inline-size: var(--tap); padding-inline: .85rem; cursor: pointer; }
body .att-choices input { inline-size: 22px; block-size: 22px; flex: none; accent-color: var(--color-green); }
.room-toolbar .seg button { min-block-size: var(--tap); min-inline-size: var(--tap); }
/* links that stand alone (table cell, definition, card title, alert, small note, toolbar): a real 44px line box, so no hit box ever lies over a neighbour (v5 RULES P4) */
.table td:not(.nums) > a:not(.btn), dd > a:not(.btn), .card-header h3 > a, li > span > a:not(.btn), .alert > span > a, .small > a, p.mt-1 > a, p.mb-0 > a, .page-divider > a {
  display: inline-flex; align-items: center; min-block-size: var(--tap); min-inline-size: var(--tap);
}

/* batch4 C, fix 2: a form page with no side panel (sign in) is one centred column */
.split--solo { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .split--solo .split__main .formcard { margin-inline: auto; max-inline-size: 34rem; } }

/* batch4 C, fix 3: card tops. No square tile, no empty space: a flat glyph (drawn for this site, partials/icons.html #c-*) sits beside the title,
   text runs full width below. Colour: green glyph, soft-ink accent part, no gold on paper (token comment). Rules: Design decision 27, P1, P4, KIT 4 (one hand). */
.feature-card .icon { inline-size: 2.25rem; block-size: 2.25rem; margin: 0; background: none; box-shadow: none; border-radius: 0; color: var(--color-green); --ic-a: var(--color-ink-soft); }
.feature-card .icon svg { inline-size: 100%; block-size: 100%; }
.feature-card:has(> .icon:not(:only-child)) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 0; }
.feature-card:has(> .icon:not(:only-child)) > .icon { margin-inline-end: var(--space-3); }
.feature-card:has(> .icon:not(:only-child)) > :not(.icon):not(h2):not(h3):not(.h3):not(.badge) { grid-column: 1 / -1; margin-block-start: var(--space-2); }
.feature-card:has(> .icon:not(:only-child)) > :is(h2, h3, .h3) { margin: 0; grid-column: 2; }
.feature-card:has(> .icon:not(:only-child)) > .badge { grid-column: 3; justify-self: end; margin-inline-start: var(--space-3); }
.libs-card.libs-card { min-block-size: 0; gap: var(--space-2); }
.libs-head { display: flex; align-items: center; gap: var(--space-3); }
.libs-card .libs-icon { flex: none; inline-size: 2.25rem; block-size: 2.25rem; display: block; background: none; border: 0; border-radius: 0; color: var(--color-green); --ic-a: var(--color-ink-soft); }
.libs-card .libs-icon svg { inline-size: 100%; block-size: 100%; display: block; }
.libs-card-title a { display: flex; align-items: center; }
.libs-card-title { flex: 1; min-inline-size: 0; }


/* ---------- 21 Nov fix 5 (pages): the audit's page faults. Palette tokens only (T1/T2), no gradient or pattern (P1), 44px taps (P2). ---------- */
.nowrap { white-space: nowrap; }

/* H3: a table with a data-label on every cell turns into stacked rows on a phone, so no column is cut and no word or date breaks. Rule: break-ui (400px worst case). */
@media (max-width: 560px) {
  .table-wrap > .table.table--stack { min-inline-size: 0; display: block; }
  .table--stack thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack tbody { display: grid; gap: var(--space-2); }
  .table--stack tr { display: block; padding: var(--space-3) var(--space-4); border: 0; border-radius: 14px; background: var(--color-panel); }
  .table--stack tr:last-child { border: 0; }
  .table--stack td:empty { display: none; }
  html .table-wrap .table.table--stack tbody > tr > :first-child { position: static; box-shadow: none; background: transparent; }
  .table--stack td, .table--stack td:first-child { display: grid; grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr); gap: var(--space-3); padding: var(--space-1) 0; border: 0; min-inline-size: 0; white-space: normal; overflow-wrap: break-word; }
  .table--stack td::before { content: attr(data-label); font-weight: 600; font-size: var(--text-small); color: var(--color-ink-soft); }
  .table--stack td.nowrap { white-space: nowrap; }
}

/* M4: a search box keeps a readable width; the button drops under it on a phone instead of cutting the hint. */
.input-group > input { flex: 1 1 15rem; }
@media (max-width: 480px) { .input-group > .btn { flex: 1 1 100%; } }

/* L9: the two links under the Musnad request sit on their own lines, no stray dot. */
.link-pair { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.card-ornate .btn-lg.btn-gold { font-size: 1rem; gap: 10px; }

/* L8: the corpus category cards size to their content. */
.feature-card:has(use[href='#i-award']) { padding-block: var(--space-4); min-block-size: 0; }

/* ---------- 21 Nov fix 6 (pages): faults from check 4. Palette tokens only (T1), logical properties, light and dark. ---------- */
.d-block { display: block; }

/* C4-M10 (Rule: 5-anti-ai-checklist "Line text, line text" and "a thin line between steps"): steps and lists are spaced, tinted panels, never ruled rows or a line down the page. */
.timeline { border: 0; display: grid; gap: var(--space-2); }
.timeline li { padding: var(--space-3) var(--space-4); border-radius: 14px; background: var(--color-panel); }
.timeline li::before { content: none; }
.timeline--steps { counter-reset: st; }
.timeline--steps li { counter-increment: st; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.timeline--steps li::before {
  content: counter(st); position: static; inline-size: 2.25rem; block-size: 2.25rem; border: 0; border-radius: 50%; background: var(--color-card); color: var(--color-ink);
  display: grid; place-items: center; font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums;
}
html[lang='ar'] .timeline--steps li::before { content: counter(st, arabic-indic); }
.list--soft { display: grid; gap: var(--space-2); }
.list--soft > li { border: 0; padding: var(--space-3) var(--space-4); border-radius: 14px; background: var(--color-panel); }

/* C4-M6: a back link points back: the arrow is the crumb's own and turns with the page direction (--dir) */
.btn > svg.back-ico { inline-size: 18px; block-size: 18px; transform: scaleX(var(--dir)); }

/* C4-L13: the page body shares the header's left edge. The header uses .wrap (page-max wide, gutter each side); .container now has the same text width. */
.phead ~ .container { max-inline-size: calc(var(--page-max) + 2 * var(--gutter)); }

/* C4-L5: previous and next page buttons stay on one line; on the narrowest phones they stack full width */
.pager .btn { white-space: nowrap; }
@media (max-width: 420px) { nav.pager { grid-template-columns: minmax(0, 1fr); } }

/* C4-L6: the word-meaning hint and the toolbar link are readable at tablet and phone, and a real 44px target. Rule: 2-fonts-and-spacing, "Buttons and touch". */
.reader-toolbar .gh-hint, .reader-toolbar .small { font-size: var(--text-small, .9375rem); }
.reader-toolbar .gh-hint { font-size: .9375rem; }
.reader-toolbar a { display: inline-flex; align-items: center; min-block-size: var(--tap); }
.reader-toolbar .gh-toggle { min-block-size: var(--tap); }

/* C4-L2: the step circle in the learning list counts in the page's own digits */
html[lang='ar'] .level-path > li::before { content: counter(lvl, arabic-indic); }
/* About, Phone apps: a plain line on the page ground, not inside a dark panel (3-colour contrast). */
.sect > .wrap > .mz__lead { color: var(--color-ink-soft); }
/* 21 Nov fix 6 (C4-M10), desktop widths: no thin line between text rows in the surah list and the source tables; every second row is a soft tint instead.
   Rule: 5-anti-ai-checklist "Line text, line text". */
.surah-table td, .surah-table th, .table--stack td, .table--stack th { border-block-end: 0; }
.surah-table tbody > tr:nth-child(even) > td, .table--stack tbody > tr:nth-child(even) > td { background: color-mix(in srgb, var(--color-tint) 55%, transparent); }
.surah-table tbody > tr:hover > td { background: var(--color-tint); }
@media (max-width: 560px) {
  .surah-table tbody > tr:nth-child(even) > td, .table--stack tbody > tr:nth-child(even) > td, .surah-table tbody > tr:hover > td { background: transparent; }
}
/* 21 Nov fix 6 (C4-L1): the surah table fits its frame at tablet width, so the page-number column is never cut off or scrolled away. */
.table-wrap > .table.surah-table { min-inline-size: 0; }
.surah-table td, .surah-table th { padding-inline: .6rem; }
.surah-table td.s-page > a, .table td.nums a { min-block-size: var(--tap); min-inline-size: var(--tap); display: inline-flex; align-items: center; justify-content: center; }
.table-wrap:has(> .surah-table) { max-inline-size: 64rem; }

/* 21 Nov: long legal text reads at a comfortable measure (KIT v5 public pages, word pages). */
.legal { max-inline-size: 70ch; margin-block-start: var(--space-6); }
.legal h2 { margin-block: var(--space-6) var(--space-2); }
.legal p, .legal li { line-height: 1.8; }
.legal ul { padding-inline-start: 1.25rem; display: grid; gap: var(--space-2); }
.legal .table-wrap { margin-block: var(--space-3); }
.legal__date { color: var(--color-ink-soft); font-size: var(--text-small); }
