/* fonts.css */
/* Self-hosted copies of Google Fonts (SIL OFL 1.1, see fonts/OFL.txt). Generated by dars.site.fonts (dars repo) into qamar-common; fonts/ = URL prefix of the fonts/ dir. */
/* arabic */
@font-face {
  font-family: 'Amiri';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../../../h/016b3821/fonts/amiri-arabic-4c2750cf61.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin-ext */
@font-face {
  font-family: 'Amiri';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../../../h/2e3dcc04/fonts/amiri-latin-ext-18b9d9c89a.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Amiri';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../../../h/897d7111/fonts/amiri-latin-06649aaf42.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'Amiri';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../../../h/a84ab940/fonts/amiri-arabic-1313bcd0bc.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin-ext */
@font-face {
  font-family: 'Amiri';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../../../h/b176e9de/fonts/amiri-latin-ext-d93796e762.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Amiri';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../../../h/4188c728/fonts/amiri-latin-25feffc581.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'Noto Nastaliq Urdu';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../../../h/d0eb5c8b/fonts/noto-nastaliq-urdu-arabic-7dde60c15f.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin-ext */
@font-face {
  font-family: 'Noto Nastaliq Urdu';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../../../h/21d16623/fonts/noto-nastaliq-urdu-latin-ext-a7bbbe8e92.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Noto Nastaliq Urdu';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(../../../h/d6d951cd/fonts/noto-nastaliq-urdu-latin-4cbd0f2300.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../../../h/51541b16/fonts/source-serif-4-latin-ext-italic-9a36f388eb.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../../../h/bdd0e2a0/fonts/source-serif-4-latin-italic-bdd0e2a056.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../../../h/8b7e230e/fonts/source-serif-4-latin-ext-231f594ad8.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../../../h/8e38e3fb/fonts/source-serif-4-latin-8e38e3fbd7.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* tokens.css */
/* qamar-common tokens.css — the design tokens of muftiqamar.com AND maktaba.muftiqamar.com: the ONE place for
   colour, type, space, shape and motion. Linked first on every page of both sites, before common.css and the
   site stylesheets, which only consume these. A site never redefines a token here; a new token goes into this file
   (see README.md, "Adding a shared component").

   Palette: Paper Emerald by day, sage by night (chosen 2026-11-27; alternatives: dars static/themes/, review mockups).
   Fonts (work/polish/content/rules.md css-ar-face, ux-research §9):
     --font-ur        Noto Nastaliq Urdu — all Urdu
     --font-ar        Amiri              — all Arabic text: Quran, hadith, duas, Arabic blocks, surah names (user prefers Amiri)
     --font-ar-display Amiri             — large Arabic display titles only (surah titles, basmala)
     --font-en        Source Serif 4     — English
   Type scale (1.2 ratio, 16 px base): --fs-{caption,small,body,lead,h3,h2,h1,display} for Latin; --fs-ur-* for Urdu
   (Nastaliq needs ~1.3× the size and ~2× the leading to read at the same weight). Caption is the minimum anywhere.
   1.6.1: the --fs-* tokens are at the end of this file ("Type scale"): they follow the reader's text size.
   The dark palette applies from the OS preference; header.js forces light/dark by rewriting this media query
   (cookie qamar-scheme, <html data-scheme>). */

:root {
  color-scheme: light dark;

  /* ─── Colour: surfaces and text ─── */
  --bg: #fdfdfa;            /* page (surface-0) */
  --bg-2: #ffffff;          /* raised surface: panels, rails, bars (surface-1) */
  --bg-3: #f3f4ef;          /* subtle fill: hover, chips, buttons, header (surface-2) */
  --fg: #1b211e;            /* text-1 */
  --fg-2: #565c57;          /* text-2: secondary text */
  --muted: var(--fg-2);
  --accent: #0d6647;        /* brand */
  --accent-2: #0a4732;      /* brand-strong: headings, titles, nav labels */
  --on-accent: #ffffff;
  --border: #e2e4dc;        /* line */
  --rule: #ecede6;          /* line-soft: hairlines and dividers */
  --glass: rgba(255, 255, 255, 0.94);
  --focus: var(--accent);

  /* ─── Colour: semantic ─── */
  --green: #1d7550; --yellow: #66665e; --red: #a93527;
  --quran-bg: #ebf5ee; --quran-fg: #154830;
  --hadith-bg: #f0f2f1; --hadith-fg: #3a4744;
  --dua-bg: #f3f4ef;
  --theme-bg: #e8f2f3; --theme-fg: #1f4f55;
  --quote-bg: #f6f7f3; --note-bg: #f0f6f2;
  --ok-bg: #e0f1e6; --warn-bg: #f1f2ee; --danger-bg: #f8e5e1;
  --gap-bg: #f3f4ef; --gap-fg: #4a4b44; --gap-border: #a8aa9f;
  --highlight: #fff4c2;     /* search hits, the paragraph now playing, a contents jump landing */
  --nl-mark: #b4b7ad;
  --cover-ph-bg: #0d6647; --cover-ph-frame: #cfe0d3;  /* cover placeholder: emerald (= --accent) */
  /* Library gold: the ONE sanctioned exception to the green palette. Used only by the Library and Naat nav items
     (.qc-library, .qc-naat, 1.8.0: the sections that include texts by others). */
  --library-gold: #7a5200;          /* text + hover/focus ring on the gold wash */
  --library-gold-bg: #f8edc8;       /* the soft warm wash behind the item */
  --library-gold-ring: #c9a23c;     /* hairline ring */
  --library-gold-glow: rgba(201, 162, 60, 0.40);  /* outer halo */
  --library-gold-sel: #ffe27a;      /* pressed / current page: luminous pale gold (glows brighter, never brown) */
  --library-gold-on-sel: #5c3d00;   /* text on the selected fill (≈7.5:1) */
  --library-gold-sel-ring: #f0b400; /* bright gold edge when selected */
  --library-gold-sel-glow: rgba(255, 196, 0, 0.65);  /* the brighter halo when selected */
  --paper: #fefefc;         /* behind page scans */
  --shadow: 0 1px 2px rgba(30, 40, 30, 0.04), 0 4px 16px rgba(40, 50, 30, 0.06);
  --shadow-hover: 0 4px 12px rgba(30, 40, 30, 0.09);
  --shadow-book: 0 18px 40px rgba(20, 45, 30, 0.16), 0 2px 6px rgba(20, 45, 30, 0.10);

  /* ─── Fonts ─── */
  --font-ur: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  --font-ar: 'Amiri', serif;  /* user 2026-11-29: Amiri everywhere (basmala style), not Noto Naskh (removed 1.4.2) */
  --font-ar-ui: var(--font-ar);
  --font-ar-display: 'Amiri', serif;
  --font-en: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;  /* review builds only */

  --lh-en: 1.6; --lh-ur: 2.1; --lh-ar: 1.9; --lh-ur-tight: 1.8;
  --lh-ur-ui: 2;
  --lh-urdu: var(--lh-ur); --lh-arabic: var(--lh-ar);

  /* ─── Chrome type (1.6.1): the shared header and footer, and any site chrome. FIXED: never multiplied by the
     text-size factors, so the header, the A− A A+ control and the footer never move when the reader resizes text. ─── */
  --fs-chrome-ur: 17px;     /* Urdu nav labels, footer text, the «رنگ» label */
  --fs-chrome-en: 14px;     /* English nav labels, footer text */
  --fs-chrome-en-s: 12px;   /* English nav labels on phones */

  /* ─── Space, shape, layout, motion ─── */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --gutter: 16px;                       /* phone side gutter */
  --measure-en: 72ch; --measure-ur: 34em;
  --radius-s: 6px; --radius-m: 10px; --radius-l: 16px; --radius-pill: 999px;
  --sidebar-w: 320px;
  --content-max: 1200px;
  --dur: 150ms;
}

@media screen and (prefers-color-scheme: dark) {  /* never in print: pale ink on white */
  :root {
    /* sage night */
    --bg: #111513; --bg-2: #181d1a; --bg-3: #212824;
    --fg: #ebedea; --fg-2: #a6aea9;
    --accent: #93b59f; --accent-2: #cfe0d3; --on-accent: #111513;
    --border: #2d3631; --rule: #252d29; --glass: rgba(24, 29, 26, 0.94);
    --green: #6fcf9c; --yellow: #b8b9b2; --red: #ec8874;
    --quran-bg: #162b21; --quran-fg: #bfe5cf;
    --hadith-bg: #1f2523; --hadith-fg: #cfd8d4;
    --dua-bg: #1d2421;
    --theme-bg: #172a2c; --theme-fg: #b4dade;
    --quote-bg: #1a201d; --note-bg: #19241f;
    --ok-bg: #162b21; --warn-bg: #222623; --danger-bg: #37201c;
    --gap-bg: #222623; --gap-fg: #d2d4cc; --gap-border: #6d706a;
    --highlight: #4a3c22;
    --nl-mark: #57605b;
    --cover-ph-bg: #1c4a37; --cover-ph-frame: #7fa28d;  /* deep green */
    --library-gold: #ecc866; --library-gold-bg: #2c2512; --library-gold-ring: #8c7230;
    --library-gold-glow: rgba(236, 200, 102, 0.28); --library-gold-sel: #ffd24d; --library-gold-on-sel: #241800;
    --library-gold-sel-ring: #ffc933; --library-gold-sel-glow: rgba(255, 201, 51, 0.55);
    --paper: #e9ebe6;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 24px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-book: 0 18px 50px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.5);
  }
}

/* ─── Generic controls (1.3.0, decision 06): the sizes of inputs, selects, primary/quiet buttons, suggestion chips,
   excerpts and result cards (components.css, "Generic controls"). dars's scale: Urdu text in a control is the Urdu
   UI size (17 px), controls are at least 44 px tall (touch target), 56 px for the large composer pair. Changing a
   size for both sites = changing it here. 1.6.1: the font sizes (--fs-ctl-*, --fs-excerpt-*) are in "Type scale". ─── */
:root {
  --ctl-h: 44px;                        /* min-height: .qc-input, .qc-select, .btn.primary, .btn.quiet, .chip.suggest */
  --ctl-h-lg: 56px;                     /* .lg: the composer textarea and its send button, a big single action */
  --ctl-pad-x: 14px;                    /* inline padding of inputs, selects, suggestion chips, result cards */
  --ctl-radius: var(--radius-m);        /* inputs, selects, suggestion chips, result cards (buttons stay pills) */
  --lh-ctl-ur: 2;
  --lh-excerpt-ur: 2.1;
}

/* ─── Caption / status text (1.3.1): .qc-caption, the meta and status lines under a control or a card (sizes
   --fs-caption-ur / --fs-caption-en: "Type scale"). ─── */
:root {
  --lh-caption-ur: 1.9;
  --lh-caption-en: 1.6;
}

/* ─── Text size (1.6.0; 1.6.1: all content): the reader's A− / A+ choice (header.html .qc-textsize, header.js,
   head-early.html). One step per device, stored in localStorage "qamar-text" (-1 … 3, default 0) and set before
   first paint as <html data-qc-text="N"> by the inline head-early.html script. Each step sets two unitless factors:
     --text-scale-ur  Nastaliq (Urdu): smaller steps, the face is already large with a 2.1 leading
     --text-scale     Latin (English) and Amiri (Arabic, Persian)
   Keep the steps in step with header.js (MIN, MAX, PCT) and head-early.html. Step 1 is at least +10 % for both. ─── */
:root { --text-scale: 1; --text-scale-ur: 1; }
html[data-qc-text="-1"] { --text-scale: 0.9;   --text-scale-ur: 0.92; }
html[data-qc-text="1"]  { --text-scale: 1.125; --text-scale-ur: 1.1; }
html[data-qc-text="2"]  { --text-scale: 1.25;  --text-scale-ur: 1.2; }
html[data-qc-text="3"]  { --text-scale: 1.4;   --text-scale-ur: 1.32; }
@media print { html[data-qc-text] { --text-scale: 1; --text-scale-ur: 1; } }  /* print ignores the choice */

/* ─── Fixed chrome (1.6.1): the shared header and footer, and any element a site marks .qc-fixed-size (its audio
   player bar, a reader toolbar, a composer) keep the default size at every step. The factors are 1 there, and the
   type tokens below are declared again on those elements, so they compute at 1 for the whole subtree (a custom
   property is computed where it is declared: resetting the factors alone would not reach the tokens). ─── */
.qc-fixed-size, .qc-header, .qc-footer { --text-scale: 1; --text-scale-ur: 1; }

/* ─── Type scale (1.6.1: every content size follows the text size) ───
   Every --fs-* token below is a CONTENT size and multiplies by its factor: Nastaliq (--fs-ur-*, --fs-urdu, the Urdu
   control / excerpt / caption sizes) by --text-scale-ur, Latin and Amiri by --text-scale. So headings, page titles,
   card and list titles, descriptions, chips, intros, metadata lines, search results and reading text all grow with
   A+. Chrome uses --fs-chrome-* (fixed, in :root above) or sits inside .qc-fixed-size.
   Site CSS: never multiply a token again (calc(var(--fs-lead) * var(--text-scale)) is now DOUBLE); write a literal
   size as calc(<px> * var(--text-scale-ur)) for Nastaliq or calc(<px> * var(--text-scale)) for Latin / Amiri
   (`python check.py --text-scale PATH` lists what to convert). A site that redefines a token writes it the same way.
   Values are at step 0. Latin: 1.2 ratio, 16 px base. Nastaliq needs ~1.3× the size and ~2× the leading. */
:root, .qc-fixed-size, .qc-header, .qc-footer {
  /* Latin */
  --fs-caption: calc(12px * var(--text-scale));  --fs-small: calc(14px * var(--text-scale));
  --fs-body: calc(16px * var(--text-scale));     --fs-lead: calc(19px * var(--text-scale));
  --fs-h3: calc(20px * var(--text-scale));       --fs-h2: calc(24px * var(--text-scale));
  --fs-h1: calc(32px * var(--text-scale));       --fs-display: calc(40px * var(--text-scale));
  --fs-xs: calc(11px * var(--text-scale)); --fs-s: var(--fs-caption); --fs-m: var(--fs-small);  /* transcript and book columns */
  /* Urdu (Nastaliq) */
  --fs-ur-caption: calc(15px * var(--text-scale-ur)); --fs-ur-small: calc(17px * var(--text-scale-ur));
  --fs-ur-body: calc(21px * var(--text-scale-ur));    --fs-ur-lead: calc(24px * var(--text-scale-ur));
  --fs-ur-h3: calc(24px * var(--text-scale-ur));      --fs-ur-h2: calc(30px * var(--text-scale-ur));
  --fs-ur-h1: calc(40px * var(--text-scale-ur));      --fs-ur-display: calc(52px * var(--text-scale-ur));
  /* Urdu page default (main[lang="ur"]): dars's Urdu UI text — labels, list rows, notes (1.1.0). Urdu reading text
     (prose, a book's page text, search snippets) is --fs-urdu. */
  --fs-ur-ui: var(--fs-ur-small);
  /* reading text: Urdu prose, Arabic, Persian, translations, Latin blocks */
  --fs-ur-body-phone: calc(19px * var(--text-scale-ur));  /* 1.1.1: Urdu reading text on phones (<= 720 px) → --fs-urdu */
  --fs-urdu: var(--fs-ur-body);
  --fs-arabic: calc(22px * var(--text-scale));
  --fs-persian: calc(20px * var(--text-scale));
  --fs-trans: calc(15px * var(--text-scale));
  --fs-latin-block: calc(15px * var(--text-scale));
  /* titles in cards and list rows (1.6.0 twins of --fs-ur-body / --fs-arabic; 1.6.1: they scale too) */
  --fs-ur-title-s: calc(21px * var(--text-scale-ur)); --fs-ar-title: calc(22px * var(--text-scale));
  /* generic controls (1.3.0, decision 06; components.css "Generic controls"). Typed English stays >= 16 px at every
     step (iOS zooms into a smaller input). Control HEIGHTS (--ctl-h) stay fixed: they are minimums. */
  --fs-ctl-ur: var(--fs-ur-small);      /* 17 px: Urdu text in every control */
  --fs-ctl-en: max(16px, calc(16px * var(--text-scale)));  /* English typed text */
  --fs-ctl-label-en: var(--fs-small);   /* 14 px, weight 600: English button labels (as .btn) */
  --fs-excerpt-ur: var(--fs-ur-small);  /* 17 px: Urdu search snippets, result-card excerpts */
  --fs-excerpt-ar: calc(19px * var(--text-scale));  /* Arabic in a snippet (Amiri reads smaller than Nastaliq at equal px) */
  /* caption / status text (1.3.1): .qc-caption, the meta and status lines under a control or a card */
  --fs-caption-ur: var(--fs-ur-caption); /* 15 px */
  --fs-caption-en: var(--fs-caption);    /* 12 px */
}
@media (max-width: 720px) { :root, .qc-fixed-size, .qc-header, .qc-footer { --fs-urdu: var(--fs-ur-body-phone); } }

/* 1.8.5 (user): nav buttons as low-profile pills: the bar's own background, a shade darker (by day) or lighter (by
   night), so each item has a visible boundary without a grey. One token for every nav-like bar on both sites (the
   kit's .qc-nav-item; maktaba's .mk-sub-item). It follows the palette by itself: --bg-3 and --fg swap with the scheme. */
:root {
  /* 1.8.6 (user): each bar gets its OWN shade, from its own background, and less contrast than 1.8.5 (6%) */
  --qc-nav-item-bg: color-mix(in oklab, var(--bg-3, #f3f4ef), var(--fg, #1b211e) 3.5%);     /* top nav (bar = --bg-3) */
  --qc-subnav-item-bg: color-mix(in oklab, var(--bg-2, #ffffff), var(--fg, #1b211e) 3.5%);  /* sub-menus (bar = --bg-2) */
}
/* qc/components.css */
/* 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);
  font-size: calc(1rem * var(--text-scale, 1));  /* 1.6.1: unstyled text follows the text size (1rem at step 0) */
  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: calc(13px * var(--text-scale)); 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; }

/* 1.11.1: .chips / .cards / .searchbox / .shelf follow the page's lead language (1.11.0 and before: always rtl, so in English
   lead the search button came first and shelves filled and scrolled from the right). Urdu lead, and no script (no
   data-lead): rtl. English lead: ltr. Zero specificity (:where), so a site's own rule wins. The nav and the header are
   NOT in this list and never change direction (1.8.4). Urdu text inside these components keeps its own direction. */
:where(.chips, .cards, .searchbox, .shelf) { direction: rtl; }
:where(html[data-lead="en"]) :where(.chips, .cards, .searchbox, .shelf) { direction: ltr; }
:where(html[data-lead="en"]) :where(.chips, .cards, .searchbox, .shelf) :where([lang|="ur"]):not(input, textarea) { direction: rtl; unicode-bidi: isolate; }

/* Chips: topics (lecture pages, topic index), facets, search kinds. */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.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: calc(13px * var(--text-scale)); 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 ─── */
/* 1.6.1: the column minimum grows with the text size (fewer, wider columns at A+; never wider than the page) */
.cards { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(calc(280px * var(--text-scale-ur)), 100%), 1fr)); }
.card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5); }
.card-titles { text-align: center; overflow-wrap: break-word; min-width: 0; }
.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); }
.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(calc(420px * var(--text-scale-ur)), 100%), 1fr)); }
.shelf.compact { --cover-w: 64px; grid-template-columns: repeat(auto-fill, minmax(min(calc(300px * var(--text-scale-ur)), 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; overflow-wrap: break-word; }
.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; max-width: 100%;  /* 1.6.1: a field sized by `size` never outgrows its box at A+ */
  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,
   Persian Amiri at --fs-persian. */
.qc-prose { font-size: var(--fs-body); line-height: var(--lh-en); overflow-wrap: anywhere; }  /* 1.6.1: the tokens scale; never multiply again */
.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: var(--fs-lead); }
.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); }
/* Persian (1.6.1): Amiri at the Persian reading size, on screen, in print and on text pages */
.qc-prose[lang="fa"], .qc-prose [lang="fa"], .qc-prose .t-fa, .t-fa { font-family: var(--font-ar); font-size: var(--fs-persian); 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); overflow-wrap: break-word; }
.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; at step 0: all
   follow the text size, 1.6.1); 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; overflow-wrap: break-word; }
