/* 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 nav item (.qc-library). */
  --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); } }
/* 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; }

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

/* Callouts: notes, reading order, warnings. */
.callout {
  background: var(--note-bg); border-left: 3px solid var(--yellow);
  padding: var(--space-2) var(--space-3); font-size: 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)); direction: rtl; }
.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); direction: rtl; }
.searchbox input {
  flex: 1 1 auto; min-width: 0; font: var(--fs-lead) var(--font-en); padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--bg-2); color: var(--fg);
}
.searchbox input:dir(rtl) { font-family: var(--font-ur); font-size: var(--fs-ur-small); padding: 4px 14px; }
.searchbox-go { flex: 0 0 auto; }

/* ─── Book card on a shelf (decision 02, 2026-12-01): the cover card with a thin accent spine on its RTL start edge
   (the right), rounded with the card. A book with a cover image shows it as a small thumbnail at the right; a book
   without one simply omits `.shelf-cover` and is a spine card with its title. `--spine` / `--cover-w` tune the two
   (`.shelf.compact` = smaller thumbnails for dense grids). `.nocover` (a title box in place of a cover) is kept for
   1.0 markup but no longer used: leave the cover out instead. ─── */
.shelf { --spine: 3px; --cover-w: 96px; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(calc(420px * var(--text-scale-ur)), 100%), 1fr)); direction: rtl; }
.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; }
/* 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). Only dars's smart-sticky behaviour lives here (header.js): the header
   slides away while reading down, back on scroll up / top edge / focus. */
.qc-header.dars-smart-sticky { position: sticky; top: 0; z-index: 40; transition: transform 150ms ease; }
.qc-header.dars-smart-sticky.is-hidden { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { .qc-header, .sidebar { transition: none !important; } }
@media print { .qc-header.dars-smart-sticky { position: static; transform: none; } }
.site-updated { font-size: var(--fs-caption); color: var(--fg-2); text-align: center; margin: var(--space-2) 0 0; }  /* footer_extra */

/* ─── 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) {
  .mb-title .en, .ms-x { 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 */
  .mode-bar:not(:has(.mode-switch)) .mb-title .en { display: none; }
  .mb-title, .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; }
}
/* pages.css */
/* pages.css — the content pages that are not a transcript or a book viewer: landing, About, Topics, Books index,
   Search and 404. Shared components only, all from tokens.css: page heads, bilingual section headings
   (Urdu right, English left), cards, chips, stat strips, timelines, passage rows, empty states. */

body.page { font-size: var(--fs-body); line-height: var(--lh-en); }
/* .wrap, page heads, crumbs, the diamond rule, section headings, cards and the search box are qamar-common's
   (static/qc/components.css). */

.stats {
  display: flex; justify-content: center; gap: var(--space-5); margin: var(--space-1) 0 0;
  border-top: 1px solid var(--border); padding-top: var(--space-3);
}
.stats div { display: flex; flex-direction: column-reverse; text-align: center; }
.stats dd { margin: 0; font-size: var(--fs-h2); font-weight: 600; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.stats dt { font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-2); }

/* ─── Empty state ─── */
.empty { text-align: center; color: var(--fg-2); padding: var(--space-6) var(--space-4); }
.empty [lang="ur"] { display: block; font-size: var(--fs-ur-small); line-height: 2; }

/* ─── 404 ─── */
.not-found .card { padding: var(--space-4) var(--space-5); }

