/* naat.css — the naat pages (/naat, /naat/<nid>/<slug>, collection / poet / occasion pages, My list). Built by
   refs.web.naat; wired by static/naat.js. Consumes tokens.css and the qamar-common components; sizes are tokens only
   (web/css-allow.txt "naat.css"): the size option and recite mode pick a larger token, they never multiply one.

   State lives on <html> (set before paint from localStorage "maktaba-layers".naat, see refs.web.naat EARLY):
     data-layers="orig translit en lit notes scan"   which layers show (no attribute = no JS: everything shows)
     data-n-primary orig|translit|en|lit (the layer that leads) · data-n-lay stack|side · data-n-shape lines|diwan · data-n-size m|l|xl
     data-n-space normal|compact|airy · data-n-nums on|off · data-n-chorus on|once
     data-n-paper a4|letter · data-n-cols 1|2 · data-n-psize s|m|l · data-n-perpage on|off   (print)
     data-n-recite (recite mode) · data-n-booklet (printing My list as a booklet) · data-n-js (naat.js can run)
   Layer markup: .n-l > p.L-orig + .n-tx > p.L-tr, p.L-en, p.L-lit (a quiet literal line under the poetic English). */

/* ─── page frame ─── */
.n-wrap { max-width: 900px; }
html[data-layers~="scan"] .naat-one .n-wrap, html[data-n-lay="side"] .n-wrap { max-width: 1240px; }
.n-crumbs { justify-content: flex-start; margin: var(--space-3) 0 var(--space-2); }
.n-page-head { margin-bottom: var(--space-4); }
.n-sub { text-align: center; margin: calc(-1 * var(--space-2)) 0 var(--space-4); }
.n-sub a { color: var(--accent-2); }
.n-bio { max-width: 680px; margin: 0 auto var(--space-5); text-align: center; color: var(--fg-2); }
.n-bio [lang="ur"] { font-size: var(--fs-ur-small); line-height: var(--lh-ur); }
.n-bio [lang="en"] { font-size: var(--fs-small); }

/* ─── the view bar: one calm row (Primary ▾ · View · actions); View opens Show + layout options ─── */
.n-bar { margin: var(--space-2) 0 var(--space-5); padding: var(--space-2) var(--space-3); display: flex; flex-direction: column;
  gap: var(--space-2); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-l); }
html:not([data-n-js]) .n-bar, html:not([data-n-js]) .n-c-star, .n-bar[hidden] { display: none; }
.n-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.n-main { gap: var(--space-2); }
.n-acts { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; }
/* compact controls: the lead language's word first, the other after it, smaller (lang.css compact pairs; never hidden) */
:is(.n-bar, .n-dlg) :is(button, .n-opt-lab, .n-prim-lab) .bi > .sep { display: none; }
:is(.n-bar, .n-dlg, .n-rc) .ur { font-family: var(--font-ur); font-size: var(--fs-ur-small); line-height: 1.7; }
:is(.n-bar, .n-dlg) .en { font-family: var(--font-en); font-size: var(--fs-small); font-weight: 600; }
html[data-lead="en"] :is(.n-bar, .n-dlg) :is(button, .n-opt-lab, .n-prim-lab) .bi > .en { font-size: var(--fs-small); color: inherit; }
/* Primary: a label and a native select (phone-friendly; its words follow the lead language, naat.js relabel) */
.n-prim { display: inline-flex; align-items: center; gap: 6px; }
.n-prim-lab { color: var(--fg-2); }
.n-prim-sel { min-height: 36px; padding: 0 28px 0 12px; border: 1px solid var(--accent); border-radius: var(--radius-pill);
  background: var(--bg); color: var(--accent-2); font-family: var(--font-ur); font-size: var(--fs-ur-small); cursor: pointer; }
html[data-lead="en"] .n-prim-sel { font-family: var(--font-en); font-size: var(--fs-small); font-weight: 600; }
.n-prim-sel:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.n-chip, .n-act, .n-seg > button, .n-rc-b, .n-li-b { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; margin: 0; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--bg-3); color: var(--accent-2); cursor: pointer; white-space: nowrap; font: inherit; }
.n-chip:hover, .n-act:hover, .n-seg > button:hover, .n-rc-b:hover, .n-li-b:hover { border-color: var(--accent); }
:is(.n-chip, .n-act, .n-seg > button, .n-rc-b, .n-li-b, .n-c-star):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.n-seg > button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.n-ico-only { width: 36px; padding: 0; }
/* a Show toggle: a check box mark + the word; on = filled; the primary's is locked on */
.n-chip { background: var(--bg); padding-inline: 8px 12px; }
.n-chip.n-chip-primary { cursor: default; border-style: dashed; }
.n-ck { width: 16px; height: 16px; flex: none; border: 1.5px solid var(--accent); border-radius: 4px; position: relative; }
.n-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--note-bg); }
.n-chip[aria-pressed="true"] .n-ck { background: var(--accent); }
.n-chip[aria-pressed="true"] .n-ck::after { content: ""; position: absolute; inset: 1px 4px 4px; border: solid var(--on-accent);
  border-width: 0 2px 2px 0; transform: rotate(45deg); }