.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; }

/* ─── Bilingual pairs (1.8.0, the lead language; header.js qamarLang, render.bi / bi_blk) ───
   A pair holds both languages; <html data-lead> says which one leads. Urdu lead (the default): as written, Urdu first
   in the right-to-left flow. English lead: English first and at reading size, Urdu second and smaller. Nothing is ever
   hidden, and <html dir> never changes: only the pair itself runs left to right.
   .qc-bi      inline: <span class="qc-bi"><span lang="ur">…</span><span class="qc-sep"> · </span><span lang="en" dir="ltr">…</span></span>
   .qc-bi-blk  two blocks (a paragraph each): <div class="qc-bi-blk"><p lang="ur">…</p><p lang="en" dir="ltr">…</p></div> */
.qc-bi > .qc-sep { opacity: 0.6; }
html[data-lead="en"] .qc-bi { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.3em; direction: ltr; }
html[data-lead="en"] .qc-bi > [lang="en"] { order: -1; font-size: inherit; }  /* the size the pair's Urdu had (a heading stays a heading) */
html[data-lead="en"] .qc-bi > .qc-sep { order: 0; }
html[data-lead="en"] .qc-bi > [lang="ur"] { order: 1; font-size: smaller; opacity: 0.85; }
.qc-bi-blk > * { margin-block: 0; }
html[data-lead="en"] .qc-bi-blk { display: flex; flex-direction: column; }
html[data-lead="en"] .qc-bi-blk > [lang="en"] { order: -1; }
html[data-lead="en"] .qc-bi-blk > [lang="ur"] { font-size: smaller; opacity: 0.85; }
/* 1.9.0 (user): ONE language for the interface. With <html data-lead> set (head-early.html, before paint) a pair shows
   only the lead language; the other half and the separator are hidden. Pairs that stay bilingual in both modes, titles
   and names (books, naats, collections, lectures, surahs, people: native script + romanized), carry .qc-keep (or sit
   inside a .qc-keep). Without scripts there is no data-lead and both languages show. */
html[data-lead="ur"] :is(.qc-bi, .qc-bi-blk):not(.qc-keep, .qc-keep *) > [lang="en"],
html[data-lead="en"] :is(.qc-bi, .qc-bi-blk):not(.qc-keep, .qc-keep *) > [lang="ur"],
html[data-lead] .qc-bi:not(.qc-keep, .qc-keep *) > .qc-sep { display: none; }
html[data-lead="en"] .qc-bi:not(.qc-keep, .qc-keep *) { direction: ltr; }

/* ─── Layer chips (1.8.0; from maktaba's reader, bilingual plan §2.2): which text layers a reader shows ───
   .qc-layerbar > .qc-layers > button.qc-layer[aria-pressed] (+ .qc-layer-box, the tick, and an optional .qc-layer-dot:
   filled .has = this page has that layer, hollow = none); .qc-layer-sep sets a separate toggle (scan) apart. A chip is a
   toggle: pressed = filled with a tick, not pressed = outlined with an empty box (never colour alone). Its label is a
   pair (.qc-bi). Behaviour (storage, which layers, "at least one on") stays with each site. */
.qc-layerbar { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.qc-layers { display: inline-flex; gap: var(--space-2); align-items: stretch; }
.qc-layer-sep { width: 1px; align-self: stretch; margin: var(--space-1); background: var(--border); }
.qc-layer { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); min-height: 40px; margin: 0;
  padding: 2px 14px 2px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-pill); background: var(--bg);
  color: var(--fg); cursor: pointer; font: inherit; line-height: 1.2; white-space: nowrap;
  transition: background var(--dur), border-color var(--dur), color var(--dur); }
.qc-layer:hover { border-color: var(--accent); }
.qc-layer:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qc-layer [lang="ur"] { font-family: var(--font-ur); font-size: var(--fs-ur-caption); line-height: 1.7; }
.qc-layer [lang="en"] { font-family: var(--font-en); font-size: var(--fs-caption); }
.qc-layer-box { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border: 1.5px solid currentColor; border-radius: 5px; font: 700 var(--fs-xs)/1 var(--font-en); opacity: 0.7; }
.qc-layer[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 13%, var(--bg)); border-color: var(--accent); color: var(--accent-2); }
.qc-layer[aria-pressed="true"] .qc-layer-box { opacity: 1; background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.qc-layer[aria-pressed="true"] .qc-layer-box::before { content: "✓"; }
.qc-layer[aria-pressed="false"] { color: var(--fg-2); }
.qc-layer:disabled { opacity: 0.45; cursor: not-allowed; }
.qc-layer-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; opacity: 0.8; }
.qc-layer-dot.has { background: currentColor; }
.qc-layer-dot[hidden], .qc-layer[hidden], .qc-layers[hidden], .qc-layerbar[hidden] { display: none; }
@media (max-width: 900px) {
  /* phones: the chip's pair as two short lines (the lead on top), 44 px targets */
  .qc-layer { min-height: var(--ctl-h); padding: 2px 10px 2px 8px; gap: 6px; }
  .qc-layer .qc-bi { display: inline-flex; flex-direction: column; align-items: flex-start; row-gap: 0; }
  .qc-layer .qc-bi > .qc-sep { display: none; }
  .qc-layer .qc-bi > [lang="ur"] { line-height: 1.5; }
  .qc-layer .qc-bi > [lang="en"] { font-size: var(--fs-xs); line-height: 1.2; }
  html[data-lead="en"] .qc-layer .qc-bi > [lang="en"] { font-size: var(--fs-caption); }
  html[data-lead="en"] .qc-layer .qc-bi > [lang="ur"] { font-size: var(--fs-ur-caption); }
}
@media print { .qc-layerbar { display: none !important; } }
/* base.css */
/* base.css — the one shared stylesheet for every page of the archive (landing, tafsir, books).

   The design tokens live in tokens.css (colour light + sage night, type scale, space, fonts); this file holds the
   shared components that every page wears: header, footer, skip link, focus, layout + rail, panels, buttons,
   chips, rows, script typography, inline tags, print. Section stylesheets (tafsir.css, books.css, pages.css,
   flip.css) only add what is specific to them and may override a token on their body class.
   Candidate palettes: static/themes/*.css (review mockups, `python -m dars.site.mockups themes`). */

/* ─── 1. Design tokens: static/tokens.css (linked before this file on every page) ────────────────── */

/* ─── 2. Base ────────────────────────────────────────────────────────────────────────────── */
/* Base, skip link, focus, script fonts, panels, buttons, pills, chips, callouts, disclosures and the segmented
   switch are qamar-common's (static/qc/components.css, linked before this file; shared with maktaba). */

/* ─── 3. Site header + footer ───────────────────────────────────────────────────────────── */
/* The primary header and the content footer are qamar-common's (static/qc/common.css, shared with
   maktaba.muftiqamar.com; dars.site.common), including the smart header since design-1.6.2 (qc/header.js: slides
   away while reading down, back on scroll up / top edge / focus; sets --header-offset for the sticky rails). */
@media (prefers-reduced-motion: reduce) { .qc-header, .sidebar { transition: none !important; } }

/* ─── 4. Layout: content + sidebar on the RIGHT ─────────────────────────────────────────────
   The content (Urdu/Arabic) reads RTL, so the nav rail sits on its natural side. DOM order is
   <main> then <nav class="sidebar"> (content first); grid auto-placement does the rest. */
.layout {
  direction: ltr;  /* <html dir="rtl">; the grid (and the English it holds) is authored LTR, content declares its own dir */
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  min-height: 100vh;
  align-items: start;
}
.main { min-width: 0; max-width: var(--content-max); padding-bottom: var(--space-6); }

.sidebar {
  position: sticky; top: var(--header-offset, 0px); height: calc(100vh - var(--header-offset, 0px));
  transition: top 150ms ease, height 150ms ease;
  background: var(--bg-2); border-left: 1px solid var(--border);
  padding: var(--space-2) var(--space-3) var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-1);
  overflow: hidden;  /* only .sb-list scrolls; the title block stays put */
}
.sidebar > :not(.sb-list) { flex: 0 0 auto; }
.sb-home { display: block; text-decoration: none; color: inherit; }
.sb-home:hover .sb-title { opacity: 0.85; }
.sidebar .sb-title {
  font-family: var(--font-ur); font-weight: 400;
  font-size: calc(28px * var(--text-scale-ur)); line-height: 1.9; margin: 0; color: var(--accent-2); text-align: center;
}
.sidebar .sb-title .subtitle {
  display: block; font-family: var(--font-en);
  font-size: var(--fs-s); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-2); margin-top: 2px;
}
.sidebar .sb-title .author-line { display: block; margin-top: 2px; line-height: 1.5; text-align: center; }
.sidebar .sb-title .author-name-ur {
  font-family: var(--font-ur); font-size: var(--fs-m);
  color: var(--accent-2); font-weight: 500; letter-spacing: 0.01em;
}
.sidebar .sb-title .author-sep {
  display: inline-block; font-size: 13px; line-height: 1;
  color: var(--accent); font-weight: 700; margin: 0 var(--space-2); vertical-align: middle;
}
.sb-search {
  width: 100%; padding: 6px var(--space-2); border: 1px solid var(--border);
  border-radius: 6px; font-size: var(--fs-s); background: var(--bg); font-family: inherit;
}
.sb-list {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 auto; min-height: 0;
  overflow-y: scroll;  /* always show the track: the affordance that the rail scrolls */
  padding-right: var(--space-1); padding-top: 14px;
  /* soft fade at both ends, a hint that there is more beyond */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-3);
}
.sb-list::-webkit-scrollbar { width: 10px; }
.sb-list::-webkit-scrollbar-track { background: var(--bg-3); border-radius: 5px; margin: 4px 0; }
.sb-list::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 5px; border: 2px solid var(--bg-3); }
.sb-list::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }
.sb-item {
  display: flex; align-items: baseline; gap: 6px;
  padding: var(--space-1) 6px; border-radius: var(--radius-s); font-size: var(--fs-s);
  text-decoration: none; color: var(--fg);
}
.sb-item:hover { background: var(--bg-3); }
.sb-item.active { background: var(--accent); color: var(--on-accent); }
.sb-item[data-current="true"] {
  border-left: 4px solid var(--accent); font-weight: 700; color: var(--accent-2);
  box-shadow: inset 0 0 0 1px var(--accent); padding-left: 6px;
}
.sb-dot { font-size: 9px; }
/* Sidebar footer: collapsed stats (tokens, rebuilt time). */
.book-meta-details {
  margin-top: auto; border-top: 1px solid var(--rule); padding-top: var(--space-2);
  font-size: var(--fs-s); color: var(--fg-2);
}
.book-meta-details > summary {
  cursor: pointer; user-select: none; padding: var(--space-1) 0;
  font-size: calc(11px * var(--text-scale)); text-transform: uppercase; letter-spacing: 0.06em;
}
.book-meta { padding-top: 6px; line-height: 1.5; }
.book-meta .stat { display: flex; justify-content: space-between; }
.book-meta .stat strong { color: var(--fg); font-weight: 600; }
.rebuilt-at { margin-top: 6px; font-size: var(--fs-xs); }