/* ─── Landing hero (also the 404 head) ─── */
body.landing { font-size: calc(17px * var(--text-scale)); line-height: 1.65; }
.hero { text-align: center; max-width: 720px; margin: 0 auto var(--space-7); }
.basmala { font-family: var(--font-ar-display); font-weight: 400; font-size: calc(26px * var(--text-scale)); color: var(--accent); margin: 0 0 var(--space-5); line-height: 1.8; }
.hero h1 { margin: 0; font-weight: 400; }
.hero h1 .ur { display: block; font-size: calc(34px * var(--text-scale-ur)); font-weight: 600; color: var(--accent-2); line-height: 2.1; }
.hero h1 .en { display: block; font-size: calc(21px * var(--text-scale)); letter-spacing: 0.04em; color: var(--fg-2); margin-top: var(--space-1); }
.intro { margin: 0 auto var(--space-3); max-width: 680px; }
.intro[lang="ur"] { font-size: var(--fs-ur-small); line-height: var(--lh-ur); }
@media (max-width: 520px) {
  body.landing { font-size: calc(16px * var(--text-scale)); }
  .basmala { font-size: calc(22px * var(--text-scale)); }
  .hero h1 .ur { font-size: calc(28px * var(--text-scale-ur)); }
  .hero h1 .en { font-size: calc(18px * var(--text-scale)); }
}

/* Books index shelf card (.shelf, .shelf-book …): qamar-common components.css. */

/* ─── Simple prose pages ─── */
.prose { max-width: var(--measure-en); margin: 0 auto; }
.prose[lang="ur"], .prose [lang="ur"] { font-size: var(--fs-ur-body); line-height: var(--lh-ur); }
.prose p { margin: 0 0 var(--space-4); }

