/* Web-book standard — THE stylesheet (docs/webbook-standard.md). v1.1, 2026-09-04.
   One file for every web book, both directions: `.wb-stage > .wb-content` is the page; `.wb-content[dir="rtl"]`
   switches the Urdu (Nastaleeq) rules on, anything else reads as English. The look is malfuzat.com's book.css
   (warm ink, quiet tokens, one rule per line) generalised to the kit's vocabulary. Fonts come from
   files.alislam.cloud (woff2 first) and Google Fonts only — never a relative fonts/ path, never bundled.
   Sizes inside the page are em (they follow --wb-font-scale and the root font-size a viewer's A−/A+ sets);
   apparatus (page numbers, notes) is rem so it stays small when the text grows. */
@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=Roboto:ital,wght@0,400;0,500;0,700;1,400&family=Lateef:wght@400;700&display=swap");

@font-face { font-family:"Jameel Noori Nastaleeq";
  src: url("https://files.alislam.cloud/fonts/Urdu-Nastaleeq.woff2") format("woff2"),
       url("https://files.alislam.cloud/fonts/Urdu-Nastaleeq.ttf") format("truetype");
  font-display:swap; }
@font-face { font-family:"Manzoor Naskh";
  src: url("https://files.alislam.cloud/fonts/ManzoorNaskh-alislam.woff2") format("woff2"),
       url("https://files.alislam.cloud/fonts/ManzoorNaskh-alislam.ttf") format("truetype");
  font-display:swap; }
@font-face { font-family:"Noore Huda";
  src: url("https://files.alislam.cloud/fonts/noorehuda-webfont.woff2") format("woff2"),
       url("https://files.alislam.cloud/fonts/noorehuda-webfont.ttf") format("truetype");
  font-display:swap; }
/* full extended-Arabic coverage (گ پ چ ژ ے) — the fallback that keeps Urdu/Persian tagged .arabic joined */
@font-face { font-family:"Adobe Naskh";
  src: url("https://files.alislam.cloud/fonts/AdobeNaskh-Medium.woff2") format("woff2");
  font-display:swap; }