@media screen and (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-left: none; border-top: 1px solid var(--border); }
  .sb-list { max-height: 70vh; }
}

/* ─── 5. Mode bar (panels, buttons, pills, chips, callouts: qamar-common components.css) ─────── */
/* The mode bar of an OCR'd book (study view: books/templates/book.html; flip-book: templates/flip.html): one row
   under the site header, the same in both views. Right: back to Books + title; centre: the Study ⇄ Flip-book
   segmented control (templates/_modeswitch.html); left: the page in view. Sticky in the study view. */
body { --modebar-h: 0px; }
body.has-modebar { --modebar-h: 52px; }
.mode-bar {
  box-sizing: border-box; height: 52px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: var(--space-3); padding: 0 var(--gutter);
  background: var(--bg-2); border-bottom: 1px solid var(--border);
}
body.book .mode-bar { position: sticky; top: var(--header-offset, 0px); z-index: 20; transition: top 150ms ease; }
.mb-side { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.mb-start { grid-column: 1; } .mode-switch { grid-column: 2; } .mb-end { grid-column: 3; justify-content: flex-end; }
.mb-title { min-width: 0; margin: 0; display: flex; align-items: baseline; gap: var(--space-2); font-weight: 400; font-size: inherit; overflow: hidden; }
.mb-title .ur { font-family: var(--font-ur); font-size: var(--fs-ur-small); font-weight: 600; color: var(--accent-2); line-height: 1.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-title .en { font-size: var(--fs-small); color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-bar .sep { white-space: pre; }
.mb-back [lang="ur"] { font-size: var(--fs-ur-caption); line-height: 1.6; }
.mb-page { font-size: var(--fs-small); color: var(--fg-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 900px) {
  /* narrow: the book title in one language, the lead's (Urdu without a lead) */
  html:not([data-lead="en"]) .mb-title .en, .ms-x { display: none; }
  html[data-lead="en"] .mb-title .ur { display: none; }
}
@media (max-width: 640px) {
  body.has-modebar { --modebar-h: 48px; }
  .mode-bar { height: 48px; gap: var(--space-2); padding: 0 var(--space-2); }
  .mode-bar:not(:has(.mode-switch)) .mb-title { display: flex; }  /* flip-only books: room for the title */
  html:not([data-lead="en"]) .mode-bar:not(:has(.mode-switch)) .mb-title .en { display: none; }
  html[data-lead="en"] .mode-bar:not(:has(.mode-switch)) .mb-title .ur { display: none; }
  .mb-title, html:not([data-lead="en"]) .mb-back [lang="en"], .mb-back .sep, .ms-ico { display: none; }
  .ms-opt { padding: 3px 10px; min-height: 34px; gap: 0; font-size: var(--fs-caption); }
  .ms-opt .ur { font-size: 14px; }
}
@media (max-width: 440px) {
  .ms-opt { padding: 3px 8px; }
  .mode-switch { gap: 2px; padding: 2px; }
  .mb-back { padding: 5px 9px; }
  .mb-page { font-size: var(--fs-caption); }
}
@media print { .mode-bar { display: none !important; } }

/* ─── 6. Two-column original/translation rows ────────────────────────────────────────────
   Each .row holds [translation | original]; display:contents flows both cells into the grid so a
   segment sits level with the blocks it translates. `stretch` gives both cells the same height so
   the dashed dividers line up (Nastaliq lines are much taller than the English serif). */
.aligned {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-3) 28px;
  align-items: stretch;
  margin-top: 14px;
}
.aligned .row { display: contents; }
.aligned .col-header {
  font-size: calc(11px * var(--text-scale)); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-2); font-weight: 600;
  padding-bottom: var(--space-1); border-bottom: 1px solid var(--rule);
}
.aligned .orig-col-header { text-align: right; }
.aligned .trans-cell, .aligned .orig-cell { padding-bottom: var(--space-2); border-bottom: 1px dashed var(--rule); }
.aligned > .row:last-child .trans-cell,
.aligned > .row:last-child .orig-cell { border-bottom: none; padding-bottom: 0; }
.aligned .trans-cell.empty { color: var(--rule); font-size: calc(13px * var(--text-scale)); }
.aligned .trans-cell.continued { color: var(--fg-2); font-size: calc(11px * var(--text-scale)); font-style: italic; }
.aligned .trans-cell p { margin: var(--space-1) 0 0; font-size: var(--fs-trans); line-height: 1.65; }
.trans-refs { font-size: var(--fs-xs); color: var(--fg-2); font-family: var(--font-mono); }
.trans-seg { margin-bottom: var(--space-4); padding-bottom: var(--space-3); border-bottom: 1px dashed var(--rule); }
.trans-seg:last-child { border-bottom: none; }
.aligned .orig-cell.stack { display: flex; flex-direction: column; gap: 6px; }
.aligned .orig-cell.stack .block { padding: var(--space-1) 0; border-bottom: 1px dotted var(--rule); }
.aligned .orig-cell.stack .block:last-child { border-bottom: none; }
/* Narrow screens: one column, each row stacked original-then-translation. The row becomes a real
   box here (not display:contents), so the reordering stays inside the row. */
@media screen and (max-width: 1100px) {  /* screen only: A4 landscape is ~1017px wide */
  .aligned { display: block; }
  .aligned .col-header { display: none; }
  .aligned .row { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) 0; border-bottom: 1px dashed var(--rule); }
  .aligned > .row:last-child { border-bottom: none; }
  .aligned .trans-cell, .aligned .orig-cell { border-bottom: none; padding-bottom: 0; }
  .aligned .orig-cell { order: 1; }
  .aligned .trans-cell { order: 2; }
  /* A row of several translated paragraphs (dars.site.tafsir.body): each Urdu paragraph is followed by its own
     English. The cells dissolve into one column; each English paragraph takes the grid row the build gave it (--r,
     right after its last Urdu block) and the Urdu blocks fill the other rows in order. Markup only, no script. */
  .aligned .row.pairs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .aligned .row.pairs > .trans-cell, .aligned .row.pairs > .orig-cell { display: contents; }
  .aligned .row.pairs .trans-seg { grid-column: 1; grid-row: var(--r, auto); margin: 0 0 var(--space-3); }
  .aligned .row.pairs .orig-cell.stack > .block { border-bottom: none; }
}

/* ─── 7. Blocks and script typography ───────────────────────────────────────────────────── */
.block { margin: 0 0 var(--space-3) 0; }
.block-body { line-height: 1.7; }
.block-note {
  display: block; font-size: calc(11px * var(--text-scale)); color: var(--fg-2); font-style: italic;
  margin-top: var(--space-1); text-align: left;
}
.script-urdu, .script-arabic, .script-persian, .block.script-mixed[dir="rtl"] { text-align: right; }
.script-urdu { font-family: var(--font-ur); font-size: var(--fs-urdu); line-height: var(--lh-urdu); }
.script-arabic { font-family: var(--font-ar); font-size: var(--fs-arabic); line-height: var(--lh-arabic); }
.script-persian { font-family: var(--font-ur); font-size: var(--fs-persian); line-height: 2; }
.block.script-mixed[dir="rtl"] { font-family: var(--font-ur); font-size: var(--fs-urdu); line-height: var(--lh-urdu); }
/* Nastaliq keeps its block's line height (--lh-urdu 2.1, Persian 2): the 1.7 of .block-body made one line's descenders
   touch the next line's letters (UX review 2, issue 6). */
.script-urdu > .block-body, .script-persian > .block-body, .block.script-mixed[dir="rtl"] > .block-body { line-height: inherit; }
.block.script-english, .block.script-unknown, .block.script-mixed[dir="ltr"] { font-family: var(--font-en); font-size: var(--fs-latin-block); }

/* ─── 8. Inline tags inside a block ─────────────────────────────────────────────────────── */
/* Script switches */
.inline-arabic { font-family: var(--font-ar); font-size: 0.95em; padding: 0 2px; }
.inline-persian, .inline-urdu { font-family: var(--font-ur); }
.inline-english { font-family: var(--font-en); font-size: 0.92em; direction: ltr; display: inline-block; }
/* Semantic spans. Quran/hadith/dua imply Arabic typography. */
.semantic-quran, .semantic-hadith {
  padding: 1px var(--space-2); border-radius: 3px; font-family: var(--font-ar);
  border-right: 2px solid var(--green);
}
.semantic-quran { background: var(--quran-bg); color: var(--quran-fg); }
.semantic-hadith { background: var(--hadith-bg); color: var(--hadith-fg); border-right-color: var(--yellow); }
[dir="ltr"] .semantic-quran, [dir="ltr"] .semantic-hadith { border-right: none; border-left: 2px solid var(--green); }
[dir="ltr"] .semantic-hadith { border-left-color: var(--yellow); }
.semantic-quran .ref, .semantic-hadith .ref {
  font-family: var(--font-en); font-size: 0.7em; font-weight: 600;
  color: var(--green); margin-right: var(--space-1); vertical-align: super;
}
.semantic-hadith .ref { color: var(--yellow); }
.semantic-poetry { display: inline-block; font-style: italic; padding: 0 var(--space-1); white-space: pre-wrap; }
.semantic-dua { background: var(--dua-bg); font-family: var(--font-ar); padding: 0 var(--space-1); border-radius: 3px; }
/* Audio-transcript annotations. Greyed, never italic: Nastaliq has no italic and would fall back. */
.audio-extraneous, .audio-aside, .audio-unclear { color: var(--fg-2); font-size: 0.92em; }
.audio-unclear { border-bottom: 1px dotted var(--red); cursor: help; }
.mode-public .audio-unclear { border-bottom-color: var(--border); cursor: auto; }
/* An ayah reference (`21:93-100`) keeps its LTR order inside RTL text. */
.ayah-ref { direction: ltr; unicode-bidi: isolate; }
/* The English column: quotations of Quran / hadith (rendered from the translation's inline tags). */
.inline-quran-en { color: var(--quran-fg); }
.inline-hadith-en { color: var(--hadith-fg); }
.inline-dua-en { font-style: italic; }
.ayah-cite { font-size: 0.88em; color: var(--fg-2); white-space: nowrap; }
.inline-poetry { font-style: italic; }
/* A `\n` in the source, kept as a faint divider so a Nastaliq run flows as one paragraph. */
.nl-mark { color: var(--nl-mark); margin: 0 6px; font-weight: 300; user-select: none; }

/* ─── 9. Print ──────────────────────────────────────────────────────────────────────────────
   A4 landscape, two columns locked regardless of paper width (sections can set --print-cols). */
@media print {
  @page { size: A4 landscape; margin: 12mm 14mm; }
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .qc-header, .qc-footer, .sidebar, .no-print { display: none !important; }
  .layout { display: block !important; }
  .main { padding: 0; max-width: none; }
  .panel { box-shadow: none; border: none; padding: 0 !important; margin: 0 0 8mm 0 !important; }
  .aligned {
    display: grid !important;
    grid-template-columns: var(--print-cols, 1fr 1.05fr) !important;
    gap: 10pt 22pt !important;
  }
  .aligned .row { display: contents !important; }
  .aligned .col-header { display: block !important; border-bottom: 0.5pt solid #555 !important; color: #333 !important; }
  .aligned .trans-cell, .aligned .orig-cell {
    order: unset !important;
    padding-top: 0 !important; padding-bottom: 8pt !important;
    border-top: none !important; border-bottom: 0.3pt dashed #bbb !important;
  }
  .script-urdu, .script-arabic, .script-persian, .block.script-mixed[dir="rtl"] { font-size: 14pt; line-height: 1.7; }
  .block.script-english, .block.script-mixed[dir="ltr"] { font-size: 10.5pt; }
  .pill { font-size: 9pt; }
  .block, .trans-seg { break-inside: avoid; page-break-inside: avoid; }
  .callout { background: transparent; border-left-color: #888; }
  a { color: inherit; text-decoration: none; }
}

/* ─── 10. Lead language (qamar-common 1.8.x; README "Lead language") ──────────────────────────
   <html data-lead="en"> (the header's «اردو | English» switch, qc/header.js) makes every bilingual pair English first
   and at reading size, Urdu second and smaller. Nothing is hidden and <html dir> never changes: only a reordered pair
   runs LTR. Pairs carry the kit classes (.qc-bi inline, .qc-bi-blk stacked; components.css) or get a rule here, in
   pages.css, tafsir.css or books.css. Bars never reorder (kit 1.8.4): section bars, tabs, chip rows, crumbs, the
   lecture toolbar and player, the book mode bar and rail keep their order and direction; only their labels
   re-weight. Urdu lead (the default): none of these rules apply. */
/* the kit sets the second Urdu `smaller` than the English beside it: never below the Urdu caption size (Nastaliq at
   12-13 px does not read) */
html[data-lead="en"] :is(.qc-bi, .qc-bi-blk) > [lang="ur"] { font-size: max(0.85em, var(--fs-ur-caption)); }
/* labels inside chip rows and crumbs: English stronger, Urdu lighter; same order, same row */
html[data-lead="en"] :is(.chip, .crumbs a, .try-label) > :is(.en, [lang="en"]) { font-size: var(--fs-small); font-weight: 600; color: inherit; }
html[data-lead="en"] :is(.chip, .crumbs a, .try-label) > :is(.ur, [lang="ur"]) { font-size: var(--fs-ur-caption); opacity: 0.85; }
/* the book mode bar (book.html, flip.html): re-weight only */
html[data-lead="en"] :is(.mb-title, .mb-back, .ms-opt) > :is(.en, [lang="en"]) { font-weight: 600; color: inherit; }
html[data-lead="en"] :is(.mb-title, .mb-back, .ms-opt) > :is(.ur, [lang="ur"]) { font-weight: 400; opacity: 0.85; }
/* The aligned Urdu/English rows (lecture and book text, §6). Two columns: the English column is already the left one
   (the first in LTR reading), so nothing moves. Stacked (narrow screens): each row shows its English before its Urdu,
   and in a row of several paragraphs each English takes the grid row right BEFORE its first Urdu block (--re, from
   dars.site.tafsir.body; --r is the Urdu-lead row). CSS order only: the DOM stays Urdu, English. The view buttons
   (body.urdu-only / body.english-only) are a separate choice and still apply. Print keeps the two columns. */
@media screen and (max-width: 1100px) {
  html[data-lead="en"] .aligned .trans-cell { order: 0; }
  html[data-lead="en"] .aligned .row.pairs .trans-seg { grid-row: var(--re, var(--r, auto)); }
}

/* ─── 11. One language for the interface (qamar-common 1.9.0, user decision 2026-12-04) ──────────
   With <html data-lead> set (head-early.html, before paint) the interface shows only the lead language: nav, section
   bars, buttons, labels, headings, ledes, notes, card descriptions, counts, topic names. The kit hides the other half
   of every .qc-bi / .qc-bi-blk that is not .qc-keep; these rules do the same for dars's own pairs (.ur/.en, lang
   spans, .lbl-ar/.lbl-en). Bilingual in both modes: titles (books, lectures, surahs, chapters), names of people, and
   the content with its translation (lecture and book rows, the About and biography prose, quotes, topic passages).
   Without scripts there is no data-lead and both languages show. Nothing here moves a bar (kit 1.8.4): it only hides
   a label's other half. */
html[data-lead="ur"] :is(.skip-link, .sec-h, .crumbs a, .chip, .try-label, .bio-link, .page-head h1, .page-header h2,
  .scan-toggle > summary, .page-flip, .goto label, .rail-h, .book-toc > summary, .toc-page-title, .mb-back, .ms-opt,
  .book-note, .missing-note, .flip-back, .flip-jump label, .surah-picker-label, .podcast-link, .surah-index > summary,
  .filter-label, .sb-nb-label, .sb-library, .sb-title, .toggle-btn, .print-menu-list > *, .aud-menu-head, .aud-menu-item,
  .aud-prompt-go, .timeline .yr, .privacy .bi, .searchbox-go, .qc-notfound-links a) > :is([lang="en"], .en, .lbl-en),
html[data-lead="en"] :is(.skip-link, .sec-h, .crumbs a, .chip, .try-label, .bio-link, .page-head h1, .page-header h2,
  .scan-toggle > summary, .page-flip, .goto label, .rail-h, .book-toc > summary, .toc-page-title, .mb-back, .ms-opt,
  .book-note, .missing-note, .flip-back, .flip-jump label, .surah-picker-label, .podcast-link, .surah-index > summary,
  .filter-label, .sb-nb-label, .sb-library, .sb-title, .toggle-btn, .print-menu-list > *, .aud-menu-head, .aud-menu-item,
  .aud-prompt-go, .timeline .yr, .privacy .bi, .searchbox-go, .qc-notfound-links a) > :is([lang="ur"], .ur, .lbl-ar),
html[data-lead] :is(.skip-link, .try-label, .crumbs a, .page-flip, .scan-toggle > summary, .goto label, .rail-h, .mb-back,
  .ms-opt, .flip-back, .flip-jump label, .surah-picker-label, .podcast-link, .surah-index > summary, .filter-label,
  .sb-nb-label, .sb-library, .toggle-btn, .print-menu-list > *, .aud-prompt-go, .library-link, .toc-cta, .timeline .yr)
  > :is(.sep, .qc-sep, .lbl-sep) { display: none; }
/* sibling pairs (a paragraph each): ledes, the landing intro, card descriptions, work notes, stat labels. An
   English-only description (topics, book notes) is interface too: Urdu lead hides it. A lede that is a name (the
   biography's) carries .qc-keep. */
html[data-lead="ur"] :is(.page-head, .hero, .card) > [lang="en"]:is(.lede, .intro, .card-desc):not(.qc-keep),
html[data-lead="en"] :is(.page-head, .hero, .card) > [lang="ur"]:is(.lede, .intro, .card-desc):not(.qc-keep),
html[data-lead="ur"] .shelf-note[lang="en"],
html[data-lead="ur"] .work > .w-note[lang="en"], html[data-lead="en"] .work > .w-note[lang="ur"],
html[data-lead="ur"] .stats [lang="en"], html[data-lead="en"] .stats [lang="ur"] { display: none; }
/* a section heading's count pill sits in both halves (Urdu lead hides the English one); with both halves showing
   (no data-lead) only the English one shows, as before */
html:not([data-lead]) .sec-h > .ur > .count { display: none; }
/* the side-by-side columns that become one (privacy): the remaining column takes the width */
html[data-lead] :is(.privacy .bi, .lede-pair) { grid-template-columns: 1fr; }
/* the column labels of the text rows: Urdu at a readable size */
.aligned .col-header [lang="ur"] { font-family: var(--font-ur); font-size: var(--fs-ur-caption); font-weight: 400; letter-spacing: 0; text-transform: none; }
/* the lecture sidebar's title: «درس» in Urdu lead, "Dars Archive" (at title size) in English lead */
html[data-lead="en"] .sidebar .sb-title .subtitle { font-size: var(--fs-h3); text-transform: none; letter-spacing: 0.01em; color: var(--accent-2); }
/* tafsir.css */
/* tafsir.css — what only the tafsir pages have: the surah-grouped sidebar, catalog filters and
   cards, the recording header, the audio bar, chunk-seam markers, muted closing dua, speaker
   badges and the Urdu-only toggle. Everything shared (tokens, shell, layout, rows, script
   typography, inline tags, print) is in base.css. */

/* ─── Sidebar: one <details> per focus surah ─────────────────────────────────────────────── */
.sb-year { margin-bottom: var(--space-1); }
.sb-year > summary {
  cursor: pointer; user-select: none; padding: var(--space-1) 6px;
  font-family: var(--font-ar); font-size: calc(17px * var(--text-scale)); font-weight: 400; line-height: 1.6;
  color: var(--accent-2); direction: rtl; text-align: right;
}
.sb-date { font-family: var(--font-mono); color: var(--fg-2); }
.sb-refs {
  margin-left: auto; text-align: right; direction: rtl;
  font-family: var(--font-ar); font-size: calc(17px * var(--text-scale)); line-height: 1.6; color: var(--accent-2);
}
.sb-item[data-current="true"] .sb-date { color: var(--accent-2); }
.sb-item[data-current="true"] .sb-refs { font-weight: 400; } /* Arabic is never bold (no bold Amiri file); the border + outline mark it */
.sb-back { align-self: center; margin: var(--space-4) 0 6px; }
/* Previous / next lecture (R27: kept in the page; the full list is fetched) */
.sb-neighbours {
  display: flex; flex-direction: column; gap: var(--space-1);
  margin: var(--space-3) 0; padding: var(--space-3) 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.sb-nb { flex-wrap: wrap; }
.sb-nb-label { flex: 1 0 100%; display: flex; align-items: baseline; gap: 0 var(--space-2); font-weight: 600; color: var(--accent); }
.sb-nb-label [lang="ur"] { font-size: var(--fs-ur-small); }
.sb-nb-label [lang="en"] { font-size: var(--fs-small); }

/* ─── Catalog: filter bar + card grid ────────────────────────────────────────────────────── */
.filter-bar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  padding: 10px var(--space-4);
  display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center;
}
.filter-search, .filter-input {
  padding: 5px var(--space-2); border: 1px solid var(--border); border-radius: 6px;
  font-size: var(--fs-s); background: var(--bg); font-family: inherit;
}
.filter-search-form { flex: 1 1 280px; display: flex; min-width: 200px; }
.filter-search-form .filter-search { flex: 1 1 auto; }
.filter-search { flex: 1 1 280px; min-width: 200px; padding: 6px 10px; font-size: 13px; }
.filter-label { display: inline-flex; gap: var(--space-1); align-items: baseline; font-size: 11px; color: var(--fg-2); }
.filter-label .filter-input { width: 70px; }
.filter-bar > * { direction: ltr; }  /* the bar is dir="rtl" (search box on the right); controls stay LTR */
/* Touch (UX review 2, issue 10): the search box and year boxes are 44 px targets, their text 16 px (smaller text makes
   iOS zoom the page on focus); the labels are readable (Urdu at the small Urdu size). */
@media (pointer: coarse) {
  .filter-search, .filter-input { min-height: var(--ctl-h); font-size: 16px; }
  .filter-label .filter-input { width: 84px; }
  .filter-label { align-items: center; font-size: var(--fs-small); }
  .filter-label [lang="ur"] { font-size: var(--fs-ur-small); }
}

/* RTL grid flow: the first card lands top-right, matching the Arabic surah index in the rail.
   Card contents flow RTL too (title, meta, pills and the call to action anchor on the right); each
   English leaf is its own LTR island, and a label+value pair (.toc-source) keeps its LTR order. */
.toc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
  gap: 14px; padding: var(--space-4); direction: rtl;
}
.toc-card {
  display: flex; flex-direction: column; gap: 6px;
  border-color: var(--rule); border-radius: var(--radius-m); box-shadow: none;
  padding: 14px var(--space-4);
}
.toc-card-head { font-size: var(--fs-m); display: flex; flex-direction: column; gap: var(--space-1); }
.toc-card-head .english-meta {  /* "date · min · chunks" keeps its LTR order, anchored right */
  display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; direction: ltr; justify-content: flex-end;
}
.toc-card-head strong { font-size: var(--fs-body); color: var(--accent-2); }
.toc-card-head .title-arabic { display: block; text-align: right; font-size: calc(18px * var(--text-scale)); }
.toc-meta { color: var(--fg-2); font-size: var(--fs-small); }
.toc-source {
  color: var(--fg-2); font-size: var(--fs-s); display: flex; align-items: baseline; gap: 6px;
  direction: ltr; justify-content: flex-end;
}
.toc-source-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.65; }
.toc-source-name { font-family: var(--font-mono); font-size: calc(11.5px * var(--text-scale)); word-break: break-all; }
.toc-refs { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.toc-themes { gap: 3px; margin-top: var(--space-1); }
.toc-cta { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: baseline; gap: 0 var(--space-2); }
.toc-cta [lang="en"] { font-size: var(--fs-small); }
.toc-cta .sep { opacity: 0.6; }
.toc-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-3); direction: rtl; }
.toc-title-row .title-arabic { margin: 0; }
.toc-en { font-size: var(--fs-small); color: var(--fg-2); }
.toc-date, .toc-hijri { font-size: var(--fs-small); color: var(--fg-2); }
.toc-card-head .english-meta { gap: 0 var(--space-2); }