.n-chip.n-wobble { animation: n-wobble .35s ease; }
@keyframes n-wobble { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.n-ico { width: 18px; height: 18px; flex: none; }
.n-act[data-n-star] .n-star-on { display: none; }
.n-act[data-n-star][aria-pressed="true"] .n-star-on { display: inline; }
.n-act[data-n-star][aria-pressed="true"] .n-star-off { display: none; }
[data-n-star][aria-pressed="true"] .n-ico { fill: var(--library-gold, var(--accent)); stroke: var(--library-gold, var(--accent)); }
.n-more-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--note-bg); }
.n-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: var(--space-2) var(--space-4);
  padding-top: var(--space-2); border-top: 1px solid var(--rule); }
.n-opts[hidden] { display: none; }
.n-opt { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.n-opt-lab { min-width: 5.5em; color: var(--fg-2); }
.n-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.n-seg > button { min-height: 32px; padding: 0 10px; }
.n-status:empty { display: none; }
.n-status { margin: 0; color: var(--fg-2); }
/* phones: one row still; the labels of View / Recite / the star drop to icons (their words stay in aria-label) */
@media (max-width: 720px) {
  .n-bar { padding: var(--space-2); margin-inline: calc(-1 * var(--space-1)); }
  .n-act .bi, .n-act-star > span { display: none; }
  .n-act { padding: 0 10px; }
  .n-chip { padding-inline: 6px 10px; }
  .n-opt-lab { min-width: 0; flex-basis: 100%; }
}
@media (max-width: 380px) { .n-prim-lab { display: none; } }
@media (pointer: coarse) { .n-chip, .n-act, .n-seg > button, .n-rc-b, .n-li-b, .n-prim-sel { min-height: 44px; } .n-ico-only { width: 44px; } }

/* ─── the naat: head ─── */
.naat { margin: 0 0 var(--space-7); }
.n-head { text-align: center; margin-bottom: var(--space-4); }
.n-kind { margin: 0 0 var(--space-1); }
.n-kind a, .n-by a { color: var(--accent-2); text-decoration: none; }
.n-kind a:hover, .n-by a:hover { text-decoration: underline; }
.n-title { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 400; }
.n-t-orig { font-family: var(--font-ur); font-size: var(--fs-ur-h2); line-height: 1.9; color: var(--accent-2); font-weight: 600; }
.n-t-orig.t-ar { font-family: var(--font-ar); }
.n-t-roman { font-family: var(--font-en); font-size: var(--fs-h3); color: var(--fg); font-weight: 600; }
.n-t-en { font-family: var(--font-en); font-size: var(--fs-body); color: var(--fg-2); font-style: italic; }
html[data-lead="en"] .n-t-roman { order: -1; font-size: var(--fs-h2); color: var(--accent-2); }
html[data-lead="en"] .n-t-orig { font-size: var(--fs-ur-h3); color: var(--fg); }
/* the poet, unmistakable: a bordered badge right under the title (and on every card). The Mufti's own naats carry
   the same badge with his name (.n-poet-mufti: an accent edge), so nothing else can read as his. */
.n-poet { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 8px; margin: var(--space-2) 0 0;
  padding: 2px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-2); }
.n-poet-lab { color: var(--fg-2); }
.n-poet-lab .sep { display: none; }   /* both languages show: the lead first, the other smaller (lang.css); never hidden */
.n-poet-lab { display: inline-flex; gap: .3em; align-items: baseline; }
html[data-lead="en"] .n-poet-lab .en { order: -1; }
.n-poet-lab .ur { font-size: var(--fs-ur-caption); }
.n-poet-lab .en { font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: .04em; }
.n-poet a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.n-poet a:hover { text-decoration: underline; }
.n-poet .ur { font-size: var(--fs-ur-small); line-height: 1.8; }
.n-poet .en { font-size: var(--fs-small); }
.n-poet-mufti { border-color: var(--accent); }
.n-by { margin: var(--space-1) 0 0; }
.n-by .ur { font-size: var(--fs-ur-caption); }
.n-by .en { font-size: var(--fs-caption); color: var(--fg-2); }
html[data-n-recite] .n-poet { margin-top: var(--space-1); border: 0; background: none; opacity: .8; }
.n-draft { display: inline-flex; align-items: baseline; gap: 6px; margin: var(--space-3) 0 0; padding: 2px 12px; border-radius: var(--radius-pill);
  background: var(--warn-bg); border: 1px solid var(--border); color: var(--fg); }
.n-draft .ur { font-size: var(--fs-ur-caption); line-height: 1.8; }
.n-draft .en { font-size: var(--fs-caption); }
.n-draft-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow, var(--accent)); flex: none; align-self: center; }
html[data-lead="en"] .n-draft .en { order: -1; }
.n-draft .sep { display: none; }
@media (max-width: 720px) { .n-u { grid-template-columns: 1.4em minmax(0, 1fr) 0.6em; } }
.n-ctx { max-width: 720px; margin: 0 auto var(--space-4); }
.n-excerpt { text-align: center; }

