/* Iqbal Repository: Indo-Persian manuscript styling. Lapis, turquoise and gold on ivory paper; eight-point stars (khatam) as ornament. */
:root {
  --paper: #f6efe0; --surface: #fffaf0; --ink: #1f2633; --muted: #5d6170; --rule: #e1d5bb;
  --lapis: #1d3f7a; --turq: #1b8a8f; --gold: #b08423; --verm: #a3432b; --soft: #ece3cf; --hl: #fff3cf;
  --f-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", serif;
  --f-text: "Literata", Georgia, serif; --f-disp: "Cormorant Garamond", "Literata", Georgia, serif;
  --f-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tile-l: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2780%27 height=%2780%27 viewBox=%270 0 80 80%27%3E%3Cg fill=%27none%27 stroke=%27%231d3f7a%27 stroke-width=%271%27%3E%3Crect x=%2722%27 y=%2722%27 width=%2736%27 height=%2736%27/%3E%3Crect x=%2722%27 y=%2722%27 width=%2736%27 height=%2736%27 transform=%27rotate%2845 40 40%29%27/%3E%3Cpath d=%27M0 0L14.5 14.5M80 0L65.5 14.5M0 80L14.5 65.5M80 80L65.5 65.5M40 0V14.5M40 80V65.5M0 40H14.5M80 40H65.5%27/%3E%3C/g%3E%3C/svg%3E");
  --tile-d: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2780%27 height=%2780%27 viewBox=%270 0 80 80%27%3E%3Cg fill=%27none%27 stroke=%27%23c99a2e%27 stroke-width=%271%27%3E%3Crect x=%2722%27 y=%2722%27 width=%2736%27 height=%2736%27/%3E%3Crect x=%2722%27 y=%2722%27 width=%2736%27 height=%2736%27 transform=%27rotate%2845 40 40%29%27/%3E%3Cpath d=%27M0 0L14.5 14.5M80 0L65.5 14.5M0 80L14.5 65.5M80 80L65.5 65.5M40 0V14.5M40 80V65.5M0 40H14.5M80 40H65.5%27/%3E%3C/g%3E%3C/svg%3E");
  --band-l: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2740%27 height=%2714%27 viewBox=%270 0 40 14%27%3E%3Crect width=%2740%27 height=%2714%27 fill=%27%231d3f7a%27/%3E%3Cpath d=%27M0 7H40%27 stroke=%27%23c99a2e%27 stroke-width=%271%27/%3E%3Cg transform=%27translate%2820 7%29%27%3E%3Crect x=%27-4.2%27 y=%27-4.2%27 width=%278.4%27 height=%278.4%27 fill=%27%23c99a2e%27/%3E%3Crect x=%27-4.2%27 y=%27-4.2%27 width=%278.4%27 height=%278.4%27 fill=%27%23c99a2e%27 transform=%27rotate%2845%29%27/%3E%3Ccircle r=%272%27 fill=%27%231d3f7a%27/%3E%3C/g%3E%3Cg fill=%27%234fb3b0%27%3E%3Ccircle cx=%274%27 cy=%277%27 r=%271.6%27/%3E%3Ccircle cx=%2736%27 cy=%277%27 r=%271.6%27/%3E%3C/g%3E%3C/svg%3E");
  --band-d: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2740%27 height=%2714%27 viewBox=%270 0 40 14%27%3E%3Crect width=%2740%27 height=%2714%27 fill=%27%230b1424%27/%3E%3Cpath d=%27M0 7H40%27 stroke=%27%23c99a2e%27 stroke-width=%271%27/%3E%3Cg transform=%27translate%2820 7%29%27%3E%3Crect x=%27-4.2%27 y=%27-4.2%27 width=%278.4%27 height=%278.4%27 fill=%27%23c99a2e%27/%3E%3Crect x=%27-4.2%27 y=%27-4.2%27 width=%278.4%27 height=%278.4%27 fill=%27%23c99a2e%27 transform=%27rotate%2845%29%27/%3E%3Ccircle r=%272%27 fill=%27%230b1424%27/%3E%3C/g%3E%3Cg fill=%27%234fb3b0%27%3E%3Ccircle cx=%274%27 cy=%277%27 r=%271.6%27/%3E%3Ccircle cx=%2736%27 cy=%277%27 r=%271.6%27/%3E%3C/g%3E%3C/svg%3E");
  --orn-l: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27240%27 height=%2728%27 viewBox=%270 0 240 28%27%3E%3Cg stroke=%27%23b08423%27 stroke-width=%271%27 fill=%27none%27%3E%3Cpath d=%27M10 14H96M144 14H230%27/%3E%3Cpath d=%27M96 14l6-5 6 5-6 5zM132 14l6-5 6 5-6 5z%27 fill=%27%231b8a8f%27 stroke=%27none%27/%3E%3C/g%3E%3Cg transform=%27translate%28120 14%29%27%3E%3Crect x=%27-9%27 y=%27-9%27 width=%2718%27 height=%2718%27 fill=%27%231d3f7a%27/%3E%3Crect x=%27-9%27 y=%27-9%27 width=%2718%27 height=%2718%27 fill=%27%231d3f7a%27 transform=%27rotate%2845%29%27/%3E%3Crect x=%27-9%27 y=%27-9%27 width=%2718%27 height=%2718%27 fill=%27none%27 stroke=%27%23b08423%27 stroke-width=%271.2%27/%3E%3Crect x=%27-9%27 y=%27-9%27 width=%2718%27 height=%2718%27 fill=%27none%27 stroke=%27%23b08423%27 stroke-width=%271.2%27 transform=%27rotate%2845%29%27/%3E%3Ccircle r=%274%27 fill=%27%23b08423%27/%3E%3C/g%3E%3C/svg%3E");
  --orn-d: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27240%27 height=%2728%27 viewBox=%270 0 240 28%27%3E%3Cg stroke=%27%23d6ad55%27 stroke-width=%271%27 fill=%27none%27%3E%3Cpath d=%27M10 14H96M144 14H230%27/%3E%3Cpath d=%27M96 14l6-5 6 5-6 5zM132 14l6-5 6 5-6 5z%27 fill=%27%234fb3b0%27 stroke=%27none%27/%3E%3C/g%3E%3Cg transform=%27translate%28120 14%29%27%3E%3Crect x=%27-9%27 y=%27-9%27 width=%2718%27 height=%2718%27 fill=%27%232a5aa8%27/%3E%3Crect x=%27-9%27 y=%27-9%27 width=%2718%27 height=%2718%27 fill=%27%232a5aa8%27 transform=%27rotate%2845%29%27/%3E%3Crect x=%27-9%27 y=%27-9%27 width=%2718%27 height=%2718%27 fill=%27none%27 stroke=%27%23d6ad55%27 stroke-width=%271.2%27/%3E%3Crect x=%27-9%27 y=%27-9%27 width=%2718%27 height=%2718%27 fill=%27none%27 stroke=%27%23d6ad55%27 stroke-width=%271.2%27 transform=%27rotate%2845%29%27/%3E%3Ccircle r=%274%27 fill=%27%23d6ad55%27/%3E%3C/g%3E%3C/svg%3E");
  --tile: var(--tile-l); --band: var(--band-l); --orn: var(--orn-l);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0e1626; --surface: #142036; --ink: #ece6d8; --muted: #a9a593; --rule: #2a3854;
  --lapis: #8fb2ea; --turq: #5cc2bd; --gold: #d6ad55; --verm: #e0896e; --soft: #1a2944; --hl: #2c3a20;
  --tile: var(--tile-d); --band: var(--band-d); --orn: var(--orn-d); color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #0e1626; --surface: #142036; --ink: #ece6d8; --muted: #a9a593; --rule: #2a3854;
  --lapis: #8fb2ea; --turq: #5cc2bd; --gold: #d6ad55; --verm: #e0896e; --soft: #1a2944; --hl: #2c3a20;
  --tile: var(--tile-d); --band: var(--band-d); --orn: var(--orn-d); color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background-color: var(--paper); color: var(--ink); font-family: var(--f-text); font-size: 17px; line-height: 1.65; }