/* ─── Search ─── */
.search-kinds { margin-bottom: var(--space-3); }
.search-kinds .chip { cursor: pointer; font-family: inherit; }
.search-status { color: var(--fg-2); font-size: var(--fs-small); min-height: 1.6em; margin: 0 0 var(--space-3); }
.search-status [lang="ur"] { font-size: var(--fs-ur-small); }
.ayah-card { padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5); border-inline-end: 4px solid var(--accent); }
.ayah-card h2 { margin: 0 0 var(--space-2); font-weight: 400; display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; direction: rtl; }
.ayah-card h2 .ar { font-family: var(--font-ar-display); font-weight: 400; font-size: var(--fs-h2); color: var(--accent-2); }
.ayah-card h2 .en { font-size: var(--fs-body); color: var(--fg-2); }
.ayah-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ayah-card li a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--space-3); padding: 4px var(--space-2); border-radius: var(--radius-s); text-decoration: none; color: var(--fg); direction: rtl; }
.ayah-card li a:hover { background: var(--bg-3); }
.ayah-card .ar { font-family: var(--font-ar); }
.ayah-card .meta { color: var(--fg-2); font-size: var(--fs-small); direction: ltr; margin-right: auto; }  /* wrapped: the English line keeps to the left */
.ayah-card .also { margin: var(--space-3) 0 0; font-size: var(--fs-small); }
.ayah-card .also [lang="ur"] { font-size: var(--fs-ur-small); }
.hits { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.hit { padding: var(--space-4) var(--space-5); }
.hit-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.hit-title { font-size: var(--fs-h3); text-decoration: none; color: var(--accent-2); font-family: var(--font-ar-display); font-weight: 400; }
.hit-title:hover { text-decoration: underline; }
.hit-kind { font-size: var(--fs-caption); color: var(--fg-2); }
.hit-kind [lang="ur"] { font-size: var(--fs-ur-small); }
.hit-ex { margin: var(--space-2) 0 0; color: var(--fg); font-size: var(--fs-small); line-height: 2; unicode-bidi: plaintext; }
.hit-ex:dir(rtl) { font-family: var(--font-ur); font-size: var(--fs-excerpt-ur); line-height: 2.2; }
.hit mark { background: var(--highlight); color: inherit; border-radius: 2px; padding: 0 1px; }
.hit-subs { list-style: none; margin: var(--space-2) 0 0; padding: 0; border-top: 1px dashed var(--rule); }
.hit-subs li { display: flex; gap: var(--space-3); align-items: baseline; padding: var(--space-2) 0 0; }
.hit-at { flex: 0 0 auto; font-size: var(--fs-caption); font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 0 var(--space-2); direction: ltr; }
.hit-at:hover { border-color: var(--accent); }
/* Touch: the `▶ 59:26` moment links (search results, topic passages) are the main action: a 44 px target with
   room around the label (UX review 2, issue 10; they were 21 px tall) */
@media (pointer: coarse) {
  .hit-at { display: inline-flex; align-items: center; min-height: var(--ctl-h); min-width: var(--ctl-h); padding: 0 var(--space-3); }
  .hit-subs li { align-items: center; }
}
.hit-subs .hit-ex { margin: 0; }
.more-wrap { text-align: center; margin: var(--space-5) 0 0; }

/* ─── Topics ─── */
.facet-jump { justify-content: center; margin-bottom: var(--space-5); }
.topic-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.topic-card { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); height: 100%; }
.topic-card.none { opacity: 0.55; }
.tc-ur { font-size: var(--fs-ur-small); font-weight: 600; color: var(--accent-2); line-height: 1.9; }
.tc-en { font-size: var(--fs-small); font-weight: 600; color: var(--fg); text-align: left; }
.tc-desc { font-size: var(--fs-small); color: var(--fg-2); text-align: left; line-height: 1.5; }
.tc-n { margin-top: auto; padding-top: var(--space-1); font-size: var(--fs-small); color: var(--fg-2); }
.tc-n [lang="ur"] { font-size: var(--fs-ur-small); }
.page-head .count { font-size: var(--fs-small); }
.page-head .count [lang="ur"] { font-size: var(--fs-ur-small); }
.passages { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.passage { padding: var(--space-3) var(--space-4); }
.passage.disputed { border-style: dashed; border-color: var(--red); }
.ps-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); }
.ps-title { flex: 1 1 auto; text-decoration: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.ps-title .ar { font-family: var(--font-ar-display); font-weight: 400; font-size: var(--fs-h3); color: var(--accent-2); }
.ps-title .en { font-size: var(--fs-small); color: var(--fg-2); }
.ps-title:hover .ar { text-decoration: underline; }
.ps-mode { font-size: var(--fs-small); color: var(--fg-2); }
.ps-mode [lang="ur"] { font-size: var(--fs-ur-small); }
.ps-disputed { font-size: var(--fs-caption); color: var(--red); }
.ps-ur { margin: var(--space-2) 0 0; font-size: var(--fs-ur-small); line-height: 2.2; }
.ps-ur::before { content: "«\00a0"; color: var(--fg-2); } .ps-ur::after { content: "\00a0»"; color: var(--fg-2); } /* nbsp: the marks never wrap alone */
.ps-en { margin: var(--space-1) 0 0; font-size: var(--fs-small); color: var(--fg-2); text-align: left; }

/* ─── About ─── */
/* Two languages side by side: Urdu at the right, English at the left; stacked (Urdu first) on narrow screens. */
.bi { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); direction: rtl; }
.bi > * { min-width: 0; }
.bi [lang="ur"] p, .bi p[lang="ur"] { font-size: var(--fs-ur-body); line-height: 2.2; margin: 0 0 var(--space-3); }
.bi [lang="en"] p, .bi p[lang="en"] { font-size: calc(17px * var(--text-scale)); line-height: 1.7; margin: 0 0 var(--space-3); }
.about-hero { text-align: center; padding: var(--space-7) 0 var(--space-6); }
.about-hero .wrap { padding-top: 0; padding-bottom: 0; }
.kicker { margin: 0; font-size: var(--fs-caption); letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-2); }
.kicker [lang="ur"] { font-size: var(--fs-ur-small); letter-spacing: 0; }
.about-hero h1 { margin: var(--space-2) 0 0; font-weight: 400; }
.about-hero h1 .ur { display: block; font-size: calc(clamp(30px, 5vw, 48px) * var(--text-scale-ur)); font-weight: 600; line-height: 2.1; color: var(--fg); }
.about-hero h1 .en { display: block; font-size: calc(clamp(18px, 2.4vw, 23px) * var(--text-scale)); color: var(--fg-2); }
.honorific { margin: var(--space-1) 0 0; color: var(--fg-2); font-size: var(--fs-ur-small); }
.title-pill { display: inline-flex; gap: 0.8em; align-items: baseline; flex-wrap: wrap; justify-content: center; margin: var(--space-5) 0 0;
  padding: 4px 20px; border: 1px solid var(--accent); border-radius: var(--radius-pill); color: var(--accent-2); }