/* ─── the units: sizes (token sets per size option; recite mode takes the next one) ─── */
/* --n-orig / --n-prim: the primary layer (script / Latin); --n-orig2: the script when another layer leads;
   --n-tr, --n-en, --n-q: roman, English, meaning when they follow */
.naat, .n-ch { --n-orig: var(--fs-ur-h3); --n-ar: var(--fs-ur-h3); --n-orig2: var(--fs-ur-body); --n-tr: var(--fs-lead); --n-prim: var(--fs-h2);
  --n-en: var(--fs-body); --n-q: var(--fs-small); --n-gap: var(--space-5); }
html[data-n-size="l"] .naat { --n-orig: var(--fs-ur-h2); --n-ar: var(--fs-ur-h2); --n-orig2: var(--fs-ur-lead); --n-tr: var(--fs-h3); --n-prim: var(--fs-h1); --n-en: var(--fs-lead); --n-q: var(--fs-body); }
html[data-n-size="xl"] .naat { --n-orig: var(--fs-ur-h1); --n-ar: var(--fs-ur-h1); --n-orig2: var(--fs-ur-h2); --n-tr: var(--fs-h2); --n-prim: var(--fs-display); --n-en: var(--fs-h3); --n-q: var(--fs-lead); }
html[data-n-space="compact"] .naat { --n-gap: var(--space-3); }
html[data-n-space="airy"] .naat { --n-gap: var(--space-7); }
.n-units { display: flex; flex-direction: column; gap: var(--n-gap); }
.n-u { display: grid; grid-template-columns: 2em minmax(0, 1fr) 2em; align-items: start; }
.n-u > .n-ls, .n-u > .n-note { grid-column: 2; }
.n-no { grid-column: 1; grid-row: 1; padding-top: .6em; color: var(--muted); font-size: var(--fs-caption); text-align: center; }
html[data-n-nums="off"] .n-no { visibility: hidden; }
.n-ls { display: flex; flex-direction: column; gap: var(--space-2); }
/* Layer rank (plan §2.2a): the primary (html[data-n-primary]) comes first and largest; the others follow in the
   default rank orig > translit > en > lit, each smaller. The markup order is fixed (p.L-orig, then .n-tx > L-tr, L-en,
   L-lit); .n-tx dissolves (display: contents) so `order` can move any line to the top. */