/* ---------- the page: grey desk, white sheet ---------- */
.wb-stage { --wb-stage-bg:#f4f5f6; background:var(--wb-stage-bg); min-height:100vh; padding:1.5rem 1rem 4rem; }
.wb-stage.wb-stage-dark { --wb-stage-bg:#0a0a0a; }
.wb-content { --wb-font-scale:1; --ink:#1a1a1a; --muted:#6b6b6b; --rule:#d8d8d8; --quran:#0b5c2e; --hadith:#7a4a12; --accent:#0b5c2e;
  --paper:#fff; --edge:#e5e7eb; --marker:#b9b3a6; --mark-bg:#fff59d; --mark-fg:#2b2600; }
.wb-content.wb-dark { --ink:#e8e8e8; --muted:#9a9a9a; --rule:#3a3a3a; --quran:#7fc98f; --hadith:#d3a46b; --accent:#9ad06a;
  --paper:#111; --edge:rgba(255,255,255,.07); --marker:#555; --mark-bg:#5c5220; --mark-fg:#f2eecd; }
.wb-content { max-width:44rem; margin:0 auto; padding:2.5rem 3.5rem 4rem; background:var(--paper); color:var(--ink);
  border-radius:14px; box-shadow:0 0 0 1px var(--edge), 0 8px 30px rgba(0,0,0,.05); text-align:justify; direction:ltr;
  font-family:Roboto,system-ui,sans-serif; font-size:calc(1.05rem * var(--wb-font-scale)); line-height:1.7; hyphens:auto; }
.wb-content[dir="rtl"] { max-width:46rem; direction:rtl; hyphens:manual;
  font-family:"Jameel Noori Nastaleeq","Noto Nastaliq Urdu",serif; font-size:calc(1.6rem * var(--wb-font-scale)); line-height:2.6; }
.wb-content a { color:inherit; text-decoration:none; }
.wb-content a:hover { text-decoration:underline; }
.wb-content img { max-width:100%; height:auto; }
.wb-content b, .wb-content strong { font-weight:700; }
.wb-content mark { background:var(--mark-bg); color:var(--mark-fg); padding:0 2px; border-radius:2px; }
/* a search deep link (#anchor:~:text=…) is highlighted by the browser's ::target-text — the same soft yellow as mark, not the browser's purple */
.wb-content ::target-text { background:var(--mark-bg); color:var(--mark-fg); }
.wb-content section[data-wb-section], .wb-content h1, .wb-content h2, .wb-content h3, .wb-content h4 { scroll-margin-top:72px; }

/* ---------- headings & paragraphs ---------- */
.wb-content h1, .wb-content h2, .wb-content h3, .wb-content h4 { font-family:"EB Garamond",Georgia,serif; line-height:1.3; text-align:center; text-indent:0; }
.wb-content h1 { font-size:2.1em; font-weight:600; margin:1rem 0 .5rem; }
.wb-content h2 { font-size:1.35em; letter-spacing:.12em; text-transform:uppercase; font-weight:400; margin:3rem 0 1rem; }
.wb-content h3 { font-size:1.25em; font-weight:600; margin:2.2rem 0 .8rem; }
.wb-content h4 { font-size:1.05em; font-weight:600; font-style:italic; margin:1.8rem 0 .6rem; }
.wb-content[dir="rtl"] h1, .wb-content[dir="rtl"] h2, .wb-content[dir="rtl"] h3, .wb-content[dir="rtl"] h4 { font-family:inherit; line-height:2.2; letter-spacing:0; text-transform:none; font-weight:400; }
.wb-content[dir="rtl"] h1 { font-size:1.5em; margin:1rem 0 2.5rem; }
.wb-content[dir="rtl"] h2 { font-size:1.25em; margin:3rem 0 1.5rem; padding-bottom:.4rem; border-bottom:2px solid var(--ink); }
.wb-content[dir="rtl"] h3 { font-size:1.12em; text-align:start; margin:2.2rem 0 .8rem; text-decoration:underline; text-underline-offset:.35em; }
.wb-content[dir="rtl"] h4 { font-size:1.05em; font-style:normal; text-align:start; }
.wb-content p { margin:0 0 1em; }
.wb-content p + p { text-indent:1.4em; }
.wb-content[dir="rtl"] p { text-indent:1em; }
.wb-content p.chapter-label { text-align:center; text-indent:0; font-size:1.2em; letter-spacing:.08em; color:var(--muted); margin:2.5rem 0 0; }
.wb-content p.chapter-label + h1 { margin-top:.2rem; }
/* a topic heading the print runs into its paragraph (h3.run-in / h4.run-in, kit §2; Anwarul Uloom has 4,900): the
   heading sits inline at the head of the paragraph that follows, which continues on the same line */
.wb-content h3.run-in, .wb-content h4.run-in { display:inline; margin:0; padding:0; font-size:1.05em; line-height:inherit; }
.wb-content h3.run-in + p, .wb-content h4.run-in + p { display:inline; text-indent:0; }
.wb-content h3.run-in + p::after, .wb-content h4.run-in + p::after { content:""; display:block; height:.8em; }
.wb-content h3.run-in::after, .wb-content h4.run-in::after { content:"\00a0"; }
.wb-content p.caption { text-align:center; text-indent:0; font-style:italic; color:var(--muted); margin:-.5rem 0 1.5rem; }
.wb-content[dir="rtl"] p.caption { font-style:normal; font-size:.8em; margin:-1rem 0 1.2rem; }
.wb-content p.part-title { font-family:"EB Garamond",Georgia,serif; font-style:italic; text-align:center; font-size:1.7em; margin:2rem 0 1.5rem; text-indent:0; }
.wb-content p.invocation { text-align:center; text-indent:0; margin:0 0 .3em; line-height:2.4; }
.wb-content p.invocation .arabic, .wb-content p.invocation .quranic { font-size:1.15em; }
.wb-content h2.book-title { font-size:2em; border:0; margin:1.6rem 0 .6rem; padding:0; letter-spacing:0; text-transform:none; }
.wb-content h3.book-subtitle { text-align:center; text-decoration:underline; text-underline-offset:.35em; font-size:1.2em; margin:0 0 2.4rem; }
.wb-content hr { border:0; border-top:1px solid var(--rule); width:40%; margin:2.5rem auto; }
.wb-content hr.session-end { border-top-color:var(--ink); }
.wb-content .page-break { break-after:page; }

/* ---------- layout & sizing utilities ---------- */
.wb-content .center { display:block; text-align:center; text-indent:0; }
.wb-content .right { display:block; text-align:right; text-indent:0; }
.wb-content .list-para { text-indent:0; padding-inline-start:2em; }
.wb-content .large { font-size:1.5em; }
.wb-content .medium { font-size:1.2em; }
.wb-content .small { font-size:.8em; }
.wb-content .arabic-large { font-size:2em; }
.wb-content .arabic-medium { font-size:1.5em; }
.wb-content .arabic-small { font-size:1em; }

/* ---------- scripts inside the text ---------- */
/* Qur'an: the class is `quran` (v2) — `quranic` is the pre-v2 name, styled identically until the books migrate.
   Manzoor Naskh (Noore Huda fallback), green; both faces cover Qur'anic text only.
   .arabic keeps Adobe Naskh in its chain so OCR'd Urdu/Persian tagged as arabic still joins (گ is not in Manzoor). */
.wb-content .quranic, .wb-content .quran, .wb-content .arabic, .wb-content .hadith { direction:rtl; unicode-bidi:isolate; margin-inline:.2em; }
.wb-content .quranic, .wb-content .quran { font-family:"Manzoor Naskh","Noore Huda","Adobe Naskh","Noto Naskh Arabic",serif; color:var(--quran); }
/* non-Qur'an Arabic (prayers, revelations, prose, titles) in Adobe Naskh (2026-09-12): the Qur'an face is the Qur'an's alone,
   as the proofread EPUBs set it — a reader tells a verse from a prayer by the face, not only by the colour */
.wb-content .arabic { font-family:"Adobe Naskh","Noto Naskh Arabic","Manzoor Naskh",serif; }
.wb-content .hadith { font-family:Lateef,"Adobe Naskh","Noto Naskh Arabic",serif; color:var(--hadith); font-size:1.25em; }
.wb-content .urdu, .wb-content .persian { font-family:"Jameel Noori Nastaleeq","Noto Nastaliq Urdu",serif; direction:rtl; unicode-bidi:isolate; margin-inline:.2em; }
.wb-content:not([dir="rtl"]) .quranic, .wb-content:not([dir="rtl"]) .quran, .wb-content:not([dir="rtl"]) .arabic { font-size:1.15em; }
.wb-content:not([dir="rtl"]) .urdu, .wb-content:not([dir="rtl"]) .persian { font-size:1.15em; line-height:2; }
.wb-content[dir="rtl"] .quranic, .wb-content[dir="rtl"] .quran, .wb-content[dir="rtl"] .arabic { line-height:2.2; }
.wb-content[dir="rtl"] .hadith { line-height:2; }
.wb-content .ref { font-size:.7em; color:var(--muted); margin:0 .25em; font-family:inherit; }
/* a reference the print set as a footnote, inlined after the verse (2026-09-11): a touch of the Qur'an colour tells it apart */
.wb-content .ref[data-from="note"] { color:var(--quran); opacity:.8; font-size:.62em; white-space:nowrap; }
/* verse links: a dotted rule (an underline would cut the harakat), firming up on hover */
.wb-content a.quranic-link, .wb-content a.quranic, .wb-content a.quran { text-decoration:none; color:inherit; border-bottom:1px dotted var(--quran); }
.wb-content a.quranic-link:hover, .wb-content a.quranic:hover, .wb-content a.quran:hover { text-decoration:none; border-bottom-style:solid; background:rgba(11,92,46,.08); }
.wb-content .quranic-verses { display:inline; }
.wb-content .quranic-verses > .quranic-link + .quranic-link { margin-inline-start:.45em; }
/* display quotations: the Qur'an / Arabic line on its own, the translation under it */
.wb-content .quote { text-align:center; text-indent:0; margin:1em 1.5em .4em; }
.wb-content .quote:has(> .quranic-link:first-child), .wb-content .quote:has(> .quranic:first-child), .wb-content .quote:has(> .quran:first-child), .wb-content .quote:has(> .arabic:first-child), .wb-content .quote:has(> .hadith:first-child) { direction:rtl; }
.wb-content .quote .quranic, .wb-content .quote .quran, .wb-content .quote .arabic, .wb-content .quote .hadith { font-size:1.3em; line-height:2; }
.wb-content[dir="rtl"] .quote .quranic, .wb-content[dir="rtl"] .quote .quran, .wb-content[dir="rtl"] .quote .arabic { font-size:1.15em; }
.wb-content p.translation { text-align:center; text-indent:0; font-style:italic; margin:0 1.5em 1.2em; }
.wb-content[dir="rtl"] p.translation { font-style:normal; font-size:.9em; }
.wb-content blockquote { margin:1em 1.5em 1.2em; padding-inline-start:1em; border-inline-start:3px solid var(--rule); }
.wb-content blockquote + blockquote { margin-top:-.4em; }
.wb-content blockquote p:first-child { text-indent:0; }

/* ---------- poetry ---------- */
/* THE form (v2): <div class="couplet"> with one <p> per misra — two p's make a bayt and sit side by side
   on one row, the next two on the next row, so a whole ghazal is one div. On a phone each misra takes
   its own centred line. couplet-arabic = the same in Naskh. */
.wb-content .couplet, .wb-content .couplet-arabic { display:flex; flex-wrap:wrap; justify-content:center; column-gap:2.5em; row-gap:.1em;
  max-width:40rem; margin:1.2em auto 1.4em; text-indent:0; text-align:center; direction:rtl; unicode-bidi:isolate; }
.wb-content .couplet > p, .wb-content .couplet-arabic > p { flex:0 0 calc(50% - 1.25em); margin:0; text-indent:0; text-align:center; }
.wb-content .couplet > p:only-child, .wb-content .couplet-arabic > p:only-child { flex-basis:100%; }
.wb-content .couplet { font-family:"Jameel Noori Nastaleeq","Noto Nastaliq Urdu",serif; line-height:2.2; }
.wb-content .couplet-arabic { font-family:"Adobe Naskh","Noto Naskh Arabic","Manzoor Naskh",serif; line-height:2.2; }
.wb-content:not([dir="rtl"]) .couplet, .wb-content:not([dir="rtl"]) .couplet-arabic { font-size:1.25em; }
.wb-content[dir="rtl"] .couplet { line-height:2.4; }
@media (max-width:640px) { .wb-content .couplet > p, .wb-content .couplet-arabic > p { flex-basis:100%; } }
/* legacy forms, styled until their books migrate: essence's figure.couplet (misras as <p> or <br>-separated
   text, sometimes an empty <p>) stays a block of centred lines; malfuzat's .poetry > .verse > .misra row */
.wb-content figure.couplet, .wb-content figure.couplet-arabic { display:block; }
.wb-content figure.couplet > p, .wb-content figure.couplet-arabic > p { margin:0; }
.wb-content .poetry { text-align:center; text-indent:0; margin:1.4em auto 1.6em; max-width:40rem; }
.wb-content:not([dir="rtl"]) .poetry { direction:rtl; font-family:"Jameel Noori Nastaleeq","Noto Nastaliq Urdu",serif; font-size:1.25em; line-height:2.2; }
.wb-content[dir="rtl"] .poetry { line-height:2.4; }
.wb-content .verse { display:flex; justify-content:center; gap:2.5em; flex-wrap:wrap; margin:.15em 0; }
.wb-content .verse[lang="ar"] { font-family:"Adobe Naskh","Noto Naskh Arabic","Manzoor Naskh",serif; }
.wb-content .misra { display:inline-block; white-space:nowrap; }
.wb-content .verse:has(.misra:only-child) .misra { white-space:normal; }
.wb-content .poetry-refs { font-size:.7em; direction:ltr; margin-inline-start:.3em; }
.wb-content .couplet p { margin:0; text-indent:0; }
.wb-content .poem-container { text-align:center; padding:1em 0; }
.wb-content .poem-group { margin:1em 0; }
.wb-content .poem-line-first { margin-bottom:.3em; }
.wb-content .poem-line-second-urdu { margin-bottom:.5em; }
.wb-content .poem-line-second-english { margin-bottom:1.5em; }
.wb-content .poem-english { font-style:italic; }

/* ---------- apparatus: honorifics, citations, footnotes, page markers ---------- */
.wb-content sup { font-size:.7em; line-height:0; vertical-align:super; }
.wb-content sup.hon { font-size:.6em; margin-inline-start:.05em; }
.wb-content sup a, .wb-content .fnref a { color:var(--accent); font-weight:500; text-decoration:none; padding:0 .1em; }
.wb-content sup a:hover { text-decoration:underline; }
.wb-content cite { display:block; font-style:normal; font-size:.78em; line-height:1.5; color:var(--muted); text-indent:0; margin:-.5em 0 1.2em; text-align:end; }
.wb-content .right > cite, .wb-content cite:only-child { margin-top:0; }
.wb-content cite b { font-weight:500; }
.wb-content cite a { color:inherit; }
.wb-content cite a:hover { color:var(--accent); text-decoration:none; border-bottom:1px dotted currentColor; }
/* inline footnotes (the standard): aside.wb-footnotes > details.wb-footnote after the paragraph */
.wb-content .wb-footnotes { margin:-.4em 0 1em; padding:0; font-size:.8em; line-height:1.55; color:var(--muted); text-indent:0; text-align:start; }
.wb-content[dir="rtl"] .wb-footnotes { line-height:2; }
.wb-content .wb-footnote { margin:.2em 0; padding-inline-start:.7em; border-inline-start:2px solid var(--rule); }
.wb-content .wb-footnote-summary { cursor:pointer; list-style:none; width:max-content; user-select:none; }
.wb-content .wb-footnote-summary::-webkit-details-marker { display:none; }
.wb-content .wb-footnote-summary sup { display:inline-block; vertical-align:baseline; line-height:1.4; min-width:1.6em; padding:0 .4em; border-radius:999px; text-align:center;
  font-size:.85em; font-weight:500; color:var(--accent); background:rgba(11,92,46,.08); font-family:Roboto,system-ui,sans-serif; }
.wb-content .wb-footnote-summary:hover sup { background:rgba(11,92,46,.18); }
.wb-content .wb-footnote[open] > .wb-footnote-summary { margin-bottom:.2em; }
.wb-content .wb-footnote-body { color:var(--ink); }
.wb-content .wb-footnote-body p { margin:0; text-indent:0; }
/* the author's «منہ» closing his own note (kit §2 fn-sig): Adobe Naskh, so it reads as the print's signature */
.wb-content .fn-sig { font-family:"Adobe Naskh","Noto Naskh Arabic",serif; font-weight:400; margin-inline-start:.4em; }
.wb-content .fn-back { font-size:.85em; margin-inline-start:.3em; opacity:.7; }
.wb-content .fn-back:hover { opacity:1; }
.wb-content .wb-footnote, .wb-content sup a[id] { scroll-margin-top:90px; }
@keyframes wb-fn-flash { 0% { background-color:rgba(11,92,46,.18); } 100% { background-color:transparent; } }
.wb-content .wb-fn-flash { animation:wb-fn-flash 1.5s ease-out; border-radius:4px; }
/* endnotes (malfuzat books): section.footnotes > h2 + ol > li#fn-… */
.wb-content .footnotes { margin-top:4rem; border-top:1px solid var(--rule); font-size:.85em; line-height:1.55; }
.wb-content[dir="rtl"] .footnotes { line-height:2.2; }
.wb-content .footnotes h2 { border:0; letter-spacing:0; text-transform:none; font-size:1.2em; margin:1.5rem 0 1rem; }
.wb-content .footnotes ol { padding-inline-start:1.6em; }
.wb-content .footnotes li { margin-bottom:.5em; text-align:start; }
/* a note that carries its own printed marker («۱؎», «1») must not also get the <ol> number */
.wb-content .footnotes li:has(> .marker) { list-style:none; }
.wb-content .marker { color:var(--muted); margin-inline-end:.3em; }
.wb-content .fn-page, .wb-content .backref { font-size:.8em; color:var(--muted); white-space:nowrap; }
/* page markers: <a class="pb" id="page-N" data-print-page="N"> — zero width in the line, the number floats above the join
   in the outer margin; .hide-pb on .wb-content hides them. A viewer may set href to link the number to the scan. */
.wb-content .pb { display:inline; position:relative; }
.wb-content .pb::before { content:attr(data-print-page); position:absolute; bottom:1.05em; left:-.6em; font-family:system-ui,sans-serif;
  font-size:.58rem; line-height:1; color:var(--marker); direction:ltr; white-space:nowrap; pointer-events:none; }
.wb-content[dir="rtl"] .pb::before { left:auto; right:-.6em; }
.wb-content .pb[href]::before { pointer-events:auto; cursor:pointer; padding:.35em .4em; border-radius:4px; bottom:calc(1.05em - .35em); left:calc(-.6em - .4em); }
.wb-content[dir="rtl"] .pb[href]::before { left:auto; right:calc(-.6em - .4em); }
.wb-content .pb[href]:hover::before, .wb-content .pb[href]:focus-visible::before { color:var(--accent); background:rgba(11,92,46,.08); font-weight:700; }
.wb-content.hide-pb .pb::before { display:none; }
/* legacy form from the epub pipeline: <span class="page-marker" data-page="N">, shown only when the reader
   asks for it. `a.pb[data-print-page]` above is the canonical one — new books emit that. */
.wb-content .page-marker { display:none; }
.wb-content.show-page-markers .page-marker { display:inline; user-select:none; }
.wb-content.show-page-markers .page-marker::before { content:"[" attr(data-page) "]"; font-family:system-ui,sans-serif;
  font-size:.58rem; vertical-align:super; color:var(--marker); padding:0 .25em; }

/* ---------- images ---------- */
.wb-content img[data-role="script-inline"] { display:inline-block; vertical-align:middle; }
.wb-content img[data-role="figure"], .wb-content figure > img { display:block; margin:1.5em auto; }
.wb-content figure { margin:1em 0; }

/* figures and facsimiles (2026-09-11): figure.wb-figure > img[data-role=figure] + figcaption; .wb-facsimile = a picture standing in for print */
.wb-content .wb-figure { margin:1.5em auto; padding:0; text-align:center; text-indent:0; max-width:100%; }
.wb-content .wb-figure img { display:block; margin:0 auto; max-width:100%; height:auto; }
.wb-content .wb-figure figcaption { font-size:.8em; line-height:1.6; color:var(--muted); margin-top:.5em; text-align:center; }
.wb-content[dir="rtl"] .wb-figure figcaption { line-height:2; }
.wb-content .wb-facsimile img { border:1px solid var(--rule); border-radius:6px; background:#fff; padding:.4em; box-sizing:border-box; }
.wb-content.wb-dark .wb-facsimile img { background:#f4f4f4; }

/* ---------- tables (2026-09-11): table.wb-table[data-kind=parallel|interlinear|register|table] ---------- */
.wb-content .wb-table { border-collapse:collapse; width:100%; margin:1.2em 0; font-size:.92em; line-height:1.6; text-indent:0; }
.wb-content[dir="rtl"] .wb-table { line-height:2; }
.wb-content .wb-table th, .wb-content .wb-table td { border:1px solid var(--rule); padding:.35em .6em; vertical-align:top; text-align:start; }
.wb-content .wb-table th { font-weight:700; background:rgba(0,0,0,.035); }
.wb-content.wb-dark .wb-table th { background:rgba(255,255,255,.06); }
.wb-content .wb-table p { margin:0 0 .4em; text-indent:0; }
.wb-content .wb-table p:last-child { margin-bottom:0; }
.wb-content .wb-table .wb-footnotes { margin:.2em 0 .4em; }
.wb-content .wb-table[data-kind="parallel"] td { width:50%; }
.wb-content .wb-table[data-kind="register"] td:first-child, .wb-content .wb-table[data-kind="register"] th:first-child { white-space:nowrap; }
.wb-content .wb-table[data-kind="interlinear"] { width:auto; margin-inline:auto; direction:rtl; }
.wb-content .wb-table[data-kind="interlinear"] td { border:0; padding:.1em .6em; text-align:center; vertical-align:baseline; }
.wb-content .wb-table[data-kind="interlinear"] tr.hebrew td { font-family:"Times New Roman","Noto Serif Hebrew",serif; font-size:1.15em; direction:rtl; line-height:1.6; }
.wb-content .wb-table[data-kind="interlinear"] tr.translit td { font-family:"Adobe Naskh","Noto Naskh Arabic",serif; color:var(--muted); line-height:1.8; }
.wb-content .wb-table[data-kind="interlinear"] tr.gloss td { font-size:.85em; }
@media (max-width: 720px) { .wb-content .wb-table:not([data-kind="parallel"]) { display:block; overflow-x:auto; } }

/* a Latin run inside an RTL book: attributes only (kit §2), the face and direction come from here */
.wb-content[dir="rtl"] [dir="ltr"] { direction:ltr; text-align:left; unicode-bidi:isolate; font-family:Roboto,system-ui,sans-serif; font-size:.75em; line-height:1.6; }
.wb-content[dir="rtl"] p[dir="ltr"] { text-indent:0; margin:.4em 0; }

/* a note cited from inside a note (kit §2 nested footnote): same structure one level down, the size does not compound */
.wb-content .wb-footnote-body .wb-footnotes { font-size:1em; margin:.3em 0 .5em; padding-inline-start:.4em; }

/* ---------- title page, contents, chapter navigation ---------- */
.wb-content .titlepage { text-align:center; margin:1rem 0 3rem; padding-bottom:2rem; border-bottom:1px solid var(--rule); }
.wb-content .titlepage h1 { margin-bottom:.5rem; }
.wb-content .byline { font-family:"EB Garamond",Georgia,serif; font-size:1.1em; color:var(--muted); text-indent:0; text-align:center; margin:0 0 .5rem; }
.wb-content[dir="rtl"] .byline { font-family:inherit; font-size:.85em; }
.wb-content .scope { font-size:.9em; color:var(--muted); text-indent:0; text-align:center; margin:0; }
.wb-content[dir="rtl"] .scope { font-size:.7em; }
.wb-content .note { direction:ltr; font-family:system-ui,-apple-system,sans-serif; font-size:.8rem; line-height:1.6; color:var(--muted); text-indent:0; text-align:center; margin:1.5rem auto 0; max-width:34rem; }
.wb-content .toc { margin:0 0 3.5rem; padding-bottom:2rem; border-bottom:1px solid var(--rule); text-align:start; }
.wb-content .toc summary { cursor:pointer; list-style:none; font-family:"EB Garamond",Georgia,serif; font-size:1.4em; font-weight:600; margin:0 0 1rem; }
.wb-content[dir="rtl"] .toc summary { font-family:inherit; font-size:1em; }
.wb-content .toc summary::-webkit-details-marker { display:none; }
.wb-content .toc summary::before { content:"▸ "; font-size:.8em; color:var(--muted); }
.wb-content .toc[open] summary::before { content:"▾ "; }
.wb-content .toc h2 { border:0; letter-spacing:0; text-transform:none; margin:0 0 1rem; text-align:start; }
.wb-content .toc ul, .wb-content .toc ol { list-style:none; margin:0; padding:0; font-size:.9em; line-height:1.6; }
.wb-content[dir="rtl"] .toc ul, .wb-content[dir="rtl"] .toc ol { font-size:.8em; line-height:2; }
.wb-content .toc li { display:flex; align-items:baseline; gap:.5rem; }
.wb-content .toc li.l2 { margin-top:.5rem; font-weight:500; }
.wb-content .toc li.l3 { padding-inline-start:1.5rem; }
.wb-content .toc li.l4 { padding-inline-start:3rem; font-size:.9em; }
.wb-content .toc a { color:inherit; text-decoration:none; flex:1; text-align:start; }
.wb-content .toc a:hover { text-decoration:underline; }
.wb-content .tocpage { font-family:system-ui,sans-serif; font-size:.75rem; color:var(--muted); direction:ltr; }
.wb-content .chapter-nav { display:flex; justify-content:space-between; align-items:baseline; gap:1em; flex-wrap:wrap; padding:.6em 0; margin-top:2em;
  border-top:1px solid var(--rule); font-family:Roboto,system-ui,sans-serif; font-size:.9em; text-indent:0; }
.wb-content .chapter-nav .next { margin-inline-start:auto; text-align:end; }

/* ---------- reader UI outside the page (toolbar, drawer, overlays) ---------- */
.wb-title { font-family:"EB Garamond",Georgia,serif; font-size:1.05rem; font-weight:600; }
[dir="rtl"] .wb-title, .wb-title[dir="rtl"] { font-family:"Jameel Noori Nastaleeq",serif; }
.wb-toc { font-family:Roboto,system-ui,sans-serif; color:#1a1a1a; }
.wb-toc .wb-toc-section { font-weight:700; font-size:1.05rem; }
.wb-toc .wb-toc-h3 { font-size:.95rem; }
[dir="rtl"] .wb-toc, .wb-toc[dir="rtl"] { font-family:"Jameel Noori Nastaleeq",serif; text-align:right; }
[dir="rtl"] .wb-toc .wb-toc-section { font-size:1.2rem; }
[dir="rtl"] .wb-toc .wb-toc-h3 { font-size:1.05rem; }
.wb-toc-dark, .wb-toc-dark .wb-toc-section, .wb-toc-dark .wb-toc-h3 { color:#fff; }
.wb-citation-item { font-family:"Jameel Noori Nastaleeq",serif; direction:rtl; text-align:right; font-size:1.5rem; line-height:1.9; }
.wb-verse-item { font-family:"Manzoor Naskh","Noore Huda",serif; direction:rtl; text-align:right; font-size:1.6rem; line-height:2; color:#0b5c2e; }

/* ---------- screens & paper ---------- */
@media (max-width: 720px) {
  .wb-stage { padding:0; }
  .wb-content { max-width:none; border-radius:0; box-shadow:none; padding:1.5rem 1.25rem 3rem; }
  .wb-content .couplet, .wb-content .couplet-arabic { max-width:100%; }
}
@media print {
  .wb-stage { background:#fff !important; padding:0; min-height:0; }
  .wb-content { max-width:none; padding:0; border-radius:0; box-shadow:none; background:#fff !important; color:#000 !important; font-size:11pt; }
  .wb-content[dir="rtl"] { font-size:12pt; }
  .wb-content .pb::before { color:#ccc; }
  .wb-content .toc, .wb-content .note { break-after:page; }
  .wb-content h2, .wb-content h3, .wb-content h4 { break-after:avoid; }
  .wb-content .chapter-nav, .wb-content .fn-back { display:none; }
}