/* Surah picker above the cards: a select that jumps (phones: two taps to any surah) and the full index of links */
.surah-picker {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4) 0; direction: rtl;
}
.surah-picker-label { display: inline-flex; align-items: baseline; gap: 0 var(--space-2); color: var(--fg-2); }
.surah-picker-label [lang="ur"] { font-size: var(--fs-ur-small); }
.surah-picker-label [lang="en"] { font-size: var(--fs-small); }
.surah-picker .sep { color: var(--fg-2); }
.surah-jump {
  flex: 1 1 220px; min-width: 0; max-width: min(420px, 100%); min-height: 40px; padding: 4px var(--space-2);
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--fg);
  font-family: var(--font-ar); font-size: var(--fs-body);
}
.surah-index { flex: 1 0 100%; }
/* The lectures' podcast feed (dars/feed.xml), shown beside the surah picker (UX review 2, issue 8). */
.podcast-link {
  display: inline-flex; align-items: center; gap: 0 var(--space-2); min-height: 40px; color: var(--accent-2);
  text-decoration: none;
}
.podcast-link:hover [lang] { text-decoration: underline; }
.podcast-link [lang="ur"] { font-size: var(--fs-ur-small); }
.podcast-link [lang="en"] { font-size: var(--fs-small); }
.podcast-link .sep { color: var(--fg-2); }
.podcast-icon { width: 16px; height: 16px; flex: none; color: var(--library-gold, var(--accent)); }
.surah-index > summary {
  cursor: pointer; display: inline-flex; align-items: baseline; gap: 0 var(--space-2); color: var(--accent);
  font-weight: 600; padding: var(--space-1) 0;
}
.surah-index > summary [lang="ur"] { font-size: var(--fs-ur-small); }
.surah-index > summary [lang="en"] { font-size: var(--fs-small); }
.surah-index-grid {
  list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: 2px var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(min(118px, 100%), 1fr)); direction: rtl;
}
.surah-index-grid a {
  display: flex; align-items: baseline; gap: var(--space-1); padding: 2px var(--space-2); border-radius: var(--radius-s);
  text-decoration: none; color: var(--fg);
}
.surah-index-grid a:hover { background: var(--bg-3); }
.si-n, .si-k { font-size: var(--fs-small); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.si-ar { font-size: var(--fs-ur-small); color: var(--accent-2); line-height: 1.7; }
.si-k { margin-inline-start: auto; }

/* One collapsible group per surah, anchored #s<N> (the sticky filter bar stays clear of the heading) */
.toc-groups { padding-bottom: var(--space-4); }
.toc-group { scroll-margin-top: 64px; }
.toc-group-h {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-3); cursor: pointer;
  margin: var(--space-3) var(--space-4) 0; padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); direction: rtl;
  list-style: none;
}
.toc-group-h::-webkit-details-marker { display: none; }
.toc-group-h::before { content: "▾"; color: var(--fg-2); font-size: var(--fs-small); }
.toc-group:not([open]) > .toc-group-h::before { content: "◂"; }
.tg-n { font-size: var(--fs-small); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.tg-ar { font-size: var(--fs-ur-lead); color: var(--accent-2); font-weight: 400; line-height: 1.6; }
.tg-en { font-size: var(--fs-small); color: var(--fg-2); font-weight: 600; }
.tg-k {
  margin-inline-start: auto; font-size: var(--fs-small); color: var(--fg-2);
  border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 0 var(--space-2);
}
/* the year filter (tafsir.js) hides cards: a group left with none hides too */
.toc-group:not(:has(.toc-card:not([class~="hidden"]))) { display: none; }

/* ─── One recording ──────────────────────────────────────────────────────────────────────── */
.session { padding: 22px 28px; margin: var(--space-5) var(--space-6); scroll-margin-top: 70px; }
.session-header { margin-bottom: var(--space-3); }
/* The header is dir="rtl": the Arabic title and every meta row start at the right edge. Each English
   item stays an LTR island. */
.session-title-arabic-row { display: flex; justify-content: flex-start; margin-bottom: 6px; }
.session-title > *, .session-meta > * { direction: ltr; unicode-bidi: isolate; }
.session-title-arabic-row .title-arabic, .session-title-arabic-row h1 { margin: 0; }
.session-title-arabic-row h1 { font-size: calc(26px * var(--text-scale)); }
.title-en { color: var(--accent-2); font-size: var(--fs-m); font-weight: 600; }
.title-hijri { color: var(--muted); font-size: calc(13px * var(--text-scale)); }
.title-arabic {
  font-family: var(--font-ar-display); font-size: calc(26px * var(--text-scale)); font-weight: 400;
  color: var(--accent-2); direction: rtl; margin: var(--space-1) 0;
}
.session-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-date { color: var(--muted); font-size: calc(13px * var(--text-scale)); font-family: var(--font-mono); margin-inline-end: var(--space-2); }
.audio-dot { font-size: var(--fs-m); }
.meta-series { font-style: italic; color: var(--fg-2); font-size: calc(13px * var(--text-scale)); }
.session-meta {
  display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: baseline;
  margin-top: var(--space-1); font-size: var(--fs-s); color: var(--fg-2);
}
.theme-pills { margin-top: 6px; }
.topic-chips { margin-top: var(--space-3); }
.library-row + .topic-chips { margin-top: var(--space-4); }
/* Phones (UX review 2, issue 4): the topic chips are one row that scrolls sideways (it was one chip per line, a
   whole screen before the transcript); the far edge fades to show there is more. */
@media (max-width: 720px) {
  .topic-chips {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    padding-block: 2px; margin-inline: calc(-1 * var(--space-4)); padding-inline: var(--space-4);
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
  }
  .topic-chips::-webkit-scrollbar { display: none; }
  .topic-chips .chip { flex: none; white-space: nowrap; }
  .library-row + .topic-chips { margin-top: var(--space-3); }
}
/* «Read the Mufti's written tafsir (Noor-ul-Bayan)»: the lecture's first ayah in his written tafsir (sibling
   library), and «… Khulasa Tafseer-e-Quran» (this site's book), as one row of pills under the duration line (they wrap
   on phones); the sidebar's surah groups link the Noor-ul-Bayan surah's start. */
.library-row { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-start; margin-top: var(--space-2); }
.library-link, .sb-library {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); direction: rtl;
  color: var(--accent-2); text-decoration: none;
}
/* Same gold as the header's Library button (the only non-green accent: it always means "the library") */
.library-link {
  padding: 2px 14px; border: 1px solid transparent; border-radius: var(--radius-pill);
  color: var(--library-gold); background: var(--library-gold-bg);
  box-shadow: inset 0 0 0 1px var(--library-gold-ring), 0 0 10px var(--library-gold-glow);
}
.library-link:hover { border-color: var(--library-gold); box-shadow: inset 0 0 0 1px var(--library-gold-ring), 0 0 14px var(--library-gold-glow); }
.library-link:focus-visible { outline: 2px solid var(--library-gold); outline-offset: 2px; }
.sb-library { color: var(--library-gold); }
.library-link:hover .ur, .sb-library:hover .ur { text-decoration: underline; }
.library-link .ur, .sb-library .ur { font-size: var(--fs-ur-caption); line-height: 2; }
.library-link .en, .sb-library .en, .library-link .sep, .sb-library .sep { font-size: var(--fs-caption); color: var(--fg-2); }
/* on the gold wash the English keeps the gold ink (WCAG AA: ≈6:1 light, ≈9:1 night; was --fg-2 at 85%: 4.2:1) */
.library-link .en, .library-link .sep { color: var(--library-gold); font-size: var(--fs-small); }
.sb-library { display: flex; padding: var(--space-1) 6px var(--space-2); }
.theme-pill { font-size: var(--fs-xs); }
.session-footer { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--rule); }