.n-l { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.n-tx { display: contents; }
.L { margin: 0; overflow-wrap: anywhere; }
.L-orig { order: 1; font-family: var(--font-ur); font-size: var(--n-orig); line-height: 2.05; color: var(--fg); }
.L-orig[lang="ar"], .L-orig.t-ar { font-family: var(--font-ar); font-size: var(--n-ar); line-height: 1.8; }
.L-tr { order: 2; font-family: var(--font-en); font-size: var(--n-tr); line-height: 1.45; color: var(--accent-2); font-weight: 600; }
.L-en { order: 3; font-family: var(--font-en); font-size: var(--n-en); line-height: 1.5; color: var(--fg-2); }
.L-lit { order: 4; font-family: var(--font-en); font-size: var(--n-q); line-height: 1.45; color: var(--muted); font-style: italic; }
.L-lit::before { content: "≈ "; font-style: normal; opacity: .7; }
/* another layer leads: it moves to the top at the primary size; the script steps down to follow it */
html[data-n-primary="translit"] .L-tr, html[data-n-primary="en"] .L-en, html[data-n-primary="lit"] .L-lit {
  order: 0; font-size: var(--n-prim); line-height: 1.4; color: var(--fg); font-style: normal; }
html[data-n-primary="translit"] .L-tr { font-weight: 600; }
html[data-n-primary]:not([data-n-primary="orig"]) .L-orig { font-size: var(--n-orig2); line-height: 1.95; color: var(--fg-2); }
.saw { font-family: var(--font-ar); font-size: inherit; }
/* the layer switches */
html[data-layers]:not([data-layers~="orig"]) :is(.L-orig, .n-scan-only),
html[data-layers]:not([data-layers~="translit"]) .L-tr,
html[data-layers]:not([data-layers~="en"]) .L-en,
html[data-layers]:not([data-layers~="lit"]) .L-lit,
html[data-layers]:not([data-layers~="notes"]) :is(.n-note, .n-ch-note),
html[data-layers]:not([data-layers~="scan"]) .n-scan { display: none; }
/* notes: a short gloss under the couplet */
.n-note { margin: var(--space-2) auto 0; max-width: 640px; padding: 6px 12px; border-inline-start: 3px solid var(--accent);
  background: var(--note-bg); border-radius: var(--radius-s); text-align: start; }
.n-note p { margin: 0; }
.n-note [lang="en"] { font-size: var(--fs-small); line-height: 1.5; color: var(--fg); }
.n-note [lang="ur"] { font-size: var(--fs-ur-caption); line-height: var(--lh-ur); }
.n-ctx .n-note { max-width: none; }
/* a heading inside the poem (a section of a mawlid) */
.n-u.n-hd { display: block; text-align: center; padding-top: var(--space-3); border-top: 1px solid var(--rule); }
.n-hd .L-orig { font-weight: 700; color: var(--accent-2); }
/* the refrain: once in full above the poem, then a small repeat after the couplets its rule names */
.n-ch-full { margin: 0 auto var(--n-gap, var(--space-5)); max-width: 720px; padding: var(--space-2) var(--space-4);
  border: 1.5px dashed var(--accent); border-radius: var(--radius-l); text-align: center; }
.n-ch-lab { margin: 0 0 var(--space-1); }
.n-ch-rep { display: flex; align-items: center; justify-content: center; gap: var(--space-2); opacity: .8; }
/* (html[data-n-primary] … : as specific as the primary rules above, so a repeat stays small whatever leads) */
html .n-ch-rep .L-orig, html[data-n-primary] .n-ch-rep .L-orig { font-size: var(--n-q); line-height: 2; color: var(--fg-2); }
html .n-ch-rep .L-orig[lang="ar"], html[data-n-primary] .n-ch-rep .L-orig[lang="ar"] { font-size: var(--n-en); }
html .n-ch-rep .L-tr, html[data-n-primary] .n-ch-rep .L-tr { font-size: var(--n-q); line-height: 1.45; color: var(--fg-2); font-weight: 400; font-style: italic; }
.n-ch-mark { color: var(--accent); font-size: var(--fs-small); }
html[data-n-chorus="once"] .n-ch-rep { display: none; }

/* couplet shape: two misra's side by side like a printed diwan (wide screens) */
@media (min-width: 721px) {
  html[data-n-shape="diwan"]:not([data-n-lay="side"]) .n-ls { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-6); direction: rtl; }
  html[data-n-shape="diwan"]:not([data-n-lay="side"]) .n-ls > .n-l { direction: ltr; }
}
/* layout: side by side, the script on the right and the roman + English on the left, aligned per line */
@media (min-width: 721px) {
  html[data-n-lay="side"] .n-l { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-5);
    align-items: center; direction: rtl; }
  /* explicit cells: the layer `order` (rank) must not move the script out of the right-hand column (RTL grid: column 1) */
  html[data-n-lay="side"] .n-l > .L-orig { text-align: right; order: 0; grid-column: 1; grid-row: 1; }
  html[data-n-lay="side"] .n-l > .n-tx { direction: ltr; text-align: left; display: flex; flex-direction: column; gap: 2px; order: 0; grid-column: 2; grid-row: 1; }
  html[data-n-lay="side"][data-layers]:not([data-layers~="orig"]) .n-l { display: block; text-align: center; }
  html[data-n-lay="side"] .n-ls { gap: var(--space-3); }
  html[data-n-lay="side"] .n-u { border-bottom: 1px solid var(--rule); padding-bottom: var(--space-3); }
}

/* ─── the scan: the printed block cropped from the page render; beside its couplets on wide screens ─── */
.n-scan { margin: 0 auto; max-width: 520px; width: 100%; }
.n-scan-a { display: block; border: 1px solid var(--border); border-radius: var(--radius-m); overflow: hidden; background: var(--paper, #fff); }
.n-scan-a:hover { border-color: var(--accent); }
.n-crop { display: block; position: relative; overflow: hidden; aspect-ratio: var(--ar); }
.n-crop img { position: absolute; display: block; max-width: none; width: var(--cw); height: auto; left: var(--cx); top: var(--cy); }
.n-crop.whole { aspect-ratio: auto; }
.n-crop.whole img { position: static; width: 100%; }
.n-scan figcaption { text-align: center; margin-top: 2px; }
@media (min-width: 1000px) {
  html[data-layers~="scan"] .naat .n-units { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 40%);
    grid-auto-flow: row dense; column-gap: var(--space-6); row-gap: var(--n-gap); align-items: start; }
  html[data-layers~="scan"] .naat .n-units > * { grid-column: 1; }
  html[data-layers~="scan"] .naat .n-units > .n-scan { grid-column: 2; grid-row: span var(--span, 1); position: sticky; top: var(--space-3); }
}

/* ─── source line (a citation for print too) ─── */
.n-src { margin-top: var(--space-6); padding-top: var(--space-3); border-top: 1px solid var(--rule); text-align: center; }
.n-src p { margin: 0; }
.n-src a { color: var(--accent-2); }
.n-cite { display: none; }

/* ─── home: search, My list, tiles, cards ─── */
.n-search { max-width: 680px; margin: 0 auto; }
.n-search-st { text-align: center; min-height: 1em; margin: var(--space-1) 0 var(--space-3); }
.n-results[hidden], .n-browse[hidden] { display: none; }
/* My list: one quiet line under the search (not a panel competing with the sections) */
.n-mylist { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px var(--space-3); margin: 0 0 var(--space-5); }
.n-mylist a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-2); font-weight: 600; text-decoration: none; }
.n-mylist a:hover { text-decoration: underline; }
.n-mylist .n-ico { color: var(--accent); }
.n-mylist .ur { font-size: var(--fs-ur-small); }
.n-mylist-n:empty { display: none; }
:is(.n-mylist, .n-poets, .n-tile-poet, .n-c-poet, .n-more-line, .n-note-links, .n-mnote-h, .n-by) .bi > .sep { display: none; }
/* compact pairs: the lead language first, the other after it, smaller (lang.css; the lead never hides content) */
:is(.n-mylist, .n-poets, .n-tile-poet, .n-c-poet, .n-more-line, .n-note-links, .n-mnote-h, .n-by) .bi { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: .3em; }
html:not([data-lead="en"]) :is(.n-mylist, .n-poets, .n-tile-poet, .n-c-poet, .n-more-line, .n-note-links, .n-mnote-h, .n-by) .bi > .en { font-size: var(--fs-caption); color: var(--fg-2); }
html[data-lead="en"] :is(.n-mylist, .n-poets, .n-tile-poet, .n-c-poet, .n-more-line, .n-note-links, .n-mnote-h, .n-by) .bi > .ur { font-size: var(--fs-ur-caption); color: var(--fg-2); }
.n-mc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.n-mc { display: flex; flex-direction: column; align-items: center; padding: var(--space-2); border: 1px solid var(--border);
  border-radius: var(--radius-m); background: var(--bg); text-align: center; text-decoration: none; height: 100%; box-sizing: border-box; }