body::before { content: ""; position: fixed; inset: 0; background-image: var(--tile); opacity: .055; pointer-events: none; z-index: -1; }
a { color: var(--lapis); }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px 56px; }

/* Header and footer */
header.site { background: var(--lapis); color: #f6efe0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) header.site { background: #0b1424; } }
.site-in { max-width: 1060px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-ur { font-family: var(--f-ur); font-size: 22px; line-height: 1.9; }
.brand-en { font-family: var(--f-disp); font-size: 22px; font-weight: 600; letter-spacing: .02em; }
header.site nav { display: flex; gap: 18px; font-family: var(--f-ui); font-size: 15px; }
header.site nav a { color: #f6efe0; text-decoration: none; opacity: .9; }
header.site nav a:hover { opacity: 1; text-decoration: underline; text-decoration-color: #c99a2e; text-underline-offset: 4px; }
.band { height: 14px; background-image: var(--band); background-repeat: repeat-x; }
footer.site { margin-top: 24px; color: var(--muted); font-family: var(--f-ui); font-size: 13px; }
footer.site .site-in { padding-block: 18px 32px; }
.draft-note { font-family: var(--f-ui); font-size: 13px; text-align: center; color: var(--muted); background: var(--soft); padding: 6px 16px; border-bottom: 1px solid var(--rule); }

/* Ornaments */
.ornament { height: 28px; margin: 28px auto; background: var(--orn) center / auto 28px no-repeat; }
.arch { position: relative; margin: 0 auto; max-width: 640px; padding: 34px 28px 10px; border: 1.5px solid var(--gold); border-bottom: 0;
  border-radius: 50% 50% 0 0 / 70px 70px 0 0; background: linear-gradient(var(--surface), transparent 85%); }
.arch::before { content: ""; position: absolute; inset: 6px 6px 0; border: 1px solid var(--gold); border-bottom: 0; border-radius: inherit; opacity: .55; pointer-events: none; }
.arch::after { content: ""; position: absolute; top: -11px; left: 50%; width: 22px; height: 22px; transform: translateX(-50%); background: url("star.svg") center / contain no-repeat; }
.title-ur { font-family: var(--f-ur); color: var(--lapis); font-size: clamp(34px, 6.5vw, 58px); line-height: 2.1; margin: 0; text-align: center; }

/* Home */
.hero { text-align: center; padding-top: 36px; }
.hero h1 { font-family: var(--f-disp); font-weight: 600; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.15; margin: 18px 0 8px; text-wrap: balance; }
.lede { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: 18px; text-wrap: pretty; }
.count { font-family: var(--f-ui); font-size: 14px; color: var(--turq); margin-top: 10px; }
.book h2 { font-family: var(--f-disp); font-size: 30px; font-weight: 600; margin: 34px 0 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.book h2 em { font-weight: 500; color: var(--muted); font-size: 22px; }
.b-ur { font-family: var(--f-ur); color: var(--lapis); font-size: 24px; line-height: 2; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.card { display: grid; gap: 2px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--turq);
  border-radius: 999px 999px 10px 10px / 46px 46px 10px 10px; padding: 22px 16px 14px; text-align: center; transition: border-color .15s, transform .15s, box-shadow .15s; }
.card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 18px rgb(29 63 122 / .12); }
.c-ur { font-family: var(--f-ur); font-size: 21px; line-height: 2.1; color: var(--lapis); }
.c-tr { font-weight: 600; }
.c-en { font-style: italic; color: var(--muted); font-size: 15px; }
.c-meta { font-family: var(--f-ui); font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.prose-card { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--gold); border-radius: 8px; padding: 16px 20px; }
.prose-card h3 { font-family: var(--f-disp); font-size: 24px; margin: 0 0 4px; }
.toc { padding-left: 0; list-style: none; margin: 10px 0 0; display: grid; gap: 4px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.rn { display: inline-block; min-width: 92px; font-family: var(--f-ui); font-size: 13px; color: var(--turq); }
.toc.big { font-size: 19px; gap: 10px; max-width: 680px; margin: 0 auto; }

/* Poem page */
.toolbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); }
.tb-in { max-width: 1060px; margin: 0 auto; padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: var(--f-ui); font-size: 14px; }
.tb-label { color: var(--muted); margin-right: 4px; }
.toolbar label { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--rule); cursor: pointer; color: var(--muted); background: var(--surface); }
.toolbar label:has(input:checked) { color: var(--ink); border-color: var(--turq); }
.toolbar input { accent-color: var(--turq); margin: 0; }
.poem-head { text-align: center; padding-top: 34px; }
.poem-head h1 { font-family: var(--f-disp); font-weight: 600; font-size: clamp(28px, 4.2vw, 40px); line-height: 1.2; margin: 14px 0 6px; text-wrap: balance; }
.poem-head h1 em { display: block; font-weight: 500; color: var(--muted); font-size: .7em; }
.kicker { font-family: var(--f-ui); color: var(--turq); letter-spacing: .08em; text-transform: uppercase; font-size: 13px; margin: 0; }
.meta { font-family: var(--f-ui); font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 0; }
.badge { color: var(--verm); border: 1px solid currentColor; border-radius: 4px; padding: 0 7px; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.badge.reviewed { color: var(--lapis); }
.listen { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; font-family: var(--f-ui); font-size: 14px; margin-top: 12px; }
.listen > span { color: var(--muted); }
.chip { text-decoration: none; border: 1px solid var(--rule); background: var(--surface); padding: 4px 12px; border-radius: 999px; }
.chip:hover { border-color: var(--gold); }

.commentary { margin-top: 26px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 4px 22px 18px; position: relative; }
.commentary::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--rule); border-radius: 7px; pointer-events: none; }
.commentary summary { cursor: pointer; font-family: var(--f-disp); font-size: 22px; font-weight: 600; color: var(--lapis); padding: 12px 0; }
.cm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px 34px; position: relative; }
.cm-grid .lead { grid-column: 1 / -1; font-size: 1.06em; }
.cm-grid h3 { font-family: var(--f-ui); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--turq); margin: 0 0 3px; }
.cm-grid p { margin: 0; }
.by { font-family: var(--f-ui); font-size: 12px; color: var(--muted); margin: 14px 0 0; }

