/* qamar-common components.css — the shared look of muftiqamar.com and maktaba.muftiqamar.com: base typography and
   RTL rules, buttons, panels, pills, chips, callouts, disclosures, the segmented switch, page heads, breadcrumbs,
   bilingual section headings (+ count pill), cards, the book shelf card (cover + spine), list numbers (Urdu over
   Western) and the search box. Lifted from the dars site (its look is the canonical one);
   class names kept as dars had them. Link it after tokens.css and fonts.css, before the site's own CSS.
   Reads only tokens.css. A site never restyles these; changes go here (README.md, "Changing qamar-common").
   Look decisions (all decided 2026-12-01): decisions/*.html. */

/* ─── Base ─── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-en);
  color: var(--fg); background: var(--bg);
  line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column;  /* footer at the bottom of short pages */
}
body > * { flex: 0 0 auto; }
input, select, button { color: inherit; }
.ur { font-family: var(--font-ur); }
.hidden, [hidden] { display: none !important; }

/* ─── Skip link, focus, links, script fonts ─── */
/* Skip link: the first focusable thing on every page. */
.skip-link {
  position: absolute; inset-inline-start: var(--space-2); top: -60px; z-index: 100;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-s);
  background: var(--accent); color: var(--on-accent); text-decoration: none; font-size: var(--fs-small);
}
.skip-link:focus { top: var(--space-2); }
.skip-target { display: block; height: 0; outline: none; }
/* One focus style everywhere. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--accent); }
[lang="ur"] { font-family: var(--font-ur); }
[lang="en"] { font-family: var(--font-en); }
[lang="ar"] { font-family: var(--font-ar); }

/* ─── Panels, buttons, pills, chips, callouts, disclosures ─── */
/* A raised surface: one recording, one book page, one landing card. */
.panel {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-l);
  box-shadow: var(--shadow);
}
/* A whole-surface link that lifts on hover. */
.lift { color: inherit; text-decoration: none; transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease; }
.lift:hover, .lift:focus-visible { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-hover); }
.lift:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Small boxed button (back links, "open" calls to action, download). */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  font-family: var(--font-en); font-size: var(--fs-small); font-weight: 600;
  color: var(--accent-2); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--bg-3); max-width: 100%;
}
.btn:hover, .lift:hover .btn { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
/* Nastaliq inside small Latin-sized components: never below the Urdu caption size (1.1.0); in buttons, chips and the
   switch the Urdu UI size, 17 px (1.4.3). */
.btn [lang="ur"], .btn .ur, .btn[lang="ur"] { font-size: var(--fs-ur-small); line-height: 1.6; }  /* 1.4.3: 17 px (was 15) */

/* Rounded toggle button (e.g. Urdu-only). */
.toggle-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 6px var(--space-3); border-radius: var(--radius-pill);
  background: var(--bg-2); color: var(--accent-2); border: 1px solid var(--rule);
  font-size: 13px; font-family: var(--font-en);
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.toggle-btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Pills: references, themes, flags, types, confidence. */
.pill {
  display: inline-block; font-size: var(--fs-caption);  /* 1.4.3: 12 px (was 11) */ line-height: 1.5;
  padding: 1px 7px; border-radius: var(--radius-pill);
  background: var(--bg-3); color: var(--accent-2);
}
.pill, .btn { unicode-bidi: isolate; }  /* English islands inside RTL rows keep their own order */
.pill.caps { font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; padding: 2px 8px; }
.tone-quran  { background: var(--quran-bg); color: var(--green); }
.tone-hadith { background: var(--hadith-bg); color: var(--hadith-fg); }
.tone-theme  { background: var(--theme-bg); color: var(--theme-fg); }
.tone-ok     { background: var(--ok-bg); color: var(--green); }
.tone-warn   { background: var(--warn-bg); color: var(--yellow); }
.tone-danger { background: var(--danger-bg); color: var(--red); }
.pills { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.pill [lang="ur"], .pill .ur, .pill[lang="ur"] { font-size: var(--fs-ur-caption); line-height: 1.7; }

/* ﷺ inside Urdu labels: Amiri, small, on the line (the `hs` filter wraps it). */
.salawat { font-family: var(--font-ar); font-size: 0.8em; line-height: 1; font-weight: 400; }

/* Chips: topics (lecture pages, topic index), facets, search kinds. */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); direction: rtl; }
.chip {
  display: inline-flex; align-items: baseline; gap: var(--space-2);
  padding: 2px var(--space-3); border-radius: var(--radius-pill);
  background: var(--bg-3); color: var(--accent-2); border: 1px solid var(--border);
  text-decoration: none; font-size: var(--fs-small); line-height: 1.9;
}
.chip .ur, .chip [lang="ur"], .chip[lang="ur"] { font-size: var(--fs-ur-small); }  /* 1.4.3: 17 px (was 15; + lang="ur") */
.chip .en { font-size: var(--fs-caption); color: var(--fg-2); }
.chip .n { font-size: var(--fs-caption); color: var(--fg-2); font-variant-numeric: tabular-nums; }
a.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip.on .en, .chip.on .n { color: inherit; opacity: 0.85; }