a.n-mc:hover { border-color: var(--accent); }
.n-mc-t { font-family: var(--font-ur); font-size: var(--fs-ur-small); line-height: 1.9; color: var(--accent-2); }
.n-mc-r { font-size: var(--fs-caption); color: var(--fg-2); }
.n-mc-off .n-mc-t { color: var(--fg-2); }
/* occasions: the first way in (which naat for which event) */
.n-occ { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: grid; gap: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.n-occ-t { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; box-sizing: border-box;
  padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--bg-2);
  color: var(--accent-2); text-decoration: none; text-align: center; }
.n-occ-t:hover { border-color: var(--accent); }
.n-occ-t:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.n-occ-t .ur { font-size: var(--fs-ur-small); line-height: 1.9; font-weight: 600; }
.n-occ-t .en { font-size: var(--fs-caption); color: var(--fg-2); }
.n-occ-t .n, .n-poets .n { font-size: var(--fs-caption); color: var(--muted); }
html[data-lead="en"] .n-occ-t .en { order: -1; font-size: var(--fs-small); color: var(--accent-2); font-weight: 600; }
html[data-lead="en"] .n-occ-t .ur { font-size: var(--fs-ur-caption); font-weight: 400; color: var(--fg-2); }
.n-poets { text-align: center; margin: calc(-1 * var(--space-3)) 0 var(--space-6); color: var(--fg-2); }
.n-poets a { color: var(--accent-2); }
/* all naats: folded away under its heading (search, occasions and collections come first) */
.n-all { margin: 0 0 var(--space-5); }
.n-all > summary { cursor: pointer; list-style: none; }
.n-all > summary::-webkit-details-marker { display: none; }
.n-all > summary .sec-h::after { content: " ▾"; color: var(--accent); }
.n-all[open] > summary .sec-h::after { content: " ▴"; }
.n-all > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.n-pnote { max-width: 680px; margin: calc(-1 * var(--space-3)) auto var(--space-5); text-align: center; }
.n-pnote p { margin: 0; }
.n-tiles { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: grid; gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.n-tile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-3); height: 100%; box-sizing: border-box; }
.n-tile-t { font-size: var(--fs-ur-lead); line-height: 1.9; color: var(--accent-2); font-weight: 600; }
.n-tile-r { font-size: var(--fs-small); color: var(--fg); font-weight: 600; }
.n-tile-m { margin-top: var(--space-1); }
html[data-lead="en"] .n-tile-r { order: -1; font-size: var(--fs-body); color: var(--accent-2); }
html[data-lead="en"] .n-tile-t { font-size: var(--fs-ur-small); color: var(--fg-2); }
.n-cards { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: grid; gap: var(--space-2); }
.n-card { display: flex; align-items: stretch; gap: 0; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-m); }
.n-card:hover { border-color: var(--accent); }
.n-card-a { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: var(--space-2) var(--space-4); color: inherit; text-decoration: none; }
.n-card-a:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--radius-m); }
.n-c-orig { font-family: var(--font-ur); font-size: var(--fs-ur-title-s); line-height: 2; color: var(--accent-2); text-align: right; }
.n-c-orig.t-ar { font-family: var(--font-ar); font-size: var(--fs-ar-title); }
.n-c-roman { font-size: var(--fs-small); color: var(--fg); font-weight: 600; text-align: left; }
.n-c-en { font-size: var(--fs-small); color: var(--fg-2); font-style: italic; text-align: left; }
.n-c-poet { margin-top: 2px; color: var(--fg); font-weight: 600; }
.n-c-poet .ur { font-size: var(--fs-ur-caption); line-height: 1.9; }
.n-c-poet .en { font-size: var(--fs-small); }
html[data-lead="en"] .n-c-poet { direction: ltr; text-align: left; }
.n-c-poet.n-poet-mufti { color: var(--accent-2); }
.n-tile-poet .ur { font-size: var(--fs-ur-caption); }
.n-tile-poet .en { font-size: var(--fs-caption); }
.n-c-meta { margin-top: 2px; }
/* the meta line: the lead language first, the other smaller after it (lang.css compact pairs; never hidden) */
:is(.n-c-meta, .n-tile-m) .bi > .sep { display: none; }
html[data-lead="en"] .n-c-meta { direction: ltr; text-align: left; }
html[data-lead="en"] .n-c-roman { order: -1; font-size: var(--fs-body); color: var(--accent-2); }
html[data-lead="en"] .n-c-orig { font-size: var(--fs-ur-small); color: var(--fg); line-height: 1.9; }
.n-pill { display: inline-block; padding: 0 8px; border-radius: var(--radius-pill); background: var(--warn-bg); color: var(--fg); }
.n-c-star { flex: none; width: 52px; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0;
  border: 0; border-inline-start: 1px solid var(--border); background: transparent; color: var(--accent-2); cursor: pointer;
  border-start-end-radius: var(--radius-m); border-end-end-radius: var(--radius-m); }