.title-pill [lang="ur"] { font-size: calc(20px * var(--text-scale-ur)); line-height: 2; } .title-pill [lang="en"] { font-size: var(--fs-body); font-style: italic; }
.title-by { margin: var(--space-2) 0 0; font-size: var(--fs-caption); color: var(--fg-2); display: flex; flex-direction: column; }
.title-by [lang="ur"] { font-size: var(--fs-ur-small); line-height: 2; }
.lede-pair { max-width: 900px; margin: var(--space-5) auto 0; text-align: start; }
.facts { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; }
.facts li { background: var(--bg-2); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; justify-content: center; }
.facts [lang="ur"] { font-size: var(--fs-ur-small); line-height: 2; }
.facts [lang="en"] { font-size: var(--fs-small); color: var(--fg-2); line-height: 1.4; }
.about-sec { padding: var(--space-5) 0; }
.pq { margin: var(--space-4) 0 0; padding: var(--space-3) var(--space-5); background: var(--note-bg); border-radius: var(--radius-m); }
.pq blockquote { margin: 0; }
.pq [lang="ur"] blockquote { font-size: var(--fs-ur-small); line-height: 2.2; }
.pq [lang="en"] blockquote { font-size: calc(17px * var(--text-scale)); line-height: 1.6; font-style: italic; }
.pq figcaption { font-size: var(--fs-small); color: var(--fg-2); margin-top: var(--space-1); }
.pq [lang="ur"] figcaption { font-size: var(--fs-ur-small); }
.tl-cols .sec-h { margin-top: 0; }
.tl-cols > div > .sec-h ~ .sec-h { margin-top: var(--space-6); }
.timeline, .plain { list-style: none; margin: 0; padding: 0; }
.timeline li, .lineage li { display: grid; grid-template-columns: 5.5em 1fr; gap: var(--space-3); align-items: baseline; padding: 4px 0;
  border-bottom: 1px dashed var(--rule); }
.timeline .yr, .lineage .yr { font-weight: 600; color: var(--accent); font-size: var(--fs-small); text-align: end; font-variant-numeric: tabular-nums; }
.ev { display: flex; flex-direction: column; }
.ev [lang="ur"], .plain [lang="ur"] { font-size: var(--fs-ur-small); line-height: 2; }
.ev [lang="en"], .plain [lang="en"] { font-size: var(--fs-small); color: var(--fg-2); line-height: 1.4; }
.timeline li.now .yr { color: var(--accent-2); }
.plain li { display: flex; flex-direction: column; padding: 4px 0; border-bottom: 1px dashed var(--rule); }
.plain.lineage li { display: grid; }
.works { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.work { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); }
.w-ur { font-size: var(--fs-ur-small); font-weight: 600; color: var(--accent-2); line-height: 2; }
.w-en { font-weight: 600; font-size: var(--fs-small); }
.w-note[lang="ur"] { font-size: var(--fs-ur-small); color: var(--fg-2); line-height: 2; }
.w-note[lang="en"] { font-size: var(--fs-small); color: var(--fg-2); }
.bio-link { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-4) var(--space-5); }
.bio-link .ur { font-size: var(--fs-ur-h3); color: var(--accent-2); font-weight: 600; }
.bio-link .en { font-size: var(--fs-body); color: var(--accent); font-weight: 600; }
.sources { margin: var(--space-5) 0 0; color: var(--fg-2); font-size: var(--fs-small); display: flex; flex-direction: column; gap: var(--space-1); }
.sources [lang="ur"] { font-size: var(--fs-ur-small); line-height: 2; }
.bio h2 { font-size: var(--fs-h3); color: var(--accent-2); border-bottom: 1px solid var(--border); padding-bottom: var(--space-1); margin: var(--space-6) 0 var(--space-3); font-weight: 600; }
.bio [lang="ur"] h2 { font-size: var(--fs-ur-h3); line-height: 2; }
.bio li { margin-bottom: var(--space-1); }
.bio [lang="ur"] li { font-size: var(--fs-ur-small); line-height: 2.1; }
.bio [lang="en"] li { font-size: var(--fs-body); }
@media (max-width: 800px) {
  .bi { grid-template-columns: 1fr; gap: var(--space-2); }
  .facts { grid-template-columns: 1fr 1fr; }
  .works { grid-template-columns: 1fr; }
}
@media (max-width: 420px) { .facts { grid-template-columns: 1fr; } }