/* Callouts: notes, reading order, warnings. */
.callout {
  background: var(--note-bg); border-left: 3px solid var(--yellow);
  padding: var(--space-2) var(--space-3); font-size: 13px; color: var(--fg-2);
  border-radius: 0 6px 6px 0;
}
.callout.danger { background: var(--danger-bg); border-left-color: var(--red); color: var(--fg); }
.callout.danger strong { color: var(--red); }
.callout [lang="ur"], .callout .ur, .callout[lang="ur"] { font-size: var(--fs-ur-small); line-height: 2; }

/* <details> disclosures (provenance, scans). */
.disclosure > summary {
  cursor: pointer; user-select: none; padding: 6px 0;
  font-size: var(--fs-s); color: var(--fg-2);
  display: flex; align-items: center; gap: 10px;
}
.disclosure > summary::-webkit-details-marker { color: var(--accent); }
.disclosure-label { font-weight: 500; color: var(--fg); }
.disclosure-aside { color: var(--fg-2); margin-left: auto; font-variant-numeric: tabular-nums; }

/* ─── Segmented switch (two or three options in one pill: Study ⇄ Flip-book; Text ⇄ Scan) ─── */
.mode-switch {
  display: inline-flex; gap: 3px; padding: 3px; border: 1.5px solid var(--accent); border-radius: var(--radius-pill);
  background: var(--bg-3); unicode-bidi: isolate;
}
.ms-opt {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 14px; min-height: 36px; box-sizing: border-box;
  border-radius: var(--radius-pill); color: var(--accent-2); text-decoration: none; white-space: nowrap;
  font-family: var(--font-en); font-size: var(--fs-small); font-weight: 600; transition: background 0.12s, color 0.12s;
}
.ms-opt .ur { font-family: var(--font-ur); font-size: var(--fs-ur-small); line-height: 1.7; }
.ms-opt .sep { white-space: pre; opacity: 0.7; padding-inline: 2px; }
.ms-ico { width: 18px; height: 18px; flex: 0 0 auto; }
a.ms-opt:not(.on):hover { background: var(--bg-2); color: var(--accent); }
.ms-opt.on { background: var(--accent); color: var(--on-accent); cursor: default; }
.ms-opt:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* The same switch built from <button role="tab"> (maktaba's Text | Scan): aria-selected="true" = .on. */
button.ms-opt { margin: 0; border: 0; background: transparent; cursor: pointer; }
button.ms-opt:not(.on):not([aria-selected="true"]):hover { background: var(--bg-2); color: var(--accent); }
.ms-opt[aria-selected="true"] { background: var(--accent); color: var(--on-accent); cursor: default; }

/* ─── Content pages: wrap, page head (Urdu title over its English), crumbs, diamond rule, section heading ─── */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: var(--space-7) var(--gutter) var(--space-7); }
.wrap.narrow { max-width: 820px; }
.wrap.tight { padding-block: var(--space-4) var(--space-5); }  /* app-like pages: reader, ask */
/* A page whose main content is Urdu: dars's Urdu UI size by default (1.1.0; tokens --fs-ur-ui / --lh-ur-ui). */
main[lang="ur"] { font-size: var(--fs-ur-ui); line-height: var(--lh-ur-ui); }