.n-c-star:hover { background: var(--bg-3); }
.n-c-star .n-ico { width: 22px; height: 22px; }
.n-hit { margin: 2px 0 0; color: var(--fg-2); }
.n-hit [lang="ur"] { font-size: var(--fs-ur-caption); }

/* ─── My list ─── */
.n-shared { margin: 0 0 var(--space-4); }
.n-shared[hidden], .n-list-tools[hidden], .n-empty[hidden], .n-toc[hidden] { display: none; }
.n-shared p { margin: 0 0 var(--space-2); }
.n-shared-acts, .n-dlg-acts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.n-list-tools { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3); margin: 0 0 var(--space-3); }
.n-name-lab, .n-cover-lab { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; }
.n-toc { margin: 0 0 var(--space-3); padding-inline-start: 1.6em; }
.n-toc li { margin: 2px 0; }
.n-toc a { color: var(--accent-2); text-decoration: none; }
.n-toc a:hover { text-decoration: underline; }
.n-toc .n-toc-o { font-size: var(--fs-ur-small); }
.n-toc .n-toc-r { font-size: var(--fs-small); color: var(--fg-2); }
:is(.n-toc, .n-bc-toc) .n-toc-r { display: inline-block; margin-inline-start: .8em; unicode-bidi: isolate; }
.n-li { margin: 0 0 var(--space-6); padding-top: var(--space-3); border-top: 2px solid var(--rule); }
.n-li-bar { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.n-li-no { font-weight: 700; color: var(--accent); min-width: 1.5em; }
.n-li-b { min-height: 32px; padding: 0 8px; }
.n-li-b:disabled { opacity: .35; cursor: default; }
.n-li .naat { margin-bottom: 0; }
.n-li .n-title .n-t-orig { font-size: var(--fs-ur-h3); }
.n-booklet-cover { display: none; }

/* ─── dialogs (print, share) ─── */
.n-dlg { max-width: min(560px, calc(100vw - 24px)); width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-l);
  background: var(--bg); color: var(--fg); box-shadow: var(--shadow-hover); }