/* Urdu-only toggle: hides the English column (choice persisted by tafsir.js). */
.urdu-toggle-bar { display: flex; justify-content: flex-end; align-items: center; margin: 0 0 var(--space-2); padding: 6px 0; }
.urdu-toggle-btn .lbl-ar { font-family: var(--font-ur); font-size: 15px; line-height: 1; direction: rtl; }
.urdu-toggle-btn .lbl-en { font-size: var(--fs-s); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.urdu-toggle-btn .lbl-sep { color: var(--rule); }
.urdu-toggle-btn.active .lbl-en, .urdu-toggle-btn.active .lbl-sep { color: inherit; opacity: 0.8; }
body.urdu-only { --print-cols: 1fr; }
body.urdu-only .aligned { grid-template-columns: 1fr; }
body.urdu-only .aligned .trans-cell,
body.urdu-only .aligned .trans-col-header { display: none !important; }
/* English only (decision B): the Urdu/Arabic column hides; rows with no English go too. A missing-audio note stays. */
body.english-only { --print-cols: 1fr; }
body.english-only .aligned { grid-template-columns: 1fr; }
body.english-only .aligned .orig-cell:not(.quiet-line),
body.english-only .aligned .orig-col-header { display: none !important; }
/* its own rule: a browser without :has() drops only this one (the empty row then just stays) */
body.english-only .aligned .row:has(> .trans-cell.empty) { display: none !important; }

/* ─── Transcript specifics ───────────────────────────────────────────────────────────────── */
/* Hover = clickable: only a paragraph with a time (it seeks the audio, tafsir.js) is tinted; untimed text is not. */
@media (hover: hover) {
  .block:is([data-t], [data-c]):hover { background: var(--bg-3); border-radius: var(--radius-s); }
}
.aligned .orig-cell.stack.untranslated .block { opacity: 0.65; }
.speaker-label, .speaker-tag {
  display: inline-block; padding: 0 var(--space-1); margin-right: var(--space-1);
  background: var(--bg-3); color: var(--accent-2);
  border-radius: 3px; font-size: 0.8em; font-weight: 600; cursor: help;
}
.speaker-inline { display: block; margin-top: 6px; }  /* one line per speaker turn */
/* Public: a listener's turn, labelled "سامع:" (no speaker letters). */
.listener-label { cursor: auto; font-family: var(--font-ur); font-weight: 500; }
.trans-cell .listener-label { font-family: var(--font-en); }
/* Public: silence or missing audio, a quiet one-line note instead of the pipeline's markers. */
.quiet-line {
  color: var(--fg-2); font-family: var(--font-ur); font-size: var(--fs-m); line-height: 2;
  text-align: center !important;
}
/* full --fg-2 (AA, ≈6.9:1): a silence note in an untranslated stack is not dimmed with the stack */
.aligned .orig-cell.stack.untranslated .block.block-silence { opacity: 1; }
.quiet-line [lang="en"] { font-family: var(--font-en); font-size: var(--fs-small); }
.aligned .quiet-row .orig-cell { grid-column: 1 / -1; }
.speaker-inline:first-child { margin-top: 0; }
.quran-truncation-warn {
  display: inline-block; margin-left: 6px; padding: 1px 6px; vertical-align: middle;
  background: var(--warn-bg); color: var(--gap-fg); border: 1px solid var(--gap-border);
  border-radius: 3px; font-size: var(--fs-xs); font-weight: 600; cursor: help;
}
/* Chunk seams; missing-chunk markers must stand out: the reader needs to know content is absent. */
.aligned .chunk-boundary-row .trans-cell,
.aligned .chunk-boundary-row .orig-cell.chunk-boundary {
  border-top: 2px dotted var(--accent); border-bottom: 2px dotted var(--accent);
  background: var(--bg-3); padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono); font-size: 11px; color: var(--accent-2); text-align: center;
}
.aligned .chunk-boundary-row .orig-cell.chunk-boundary.chunk-gap {
  background: var(--gap-bg); color: var(--gap-fg); font-weight: 600;
  border-top: 2px solid var(--gap-border); border-bottom: 2px solid var(--gap-border);
}
/* The Mufti's closing dua: visible but de-emphasized (colour + opacity; never italic Nastaliq). */
.aligned .block[data-editorial-muted="1"],
.aligned .trans-cell .seg-muted,
.aligned .row.editorial-muted .trans-cell,
.aligned .row.editorial-muted .orig-cell { color: var(--muted); }
/* Full opacity (owner, 2026-12-02): --muted is ≥ 4.5:1 on the page in both themes; nested Arabic, Quran and dua
   spans take the same quiet colour instead of their own. */
.aligned .block[data-editorial-muted="1"] .block-body *,
.aligned .trans-cell .seg-muted *,
.aligned .row.editorial-muted .trans-cell *,
.aligned .row.editorial-muted .orig-cell .block-body * { color: inherit; }

/* ─── Audio bar: fixed thin bottom player, stopping at the sidebar's edge ───────────────── */
body.per-mp3 { padding-bottom: 64px; }
.session-audio-wrap {
  position: fixed; left: 0; right: var(--sidebar-w); bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.04), 0 -8px 24px rgba(138, 109, 59, 0.10);
}
@media (max-width: 1100px) { .session-audio-wrap { right: 0; } }
.session-audio-wrap audio.session-audio { display: none; }
.aud-date, .aud-time {
  font-family: var(--font-mono); font-size: var(--fs-s); color: var(--fg-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.aud-time { font-size: 11px; }
.aud-title-ar {
  font-family: var(--font-ar-ui); font-size: var(--fs-body); line-height: 1; font-weight: 500;
  direction: rtl; color: var(--accent-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px;
  margin-left: auto;  /* pushes title + download to the right edge */
}
.aud-download { font-size: var(--fs-s); padding: 5px var(--space-3); }
.aud-download-icon { width: 14px; height: 14px; flex: 0 0 14px; }
@media (max-width: 720px) { .aud-title-ar { display: none; } }
/* The date is in the page header too: below 1400 px it gives its room to the scrubber (speed, sleep, share). */
@media (max-width: 1399px) { .aud-date { display: none; } }
@media (max-width: 860px) { .aud-download-label, html[data-lead] .aud-download-label { display: none; } }  /* also over the kit's English-lead .qc-bi display */
.aud-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1.5px solid var(--accent); color: var(--accent-2);
  font-family: var(--font-en); font-weight: 600;
  cursor: pointer; user-select: none; transition: background 0.12s, color 0.12s, transform 0.06s;
}
.aud-btn:hover { background: var(--bg-3); }
.aud-btn:active { transform: scale(0.94); }
.aud-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.aud-skip { height: 32px; min-width: 46px; padding: 0 var(--space-2); border-radius: 16px; gap: 3px; font-size: var(--fs-s); }
.aud-skip .skip-arrow { font-size: 13px; line-height: 1; }
.aud-skip .skip-num { font-variant-numeric: tabular-nums; font-size: 11px; }
.aud-play {
  width: 38px; height: 38px; border-radius: 19px; font-size: var(--fs-m); line-height: 1;
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  box-shadow: 0 2px 6px rgba(138, 109, 59, 0.3);
}
.aud-play:hover { background: var(--accent-2); border-color: var(--accent-2); }
.aud-play .pause-glyph { display: none; font-size: 11px; }
.aud-play.playing .play-glyph { display: none; }
.aud-play.playing .pause-glyph { display: inline; }
/* Resumed at the saved place (tafsir.js + player-state.js): the time reads in gold and a small "start over"
   pill shows until playback starts. */
.session-audio-wrap.resumed .aud-time-cur { color: var(--accent-2); font-weight: 600; }
.aud-restart { height: 26px; padding: 0 var(--space-2); border-radius: 13px; gap: 4px; font-size: 11px; white-space: nowrap; }
.aud-restart[hidden] { display: none; }
.aud-restart .skip-arrow { font-size: 12px; line-height: 1; }
.aud-restart-label { font-family: var(--font-ur); font-weight: 400; font-size: 12px; line-height: 1; }
.aud-scrub {
  flex: 1 1 180px; min-width: 100px; height: 22px; margin: 0 2px;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.aud-scrub::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--seek-pct, 0%),
    var(--rule) var(--seek-pct, 0%), var(--rule) 100%);
}
.aud-scrub::-moz-range-track { height: 5px; border-radius: 3px; background: var(--rule); }
.aud-scrub::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--accent); }
.aud-scrub::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -7px;
  width: 18px; height: 18px; border-radius: 9px; cursor: grab;
  background: var(--accent-2); border: 3px solid var(--bg-2); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.aud-scrub::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 9px; cursor: grab;
  background: var(--accent-2); border: 3px solid var(--bg-2); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.aud-scrub::-webkit-slider-thumb:active { cursor: grabbing; }
.aud-scrub:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius-s); }
/* Stretches damaged in the original recording (registry/audio-glitches.csv): orange marks laid over the scrubber's
   track by tafsir.js (it sets the box and direction from the scrubber); the label is in title + the note's
   aria-label, so the colour is never the only cue. #c45a0c: >= 3:1 against the light and the dark bar. */
.session-audio-wrap { --damage: #c45a0c; }
.aud-marks { position: absolute; height: 9px; visibility: hidden; pointer-events: none; }
.aud-marks.placed { visibility: visible; }
.aud-mark {
  position: absolute; top: 0; height: 9px; min-width: 4px; border-radius: 2px;
  background: var(--damage); opacity: 0.9; pointer-events: auto; cursor: help;
}

/* Speed, sleep timer, share: small round buttons after the scrubber; `.on` = not the default (1×, timer off). */
.aud-opt { position: relative; height: 32px; min-width: 32px; padding: 0 var(--space-1); border-radius: 16px; font-size: var(--fs-s); }
.aud-opt.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.aud-speed-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.aud-icon { width: 16px; height: 16px; flex: none; }
.aud-sleep-left {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-2); color: var(--on-accent); font-size: var(--fs-xs); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.aud-sleep-left[hidden] { display: none; }
.aud-pop { position: relative; display: inline-flex; flex: none; }
.aud-menu {
  position: absolute; bottom: calc(100% + 10px); right: 0; z-index: 60; min-width: 13rem; white-space: nowrap;
  display: flex; flex-direction: column; padding: var(--space-1); background: var(--bg-2);
  border: 1px solid var(--rule); border-radius: var(--radius-m); box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
}
.aud-menu[hidden] { display: none; }
.aud-menu-item, .aud-menu-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 44px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-s);
  background: none; color: var(--fg); font: inherit; text-align: start; cursor: pointer;
}
.aud-menu-head { cursor: default; color: var(--fg-2); border-bottom: 1px solid var(--rule); border-radius: 0; margin-bottom: var(--space-1); }
.aud-menu-item:hover, .aud-menu-item:focus-visible { background: var(--bg-3); color: var(--accent-2); outline: none; }
.aud-menu-item[aria-checked="true"] { color: var(--accent-2); font-weight: 600; box-shadow: inset -3px 0 0 var(--accent); }
.aud-menu .lbl-ar { font-family: var(--font-ur); font-size: var(--fs-ur-small); line-height: 2; }
.aud-menu .lbl-en { font-size: var(--fs-small); }
/* One-line prompt above the bar (tafsir.js showPrompt): "play from here" for a shared moment, "go to that place" after
   a resume, "next lecture" when the audio ends. Centred over the bar, never wider than the screen less 16 px. Its text
   is announced by .aud-live (a polite status region, visually hidden). */