.stanza { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 0 18px; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.stanza:last-child { border-bottom: 0; }
.num { width: 40px; height: 40px; display: grid; place-items: center; text-decoration: none; color: var(--lapis); font-family: var(--f-ui); font-size: 13px; font-weight: 600;
  background: url("star.svg") center / 40px 40px no-repeat; }
.num span { background: var(--surface); border-radius: 50%; width: 19px; height: 19px; display: grid; place-items: center; line-height: 1; }
.st-body { display: grid; gap: 22px; min-width: 0; }
.speaker { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px dashed var(--gold); padding-bottom: 4px; }
.sp-en { font-family: var(--f-ui); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--verm); }
.sp-ur { font-family: var(--f-ur); color: var(--verm); font-size: 21px; line-height: 1.9; }
.couplet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 36px; }
.couplet .ur { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-family: var(--f-ur); font-size: 23px; line-height: 2.35; text-align: right; }
.couplet .tr { grid-column: 1; margin: 0; font-style: italic; color: var(--muted); font-size: 15.5px; }
.couplet .en { grid-column: 1; margin: 0; }
.couplet.prose .ur { font-size: 19px; line-height: 2.25; text-align: justify; }
.couplet.prose .en { text-align: justify; hyphens: auto; }
body.hide-tr.hide-en .couplet.prose .ur { text-align: justify; }
.note { margin: 0; font-family: var(--f-ui); font-size: 14px; color: var(--muted); background: var(--soft); border-left: 3px solid var(--gold); border-radius: 4px; padding: 8px 12px; }
.note b { color: var(--gold); }
body.hide-ur .couplet .ur, body.hide-tr .couplet .tr, body.hide-en .couplet .en, body.hide-note .note { display: none; }
body.hide-ur .couplet .tr, body.hide-ur .couplet .en { grid-column: 1 / -1; }
body.hide-tr.hide-en .couplet .ur { grid-column: 1 / -1; grid-row: auto; text-align: center; }
.source { font-family: var(--f-ui); font-size: 13px; color: var(--muted); margin: 6px 0; }
.pn { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; font-family: var(--f-ui); font-size: 15px; }
.pn a { text-decoration: none; border: 1px solid var(--rule); background: var(--surface); padding: 6px 14px; border-radius: 999px; }