/* ─── Page head: Urdu title over its English, centred ─── */
.page-head { text-align: center; max-width: 760px; margin: 0 auto var(--space-6); }
.page-head h1 { margin: 0; font-weight: 400; }
.page-head h1 .ur { display: block; font-size: var(--fs-ur-h1); font-weight: 600; color: var(--accent-2); line-height: var(--lh-ur-tight); }
.page-head h1 .en { display: block; font-size: var(--fs-h3); letter-spacing: 0.03em; color: var(--fg-2); margin-top: var(--space-1); }
.page-head .lede { margin: var(--space-4) auto 0; color: var(--fg-2); }
.page-head .lede[lang="ur"] { font-size: var(--fs-ur-small); line-height: var(--lh-ur); color: var(--fg); }
.page-head .lede[lang="en"] { font-size: var(--fs-body); }
.crumbs { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; font-size: var(--fs-small); margin-bottom: var(--space-3); }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--border); }
.crumbs [lang="ur"], .crumbs .ur { font-size: var(--fs-ur-caption); line-height: 1.9; }

/* The diamond rule under a hero title. */
.rule { display: flex; justify-content: center; margin: var(--space-5) 0; }
.rule span { width: 120px; height: 1px; background: var(--accent); opacity: 0.6; position: relative; }
.rule span::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px;
  background: var(--accent); transform: translate(-50%, -50%) rotate(45deg);
}

/* ─── Bilingual section heading: Urdu at the right, English at the left (dir=rtl row) ─── */
.sec-h {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap;
  margin: var(--space-7) 0 var(--space-4); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border);
  font-weight: 400;
}
.wrap > .sec-h:first-child, main > .sec-h:first-child { margin-top: 0; }  /* 1.1.1: only as the first thing on the page; inside other wrappers keep the gap */
.sec-h .ur { font-size: var(--fs-ur-h3); font-weight: 600; color: var(--accent-2); line-height: var(--lh-ur-tight); }
.sec-h .en { font-size: var(--fs-small); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-2); }
/* Item count beside a section heading: a small grey pill (decision 05, 2026-12-01). Put it inside `.en`. */
.sec-h .count {
  display: inline-block; margin-inline-start: var(--space-2); padding: 0 9px; vertical-align: 1px;
  font: 500 var(--fs-caption)/1.7 var(--font-en); color: var(--fg-2); background: var(--bg-3); border-radius: var(--radius-pill);
  letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; unicode-bidi: isolate;
}
.sec-note { margin: calc(-1 * var(--space-2)) 0 var(--space-4); color: var(--fg-2); font-size: var(--fs-small); }
.sec-note.end { margin-top: var(--space-4); }
.sec-note[lang="ur"], .sec-note [lang="ur"] { font-size: var(--fs-ur-small); line-height: 2; }  /* 1.4.3: 17 px (was 15) */

/* ─── Cards ─── */
.cards { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); direction: rtl; }
.card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5); }
.card-titles { text-align: center; }
.card-titles .ur { display: block; font-size: var(--fs-ur-h3); color: var(--accent-2); line-height: var(--lh-ur); }
.card-titles .en { display: block; font-size: var(--fs-body); font-weight: 600; letter-spacing: 0.02em; }
.card-desc { margin: 0; color: var(--fg-2); font-size: var(--fs-small); text-align: center; }
.card-desc[lang="ur"] { font-size: var(--fs-ur-small); line-height: 2; color: var(--fg); }  /* 1.4.3: 17 px (was 15) */
.card .go { margin-top: auto; text-align: center; color: var(--accent); font-weight: 600; font-size: var(--fs-small); }

@media (max-width: 600px) {
  .wrap { padding: var(--space-6) var(--gutter) var(--space-6); }
  .wrap.tight { padding-block: var(--space-3) var(--space-4); }
  .page-head h1 .ur { font-size: var(--fs-ur-h2); }
  .page-head h1 .en { font-size: var(--fs-body); }
  .card { padding: var(--space-4); }
}

/* ─── Search box (input + button; RTL input switches to Nastaliq) ─── */
.searchbox { display: flex; gap: var(--space-2); margin: 0 0 var(--space-3); direction: rtl; }
.searchbox input {
  flex: 1 1 auto; min-width: 0; font: var(--fs-lead) var(--font-en); padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--bg-2); color: var(--fg);
}
.searchbox input:dir(rtl) { font-family: var(--font-ur); font-size: var(--fs-ur-small); padding: 4px 14px; }
.searchbox-go { flex: 0 0 auto; }

/* ─── Book card on a shelf (decision 02, 2026-12-01): the cover card with a thin accent spine on its RTL start edge
   (the right), rounded with the card. A book with a cover image shows it as a small thumbnail at the right; a book
   without one simply omits `.shelf-cover` and is a spine card with its title. `--spine` / `--cover-w` tune the two
   (`.shelf.compact` = smaller thumbnails for dense grids). `.nocover` (a title box in place of a cover) is kept for
   1.0 markup but no longer used: leave the cover out instead. ─── */