.aud-prompt[hidden], .aud-prompt-title[hidden] { display: none; }
.aud-live {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.aud-prompt {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 55;
  display: flex; align-items: stretch; max-width: calc(100vw - 16px); width: max-content;
  background: var(--bg-2); border: 1px solid var(--accent); border-radius: var(--radius-m);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
}
.aud-prompt-go, .aud-prompt-x {
  border: 0; background: none; color: var(--accent-2); font: inherit; cursor: pointer; min-height: 44px;
}
.aud-prompt-go {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 var(--space-2);
  padding: var(--space-1) var(--space-3); text-align: center;
}
.aud-prompt-go .lbl-ar { font-family: var(--font-ur); font-size: var(--fs-ur-small); line-height: 2; }
.aud-prompt-go .lbl-en { font-size: var(--fs-small); font-weight: 600; }
.aud-prompt-go .lbl-sep { color: var(--rule); }
.aud-prompt-title { flex: 1 0 100%; font-family: var(--font-ar); font-weight: 400; font-size: var(--fs-body); line-height: 1.6; }
.aud-prompt-x { min-width: 44px; font-size: 20px; line-height: 1; color: var(--fg-2); border-inline-start: 1px solid var(--rule); }
.aud-prompt-go:hover, .aud-prompt-x:hover { background: var(--bg-3); }
.aud-prompt-go:focus-visible, .aud-prompt-x:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Phones: two rows, the scrubber (+ time, and "start over" after a resume) on top, then the controls at full touch
   size (play 48 px, the rest 44 px). The date and the Arabic title are left out; Download stays as an icon. */
@media (max-width: 540px) {
  body.per-mp3 { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .session-audio-wrap {
    flex-wrap: wrap; justify-content: space-between; row-gap: 2px; column-gap: var(--space-1);
    height: auto; padding: var(--space-1) var(--space-2) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  }
  .session-audio-wrap::after { content: ""; order: 3; flex: 0 0 100%; height: 0; }  /* the row break */
  .aud-date { display: none; }
  .aud-restart { order: 0; }
  .aud-scrub { order: 1; flex: 1 1 0; min-width: 0; height: 36px; margin: 0; }
  .aud-time { order: 2; }
  .aud-back15, .aud-play, .aud-fwd15, .aud-speed, .aud-pop, .aud-download { order: 4; }
  .aud-skip, .aud-opt, .aud-restart, .aud-download { flex: none; height: 44px; min-width: 44px; border-radius: 22px; }
  .aud-skip { padding: 0 var(--space-1); }
  .aud-play { flex: none; width: 48px; height: 48px; border-radius: 24px; }
  .aud-restart { padding: 0; width: 44px; }
  .aud-restart-label, html[data-lead] .aud-restart-label { display: none; }
  .aud-download { width: 44px; padding: 0; justify-content: center; }
  .aud-download-icon { width: 18px; height: 18px; flex-basis: 18px; }
  .aud-icon { width: 18px; height: 18px; }
  /* the sleep / share menu: a sheet just above the bar, the screen's width less 8 px a side, its rows wrapping (the
     bar is the containing block: .aud-pop drops its position). Anchored at its button it ran off the left edge of a
     phone and cut the English in half (UX review 2, issue 5). */
  .aud-pop { position: static; }
  .aud-menu { left: 8px; right: 8px; bottom: calc(100% + 6px); min-width: 0; white-space: normal; }
  .aud-menu-item, .aud-menu-head { flex-wrap: wrap; row-gap: 0; padding-block: 4px; }
}

@media screen and (max-width: 1100px) {
  .aligned .chunk-boundary-row .trans-cell { display: none; }  /* stacked: the banner alone */
}
@media (max-width: 720px) {
  .filter-bar { position: static; }
  .session { margin: var(--space-3) var(--space-2); padding: var(--space-4); }
}

@media print {
  .cost-panel, .toc-cta { display: none !important; }
  .session { break-inside: avoid; }
}

/* ─── Lecture pages: click-a-paragraph audio jump (tafsir.js) ───────────────────────────────── */
/* Every block and English paragraph leaves room at its inline-start edge (right for Urdu, left for English) for the
   play button, so jumpable and plain paragraphs stay aligned. "Seekable" = a time: `data-t` (verified) or `data-c`
   (an unverified time, data-s; its ▶ starts 1.5 s early). Every seekable paragraph, Urdu or English, has a ▶ and the
   same behaviour; a paragraph with no time has neither a ▶ nor a hover look. */
.lecture .session-body .block,
.lecture .aligned .orig-cell.stack .block,
.lecture .aligned .trans-cell > p,
.lecture .aligned .trans-cell:is([data-t], [data-c]) { position: relative; padding-inline-start: 30px; }
.lecture .aligned .trans-cell:is([data-t], [data-c]) > p { padding-inline-start: 0; }
.lecture .session-body :is([data-t], [data-c]) { cursor: pointer; }
.lecture .session-body .jump {
  position: absolute; inset-inline-start: 4px; top: 0.45em;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border-radius: 11px;
  background: var(--bg-2); color: var(--accent-2); border: 1px solid var(--accent);
  cursor: pointer; opacity: 0; transition: opacity 0.12s, background 0.12s;
}
.lecture .session-body .jump svg { width: 12px; height: 12px; }
/* Desktop: the ▶ shows on hover or focus of any seekable paragraph, and on the one being heard (Urdu + its English). */
.lecture .session-body :is([data-t], [data-c]):hover > .jump,
.lecture .session-body :is([data-t], [data-c]):focus-within > .jump,
.lecture .session-body .now-playing > .jump,
.lecture .session-body .pair-playing > .jump { opacity: 1; }
.lecture .session-body .jump:hover { background: var(--accent); color: var(--on-accent); }
.lecture .session-body .jump:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
/* A 44 px hit area around the 22 px button (the circle itself stays small, so the text does not move). */
.lecture .session-body .jump::before { content: ""; position: absolute; inset: -11px; border-radius: 50%; }
.lecture .trans-cell :is([data-t], [data-c]):hover, .lecture .trans-cell:is([data-t], [data-c]):hover { color: var(--accent-2); }
/* Touch screens: the ▶ is the only way to seek (tafsir.js ignores taps on the text), so it is always shown, larger. */
@media (hover: none) { .lecture .session-body .jump { opacity: 0.85; } }
@media (hover: none) and (pointer: coarse) {
  .lecture .session-body .jump { width: 26px; height: 26px; border-radius: 13px; top: 0.35em; inset-inline-start: 2px; }
  .lecture .session-body .jump::before { inset: -9px; }
  .lecture .session-body :is([data-t], [data-c]) { cursor: auto; }
  .lecture .trans-cell :is([data-t], [data-c]):hover, .lecture .trans-cell:is([data-t], [data-c]):hover { color: inherit; }
}
/* Sidebar rows (tafsir pages only): a 44 px touch target on touch screens. */
@media (pointer: coarse) { .sb-item { min-height: 44px; align-items: center; } }
/* The paragraph being heard: a thin accent bar at its inline-start edge and a faint tint; its English (the pair)
   gets the same bar on its own inline-start edge, so the two read as one. */
.lecture .session-body .block.now-playing { background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: var(--radius-s); }
.lecture .session-body .block.now-playing::before,
.lecture .aligned .pair-playing::before {
  content: ""; position: absolute; inset-block: 3px; inset-inline-start: 0; width: 3px;
  border-radius: 2px; background: var(--accent);
}
.lecture .aligned .trans-seg.pair-playing::before { inset-block-end: calc(var(--space-3) + 3px); }  /* not its padding */
/* A shared (#t=) or resumed place: the paragraph and its English glow gold for a few seconds (tafsir.js flash). */
@keyframes cue-flash { 0%, 55% { background-color: color-mix(in srgb, var(--library-gold, var(--accent)) 26%, transparent); } 100% { background-color: transparent; } }
.lecture .session-body .cue-flash { animation: cue-flash 4.2s ease-out; border-radius: var(--radius-s); }
@media (prefers-reduced-motion: reduce) {
  .lecture .session-body .cue-flash { animation: none; outline: 2px solid var(--accent); outline-offset: 2px; }
}
/* Desktop two columns: tafsir.js sets each English paragraph of a row level with the Urdu block it translates
   (--lift = extra space above it; never past the row's Urdu, so the row keeps its height). Stacked: no lift. */
@media screen and (min-width: 1101px) {
  .lecture .aligned .trans-cell.multi > .trans-seg { margin-top: calc(var(--space-1) + var(--lift, 0px)); }
}
@media print { .jump { display: none !important; } }

/* ─── Edited / as-spoken toggle and the Print menu (lecture pages; dars.site.tafsir.printview, dars.edit) ─── */
.urdu-toggle-bar { gap: var(--space-2); flex-wrap: wrap; }
.view-toggle { display: inline-flex; gap: 4px; }
/* Phones: the reading-view buttons (Urdu only, English only, Print, Edited / As spoken) put Urdu over English so they
   share one row instead of one line each */
@media (max-width: 540px) {
  .urdu-toggle-bar .toggle-btn { flex-direction: column; gap: 0; padding: 2px var(--space-3); border-radius: var(--radius-m); }
  .urdu-toggle-bar .toggle-btn .lbl-sep { display: none; }
  .urdu-toggle-bar .toggle-btn .lbl-ar { line-height: 1.7; }
  .urdu-toggle-bar .toggle-btn .lbl-en { letter-spacing: 0.02em; }
}
.view-btn .lbl-ar, .print-menu .lbl-ar { font-family: var(--font-ur); font-size: 15px; line-height: 1; direction: rtl; }
.view-btn .lbl-en, .print-menu .lbl-en { font-size: var(--fs-s); text-transform: uppercase; letter-spacing: 0.06em; }
.view-btn .lbl-sep, .print-menu .lbl-sep { color: var(--rule); }
.print-menu { position: relative; }
.print-menu > summary { list-style: none; }
.print-menu > summary::-webkit-details-marker { display: none; }
.print-menu-list {
  position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 5; min-width: 15rem; white-space: nowrap;
  display: flex; flex-direction: column; padding: 4px; background: var(--bg); border: 1px solid var(--rule);
  border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.print-menu-list a, .print-menu-list button {
  display: block; padding: 8px 10px; border: 0; background: none; color: var(--fg); text-align: start;
  font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; border-radius: 6px;
}
.print-menu-list a:hover, .print-menu-list button:hover { background: var(--bg-2); color: var(--accent); }
.print-menu-list [lang="ur"] { font-family: var(--font-ur); }
.session-body[hidden] { display: none !important; }
.block-edited { box-shadow: inset -3px 0 0 var(--accent); }

/* Reviewed off-lecture asides (dars.asides): collapsed to a small ⋯ chip that opens in place, greyed as before. */
.aside-chip {
  font: inherit; font-size: 0.8em; line-height: 1.4; padding: 0 0.5em; margin: 0 0.15em; vertical-align: middle;
  border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--fg-2); cursor: pointer;
}
.aside-chip:hover, .aside-c.open > .aside-chip { background: var(--bg-3); }
.aside-c > .aside-text { color: var(--fg-2); font-size: 0.92em; }
.aside-row > .aside-chip { display: inline-flex; gap: 0.5em; align-items: center; padding: 0.1em 0.8em; }
.aside-row .lbl-ar { font-family: var(--font-ur); font-size: var(--fs-ur-small); line-height: 1.8; }
.aside-row.open > .aside-text { display: block; margin-top: var(--space-1); }
/* the skipped ranges on the scrubber: faint ticks under the track (true timeline) */
.aud-asides { position: absolute; height: 3px; visibility: hidden; pointer-events: none; }
.aud-asides.placed { visibility: visible; }
.aud-aside-tick { position: absolute; top: 0; height: 3px; min-width: 2px; border-radius: 2px; background: var(--fg-2); opacity: 0.35; }
@media print { .aside-c, .block.aside-collapsed { display: none !important; } }

/* ─── Lead language: English lead (html[data-lead="en"]; the rule: base.css §10) ───
   The toolbar (view buttons, text view, print), the player's menus and prompt, and the tafsir index's surah picker
   are bars: their labels re-weight (English stronger, Urdu lighter), never reorder. The library links (.qc-bi) and the
   card button (.toc-cta.qc-bi) are pairs: English first. The aligned rows: base.css §10. */
html[data-lead="en"] :is(.urdu-toggle-btn, .view-btn, .print-menu, .aud-menu, .aud-prompt-go) .lbl-en { font-weight: 600; color: inherit; }
html[data-lead="en"] :is(.urdu-toggle-btn, .view-btn, .print-menu, .aud-menu, .aud-prompt-go) .lbl-ar { opacity: 0.8; }
html[data-lead="en"] :is(.surah-picker-label, .podcast-link, .surah-index > summary, .print-menu-list > *) > [lang="en"] { font-weight: 600; }
html[data-lead="en"] :is(.surah-picker-label, .podcast-link, .surah-index > summary, .print-menu-list > *) > [lang="ur"] { opacity: 0.85; }
html[data-lead="en"] .library-link .en { font-weight: 600; }
/* the "start over" pill: Urdu or English (qamar-common 1.9.0 .qc-bi), the English in the Latin face */
.aud-restart-label [lang="en"] { font-family: var(--font-en); font-size: 11px; }
/* qc/domes.css */
/* domes.css: colours and box for the engraved dome band (REVIEW PROTOTYPE).
   Every colour is a custom property, so a scheme is only a set of six values. */
.domes-band {
  --domes-h: 72px;
  display: block; position: relative; overflow: hidden;
  height: var(--domes-h); width: 100%;
  pointer-events: none; user-select: none;
  background-color: var(--domes-bg);
  background-image:
    radial-gradient(120% 140% at 50% 115%, var(--domes-bg-hi) 0%, transparent 62%),
    linear-gradient(180deg, var(--domes-bg-lo) 0%, transparent 28%, transparent 78%, var(--domes-bg-lo) 100%);
  border-bottom: 1px solid var(--domes-edge);
  contain: layout paint;
}
.domes-band.domes-tall { --domes-h: 68px; }
.domes-band .domes-svg, .domes-figure .domes-svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.domes-figure { display: block; position: relative; background-color: var(--domes-bg);
  background-image: radial-gradient(90% 80% at 50% 100%, var(--domes-bg-hi) 0%, transparent 70%); }

/* gradient stops: the gold catches light at the top and deepens toward the ground */
.dm-g0 { stop-color: var(--domes-ink-hi); }
.dm-g1 { stop-color: var(--domes-ink); }
.dm-g2 { stop-color: var(--domes-ink-lo); }
.dm-tip0 { stop-color: var(--domes-ink-hi); stop-opacity: 0.9; }
.dm-tip1 { stop-color: var(--domes-ink); stop-opacity: 0; }

/* ---- schemes ---- */
[data-domes-scheme="emerald"] { /* deep emerald + antique gold */
  --domes-bg: #0b3d2e; --domes-bg-hi: #135a44; --domes-bg-lo: #072a20; --domes-edge: #062419;
  --domes-ink: #c9a54a; --domes-ink-hi: #f3dc9a; --domes-ink-lo: #96762c;
}
[data-domes-scheme="accent"] { /* the site's own accent green + pale gold */
  --domes-bg: #0d6647; --domes-bg-hi: #17805c; --domes-bg-lo: #0a4f37; --domes-edge: #0a4732;
  --domes-ink: #e6c869; --domes-ink-hi: #fff2bf; --domes-ink-lo: #b8953a;
}
[data-domes-scheme="brass"] { /* near-black green + brass */
  --domes-bg: #0f1a15; --domes-bg-hi: #1b2f25; --domes-bg-lo: #09110d; --domes-edge: #070d0a;
  --domes-ink: #b8913a; --domes-ink-hi: #e9c977; --domes-ink-lo: #876824;
}
[data-domes-scheme="library"] { /* accent-2 (#0a4732) + the site's library gold family */
  --domes-bg: #0a4732; --domes-bg-hi: #10603f; --domes-bg-lo: #073624; --domes-edge: #06301f;
  --domes-ink: #c9a23c; --domes-ink-hi: #ffe27a; --domes-ink-lo: #8c7230;
}

/* ---- the same schemes when the page is in dark mode: a shade deeper, gold a touch softer ----
   (production: hook these to the site's own dark switch; the review page uses .domes-dark on a wrapper) */
.domes-dark [data-domes-scheme="emerald"] { --domes-bg: #082a20; --domes-bg-hi: #0f4434; --domes-bg-lo: #051c15; --domes-edge: #1f2a25; --domes-ink: #c4a24c; --domes-ink-hi: #ead39a; }
.domes-dark [data-domes-scheme="accent"]  { --domes-bg: #0b5038; --domes-bg-hi: #13684b; --domes-bg-lo: #083c2a; --domes-edge: #1f2a25; --domes-ink: #dcc06a; --domes-ink-hi: #f6e7b2; }
.domes-dark [data-domes-scheme="brass"]   { --domes-bg: #0c1511; --domes-bg-hi: #16261e; --domes-edge: #222b26; }
.domes-dark [data-domes-scheme="library"] { --domes-bg: #083a29; --domes-bg-hi: #0e5238; --domes-bg-lo: #052a1d; --domes-edge: #1f2a25; --domes-ink: #ecc866; --domes-ink-hi: #ffd24d; }
@media (prefers-color-scheme: dark) {
  .domes-auto-dark [data-domes-scheme="emerald"] { --domes-bg: #082a20; --domes-bg-hi: #0f4434; --domes-bg-lo: #051c15; --domes-edge: #1f2a25; }
}

@media print { .domes-band { display: none !important; } }

/* round 3: engraved shading. Lit faces (upper left) take the pale gold, shaded sides the deep gold, fading out */
.dm-s0 { stop-color: var(--domes-ink-hi); stop-opacity: 0.5; }
.dm-s1 { stop-color: var(--domes-ink); stop-opacity: 0.26; }
.dm-s2 { stop-color: var(--domes-ink-lo); stop-opacity: 0.06; }
.dm-d0 { stop-color: var(--domes-ink-hi); stop-opacity: 0.6; }
.dm-d1 { stop-color: var(--domes-ink); stop-opacity: 0.3; }
.dm-d2 { stop-color: var(--domes-ink-lo); stop-opacity: 0.07; }
/* round 4: white marble (the Green Dome's base), pale and even, so it reads as another material */
.dm-w0 { stop-color: var(--domes-ink-hi); stop-opacity: 0.46; }
.dm-w1 { stop-color: var(--domes-ink-hi); stop-opacity: 0.3; }
/* qc/common.css */
/* qamar-common common.css — the shared primary header and content footer of muftiqamar.com and
   maktaba.muftiqamar.com. Owned by the dars repo; vendored (pinned + hash-checked) by both sites. See README.md.

   No palette and no @font-face of its own: every colour, radius, space and font is read from the tokens both sites
   define (--bg-2 --bg-3 --fg --fg-2 --accent --accent-2 --on-accent --border --radius-s --radius-pill --space-1..5
   --font-ur --font-en), through --qc-* aliases a site may override. Dark mode comes from the site's own tokens
   (header.js forces light/dark by rewriting the prefers-color-scheme media rules). Every selector is .qc-*. */

.qc-header, .qc-footer {
  --qc-bar: var(--bg-3, #f3f4ef);
  --qc-surface: var(--bg-2, #fff);
  --qc-fg: var(--fg, #1b211e);
  --qc-fg-2: var(--fg-2, #565c57);
  --qc-accent: var(--accent, #0d6647);
  --qc-accent-2: var(--accent-2, #0a4732);
  --qc-on-accent: var(--on-accent, #fff);
  --qc-border: var(--border, #e2e4dc);
  --qc-r-s: var(--radius-s, 6px);
  --qc-r-pill: var(--radius-pill, 999px);
  --qc-s1: var(--space-1, 4px); --qc-s2: var(--space-2, 8px); --qc-s3: var(--space-3, 12px);
  --qc-s4: var(--space-4, 16px); --qc-s5: var(--space-5, 24px);
  --qc-font-ur: var(--font-ur, 'Noto Nastaliq Urdu', serif);
  --qc-font-en: var(--font-en, Georgia, serif);
  --qc-fs-ur: var(--fs-chrome-ur, 17px);  /* 1.4.3: Urdu nav labels and footer text; 1.6.1: a fixed chrome token */
  --qc-fs-en: var(--fs-chrome-en, 14px);  /* 1.6.1: English nav labels and footer text (fixed) */
  --qc-fs-en-s: var(--fs-chrome-en-s, 12px);  /* 1.6.1: English nav labels on phones (fixed) */
  --qc-tap: var(--ctl-h, 44px);          /* 1.4.3: minimum touch target */
  /* Library gold (tokens.css; the only non-green accent, Library item only) */
  --qc-gold: var(--library-gold, #7a5200);
  --qc-gold-bg: var(--library-gold-bg, #f8edc8);
  --qc-gold-ring: var(--library-gold-ring, #c9a23c);
  --qc-gold-glow: var(--library-gold-glow, rgba(201, 162, 60, 0.4));
  --qc-gold-sel: var(--library-gold-sel, #ffe27a);
  --qc-gold-on-sel: var(--library-gold-on-sel, #5c3d00);
  --qc-gold-sel-ring: var(--library-gold-sel-ring, #f0b400);
  --qc-gold-sel-glow: var(--library-gold-sel-glow, rgba(255, 196, 0, 0.65));
  box-sizing: border-box;
}
.qc-header *, .qc-footer * { box-sizing: border-box; }

/* ─── Header: one row, RTL (Home rightmost), the scheme toggle at the left end. Sticky + smart since 1.6.2 (header.js). ─── */
.qc-header {
  position: relative; z-index: 40;
  display: flex; align-items: center; gap: var(--qc-s2);
  padding-inline-end: var(--qc-s3);
  background: var(--qc-bar); border-bottom: 1px solid var(--qc-border);
  font-family: var(--qc-font-en); font-size: var(--qc-fs-en); line-height: 1.6;  /* 1.6.1: fixed, never the page's scaled size */
}
/* Smart header (1.6.2; header.js adds .qc-smart, toggles .qc-hidden): sticky, slides away on scroll down and back on
   scroll up with transform only (no layout shift: the sticky box keeps its place, the page never jumps). Reduced motion:
   no slide, instant. Print: static. A site's own bars stick below it at top: var(--header-offset, 0px). */
.qc-header.qc-smart { position: sticky; top: 0; transition: transform 200ms ease; }
.qc-header.qc-smart.qc-hidden { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { .qc-header.qc-smart { transition: none; } }
@media print { .qc-header.qc-smart { position: static; transform: none; } }
.qc-nav {
  flex: 1 1 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 2px var(--qc-s2);
  padding: var(--qc-s1) var(--qc-s4);
}
.qc-nav-item {
  display: inline-flex; align-items: baseline; gap: var(--qc-s2);
  padding: 2px var(--qc-s3); border-radius: var(--qc-r-pill);
  color: var(--qc-accent-2); text-decoration: none;
  font-family: var(--qc-font-en); font-size: var(--qc-fs-en); font-weight: 600; line-height: 2;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.04);              /* old browsers without color-mix() */
  background: var(--qc-nav-item-bg);            /* 1.8.5: a shade of the bar, so each button has a boundary */
}
.qc-nav-item .qc-ur { font-family: var(--qc-font-ur); font-weight: 400; font-size: var(--qc-fs-ur); line-height: 2; }
.qc-nav-item .qc-en { font-family: var(--qc-font-en); }
.qc-nav-item:hover { border-color: var(--qc-accent); }
.qc-nav-item[aria-current="page"] { background: var(--qc-accent); color: var(--qc-on-accent); }
.qc-nav-item:focus-visible { outline: 2px solid var(--qc-accent); outline-offset: 2px; }
.qc-search { gap: 6px; }
.qc-icon { width: 14px; height: 14px; align-self: center; flex: 0 0 auto; }
/* Library (مکتبہ, the last item) and Naat (نعت, 1.8.0, just before it): the two sections that include texts by others
   besides the Mufti's own; GOLD, the single exception to the green palette (README "Library gold"). Same rest, hover,
   focus and the same brighter glow when pressed or current. */
.qc-library, .qc-naat {
  color: var(--qc-gold); background: var(--qc-gold-bg);
  box-shadow: inset 0 0 0 1px var(--qc-gold-ring), 0 0 10px var(--qc-gold-glow);
}
.qc-library:hover, .qc-naat:hover { border-color: var(--qc-gold); box-shadow: inset 0 0 0 1px var(--qc-gold-ring), 0 0 14px var(--qc-gold-glow); }
.qc-library:focus-visible, .qc-naat:focus-visible { outline: 2px solid var(--qc-gold); outline-offset: 2px; }
.qc-library:active, .qc-library[aria-current="page"], .qc-naat:active, .qc-naat[aria-current="page"] {
  background: var(--qc-gold-sel); color: var(--qc-gold-on-sel); border-color: var(--qc-gold-sel-ring);
  box-shadow: inset 0 0 0 1px var(--qc-gold-sel-ring), 0 0 6px var(--qc-gold-sel-glow), 0 0 20px var(--qc-gold-sel-glow);
}
.qc-library[aria-current="page"]:focus-visible, .qc-naat[aria-current="page"]:focus-visible { outline-color: var(--qc-gold); }

/* ─── Lead language (1.8.0; 1.8.4): English lead only re-weights the nav labels; the nav NEVER flips ───
   User decision 2026-12-04 (1.8.4): the lead never changes the ORDER or the DIRECTION of the nav (or of a site's
   sub-nav). The nav is always laid out RTL (Urdu style: Home at the right end), in the same order in both leads, and
   inside each item Urdu stays right of English. In English lead only the emphasis changes: English a little larger
   and bolder, Urdu smaller and lighter. Nothing is hidden; the header and the tools never move. */
html[data-lead="en"] .qc-nav-item .qc-en { font-size: calc(var(--qc-fs-en) + 1px); font-weight: 700; }
html[data-lead="en"] .qc-nav-item .qc-ur { font-size: var(--qc-fs-en); opacity: 0.8; line-height: 1.8; }
/* 1.9.0 (user): one language in the header and footer: the nav labels, the footer notes and links show only the lead
   language (order and direction of the nav still never change). A link that has only one language keeps it. */
html[data-lead="ur"] .qc-nav-item .qc-en, html[data-lead="en"] .qc-nav-item .qc-ur,
html[data-lead="ur"] .qc-footer-note[lang="en"], html[data-lead="en"] .qc-footer-note[lang="ur"],
html[data-lead="ur"] .qc-footer-links a > [lang="en"]:not(:only-child),
html[data-lead="en"] .qc-footer-links a > [lang="ur"]:not(:only-child) { display: none; }

/* ─── Tools at the top-left (1.6.0; 1.8.0: the cluster) ───
   [language | colour | text size], left to right, in that fixed order in both leads (dir="ltr" on .qc-tools; the
   header stays RTL, so the cluster is always its left end). A light vertical rule separates it from the nav. */
.qc-tools { flex: 0 0 auto; display: flex; align-items: center; gap: var(--qc-s2); direction: ltr;
  padding-right: var(--qc-s3); border-right: 1px solid var(--qc-border); }  /* physical: the cluster is always at the left */
.qc-scheme-toggle, .qc-ts-open, .qc-ts-btn {
  flex: 0 0 auto; min-width: 32px; height: 32px; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--qc-s1);
  font: 600 16px/1 var(--qc-font-en); cursor: pointer;
  color: var(--qc-accent-2); background: var(--qc-surface);
  border: 1px solid var(--qc-border); border-radius: var(--qc-r-pill);
}
.qc-scheme-toggle:hover, .qc-ts-open:hover, .qc-ts-btn:hover { border-color: var(--qc-accent); color: var(--qc-accent); }
.qc-scheme-toggle:focus-visible, .qc-ts-open:focus-visible, .qc-ts-btn:focus-visible { outline: 2px solid var(--qc-accent); outline-offset: 2px; }
/* the colour button: icon + a visible «رنگ» on wide screens (1.6.0); title / aria-label are Urdu first */
.qc-scheme-icon { display: inline-block; width: 1em; text-align: center; }
.qc-scheme-label { display: none; font-family: var(--qc-font-ur); font-weight: 400; font-size: var(--qc-fs-ur); line-height: 1; padding-bottom: 0.15em; }
@media (min-width: 1000px) {
  .qc-scheme-toggle { width: 76px; padding-inline: 8px; }
  .qc-scheme-label { display: inline; }
}
/* 1.11.0: the colour menu (user: pick, not cycle). The button opens a small panel below it, the same look as the «A±»
   text-size panel: ☀ Light, ☾ Dark, ◐ Auto (follow the device), one per row, the mode in force filled. One language
   with data-lead (as the nav), both without it. Physical left: the tools sit at the left end in both leads. */
.qc-scheme { position: relative; display: inline-flex; flex: 0 0 auto; }
.qc-scheme-menu { display: none; position: absolute; z-index: 60; top: calc(100% + 4px); left: 0;
  flex-direction: column; gap: 2px; min-width: 9.5em; padding: var(--qc-s1); direction: ltr;
  background: var(--qc-surface); border: 1px solid var(--qc-border); border-radius: var(--qc-r-s);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.qc-scheme.qc-open .qc-scheme-menu { display: flex; }
.qc-scheme-toggle[aria-expanded="true"] { background: var(--qc-accent); color: var(--qc-on-accent); border-color: var(--qc-accent); }
.qc-scheme-opt { display: flex; align-items: center; gap: var(--qc-s2); width: 100%; min-height: 36px; margin: 0;
  padding: 2px var(--qc-s2); border: 1px solid transparent; border-radius: var(--qc-r-s); background: transparent;
  color: var(--qc-accent-2); cursor: pointer; font: 600 var(--qc-fs-en)/1.2 var(--qc-font-en); text-align: left;
  white-space: nowrap; }
.qc-scheme-opt .qc-ur { font: 400 var(--qc-fs-ur)/1.8 var(--qc-font-ur); }
.qc-scheme-opt .qc-sep { opacity: 0.6; }
.qc-scheme-opt-icon { display: inline-block; width: 1.2em; text-align: center; font-size: 16px; }
.qc-scheme-opt:hover { border-color: var(--qc-accent); color: var(--qc-accent); }
.qc-scheme-opt:focus-visible { outline: 2px solid var(--qc-accent); outline-offset: 1px; }
.qc-scheme-opt[aria-pressed="true"] { background: var(--qc-accent); color: var(--qc-on-accent); border-color: var(--qc-accent); }
html[data-lead="ur"] .qc-scheme-opt .qc-en, html[data-lead="en"] .qc-scheme-opt .qc-ur,
html[data-lead] .qc-scheme-opt .qc-sep { display: none; }
html[data-lead="ur"] .qc-scheme-opt { direction: rtl; text-align: right; }
@media print { .qc-scheme-menu { display: none !important; } }
/* under 380 px the tools are one column, so a menu below the colour button would cover the «A±» button: open it to the
   button's right instead (over the nav; a tap outside closes it) */
@media (max-width: 379px) { .qc-header .qc-scheme-menu { top: 0; left: calc(100% + 4px); } }
/* 1.11.0: «A±»: the A in the button's serif and weight, a smaller ± at its upper right (text size, bigger or smaller) */
.qc-ts-glyph { display: inline-flex; align-items: flex-start; line-height: 1; }
.qc-ts-pm { font-size: 0.68em; margin-left: 0.04em; margin-top: -0.18em; }
/* Text size A− · A · A+ (1.6.0). Shown only once <html data-qc-text> is set (head-early.html, before first paint, or
   header.js), so without scripts the control is absent and nothing shifts when it appears. Wide screens: the three
   steps inline. <= 720 px: one «A±» button (1.11.0; was «Aa») opens them as a small panel below the header. */
.qc-textsize { display: none; position: relative; align-items: center; }
html[data-qc-text] .qc-textsize { display: flex; }
.qc-ts-open { display: none; font-size: 15px; }
.qc-ts-steps { display: flex; align-items: center; gap: 2px; direction: ltr; }
.qc-ts-btn { width: 36px; font-size: 14px; letter-spacing: 0.02em; }  /* fixed widths: a late font never moves the nav */
.qc-ts-btn[data-qc-text-step="+1"] { font-size: 17px; }
.qc-ts-btn[data-qc-text-step="-1"] { font-size: 13px; }
.qc-ts-btn[aria-disabled="true"] { opacity: 0.45; cursor: default; border-color: var(--qc-border); color: var(--qc-accent-2); }
/* The lead-language switch «اردو | English» (1.8.0): a two-part segmented control, the first of the tools. Shown only
   once <html data-lead> is set (head-early.html or header.js), as the text size waits for data-qc-text. Below 1600 px
   (where the nav needs the room: dars's eight items stay one row from 1240 px) it is ONE capsule naming the other
   language in full, «English» or «اردو» (1.8.1, user: no «EN» abbreviation; the pressed half is hidden; aria-pressed
   stays on both). */
.qc-lang { display: none; flex: 0 0 auto; direction: ltr; height: 32px; padding: 2px; gap: 2px; align-items: stretch;
  background: var(--qc-surface); border: 1px solid var(--qc-border); border-radius: var(--qc-r-pill); }
html[data-lead] .qc-lang { display: inline-flex; }
.qc-lang-btn { display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 0 10px; min-width: 0;
  border: 0; border-radius: var(--qc-r-pill); background: transparent; color: var(--qc-accent-2); cursor: pointer;
  font: 600 var(--qc-fs-en)/1 var(--qc-font-en); white-space: nowrap; }
.qc-lang-btn[lang="ur"] { font: 400 var(--qc-fs-ur)/1 var(--qc-font-ur); padding-bottom: 0.2em; }
.qc-lang-btn:hover { color: var(--qc-accent); }
.qc-lang-btn:focus-visible { outline: 2px solid var(--qc-accent); outline-offset: 1px; }
/* the lead in force, from <html data-lead> (right before header.js runs) */
html:not([data-lead="en"]) .qc-lang-btn[data-qc-lead="ur"], html[data-lead="en"] .qc-lang-btn[data-qc-lead="en"] {
  background: var(--qc-accent); color: var(--qc-on-accent); cursor: default; }
@media (max-width: 1599px) {
  .qc-header .qc-lang { width: auto; padding: 0; justify-content: center; }
  html:not([data-lead="en"]) .qc-header .qc-lang-btn[data-qc-lead="ur"],
  html[data-lead="en"] .qc-header .qc-lang-btn[data-qc-lead="en"] { display: none; }
  .qc-header .qc-lang-btn { flex: 1; padding: 0 8px; min-width: 0; }
  .qc-header .qc-lang-btn[lang="en"] { font-size: 13px; }
  .qc-header .qc-lang-btn[lang="ur"] { font-size: 14px; }
}
/* 1.8.5 (user): the nav centred on the PAGE, not in the space beside the tools. Desktop/tablet: an empty ::before on the
   right and the tools on the left share the free space equally (flex 1 1 0), so the nav sits in the middle whenever
   the row has room; when it has not, the tools keep their width, the spacer gives way first and the nav moves only as
   far as it must (it wraps exactly as before). The divider moves from the tools' edge to just after the last tool. */
@media (min-width: 721px) {
  .qc-header::before { content: ""; flex: 1 1 0; min-width: 0; }
  .qc-header .qc-nav { flex: 0 1 auto; min-width: 0; }
  .qc-header .qc-tools { flex: 1 1 0; justify-content: flex-start; padding-right: 0; border-right: 0; }
  .qc-header .qc-tools::after { content: ""; align-self: stretch; margin-left: calc(var(--qc-s3) - var(--qc-s2));
    border-right: 1px solid var(--qc-border); }
}
/* 721-1599 px: the colour button drops its «رنگ» word (icon and title stay) and the nav items sit a little closer, so
   the nav keeps one row where it had one before the language switch and Naat joined it */
@media (min-width: 721px) and (max-width: 1599px) {
  .qc-header .qc-scheme-label { display: none; }
  .qc-header .qc-scheme-toggle { width: 32px; padding-inline: 0; }
  .qc-nav { padding-inline: var(--qc-s2); gap: 2px var(--qc-s1); }
  .qc-nav-item { padding-inline: var(--qc-s2); }
}
@media print { .qc-lang { display: none !important; } }
.qc-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Guest mode (1.6.0): a site that is a guest of this header (maktaba: render.header(guest=True), the default there)
   drops the items whose meaning belongs to the host site (dars's lecture topics and lecture search), so its own
   bar's Topics / Search are the only ones on the page. */
.qc-header.qc-guest .qc-home-only { display: none; }

@media (max-width: 720px) {
  /* Phones: stacked bilingual labels (Urdu over English). 1.6.0: Urdu 17 px (the floor; was 16), English 12 px,
     items at least 44 px; when the items do not fit one row they wrap into two full rows, 4 + 4 at 360-430 px (RTL
     order, Home first at the right; flex-basis 20% (1.8.0; was 22%, the tools grid is wider; from ~600 px a row may take 5: 5 + 3), and >= 44 px wide; each row's items share
     its width), so Search and Library are always visible. English labels stay at every width (1.6.0; they were
     hidden at <= 360 px): at <= 380 px they shrink to 11 px, at <= 340 px a long one may wrap onto a second line. */
  .qc-header { padding-inline-end: var(--qc-s1); gap: 2px; }
  .qc-nav { min-width: 0; padding: 4px 2px; gap: 2px 0; justify-content: center; flex-wrap: wrap; }
  .qc-nav-item { flex: 1 0 20%; min-width: min-content; min-height: var(--qc-tap); flex-direction: column; align-items: center;
    justify-content: center; gap: 0; padding: 2px 4px; line-height: 1.2; border-radius: var(--qc-r-s); text-align: center; }
  .qc-nav-item .qc-ur { font-size: var(--qc-fs-ur); line-height: 1.8; white-space: nowrap; }
  .qc-nav-item .qc-en { font-size: var(--qc-fs-en-s); font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
  .qc-header.qc-guest .qc-nav-item { flex-basis: 30%; }  /* guest: six items (1.8.0, with Naat), 3 + 3 */
  .qc-search .qc-icon { display: none; }
  /* 1.8.0: the three tools as a 2 x 2 grid, language and colour over text size (still the reading order), so the
     cluster is never taller than the nav's two rows: the shared header stays about 100-115 px tall */
  .qc-tools { display: grid; grid-template-columns: auto auto; gap: 2px; align-content: center; justify-items: center;
    padding-right: var(--qc-s1); }
  .qc-scheme-toggle, .qc-ts-open { width: 36px; height: 36px; font-size: 15px; }
  .qc-header .qc-lang { height: 36px; grid-column: 1 / -1; }  /* 1.8.1: the capsule spans the 2 x 2 grid's top row */
  .qc-header .qc-lang-btn { padding: 0 6px; }
  .qc-header .qc-lang-btn[lang="en"] { font-size: 12px; }
  html[data-lead="en"] .qc-nav-item .qc-en { font-size: var(--qc-fs-en-s); }  /* the same width as in Urdu lead: rows unchanged (weight 700 stays) */
  html[data-lead="en"] .qc-nav-item .qc-ur { font-size: var(--qc-fs-en-s); line-height: 1.7; }
  .qc-ts-btn { width: var(--qc-tap); height: var(--qc-tap); }
}
/* The «A±» panel (1.6.0; «Aa» until 1.11.0): one button opens the steps below the header. 1.8.1: below 1400 px on every device
   (was: phones and touch tablets below 1000 px), so the full-word language capsule costs the nav no row: dars's eight
   items stay one row from 1240 px in both leads. */
@media (max-width: 1399px) {
  .qc-ts-open { display: inline-flex; }
  .qc-textsize { position: static; }
  .qc-ts-steps { display: none; position: absolute; z-index: 60; top: calc(100% + 4px); left: var(--qc-s1);  /* physical: the tools sit at the left end */
    padding: var(--qc-s2); gap: var(--qc-s2); background: var(--qc-surface); border: 1px solid var(--qc-border);
    border-radius: var(--qc-r-s); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
  .qc-textsize.qc-open .qc-ts-steps { display: flex; }
  .qc-ts-open[aria-expanded="true"] { background: var(--qc-accent); color: var(--qc-on-accent); border-color: var(--qc-accent); }
}
@media (max-width: 380px) {
  .qc-nav-item { padding-inline: 2px; }
  .qc-nav-item .qc-en, html[data-lead="en"] .qc-nav-item .qc-en { font-size: 11px; letter-spacing: 0; }
}
@media (max-width: 340px) { .qc-nav-item .qc-en { white-space: normal; line-height: 1.15; } }
@media (max-width: 1599px) and (pointer: coarse) { .qc-header .qc-lang { height: var(--qc-tap); } }
/* Under 380 px (1.8.0): the three tools as one column of 36 px buttons, also on touch screens (the 44 px targets would
   cost the nav a third row): the header stays about 120 px tall at 320-379 px */
@media (max-width: 379px) {
  .qc-header .qc-tools { grid-template-columns: auto; }
  .qc-header .qc-scheme-toggle, .qc-header .qc-ts-open { width: 36px; min-width: 36px; height: 36px; }
  /* 1.8.1: the full-word capsule as narrow as it reads well, so the nav keeps its rows */
  .qc-header .qc-lang { height: 36px; }
  .qc-header .qc-lang-btn { padding: 0 3px; }
  .qc-header .qc-lang-btn[lang="en"] { font-size: 11px; letter-spacing: -0.01em; }
}
@media (max-width: 339px) {  /* 1.8.1: with the capsule, labels that would wrap make the rows taller: shrink, never wrap */
  .qc-nav-item .qc-en, html[data-lead="en"] .qc-nav-item .qc-en { white-space: nowrap; font-size: 10px; }
  .qc-nav-item { padding-inline: 1px; }
}
}
@media (pointer: coarse) {
  /* 1.4.3: touch targets */
  .qc-nav-item { min-height: var(--qc-tap); align-items: center; }
  .qc-scheme-toggle, .qc-ts-open, .qc-ts-btn { min-width: var(--qc-tap); height: var(--qc-tap); }
  .qc-ts-btn { width: var(--qc-tap); }
  .qc-ts-steps { gap: var(--qc-s1); }
  .qc-lang { height: var(--qc-tap); }
  .qc-lang-btn { min-width: 40px; }
  .qc-footer-links a { display: inline-flex; align-items: center; min-height: var(--qc-tap); padding-inline: var(--qc-s1); }
}

/* ─── Footer (1.7.0: compact, identical on both sites): one Urdu + one English line (provenance + feedback address),
   then Home · Reference library · ChatGPT / Claude · Privacy, then the site's optional footer_extra (.site-updated) ─── */
.qc-footer {
  margin-top: auto;
  color: var(--qc-fg-2); background: var(--qc-bar);
  border-top: 1px solid var(--qc-border);
  padding: var(--qc-s4) 16px var(--qc-s3);
  font-family: var(--qc-font-en); font-size: var(--qc-fs-en); line-height: 1.5;
  text-align: center;
}
.qc-footer-notes { max-width: 820px; margin: 0 auto var(--qc-s2); }
.qc-footer-note { margin: 0; font-size: 13px; }
.qc-footer-note[lang="ur"] { font-family: var(--qc-font-ur); font-size: 15px; line-height: 2; }
.qc-footer a { color: var(--qc-accent-2); }
.qc-mail { font-family: var(--qc-font-en); font-size: 13px; unicode-bidi: isolate; }
.qc-footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  gap: 0 var(--qc-s3);
}
.qc-footer-links a { text-decoration: none; font-size: 13px; }
.qc-footer-links a [lang="ur"] { font-family: var(--qc-font-ur); font-size: var(--qc-fs-ur); }
.qc-footer-links a [lang="en"] { font-family: var(--qc-font-en); }
.qc-footer-links a:hover { text-decoration: underline; }
.qc-sep { opacity: 0.6; }
/* English lead (1.8.0): the English line first, and English first in each link; both stay */
html[data-lead="en"] .qc-footer-notes { display: flex; flex-direction: column; }
html[data-lead="en"] .qc-footer-note[lang="en"] { order: -1; }
html[data-lead="en"] .qc-footer-links { direction: ltr; }
html[data-lead="en"] .qc-footer-links a { display: inline-flex; align-items: baseline; gap: 0.3em; }
html[data-lead="en"] .qc-footer-links a [lang="en"] { order: -1; }
.qc-footer .site-updated { margin: var(--qc-s1) 0 0; font-size: 12px; color: var(--qc-fg-2); text-align: center; }

/* Slim footer (1.6.0, footer-slim.html): utility pages (about, privacy, search form): contact line + the same links. */
.qc-footer-slim .qc-footer-note { max-width: 820px; margin: 0 auto; }
.qc-footer-slim .qc-footer-links { margin-top: var(--qc-s2); }
html[data-lead="en"] .qc-footer-slim { display: flex; flex-direction: column; }  /* 1.8.0: the English line first */
html[data-lead="en"] .qc-footer-slim > .qc-footer-note[lang="en"] { order: -1; }

/* Print (1.6.0): the header and the footer's screen parts are not printed; in their place one black citation line
   (site · page title — address), so a printed sheet says where it came from. A page with its own fuller citation (the
   library reader) hides the whole footer in its print CSS. */
.qc-print-cite { display: none; }
@media print {
  .qc-header { display: none !important; }
  .qc-footer { display: block !important; margin: 12pt 0 0; padding: 4pt 0 0; background: none; border: 0;
    border-top: 1px solid #000; color: #000; }
  .qc-footer > :not(.qc-print-cite) { display: none !important; }
  .qc-print-cite { display: block; margin: 0; font: 10pt/1.9 var(--qc-font-en); color: #000; text-align: right; }
  .qc-print-cite [lang="ur"] { font-family: var(--qc-font-ur); }
  /* 1.6.1: the separators in Source Serif with a clear gap on both sides (a space after Nastaliq is narrow) */
  .qc-print-cite .qc-cite-sep { font-family: var(--qc-font-en); white-space: pre; padding-inline: 0.25em; }
  /* the page title's face follows its language (cite_lang): Nastaliq, Amiri (never bold), Source Serif; a title with
     no lang (an overridden runtime title) uses Source Serif for Latin and falls through to Nastaliq for Urdu */
  .qc-print-cite bdi:first-of-type { font-family: 'Source Serif 4', 'Noto Nastaliq Urdu', var(--qc-font-ur); }
  .qc-print-cite bdi[lang="ur"] { font-family: var(--qc-font-ur); }
  .qc-print-cite bdi[lang="ar"] { font-family: var(--font-ar, 'Amiri', serif); font-weight: 400; }
  .qc-print-cite bdi[lang="en"] { font-family: var(--qc-font-en); }
}

/* Dome band (1.10.0): the animated band directly below the header (or below the site's sub-menu). The drawing and its
   colours are band/domes.css + band/domes.js (a drop-in); these rules are the kit's part: size, placement, opt-out,
   print. The dark colours follow <html class="domes-dark">, set by header.js from the colour scheme. */
.qc-domes { display: block; width: 100%; max-width: none; margin: 0; --domes-h: 72px; height: var(--domes-h);
  pointer-events: none; user-select: none; -webkit-user-select: none; flex: none; }
html.qc-no-domes .qc-domes, body.qc-no-domes .qc-domes { display: none !important; }
@media print { .qc-domes { display: none !important; } }