/* Book contents pages */
.book h2 a { color: inherit; text-decoration: none; }
.book h2 a:hover { text-decoration: underline; }
.more { text-align: right; font-family: var(--f-ui); font-size: 15px; margin: 10px 0 0; }
h2.part { font-family: var(--f-disp); color: var(--lapis); font-size: 26px; max-width: 760px; margin: 28px auto 8px; }
.plist { list-style: none; padding: 0; margin: 0 auto; max-width: 760px; counter-reset: pl; }
.plist li { counter-increment: pl; border-bottom: 1px solid var(--rule); }
.plist a { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) minmax(0, 1.1fr); gap: 4px 14px; align-items: baseline; padding: 10px 4px; text-decoration: none; color: var(--ink); }
.plist a::before { content: counter(pl); font-family: var(--f-ui); font-size: 13px; color: var(--muted); grid-row: span 2; }
.plist a:hover { background: var(--soft); }
.l-ur { font-family: var(--f-ur); font-size: 20px; line-height: 2.1; grid-column: 3; grid-row: 1 / span 2; text-align: right; }
.l-tr { font-style: italic; grid-column: 2; }
.l-en { color: var(--muted); font-size: 15px; grid-column: 2; }
@media (max-width: 760px) { .plist a { grid-template-columns: 2em minmax(0, 1fr); } .l-ur { grid-column: 2; grid-row: auto; } }