.n-dlg::backdrop { background: rgb(0 0 0 / .35); }
.n-dlg-in { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.n-dlg-h { margin: 0; color: var(--accent-2); }
.n-dlg-h .ur { font-size: var(--fs-ur-h3); }
.n-dlg-h .en { font-size: var(--fs-h3); }
.n-dlg .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.n-share-note:empty { display: none; }

/* ─── recite mode: chrome away, large type, the screen kept awake (naat.js: Wake Lock) ─── */
.n-rc { position: fixed; z-index: 40; bottom: max(12px, env(safe-area-inset-bottom)); inset-inline-end: 12px; display: flex;
  align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--glass); backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.n-rc[hidden] { display: none; }
.n-rc-b { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
.n-rc-note { max-width: 14em; padding-inline: 4px; }
.n-rc-note:empty { display: none; }
html[data-n-recite] :is(.qc-header, .mk-subnav, .qc-footer, .n-bar, .n-crumbs, .n-src, .n-kind, .n-by, .n-page-head,
  .n-shared, .n-list-tools, .n-toc, .n-empty, .n-li-bar, .skip-link) { display: none !important; }
html[data-n-recite] body { padding-bottom: 80px; }
html[data-n-recite] .n-wrap { max-width: 1100px; }
html[data-n-recite] .naat { --n-orig: var(--fs-ur-h2); --n-ar: var(--fs-ur-h2); --n-orig2: var(--fs-ur-lead); --n-tr: var(--fs-h3); --n-prim: var(--fs-h1); --n-en: var(--fs-lead); --n-q: var(--fs-body); }
html[data-n-recite][data-n-size="l"] .naat { --n-orig: var(--fs-ur-h1); --n-ar: var(--fs-ur-h1); --n-orig2: var(--fs-ur-h2); --n-tr: var(--fs-h2); --n-prim: var(--fs-display); --n-en: var(--fs-h3); --n-q: var(--fs-lead); }
html[data-n-recite][data-n-size="xl"] .naat { --n-orig: var(--fs-ur-display); --n-ar: var(--fs-ur-display); --n-orig2: var(--fs-ur-h1); --n-tr: var(--fs-h1); --n-prim: var(--fs-display); --n-en: var(--fs-h2); --n-q: var(--fs-h3); }
html[data-n-recite] .naat { padding-top: var(--space-4); }
/* the draft label stays in recite mode, as a quiet line */
html[data-n-recite] .n-draft { display: flex; justify-content: center; margin: var(--space-1) auto 0; padding: 0; background: none; border: 0; opacity: .75; }
html[data-n-recite] .n-u { scroll-margin-top: var(--space-4); }
/* landscape phones: two columns side by side automatically */
@media (orientation: landscape) and (max-height: 600px) {
  html[data-n-recite] .n-l { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-4); align-items: center; direction: rtl; }
  html[data-n-recite] .n-l > .L-orig { order: 0; grid-column: 1; grid-row: 1; }
  html[data-n-recite] .n-l > .n-tx { direction: ltr; display: flex; flex-direction: column; gap: 2px; order: 0; grid-column: 2; grid-row: 1; }
  html[data-n-recite][data-layers]:not([data-layers~="orig"]) .n-l { display: block; }
}

/* ─── print: black on white, the layers on screen, A4 / Letter, 1-2 columns, a couplet never split ─── */
@page { size: A4; margin: 14mm 13mm 16mm; }
@page letter { size: letter; margin: 0.55in 0.5in 0.65in; }
@media print {
  html[data-n-paper="letter"] body { page: letter; }
  :is(.qc-header, .mk-subnav, .n-bar, .n-crumbs, .n-dlg, .n-rc, .n-c-star, .n-li-bar, .n-list-tools, .n-shared, .n-empty,
    .n-search, .n-search-st, .n-mylist, .skip-link, .n-draft-dot) { display: none !important; }
  .naat-page { background: #fff; }
  .naat-page :is(.naat, .n-ch, .n-cards, .n-tiles, .n-page-head) * { color: #000 !important; background: transparent !important; box-shadow: none !important; }
  .n-wrap { max-width: none !important; padding: 0 !important; }
  .naat { margin: 0; }
  .n-head { margin-bottom: 4mm; }
  .n-t-orig { font-size: var(--fs-ur-h3); line-height: 1.7; }
  .n-t-roman { font-size: var(--fs-body); }
  .n-t-en { font-size: var(--fs-small); }
  .n-draft { border: 0.5pt solid #000; }
  .naat { --n-orig: var(--fs-ur-lead); --n-ar: var(--fs-ur-lead); --n-orig2: var(--fs-ur-small); --n-tr: var(--fs-body); --n-prim: var(--fs-lead); --n-en: var(--fs-small); --n-q: var(--fs-caption); --n-gap: 4mm; }
  html[data-n-psize="s"] .naat { --n-orig: var(--fs-ur-body); --n-ar: var(--fs-ur-body); --n-orig2: var(--fs-ur-caption); --n-tr: var(--fs-small); --n-prim: var(--fs-body); --n-en: var(--fs-caption); --n-q: var(--fs-xs); --n-gap: 3mm; }
  html[data-n-psize="l"] .naat { --n-orig: var(--fs-ur-h2); --n-ar: var(--fs-ur-h2); --n-orig2: var(--fs-ur-body); --n-tr: var(--fs-lead); --n-prim: var(--fs-h3); --n-en: var(--fs-body); --n-q: var(--fs-small); --n-gap: 6mm; }
  .L-orig { line-height: 1.85; }
  .L-tr { font-weight: 600; }
  /* English that follows prints italic (not grey); the primary layer prints upright */
  .L-en, .L-lit { font-style: italic; }
  html[data-n-primary="en"] .L-en, html[data-n-primary="lit"] .L-lit { font-style: normal; }
  .n-units, html[data-layers~="scan"] .naat .n-units { display: block !important; }
  .n-units > * { margin-bottom: calc(var(--n-gap) - .5em); }
  /* a couplet is a plain block with break-inside: avoid (Chrome ignores it on GRID items inside multicol, so the screen
     grid is dropped here); the number sits absolutely at its start */
  .n-units > :is(.n-u, .n-ch-rep, .n-ch-full) { display: block !important; break-inside: avoid; page-break-inside: avoid; }
  .n-u > .n-ls { display: block; }
  .n-u .n-l { break-inside: avoid; }
  /* Nastaliq ink rises above its line box: padding keeps a column's first couplet's strokes inside its own box (else
     Chrome paints them at the foot of the previous column) */
  .n-u { position: relative; padding-inline: 1.6em 0; padding-top: .5em; }
  .n-u > .n-no { position: absolute; inset-inline-start: 0; top: 0; }
  .n-u.n-hd { padding-inline: 0; }
  .n-ch-rep .n-ls { display: inline-block; }
  .n-u, .n-ch-rep, .n-ch-full, .n-hd, .n-scan, .n-note { break-inside: avoid; page-break-inside: avoid; }
  .n-ch-rep { break-before: avoid; }
  .n-note { border-inline-start: 1.5pt solid #000; }
  .n-ch-full { border: 1pt dashed #000; }
  .n-scan { max-width: 60%; position: static !important; }
  .n-scan-a { border: 0.5pt solid #000; }
  html[data-n-cols="2"] .n-units { columns: 2; column-gap: 9mm; column-rule: 0.5pt solid #888; }
  .n-src { margin-top: 4mm; border-top: 0.5pt solid #000; }
  .n-src a { text-decoration: none; }
  .n-cite { display: block; margin-top: 1mm; }
  /* My list as a booklet: a cover with the title and the contents, each naat on its own page */
  html[data-n-booklet] .n-page-head { display: none; }
  html[data-n-booklet] .n-booklet-cover { display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 240mm; text-align: center; break-after: page; }
  .n-bc-site .ur { font-size: var(--fs-ur-h3); }
  .n-bc-site .en { font-size: var(--fs-body); }
  .n-bc-title { font-size: var(--fs-h1); margin: 10mm 0; }
  .n-bc-toc { text-align: start; margin: 0 auto; max-width: 150mm; }
  .n-bc-toc li { margin-bottom: 2mm; }
  .n-bc-toc a, .n-bc-site { color: #000 !important; text-decoration: none; }
  .n-bc-toc .n-toc-r { display: block; margin: 0; font-style: italic; }
  .n-bc-toc .n-toc-o { font-size: var(--fs-ur-small); }
  .n-bc-toc .n-toc-r { font-size: var(--fs-small); }
  html[data-n-perpage="on"] .n-li + .n-li { break-before: page; }
  .n-li { border-top: 0; margin: 0 0 8mm; padding: 0; }
  .n-toc { display: none !important; }
}

/* ─── refinements (2026-12-04 review): compact tiles, the poet badge on two lines when narrow, the Show set,
   the phone bar in two tidy rows (what you see · what you do) ─── */
.n-occ-t { position: relative; padding: 4px 30px; min-height: 56px; }
.n-occ-t .n { position: absolute; top: 6px; inset-inline-end: 10px; }
.n-mc { padding: 4px var(--space-2); }
.n-poet { border-radius: var(--radius-l); }
.n-poet a .bi { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: .6em; }
.n-poet a .bi > .sep { display: none; }
.n-poet a .bi > * { white-space: nowrap; }
.n-show-set { display: inline-flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 720px) {
  .n-acts { flex-basis: 100%; margin-inline-start: 0; justify-content: flex-start; padding-top: 6px; border-top: 1px solid var(--rule); }
}
/* the Mufti page: Arabic collection titles in Amiri */
.n-mc-t.t-ar { font-family: var(--font-ar); font-size: var(--fs-ur-small); line-height: 1.8; }
/* the landing: one line to the collections; the small note on the Mufti and naat (links to About and his naats) */
.n-more-line { text-align: center; margin: calc(-1 * var(--space-3)) 0 var(--space-6); }
.n-more-line a { color: var(--accent-2); font-weight: 600; }
.n-more-line .n { font-size: var(--fs-caption); color: var(--muted); font-weight: 400; }
.n-mnote { max-width: 720px; margin: 0 auto var(--space-5); padding: var(--space-3) var(--space-4); text-align: center;
  border-top: 1px solid var(--rule); color: var(--fg-2); }
.n-mnote-h { margin: 0 0 var(--space-1); font-weight: 600; color: var(--accent-2); }
.n-mnote-h .ur { font-size: var(--fs-ur-small); }
.n-mnote-h .en { font-size: var(--fs-small); }
.n-mnote p { margin: 0 0 var(--space-1); }
.n-mnote [lang="ur"] { font-size: var(--fs-ur-caption); line-height: var(--lh-ur); }
.n-mnote [lang="en"] { font-size: var(--fs-small); line-height: 1.55; }
.n-note-links a { color: var(--accent-2); }
/* About: one fact per line */
.n-facts { list-style: none; max-width: 720px; margin: 0 auto var(--space-5); padding: 0; }
.n-facts li { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); text-align: center; }
.n-facts p { margin: 0; }
.n-facts [lang="ur"] { font-size: var(--fs-ur-small); line-height: var(--lh-ur); }
.n-facts [lang="en"] { font-size: var(--fs-small); color: var(--fg-2); }
.naat-mufti .n-mc-list { margin-bottom: var(--space-5); }