.shelf { --spine: 3px; --cover-w: 96px; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); direction: rtl; }
.shelf.compact { --cover-w: 64px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.shelf-book {
  display: flex; gap: var(--space-4); padding: var(--space-4); align-items: flex-start;
  border-inline-start: var(--spine) solid var(--accent);
}
.shelf-cover { flex: 0 0 auto; display: block; }
/* The img carries its real width/height attributes (render.book_cover): the browser reserves the box from that
   aspect ratio before the file arrives (no layout shift); it is shown --cover-w wide, height from its own ratio. */
.shelf-cover img, .nocover {
  display: block; width: var(--cover-w); height: auto; max-height: calc(var(--cover-w) * 1.6); object-fit: cover;
  border-radius: 4px; background: var(--paper); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.nocover { height: calc(var(--cover-w) * 1.5); }
/* No cover image (1.1.2, render.book_placeholder): a solid green 2:3 book cover (the mock cover of decision 02) with a
   thin inner frame line and a paper label plate near the top. Colours come from the --cover-ph-* tokens (emerald by
   day, deep green by night). The plate may carry the title's first letter (.cover-ph-mark); not in compact. */
.cover-ph {
  position: relative; display: block; width: var(--cover-w); aspect-ratio: 2 / 3; box-sizing: border-box;
  background: var(--cover-ph-bg); border-radius: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); overflow: hidden;
}
.cover-ph::before {  /* the inner frame line */
  content: ""; position: absolute; inset: 6.4%; border: 1px solid var(--cover-ph-frame); pointer-events: none;
}
.cover-ph-plate {  /* the label plate */
  position: absolute; inset-inline: 18%; top: 20%; height: 20%; border-radius: 4px; background: var(--paper);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.cover-ph-mark { font-family: var(--font-ur); font-size: calc(var(--cover-w) * 0.2); line-height: 1; color: var(--cover-ph-bg); padding-top: 0.12em; }
.shelf.compact .cover-ph-mark { display: none; }
.nocover { display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--space-2);
  font-size: var(--fs-ur-caption); line-height: 1.9; color: var(--accent-2); background: var(--bg-3); }
.shelf-text { min-width: 0; flex: 1 1 auto; }
.shelf-text h3 { margin: 0; font-weight: 400; }
.shelf-text h3 a { text-decoration: none; color: inherit; }
.shelf-text h3 .ur { display: block; font-size: var(--fs-ur-lead); font-weight: 600; color: var(--accent-2); line-height: var(--lh-ur-tight); }
.shelf-text h3 .en { display: block; font-size: var(--fs-body); font-weight: 600; color: var(--fg); text-align: left; }
.shelf.compact .shelf-text h3 .ur { font-size: var(--fs-ur-title-s); }  /* 1.1.1: long titles in ~300 px cards */
.shelf-text h3 a:hover .ur { text-decoration: underline; text-decoration-thickness: 1px; }
.shelf-meta { margin: var(--space-1) 0 0; color: var(--fg-2); font-size: var(--fs-caption); }
.shelf-meta [lang="ur"] { font-size: var(--fs-ur-caption); }
.shelf-note { margin: var(--space-2) 0 0; color: var(--fg-2); font-size: var(--fs-small); text-align: left; }
.shelf-links { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0 0; }
.shelf-links .btn [lang="ur"] { font-size: var(--fs-ur-small); line-height: 1.6; }

/* ─── List number: the Urdu numeral over its Western number (decision 01, 2026-12-01), for every numbered list on
   both sites (catalogue rows, surah lists, contents/masala numbers). The ONE exception to "Western digits in the
   UI": the Urdu is the original, the Western number is its transliteration, as with Urdu titles over English ones.
   Markup (render.list_no(n)): <span class="list-no" dir="ltr"><span class="list-no-ur" lang="ur" aria-hidden="true">۱۲</span>
   <span class="list-no-en">12</span></span>. Put it in the list row's number column. ─── */
.list-no {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 2.2em;
  unicode-bidi: isolate; font-variant-numeric: tabular-nums;
}
.list-no-ur { font-family: var(--font-ur); font-size: var(--fs-ur-small); font-weight: 600; line-height: 1.45; color: var(--accent-2); }
.list-no-en { font: 500 var(--fs-caption)/1.25 var(--font-en); color: var(--fg-2); }

/* ═══ Generic controls (1.3.0, decision 06) ═══════════════════════════════════════════════════════════════════════
   Every generic control takes its size, font, padding and states from here, so a site sets no font-size of its own
   for them (check.lint_css). Sizes come from the --ctl-* / --fs-ctl-* / --fs-excerpt-* tokens (tokens.css): dars's
   scale, Urdu 17 px in controls, 44 px tall (56 px .lg). Urdu is picked by lang="ur" (inputs and selects also by an
   RTL direction, so dir="auto" switches to Nastaliq as the reader types Urdu); everything else is English.
   Classes: .qc-input (+ .lg; <input> or <textarea>), .qc-select, .btn.primary (+ .lg), .btn.quiet (+ .lg),
   .chip.suggest, .qc-prose (reading text; the name .prose is dars's own), .excerpt (+ .clamp), .result-card with
   .result-card-title / -meta / -excerpt / -go. Additive: no 1.2 class changes. README "Generic controls". */

/* Text input / textarea and select */
.qc-input, .qc-select {
  box-sizing: border-box; min-width: 0; min-height: var(--ctl-h); margin: 0; padding: 4px var(--ctl-pad-x);
  font: var(--fs-ctl-en)/1.5 var(--font-en); color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--ctl-radius);
}
.qc-input:dir(rtl), .qc-input[lang="ur"], .qc-select:dir(rtl), .qc-select[lang="ur"] {
  font-family: var(--font-ur); font-size: var(--fs-ctl-ur); line-height: var(--lh-ctl-ur);
}
.qc-input[lang="en"], .qc-select[lang="en"] { font-family: var(--font-en); font-size: var(--fs-ctl-en); line-height: 1.5; }
/* 1.3.3: an EMPTY dir="auto" field is LTR in Chrome, so an Urdu placeholder would sit at the left in the English font.
   An empty field that says it is Urdu (lang="ur") shows its placeholder RTL in Nastaliq; once the reader types, dir="auto"
   takes over again. Prefer lang="ur" (and dir="rtl" if the field is always Urdu) on Urdu inputs. */