/* Prose: a book-like reading column. 18.5px Literata at about 66 characters a line. */
.prose .chapter { max-width: 36em; margin: 0 auto; font-size: calc(18.5px * var(--fs, 1)); line-height: 1.8; hyphens: auto; -webkit-hyphens: auto; }
.pgroup { position: relative; margin: 0 0 2.1em; }
.para { margin: 0 0 1.05em; text-wrap: pretty; }
.pgroup .para:last-child { margin-bottom: 0; }
.chapter > .pgroup:first-child .para:first-of-type::first-letter { float: left; font-family: var(--f-disp); font-size: 3.6em; line-height: .82; margin: .06em .06em 0 0; color: var(--lapis); }
.para.quote { position: relative; margin: 0 0 2.1em; padding: .9em 1.2em; border-left: 3px solid var(--gold); background: var(--soft); border-radius: 0 8px 8px 0; font-style: italic; }
.para.quote p { margin: 0; }
.pn-num { position: absolute; left: -52px; top: .35em; width: 36px; text-align: right; font-family: var(--f-ui); font-size: 12px; font-style: normal; color: var(--muted); text-decoration: none; opacity: .75; }
.pn-num:hover { opacity: 1; color: var(--gold); }
.read-note { max-width: 36em; margin: 0 auto 26px; font-family: var(--f-ui); font-size: 13px; color: var(--muted); text-align: center; }
.toc .mins { font-family: var(--f-ui); font-size: 13px; color: var(--muted); white-space: nowrap; }
.read-tools { display: flex; justify-content: flex-end; gap: 6px; max-width: 36em; margin: 0 auto 10px; padding: 6px 0; font-family: var(--f-ui); }
.read-tools button { border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.read-tools button:focus-visible { outline: 2px solid var(--turq); outline-offset: 2px; }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--turq), var(--gold)); z-index: 30; }
.about { max-width: 720px; }
.about h2 { font-family: var(--f-disp); font-size: 26px; margin: 26px 0 6px; color: var(--lapis); }

/* Word lookup popup */
.w { cursor: pointer; border-radius: 3px; }
.w:hover { background: var(--hl); }
.w.sel { background: var(--hl); box-shadow: 0 0 0 1px var(--gold); }
.gloss { position: absolute; z-index: 20; max-width: min(340px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); border: 1px solid var(--gold); border-radius: 8px;
  box-shadow: 0 10px 28px rgb(0 0 0 / .18); padding: 10px 14px 12px; font-family: var(--f-ui); font-size: 14px; line-height: 1.45; }
.gloss .g-ur { font-family: var(--f-ur); font-size: 22px; line-height: 2; color: var(--lapis); direction: rtl; }
.gloss .g-tr { font-style: italic; color: var(--muted); }
.gloss .g-lang { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--turq); margin-left: 6px; }
.gloss .g-en { margin-top: 2px; }
.gloss .g-none { color: var(--muted); }
.gloss .g-row + .g-row { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 6px; }
.tb-hint { margin-left: auto; color: var(--muted); font-size: 13px; }
.gloss .g-x { position: absolute; top: 4px; right: 6px; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 4px; }
.gloss .g-head { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 18px 4px 0; }
.gloss-hint { font-family: var(--f-ui); font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 0; }

a:focus-visible, summary:focus-visible, .toolbar label:focus-within, .w:focus-visible { outline: 2px solid var(--turq); outline-offset: 2px; }