/* ─── Landing: the ways in ─── */
.hero-search { max-width: 760px; margin: 0 auto var(--space-2); }
.try { justify-content: center; align-items: baseline; margin: 0 auto var(--space-6); }
.try-label { font-size: var(--fs-caption); color: var(--fg-2); }
.try-label [lang="ur"] { font-size: var(--fs-ur-small); }
.continue { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4);
  max-width: 760px; margin: 0 auto var(--space-6); padding: var(--space-3) var(--space-5); border-inline-start: 4px solid var(--accent); direction: rtl; }
.c-label { font-size: var(--fs-caption); color: var(--fg-2); }
.c-label [lang="ur"] { font-size: var(--fs-ur-small); }
.c-link { display: flex; gap: var(--space-3); align-items: baseline; text-decoration: none; flex-wrap: wrap; }
.c-ar { font-family: var(--font-ar-display); font-weight: 400; font-size: var(--fs-h3); color: var(--accent-2); }
.c-en { font-size: var(--fs-small); color: var(--accent); font-weight: 600; }
/* the shared .card-desc sets Urdu at the 15 px caption size: the landing's card text reads at --fs-ur-small */
.ways .card-desc[lang="ur"] { font-size: var(--fs-ur-small); }
.ways .card-desc[lang="en"] { font-size: var(--fs-small); }
.ways { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); margin-bottom: var(--space-6); }
.topic-tiles { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.tile { display: flex; flex-direction: column; padding: var(--space-3) var(--space-4); }
.tile .ur { font-size: var(--fs-ur-small); font-weight: 600; color: var(--accent-2); line-height: 2; }
.tile .en { font-size: var(--fs-small); color: var(--fg-2); }
.tile .n { margin-top: auto; padding-top: var(--space-1); font-size: var(--fs-small); color: var(--fg-2); text-align: left; }
/* «نئے دروس · Recently added» (UX review 2, issue 8): the lectures whose audio came in last, newest batch first */
.recent { margin-bottom: var(--space-6); }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2) var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.recent-list a { display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--bg-2); text-decoration: none; color: var(--fg); }
.recent-list a:hover { border-color: var(--accent); }
.r-ar { font-family: var(--font-ar); font-weight: 400; font-size: var(--fs-body); line-height: 1.6; color: var(--accent-2); }
.r-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 var(--space-3); }
.r-en { font-size: var(--fs-small); color: var(--fg-2); }
.r-added { font-size: var(--fs-small); color: var(--accent); }
.r-added [lang="ur"] { font-size: var(--fs-ur-small); }
.more { text-align: center; margin: var(--space-4) 0 0; font-size: var(--fs-small); }
.more a { text-decoration: none; }
.more [lang="ur"] { font-size: var(--fs-ur-small); }
.surah-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); }
@media (max-width: 520px) { .surah-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-1); } }
.surah-grid a { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); grid-template-rows: auto auto; column-gap: var(--space-2); align-items: baseline;
  padding: 4px var(--space-2); border-radius: var(--radius-s); text-decoration: none; color: var(--fg); }