.qc-input:placeholder-shown[lang|="ur"], .qc-select:placeholder-shown[lang|="ur"] { direction: rtl; text-align: start; }
.qc-input:placeholder-shown[lang|="ur"]::placeholder { font-family: var(--font-ur); font-size: var(--fs-ctl-ur); line-height: var(--lh-ctl-ur); }
textarea.qc-input { display: block; width: 100%; resize: vertical; padding-block: 6px; }
.qc-input.lg { min-height: var(--ctl-h-lg); padding-block: 6px; }
.qc-input::placeholder { color: var(--fg-2); opacity: 0.75; }
.qc-select { cursor: pointer; }
.qc-input:focus-visible, .qc-select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.qc-input:disabled, .qc-select:disabled { opacity: 0.5; cursor: not-allowed; }

/* Primary and quiet buttons: the .btn pill at control height; <button> or <a>. */
.btn.primary, .btn.quiet {
  justify-content: center; min-height: var(--ctl-h); margin: 0; padding: 0 18px;
  font: 600 var(--fs-ctl-label-en)/1.4 var(--font-en); cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }
.btn.quiet { background: var(--bg-2); color: var(--fg); border-color: var(--border); }
.btn.quiet:hover { background: var(--bg-3); color: var(--accent-2); border-color: var(--accent); }
.btn.primary.lg, .btn.quiet.lg { min-height: var(--ctl-h-lg); padding: 0 22px; }
.btn.primary[lang="ur"], .btn.primary [lang="ur"], .btn.primary .ur,
.btn.quiet[lang="ur"], .btn.quiet [lang="ur"], .btn.quiet .ur { font-family: var(--font-ur); font-size: var(--fs-ctl-ur); line-height: 1.9; }
.btn.primary:disabled, .btn.quiet:disabled { opacity: 0.45; cursor: default; }

/* Suggestion chip: a tappable example question or suggested query (one per line, or in a .chips row). */
.chip.suggest {
  align-items: center; min-height: var(--ctl-h); margin: 0; padding: 4px var(--ctl-pad-x);
  font: var(--fs-ctl-en)/1.6 var(--font-en); color: var(--accent-2); text-align: start; text-decoration: none; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--ctl-radius); box-shadow: var(--shadow);
}
.chip.suggest:hover { background: var(--bg-3); border-color: var(--accent); }
.chip.suggest[lang="ur"], .chip.suggest [lang="ur"], .chip.suggest .ur { font-family: var(--font-ur); font-size: var(--fs-ctl-ur); line-height: var(--lh-ctl-ur); }