@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .stanza { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 20px 0; }
  .couplet { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .couplet .ur { grid-column: 1; grid-row: auto; font-size: 21px; }
  .couplet .tr, .couplet .en { grid-column: 1; }
  .arch { padding: 28px 12px 6px; border-radius: 50% 50% 0 0 / 46px 46px 0 0; }
  .prose .chapter { font-size: calc(17.5px * var(--fs, 1)); line-height: 1.75; }
  .pn-num { position: static; display: block; width: auto; text-align: left; margin-bottom: 2px; top: 0; }
  .para.quote { padding: .7em .9em; }
  header.site nav { gap: 14px; font-size: 14px; }
  .tb-hint { margin-left: 0; flex-basis: 100%; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
@media print { header.site, footer.site, .toolbar, .draft-note, .pn { display: none; } body::before { display: none; } }
/* English prose: section headings, signatures, diagrams and footnotes */
.chapter h2.sec { font-family: var(--f-disp); font-size: 1.15em; color: var(--lapis); margin: 2em 0 1em; text-align: center; }
.chapter .sign { text-align: right; font-style: italic; margin: 0 0 1em; }
.chapter pre.diagram { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.45; overflow-x: auto; background: var(--soft); padding: .8em 1em; border-radius: 8px; margin: 0 0 2em; }
.chapter aside.fn { font-family: var(--f-ui); font-size: 14px; line-height: 1.6; color: var(--muted); border-left: 2px solid var(--gold); padding: .2em 0 .2em .9em; margin: -1em 0 1.6em; }
.chapter aside.fn .fn-back { font-weight: 600; color: var(--gold); text-decoration: none; margin-right: .3em; }
.chapter sup.fnref { font-family: var(--f-ui); font-size: 11px; line-height: 0; }
.chapter sup.fnref a { color: var(--gold); text-decoration: none; }
.chapter sup.fnref a::before { content: "["; } .chapter sup.fnref a::after { content: "]"; }
.lede-s { max-width: 40em; margin: 0 auto 1.4em; text-align: center; color: var(--muted); }
.chapter .ednote { font-family: var(--f-ui); font-size: 15px; font-style: italic; color: var(--muted); margin: 0 0 1.4em; }
.chapter .sep { text-align: center; color: var(--gold); margin: 1.2em 0; }
.chapter blockquote.pverse { margin: 0 0 1.8em; text-align: center; }
.chapter blockquote.pverse p { font-family: var(--f-ur, 'Noto Nastaliq Urdu', serif); font-size: 1.15em; line-height: 2.3; margin: 0; }
.chapter blockquote.pverse .vl { display: block; }
.chapter blockquote.pverse cite { display: block; font-family: var(--f-ui); font-size: 12px; font-style: normal; color: var(--muted); margin-top: .3em; }
.chapter .dateline { font-family: var(--f-ui); font-size: 14px; color: var(--muted); font-style: italic; margin: 0 0 1.6em; text-align: center; }

/* Search page (search.html, assets/search.js) */
.nav-search::before { content: "⌕ "; }
.search .sbox { margin: 18px 0 8px; }
.search #q { width: 100%; box-sizing: border-box; font: inherit; font-size: 18px; padding: 12px 14px; border: 1.5px solid var(--gold); border-radius: 10px; background: var(--surface); color: var(--ink); }
.search .sfilters { margin-top: 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); padding: 8px 14px; }
.search .sfilters summary { cursor: pointer; font-family: var(--f-ui, inherit); font-weight: 600; color: var(--muted); }
.search .sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; margin: 10px 0 4px; }
.search .sf { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); gap: 3px; }
.search .sf select { font: inherit; font-size: 15px; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink); max-width: 100%; }
.search .shelp { font-size: 14px; color: var(--muted); }
.search .shelp button, .search .smore button { font: inherit; font-size: 14px; border: 1px solid var(--rule); background: var(--surface); color: var(--lapis); border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.search .scount { color: var(--muted); font-size: 15px; }
.search .sresults { list-style: none; padding: 0; margin: 0; }
.search .sresults li { border-bottom: 1px solid var(--rule); padding: 12px 0; }
.search .sr-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; text-decoration: none; }
.search .sr-title .l-ur { font-family: "Noto Nastaliq Urdu", serif; font-size: 18px; order: 3; margin-inline-start: auto; }
.search .sr-title .l-tr { font-weight: 600; }
.search .sr-title .l-en { color: var(--muted); font-style: italic; }
.search .sr-meta { margin: 4px 0; font-size: 14px; color: var(--muted); }
.search .sr-line { font-style: italic; }
.search .sr-chips { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.search .sr-chips .chip { padding: 2px 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; font-size: 14px; justify-content: center; }
.tags .chip { padding: 2px 10px; }
header.site nav a { white-space: nowrap; }

/* Quran: reader pages and the reference balloon */
:root { --f-q: "Amiri Quran", "Amiri", "Scheherazade New", "Traditional Arabic", serif; }
a.qref { text-decoration: underline dotted var(--gold); text-underline-offset: 3px; white-space: nowrap; }
a.qref:hover { background: var(--hl); }
.q-title { font-family: var(--f-q); }
.q-bas { font-family: var(--f-q); font-size: 28px; line-height: 2.2; text-align: center; color: var(--lapis); margin: 8px 0 0; }
.ayah { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 0 18px; padding: 22px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 70px; }
.ayah:target { background: var(--hl); }
.q-ar { font-family: var(--f-q); font-size: 28px; line-height: 2.3; text-align: right; margin: 0 0 8px; color: var(--ink); }
.q-end { font-size: .8em; color: var(--gold); }
.q-ya, .q-sh { margin: 4px 0; }
.q-sh { color: var(--muted); }
.q-lbl { font-family: var(--f-ui); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--turq); margin-right: 6px; }
.q-cited { font-family: var(--f-ui); font-size: 14px; margin-top: 8px; }
.q-cited summary { cursor: pointer; color: var(--gold); }
.q-cited ul { margin: 6px 0 0; padding-left: 18px; }
body.hide-qar .q-ar, body.hide-qya .q-ya, body.hide-qsh .q-sh, body.hide-qhi .q-hi { display: none; }
/* The Hindi translation of the Quran is shown on Hindi pages only, in place of the English ones. */
.q-hi { margin: 4px 0; }
html:not([lang="hi"]) .q-hi, html:not([lang="hi"]) .tb-hi { display: none; }
html[lang="hi"] .quran .q-ya, html[lang="hi"] .quran .q-sh, html[lang="hi"] .toolbar label:has([data-layer="qya"]), html[lang="hi"] .toolbar label:has([data-layer="qsh"]) { display: none; }
.qpop { max-width: min(460px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow: auto; padding: 12px 16px; }
.qpop .qp-head { font-family: var(--f-ui); font-size: 13px; margin: 0 22px 6px 0; color: var(--muted); }
.qpop .qp-ref { font-weight: 600; color: var(--lapis); }
.qpop .qp-ar, .qpop .qp-bas { font-family: var(--f-q); font-size: 24px; line-height: 2.1; text-align: right; margin: 4px 0; }
.qpop .qp-bas { text-align: center; color: var(--lapis); }
.qpop .qp-en { margin: 2px 0; font-size: 15px; line-height: 1.5; }
.qpop .qp-sh { color: var(--muted); }
.qpop .qp-ayah + .qp-ayah { border-top: 1px solid var(--rule); margin-top: 8px; padding-top: 6px; }
.qpop .qp-more { font-family: var(--f-ui); font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.qpop .qp-foot { display: flex; justify-content: space-between; gap: 12px; font-family: var(--f-ui); font-size: 12px; color: var(--muted); border-top: 1px solid var(--rule); margin: 10px 0 0; padding-top: 6px; }
.qpop.qp-sheet { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; max-width: none; max-height: 60vh; box-shadow: 0 -6px 24px rgba(0,0,0,.25); }
@media (max-width: 640px) { .ayah { grid-template-columns: minmax(0, 1fr); gap: 6px; } .q-ar { font-size: 24px; } }
/* Shia reading notes on Quran ayat */
.q-sn { margin: 10px 0 4px; padding: 8px 12px; border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 7%, transparent); border-radius: 0 6px 6px 0; font-size: .95em; }
.q-sn p { margin: 0 0 6px; }
.q-sn .sn-head { font-weight: 600; }
.q-sn .sn-rng { font-weight: normal; color: var(--muted); }
.q-sn .sn-src, .qpop .qp-sn .sn-src { font-family: var(--f-ui); font-size: 13px; color: var(--muted); }
.q-sn .sn-src summary, .qpop .qp-sn summary { cursor: pointer; color: var(--gold); }
.q-sn .sn-src ul, .qpop .qp-sn ul { margin: 4px 0 0; padding-left: 18px; }
body.hide-qsn .q-sn { display: none; }
.qpop .qp-sn { margin: 4px 0 0; font-size: 14px; }
.qpop .qp-sn p { margin: 4px 0; }
/* Quran transliteration */
.q-tl, .qpop .qp-tl { font-style: italic; color: var(--muted); margin: 4px 0 8px; }
.qpop .qp-tl { font-size: 14px; }
.q-bas-tl, .qpop .qp-bas-tl { text-align: center; }
body.hide-qtl .q-tl { display: none; }

/* Mir Anis first-line index (anis/first-lines.html) */
.f-jump { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; font-family: var(--f-ur); font-size: 20px; margin: 18px auto; max-width: 760px; }
.f-jump a { text-decoration: none; }
.flist { list-style: none; padding: 0; margin: 0 auto; max-width: 760px; }
.flist > li { border-bottom: 1px solid var(--rule); }
.flist summary { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) minmax(0, 1.1fr); gap: 4px 14px; align-items: baseline; padding: 10px 4px; cursor: pointer; list-style: none; }
.flist summary::-webkit-details-marker { display: none; }
.flist summary:hover { background: var(--soft); }
.f-n { font-family: var(--f-ui); font-size: 13px; color: var(--muted); grid-row: span 2; }
.f-read { font-family: var(--f-ui); font-size: 14px; margin-inline-start: 8px; }
.f-eds { margin: 0 0 12px 2.8em; padding: 0; list-style: none; font-size: 15px; }
.f-eds li { padding: 2px 0; }
.f-b, .f-eds .f-b { color: var(--muted); font-size: 13px; margin-inline-start: 6px; }
.f-key { padding-left: 1.2em; font-size: 15px; }
.f-key li { margin: 6px 0; }
.f-key .l-ur { font-family: var(--f-ur); font-size: 18px; }
@media (max-width: 760px) { .flist summary { grid-template-columns: 2em minmax(0, 1fr); } .flist .l-ur { grid-column: 2; grid-row: auto; } .f-eds { margin-left: 2.4em; } }