.surah-grid a:hover { background: var(--bg-3); }
.surah-grid .sn { grid-row: span 2; align-self: center; text-align: center; }  /* holds the shared .list-no (Urdu over Western) */
.surah-grid .sa { font-family: var(--font-ar); font-size: var(--fs-ur-small); line-height: 1.6; color: var(--accent-2); }
.surah-grid .se { font-size: var(--fs-small); color: var(--fg-2); text-align: left; }
.surah-grid :is(.sa, .se) { overflow-wrap: anywhere; }  /* A+ at 320 px: the long names wrap instead of widening the page */

/* Home: the Dars-e-Quran card stands out, subtly (user, 2026-11-29) */
.card-feature {
  background:
    radial-gradient(130% 100% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 72%),
    var(--bg-2);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent), 0 10px 34px -8px color-mix(in srgb, var(--accent) 42%, transparent);
}
.card-feature:hover, .card-feature:focus-visible {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 14px 40px -8px color-mix(in srgb, var(--accent) 52%, transparent);
}

/* About: a jump to the full biography near the top (user, 2026-11-29) */
.bio-top-link { text-align: center; margin: var(--space-3) 0 var(--space-4); }
/* 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. Not sticky. ─── */
.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 */
}
.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;
}
.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, its own site; GOLD, the single exception to the green palette (README). */
.qc-library {
  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 { 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 { outline: 2px solid var(--qc-gold); outline-offset: 2px; }
.qc-library:active, .qc-library[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 { outline-color: var(--qc-gold); }

/* ─── Tools at the left end (1.6.0): the text-size control and the colour-scheme toggle ─── */
.qc-tools { flex: 0 0 auto; display: flex; align-items: center; gap: var(--qc-s2); }
.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; }
}
/* 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 «Aa» button 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); }
.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 + 3 at 360-430 px (RTL
     order, Home first at the right; flex-basis 22% keeps a row to at most 4, 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 22%; 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: five items, 3 + 2 */
  .qc-search .qc-icon { display: none; }
  .qc-tools { flex-direction: column; gap: 2px; }
  .qc-scheme-toggle, .qc-ts-open { width: 36px; height: 36px; font-size: 15px; }
  .qc-ts-btn { width: var(--qc-tap); height: var(--qc-tap); }
}
/* The «Aa» panel (1.6.0): on phones, and on touch tablets below 1000 px, where the three inline steps (~190 px with
   the colour button) would push the nav into a third row, one «Aa» button opens the steps below the header. */
@media (max-width: 720px), (max-width: 999px) and (pointer: coarse) {
  .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 { font-size: 11px; letter-spacing: 0; }
}
@media (max-width: 340px) { .qc-nav-item .qc-en { white-space: normal; line-height: 1.15; } }
@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-footer-links a { display: inline-flex; align-items: center; min-height: var(--qc-tap); padding-inline: var(--qc-s1); }
}

/* ─── Footer (content pages only): disclaimer (Urdu right-aligned, English left-aligned) + Home · Library · Privacy ─── */
.qc-footer {
  margin-top: auto;
  color: var(--qc-fg-2); background: var(--qc-bar);
  border-top: 1px solid var(--qc-border);
  padding: var(--qc-s5) 16px;
  font-family: var(--qc-font-en); font-size: var(--qc-fs-en); line-height: 1.6;
}
.qc-footer-notes { max-width: 720px; margin: 0 auto var(--qc-s3); }
.qc-footer-note { margin: 0 0 var(--qc-s2); }
.qc-footer-note[lang="ur"] { font-family: var(--qc-font-ur); font-size: var(--qc-fs-ur); line-height: 2.1; text-align: right; }
.qc-footer-note[lang="en"] { text-align: left; }
.qc-footer a { color: var(--qc-accent-2); }
.qc-mail { font-family: var(--qc-font-en); unicode-bidi: isolate; }
.qc-footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  gap: var(--qc-s1) 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; }

/* Slim footer (1.6.0, footer-slim.html): utility pages (about, privacy, search form): feedback line + links only. */
.qc-footer-slim { padding: var(--qc-s4) 16px; }
.qc-footer-slim .qc-footer-note { max-width: 720px; margin: 0 auto var(--qc-s2); }

/* 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); }
}