/* Reading text: an answer, a page's text, a passage. Urdu 21 px (19 px on phones, --fs-urdu); Arabic in it is Amiri. */
.qc-prose { font-size: calc(var(--fs-body) * var(--text-scale, 1)); line-height: var(--lh-en); overflow-wrap: anywhere; }
.qc-prose[lang="ur"], .qc-prose [lang="ur"] { font-family: var(--font-ur); font-size: var(--fs-urdu); line-height: var(--lh-urdu); }
.qc-prose[lang="ur"] [lang="en"] { font-size: calc(var(--fs-lead) * var(--text-scale, 1)); }  /* 1.6.0: follows the text size */
.qc-prose[lang="ar"], .qc-prose [lang="ar"], .qc-prose .t-ar { font-family: var(--font-ar); font-size: var(--fs-arabic); line-height: var(--lh-ar); }
.qc-prose p { margin: 0 0 var(--space-3); }
.qc-prose p:last-child { margin-bottom: 0; }

/* Excerpt: a search snippet with <mark> hits (inside a result card: .result-card-excerpt, clamped to 3 lines). */
.excerpt, .result-card-excerpt { display: block; margin: 2px 0 0; color: var(--fg); overflow-wrap: anywhere; font: var(--fs-small)/1.7 var(--font-en); }
.excerpt[lang="ur"], .excerpt [lang="ur"], .result-card-excerpt[lang="ur"], .result-card-excerpt [lang="ur"] {
  font-family: var(--font-ur); font-size: var(--fs-excerpt-ur); line-height: var(--lh-excerpt-ur);
}
.excerpt[lang="ar"], .excerpt [lang="ar"], .excerpt .t-ar,
.result-card-excerpt[lang="ar"], .result-card-excerpt [lang="ar"], .result-card-excerpt .t-ar {
  font-family: var(--font-ar); font-size: var(--fs-excerpt-ar); line-height: var(--lh-ar);
}
.excerpt mark, .result-card-excerpt mark { background: var(--highlight); color: inherit; border-radius: 3px; padding: 0 2px; }
.excerpt.clamp, .result-card-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }

/* Result card: one search hit or one cited source; the whole card is the link. */
.result-card {
  display: block; padding: var(--space-2) var(--ctl-pad-x) var(--space-3); color: var(--fg); text-decoration: none;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--ctl-radius); line-height: 1.9;
}
a.result-card:hover, a.result-card:focus-visible { background: var(--note-bg); border-color: var(--accent); }
.result-card-title { display: block; font: 600 var(--fs-body)/1.6 var(--font-en); color: var(--accent-2); }
.result-card-title[lang="ur"], .result-card-title [lang="ur"] { font-family: var(--font-ur); font-size: var(--fs-ctl-ur); line-height: 2; }
.result-card-title[lang="ar"], .result-card-title [lang="ar"] { font-family: var(--font-ar); font-size: var(--fs-h3); line-height: var(--lh-ar); }
.result-card-meta { display: block; font: var(--fs-caption)/1.6 var(--font-en); color: var(--fg-2); }
.result-card-meta[lang="ur"], .result-card-meta [lang="ur"] { font-family: var(--font-ur); font-size: var(--fs-ur-caption); line-height: 1.9; }
.result-card-go { display: inline-block; margin-top: 2px; font: 600 var(--fs-small)/1.6 var(--font-en); color: var(--accent); }
.result-card-go[lang="ur"], .result-card-go [lang="ur"] { font-family: var(--font-ur); font-size: var(--fs-ur-caption); line-height: 1.9; }

/* ─── Caption (1.3.1): .qc-caption, shared meta / status text (a line under a control, card or list row). Urdu 15 px
   Nastaliq, English 12 px, muted. On an <a> it is a caption link; .status is a centred status line. Additive. ─── */