/* Author pages (tools/authors.py) */
.author .epithet { font-style: italic; text-align: center; }
.author .table-wrap { overflow-x: auto; }
.author table.works { width: 100%; border-collapse: collapse; font-size: .95em; }
.author table.works th, .author table.works td { text-align: start; padding: .4rem .5rem; border-bottom: 1px solid rgba(0,0,0,.1); vertical-align: top; }
.author dl.ideas dt { font-weight: 600; margin-top: .75rem; }
.author dl.ideas dd { margin: .25rem 0 0; }
.author figure.famous { margin: 1.25rem 0; padding: 1rem; border-inline-start: 3px solid rgba(180,140,40,.6); }
.author figure.famous figcaption { font-size: .9em; margin-top: .5rem; }

/* Report an error (app.js) */
.report-btn { display: block; margin: .5rem 0 0 auto; padding: .15rem .5rem; font: inherit; font-size: .8em; color: inherit; background: none; border: 0; opacity: .55; cursor: pointer; text-decoration: underline dotted; }
.report-btn:hover, .report-btn:focus-visible { opacity: 1; }
dialog.report { max-width: min(32rem, calc(100vw - 2rem)); width: 100%; border: 1px solid var(--rule); border-radius: 10px; padding: 1.25rem; background: var(--surface); color: var(--ink); }
dialog.report::backdrop { background: rgba(0,0,0,.4); }
dialog.report h2 { margin: 0 0 .25rem; }
dialog.report .report-where { margin: 0 0 1rem; font-size: .9em; opacity: .75; }
dialog.report label { display: block; margin: 0 0 .85rem; font-weight: 600; }
dialog.report select, dialog.report textarea, dialog.report input { display: block; width: 100%; box-sizing: border-box; margin-top: .3rem; padding: .45rem; font: inherit; font-weight: 400; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); }
dialog.report .report-status { min-height: 1.4em; font-weight: 600; }
dialog.report .report-actions { display: flex; gap: .5rem; justify-content: flex-end; }
dialog.report .report-actions button { padding: .5rem 1rem; font: inherit; border-radius: 6px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; }
dialog.report .report-actions .report-send { background: var(--lapis); color: #fff; border-color: var(--lapis); }
dialog.report, .report-btn { font-family: var(--f-ui); }
@media print { .report-btn { display: none; } }

/* Master set hearts (app.js) */
.seg-tools { display: flex; justify-content: flex-end; align-items: center; gap: .25rem; margin-top: .5rem; }
.seg-tools .report-btn { margin: 0; }
button.heart { font: inherit; font-size: 1.15rem; line-height: 1; padding: .2rem .45rem; color: var(--verm); background: none; border: 0; cursor: pointer; }
h1 button.heart { font-size: 1.4rem; vertical-align: middle; }
button.heart:focus-visible { outline: 2px solid var(--lapis); border-radius: 4px; }
@media print { button.heart { display: none; } }

/* Select for presentation (app.js) */
.member-links { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: center; align-items: center; }
.member-links .select-btn { font: inherit; font-family: var(--f-ui); font-size: .9em; padding: .25rem .7rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
label.pick { grid-column: 1 / -1; justify-self: start; display: inline-flex; gap: .35rem; align-items: center; font-family: var(--f-ui); font-size: .85em; margin: 0 0 .4rem; cursor: pointer; }
label.pick input { width: 1.1rem; height: 1.1rem; }
.select-bar { position: fixed; inset: auto 0 0 0; z-index: 50; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--rule); box-shadow: 0 -4px 16px rgba(0,0,0,.12); font-family: var(--f-ui); font-size: .9em; }
.select-bar select, .select-bar button { font: inherit; padding: .35rem .6rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); max-width: 14rem; }
.select-bar .add { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.select-bar .msg { flex-basis: 100%; text-align: center; min-height: 1.2em; }
body.selecting { padding-bottom: 7rem; }

/* Reviewed Hindi translation and bhavarth (doc 16 H4): only on /hi/ pages, where the Worker sets <html lang="hi">. */
/* A language's translation layer, added by the Worker on /<lang>/ pages (doc 16 §5) */
.lang-layer{line-height:1.8;margin:.4rem 0}
.lang-layer .lt-b{font-size:.95em;color:var(--muted)}
.couplet .tr.lt-s{font-style:normal}
/* The translation and bhavarth sit under the reading, in its column (half the width, like .couplet). */
.lang-layer{max-width:calc(50% - 18px)}
@media (max-width: 760px){.lang-layer{max-width:none}}
.gloss .g-script{font-style:normal;color:inherit}
.stanza.has-layer .en{display:none}
body.hide-lt .lang-layer{display:none}