.qc-caption { display: block; margin: 0; color: var(--muted); font: var(--fs-caption-en)/var(--lh-caption-en) var(--font-en); overflow-wrap: anywhere; }
.qc-caption[lang="ur"], .qc-caption [lang="ur"], .qc-caption .ur { font-family: var(--font-ur); font-size: var(--fs-caption-ur); line-height: var(--lh-caption-ur); }
.qc-caption[lang="ar"], .qc-caption [lang="ar"], .qc-caption .t-ar { font-family: var(--font-ar); font-size: var(--fs-excerpt-ar); line-height: var(--lh-ar); }
a.qc-caption { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
a.qc-caption:hover, a.qc-caption:focus-visible { color: var(--accent); }
.qc-caption.status { text-align: center; padding: var(--space-2) 0; }

/* ─── Touch (1.4.3): every interactive control is at least --ctl-h (44 px) tall on a coarse pointer (phones, tablets);
   mouse/trackpad layouts keep their compact sizes. Narrow screens let a long .btn label wrap instead of overflowing. ─── */
@media (pointer: coarse) {
  .btn, .toggle-btn, .ms-opt, a.chip, button.chip, label.chip { min-height: var(--ctl-h); }
  a.chip, button.chip, label.chip { align-items: center; }
  .btn, .toggle-btn { justify-content: center; }
  .disclosure > summary { padding-block: 13px; }
  .crumbs a { display: inline-flex; align-items: center; min-height: var(--ctl-h); }  /* 1.6.0 (dars UX review 2, #10) */
}
@media (max-width: 600px) { .btn { white-space: normal; text-align: center; } }

/* ─── [hidden] guard (1.3.3): the base rule `.hidden, [hidden] { display: none !important }` already wins over every
   shared class; this restates it per shared class that sets `display`, so the attribute keeps working even where a
   site's own CSS loads an `!important` display of its own on one of them. Only ever hides. ─── */
.btn[hidden], .toggle-btn[hidden], .qc-caption[hidden], .qc-input[hidden], .qc-select[hidden], .chip[hidden],
.result-card[hidden], .excerpt[hidden], .result-card-excerpt[hidden], .qc-prose[hidden], .pill[hidden] { display: none !important; }

/* ═══ Page text (1.4.0, decision 07): the text of a page that is not a control ═════════════════════════════════════
   .qc-subhead   a section sub-heading: Urdu 17 px 600 over/beside English small-caps.
   .qc-meta-row  a row of meta items (a search group header: title + meta + hit reference).
   .qc-list      + .qc-list-row: catalogue / list rows: [number] title + roman + author, meta at the end.
   Sizes are the existing tokens (--fs-ur-small 17, --fs-ur-caption 15, --fs-caption 12, --fs-small 14); nothing new.
   Direction follows the page: put them in an RTL page and Urdu sits at the right, English at the left. Additive. ═══ */

/* Sub-heading: <h3 class="qc-subhead"><span lang="ur">…</span> <span lang="en">…</span></h3> (any h2–h6 or div) */
.qc-subhead {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 var(--space-3);
  margin: var(--space-5) 0 var(--space-2); font-weight: 600; color: var(--accent-2);
  font-family: var(--font-ur); font-size: var(--fs-ur-small); line-height: var(--lh-ur-ui);
}
.qc-subhead[lang="en"], .qc-subhead [lang="en"], .qc-subhead .en {
  font-family: var(--font-en); font-size: var(--fs-small); line-height: 1.6; color: var(--fg-2);
  font-variant-caps: all-small-caps; letter-spacing: 0.06em; text-align: start;
}
.qc-subhead[lang="en"] { color: var(--accent-2); }
.qc-subhead[lang="ar"], .qc-subhead [lang="ar"], .qc-subhead .t-ar { font-family: var(--font-ar); font-size: var(--fs-excerpt-ar); line-height: var(--lh-ar); }
.qc-subhead:first-child { margin-top: 0; }

/* Meta row: <div class="qc-meta-row"><a class="qc-meta-title" lang="ur">…</a> <span class="qc-meta-ref">…</span> <small lang="ur">…</small></div> */
.qc-meta-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 var(--space-3); margin: 0; color: var(--fg-2);
  font: var(--fs-caption-en)/var(--lh-caption-en) var(--font-en); }
.qc-meta-row [lang="ur"], .qc-meta-row .ur, .qc-meta-row[lang="ur"] { font-family: var(--font-ur); font-size: var(--fs-caption-ur); line-height: var(--lh-caption-ur); }
.qc-meta-row [lang="ar"], .qc-meta-row .t-ar { font-family: var(--font-ar); font-size: var(--fs-excerpt-ar); line-height: var(--lh-ar); }
.qc-meta-row bdi, .qc-meta-row [lang="en"] { font-family: var(--font-en); font-size: var(--fs-caption-en); line-height: var(--lh-caption-en); }
/* the item that names the group (a work, a surah): same size as Urdu UI text, bold, brand colour; may be a link */
.qc-meta-title, .qc-meta-row a.qc-meta-title { font-family: var(--font-ur); font-size: var(--fs-ur-small); font-weight: 700; line-height: var(--lh-ur-ui);
  color: var(--accent-2); text-decoration: none; }
a.qc-meta-title:hover, a.qc-meta-title:focus-visible { text-decoration: underline; }
.qc-meta-title[lang="ar"], .qc-meta-title.t-ar { font-family: var(--font-ar); font-size: var(--fs-ar-title); line-height: 1.75; }
.qc-meta-title[lang="en"] { font-family: var(--font-en); font-size: var(--fs-body); line-height: 1.6; }
/* a reference chip (page 12, ayah 2:255): small pill; English parts inside (bdi / lang="en") are caption-sized */
.qc-meta-ref { display: inline-block; padding: 0 10px; border-radius: var(--radius-pill); background: var(--note-bg); color: var(--accent-2);
  font-family: var(--font-ur); font-size: var(--fs-caption-ur); line-height: var(--lh-caption-ur); unicode-bidi: isolate; }
.qc-meta-ref[lang="en"] { font-family: var(--font-en); font-size: var(--fs-caption-en); line-height: 1.7; }
.qc-meta-ref .sub { font-family: var(--font-en); font-size: var(--fs-caption-en); color: var(--fg-2); margin-inline-start: var(--space-2); }

/* List rows: <ul class="qc-list"><li><a class="qc-list-row" href><span class="list-no">…</span>
   <span class="qc-list-main"><span class="qc-list-title" lang="ur">…</span><span class="qc-list-roman">…</span>
   <span class="qc-list-sub" lang="ur">…</span></span><span class="qc-list-meta" lang="ur">…</span></a></li></ul>
   The number column is optional (omit it and the row is main + meta). */
.qc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.qc-list-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3); align-items: center;
  padding: var(--space-2) var(--space-1); border-bottom: 1px solid var(--border); color: var(--fg); text-decoration: none;
}
.qc-list-row > :first-child:not(.qc-list-main) { min-width: 2.6em; }
.qc-list-row > .qc-list-main:first-child { grid-column: 1 / span 2; }
a.qc-list-row:hover, a.qc-list-row:focus-visible { background: var(--bg-3); }
.qc-list-main { display: flex; flex-direction: column; min-width: 0; }
.qc-list-title { font-family: var(--font-ur); font-size: var(--fs-ur-small); line-height: 1.9; }
.qc-list-title[lang="ar"], .qc-list-title.t-ar { font-family: var(--font-ar); font-size: var(--fs-ar-title); line-height: 1.8; }
.qc-list-title[lang="en"] { font-family: var(--font-en); font-size: var(--fs-body); line-height: 1.6; }
.qc-list-roman { font: var(--fs-caption-en)/var(--lh-caption-en) var(--font-en); color: var(--fg-2); direction: ltr; text-align: end; unicode-bidi: isolate; }
.qc-list-sub { font-family: var(--font-ur); font-size: var(--fs-caption-ur); line-height: 1.8; color: var(--fg-2); }
.qc-list-sub[lang="en"] { font: var(--fs-caption-en)/var(--lh-caption-en) var(--font-en); }
.qc-list-meta { font-family: var(--font-ur); font-size: var(--fs-caption-ur); line-height: var(--lh-caption-ur); color: var(--fg-2); white-space: nowrap; }
.qc-list-meta[lang="en"] { font: var(--fs-caption-en)/var(--lh-caption-en) var(--font-en); }
.qc-list-meta[lang="en"], .qc-list-roman { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .qc-list-row { grid-template-columns: auto minmax(0, 1fr); }
  .qc-list-row > .qc-list-meta { grid-column: 2; }
  .qc-list-row > .qc-list-main:first-child { grid-column: 1 / -1; }
  .qc-list-row > .qc-list-main:first-child ~ .qc-list-meta { grid-column: 1 / -1; }
}

/* ─── Not-found page (1.6.0, notfound.html / render.notfound): heading + line in Urdu and English, the search box,
   two or three way-out buttons. Uses .page-head, .searchbox and .btn; only the spacing is its own. ─── */
.qc-notfound { padding-block: var(--space-6); }
.qc-notfound .searchbox { margin-block: var(--space-5) var(--space-4); }
.qc-notfound-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-3); margin: 0; }
