/* Layout concept: the verse opens the page, then the Silsila unrolled as a lineage path (tree),
   then plain indexes for books, audio and visiting. */
:root {
  --night: #0a111c;
  --night-2: #0f1929;
  --night-3: #162235;
  --line: #243449;
  --moon: #ece6d6;
  --moon-dim: #a3afbf;
  --lamp: #f0b45a;
  --lamp-deep: #c98a2e;
  --sage: #86bfae;
  --f-display: "Brygada 1918", Georgia, "Times New Roman", serif;
  --f-body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-quran: "Amiri Quran", "Scheherazade New", "Noto Naskh Arabic", serif;
  --f-urdu: "Gulzar", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--night);
  color: var(--moon);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  padding-block: 0;
  overflow-x: hidden;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--lamp); color: var(--night); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; text-wrap: balance; margin: 0; line-height: 1.08; letter-spacing: -0.015em; }
p { margin: 0; }
.wrap { max-width: 1240px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.ur { font-family: var(--f-urdu); direction: rtl; line-height: 2.1; }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--night); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 1.5rem; padding-block: 0.7rem; flex-wrap: wrap; }
.mark { font-family: var(--f-display); font-weight: 700; font-size: 1.45rem; text-decoration: none; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 0.6rem; }
.mark small { font-family: var(--f-urdu); font-size: 0.85rem; color: var(--sage); font-weight: 400; }
.top nav { display: flex; gap: 0.25rem 1.4rem; flex-wrap: wrap; margin-left: auto; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--moon-dim); padding: 0.25rem 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.top nav a:hover { color: var(--moon); border-bottom-color: var(--lamp); }

/* hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); max-width: 52rem; text-align: center; padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.7rem); font-weight: 600; }
.hero h1 em { font-style: normal; font-weight: inherit; }
.hero .lede { margin: 1.4rem auto 0; max-width: 34rem; color: var(--moon-dim); font-size: 1.15rem; }
.cta { display: flex; flex-wrap: wrap; gap: 0.8rem 1.1rem; margin-top: 2rem; align-items: center; justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 0.6rem; background: var(--lamp); color: var(--night); font-weight: 600; text-decoration: none; padding: 0.85rem 1.4rem; border-radius: 6px; transition: background .2s; }
.btn:hover { background: #ffc875; }
.btn[hidden] { display: none; }
.btn.install { border-color: var(--lamp); padding-left: 0.6rem; }
.btn.install .dl { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--lamp); color: var(--night); transition: transform .25s; }
.btn.install .dl svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.install .dl .ar { transition: transform .25s; }
.btn.install:hover .dl .ar { transform: translateY(2px); }
.btn.ghost { background: transparent; color: var(--moon); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--lamp); background: transparent; }

/* start path */
.start .wrap { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: clamp(1.5rem, 4vw, 4rem); padding-block: clamp(3rem, 6vw, 5rem); }
.start h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.start .sub { color: var(--moon-dim); margin-top: 0.9rem; max-width: 22rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 3.4rem 1fr auto; gap: 1rem; align-items: baseline; padding: 1.35rem 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps .n { font-family: var(--f-display); font-size: 1.7rem; color: var(--moon-dim); }
.steps h3 { font-size: 1.45rem; }
.steps p { color: var(--moon-dim); margin-top: 0.3rem; font-size: 1rem; max-width: 34rem; }
.steps a.go { color: var(--lamp); text-decoration: none; font-weight: 600; white-space: nowrap; }
.steps a.go:hover { text-decoration: underline; }

/* lineage tree */
.tree { background: var(--night-2); border-block: 1px solid var(--line); }
.tree .wrap { padding-block: clamp(3.5rem, 7vw, 6rem); }
.tree .head { max-width: 40rem; margin-inline: auto; text-align: center; }
.tree h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.tree .head p { margin-top: 1rem; color: var(--moon-dim); }
.path { list-style: none; margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0; position: relative; --p: 0%; }
.path::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--line); transform: translateX(-50%); }
.path::after { content: ""; position: absolute; left: 50%; top: 0; height: var(--p); width: 2px; background: var(--lamp); transform: translateX(-50%); }
.link { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding-block: 1.1rem; scroll-margin-top: 6rem; }
.link .body { grid-column: 2; text-align: left; padding-left: 3.2rem; }
.link:nth-child(even) .body { grid-column: 1; text-align: right; padding-left: 0; padding-right: 3.2rem; }
.link .ur { direction: rtl; font-size: clamp(1.45rem, 2.4vw, 2rem); text-align: left; display: block; color: var(--moon); }
.link:nth-child(even) .ur { text-align: right; }
.link .en { color: var(--moon-dim); font-size: 1rem; }
.link::before { content: ""; position: absolute; left: 50%; top: 2.1rem; width: 14px; height: 14px; border-radius: 50%; background: var(--night-3); border: 2px solid var(--line); transform: translateX(-50%); transition: background .4s, border-color .4s; z-index: 1; }
.link.lit::before { background: var(--lamp); border-color: var(--lamp); }
.link.first .ur { font-size: clamp(1.9rem, 3.2vw, 2.7rem); color: var(--lamp); }
.link.first::before { width: 20px; height: 20px; top: 2.3rem; }
.note { max-width: 40rem; margin: 2.5rem auto 0; text-align: center; color: var(--moon-dim); font-size: 0.9rem; }

/* library */
.library .wrap { padding-block: clamp(3.5rem, 7vw, 6rem); }
.library h2, .audio h2, .visit h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
.index { margin-top: 2.2rem; }
.row { display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr); gap: 1rem 2rem; padding-block: 1.6rem; border-top: 1px solid var(--line); align-items: baseline; }
.row:last-child { border-bottom: 1px solid var(--line); }
.row h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.row h3 .ur { font-size: 1.1rem; color: var(--sage); font-weight: 400; font-family: var(--f-urdu); }
.row ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; }
.row li a { text-decoration: none; background-image: linear-gradient(var(--lamp), var(--lamp)); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; padding-bottom: 2px; transition: background-size .3s cubic-bezier(.2,.8,.2,1), color .2s; }
.row li a:hover { background-size: 100% 1px; color: #fff; }
.ri { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.17em; margin-inline-end: 0.4em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wt small .ri { color: var(--lamp); }
.row li > span { color: var(--moon-dim); font-size: 0.9rem; margin-inline-start: 0.35rem; }
html[data-lang="ur"] .row li > span { margin-inline-start: 0.6rem; }
.row li a .lu { line-height: 2.4 !important; padding-inline: 0.15em; }
.row li a .lu::before, .row li a .lu::after { content: "\00a0"; } /* a space at each end of the word keeps its first and last letter from being cut */

/* audio */
.audio { background: var(--night-2); border-block: 1px solid var(--line); }
.audio .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 5rem); padding-block: clamp(3.5rem, 7vw, 6rem); align-items: start; }
.audio .sub { color: var(--moon-dim); margin-top: 1rem; max-width: 30rem; }
.years { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.8rem; }
.years button { font: inherit; font-size: 0.95rem; font-variant-numeric: tabular-nums; background: transparent; color: var(--moon-dim); border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem 0.75rem; cursor: pointer; transition: all .2s; }
.years button:hover { color: var(--moon); border-color: var(--moon-dim); }
.years button[aria-pressed="true"] { background: var(--lamp); border-color: var(--lamp); color: var(--night); font-weight: 600; }
.coll { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; color: var(--moon-dim); font-size: 0.98rem; }
.coll a { text-decoration: none; color: var(--moon); border-bottom: 1px solid var(--line); }
.coll a:hover { border-color: var(--lamp); }
.player { background: var(--night-3); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1.1rem, 2.4vw, 1.8rem); }
.player .now { display: flex; gap: 1rem; align-items: center; }
.play { flex: none; width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 0; background: var(--lamp); color: var(--night); cursor: pointer; display: grid; place-items: center; transition: transform .2s; }
.play:hover { transform: scale(1.06); }
.play svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.player .meta { min-width: 0; }
.player .t { font-family: var(--f-display); font-size: 1.3rem; line-height: 1.2; }
.player .s { color: var(--moon-dim); font-size: 0.9rem; }
.bar { height: 4px; background: var(--line); border-radius: 4px; margin-top: 1.2rem; overflow: hidden; }
.bar i { display: block; height: 100%; width: 12%; background: var(--lamp); border-radius: 4px; }
.tracks { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.tracks li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: 0.6rem; padding: 0.7rem 0; border-top: 1px solid var(--line); align-items: baseline; font-size: 0.98rem; cursor: pointer; }
.tracks li:hover { color: #fff; }
.tracks li[aria-current="true"] { color: var(--lamp); }
.tracks .d { color: var(--moon-dim); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.tracks .i { color: var(--moon-dim); font-variant-numeric: tabular-nums; }
.pv { margin-top: 0.8rem; color: var(--moon-dim); font-size: 0.82rem; }

/* visit */
.visit .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem); padding-block: clamp(3.5rem, 7vw, 6rem); }
.visit .sub { color: var(--moon-dim); margin-top: 1rem; max-width: 28rem; }
.app { margin-top: 2rem; display: inline-flex; align-items: center; gap: 0.8rem; border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1.2rem; text-decoration: none; transition: border-color .2s; }
.app:hover { border-color: var(--lamp); }
.app b { display: block; font-weight: 600; }
.app small { color: var(--moon-dim); }
.app svg { width: 1.8rem; height: 1.8rem; stroke: var(--lamp); fill: none; stroke-width: 1.6; }
.list a { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 1rem; padding: 1.15rem 0; border-top: 1px solid var(--line); text-decoration: none;  }
.list a:last-child { border-bottom: 1px solid var(--line); }
.list b { display: inline-block; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.list a:hover b { transform: translateX(0.4rem); }
.list b { font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; }
.list small { display: block; color: var(--moon-dim); font-size: 0.92rem; }
.list .tag { color: var(--lamp); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

footer { border-top: 1px solid var(--line); color: var(--moon-dim); font-size: 0.9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; justify-content: space-between; padding-block: 2rem; }
footer a { text-decoration: none; }
footer a:hover { color: var(--moon); text-decoration: underline; }

/* search */
.search { position: relative; flex: 0 1 19rem; min-width: 0; }
.search svg.mag { position: absolute; left: 0.8rem; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); stroke: var(--moon-dim); fill: none; stroke-width: 1.8; pointer-events: none; }
.search input { width: 100%; font: inherit; font-size: 0.95rem; color: var(--moon); background: var(--night-2); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 2.6rem 0.6rem 2.4rem; transition: border-color .2s, background .2s; }
.search input::placeholder { color: var(--moon-dim); }
.search input:hover { border-color: var(--moon-dim); }
.search input:focus { outline: none; border-color: var(--lamp); background: var(--night-3); }
.search kbd { position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%); font: inherit; font-size: 0.78rem; color: var(--moon-dim); border: 1px solid var(--line); border-radius: 4px; padding: 0 0.4rem; pointer-events: none; }
.results { position: absolute; right: 0; top: calc(100% + 0.5rem); width: min(36rem, calc(100vw - 32px)); background: var(--night-3); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; z-index: 40; }
.results[hidden] { display: none; }
.chips { display: flex; gap: 0.4rem; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; font: inherit; font-size: 0.85rem; background: transparent; color: var(--moon-dim); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.8rem; cursor: pointer; transition: all .2s; }
.chips button:hover { color: var(--moon); }
.chips button[aria-pressed="true"] { background: var(--lamp); border-color: var(--lamp); color: var(--night); font-weight: 600; }
.hits { list-style: none; margin: 0; padding: 0.35rem; max-height: min(60vh, 26rem); overflow-y: auto; }
.hits a { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 0.8rem; align-items: baseline; padding: 0.65rem 0.7rem; border-radius: 8px; text-decoration: none; }
.hits a:hover, .hits a[aria-selected="true"] { background: var(--night-2); }
.hits .k { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--lamp); }
.hits .tt { font-family: var(--f-display); font-size: 1.1rem; line-height: 1.25; overflow-wrap: anywhere; }
.hits .ss { display: block; font-family: var(--f-body); font-size: 0.85rem; color: var(--moon-dim); }
.hits mark { background: rgba(240,180,90,.25); color: var(--moon); border-radius: 2px; }
.hits .head { padding: 0.5rem 0.7rem 0.2rem; font-size: 0.8rem; color: var(--moon-dim); }
.hits .none { padding: 1.2rem 0.9rem; color: var(--moon-dim); }
.hits .none b { color: var(--moon); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 1080px) {
  .top .wrap { gap: 0.8rem 1.2rem; }
  .top nav { gap: 0.25rem 1rem; }
}
@media (max-width: 880px) {
  .top .wrap { padding-block: 0.6rem; }
  .mark { order: 1; }
  .top nav { order: 2; margin-left: auto; }
  .search { order: 3; flex: 1 1 100%; }
  .search kbd { display: none; }
  .results { left: 0; right: 0; width: auto; }
  .hero .wrap, .start .wrap, .audio .wrap, .visit .wrap { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
  .steps li { grid-template-columns: 2.6rem minmax(0, 1fr); }
  .steps a.go { grid-column: 2; }
  .path::before, .path::after { left: 8px; }
  .link { grid-template-columns: 1fr; }
  .link .body, .link:nth-child(even) .body { grid-column: 1; text-align: left; padding-left: 2.4rem; padding-right: 0; }
  .link .ur, .link:nth-child(even) .ur { text-align: left; }
  .link::before { left: 8px; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .mark small { font-size: 0.8rem; }
  .hero .wrap { padding-block: 2rem 2.5rem; }
  .hero .lede { font-size: 1.05rem; }
  .cta .btn { flex: 1 1 100%; justify-content: center; }
  .steps li { padding: 1.1rem 0; }
  .row { padding-block: 1.3rem; }
  .hits a { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .player { padding: 1rem; }
  .tracks li { grid-template-columns: 1.4rem minmax(0, 1fr); }
  .tracks .d { display: none; }
  .list a { grid-template-columns: minmax(0, 1fr) auto; }
  footer .wrap { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* breadcrumbs and shared page bits for internal pages */
.crumbs { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; padding: 1.2rem 0 0; margin: 0; font-size: 0.92rem; color: var(--moon-dim); list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 0.6rem; color: var(--line); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--moon); text-decoration: underline; }
.crumbs [aria-current] { color: var(--moon); }
footer .social { display: inline-flex; gap: 1.2rem; }
.years a.yr { font-size: 0.95rem; font-variant-numeric: tabular-nums; color: var(--moon-dim); border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem 0.75rem; text-decoration: none; transition: all .2s; }
.years a.yr:hover { color: var(--night); background: var(--lamp); border-color: var(--lamp); }
.tracks li:focus-visible { outline: 2px solid var(--lamp); outline-offset: -2px; }

/* Nastaliq needs tall line boxes: keep Urdu and English apart */
.link .ur { line-height: 2.7; padding-block: 0.3rem 0.15rem; }
.link .en { display: block; margin-top: 0.15rem; }
.link.first .ur { line-height: 3.2; padding-top: 0.8rem; }

/* small "رح" after the names of the teachers who have passed */
.ur sup.rh { font-family: var(--f-urdu); font-size: 0.62em; line-height: 0; vertical-align: super; color: var(--lamp); margin-inline-start: 0.55em; padding-inline: 0.1em; font-weight: 400; }

/* honorific after an English name, as on the old site */
.en .hon { font-size: 0.85em; opacity: 0.8; font-style: italic; }

/* the Prophet's name in the headline: same weight and colour as the rest, no ornament */
.hero h1 em { color: inherit; }

/* link under the home player to the full collection */
.player .more { display: flex; justify-content: space-between; align-items: center; margin-top: 0.4rem; padding: 0.9rem 0 0.2rem; border-top: 1px solid var(--line); color: var(--lamp); font-weight: 600; text-decoration: none; min-height: 2.75rem; }
.player .more:hover { text-decoration: underline; }

/* header controls that only exist on phones */
.sbtn { display: none; }
.top nav svg { display: none; }
.top nav .short { display: none; }
.top nav a.only-m { display: none; }

/* phones: slim top bar (name + search), the four sections in a tab bar at the bottom */
@media (max-width: 600px) {
  :root { --tabh: calc(3.7rem + env(safe-area-inset-bottom, 0px)); }
  body { padding-bottom: var(--tabh); }
  .top .wrap { flex-wrap: wrap; gap: 0.5rem; padding-block: 0.5rem; }
  .mark { order: 1; font-size: 1.3rem; }
  .mark small { display: none; } /* keeps the sticky bar to one row on a phone */
  .sbtn { order: 2; display: inline-grid; place-items: center; margin-left: auto; width: 2.75rem; height: 2.75rem; background: transparent; color: var(--moon); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
  .sbtn svg { width: 1.15rem; height: 1.15rem; stroke: currentColor; fill: none; stroke-width: 1.8; }
  .top.searching .sbtn { border-color: var(--lamp); color: var(--lamp); }
  .search { order: 3; display: none; flex: 1 1 100%; }
  .top.searching .search { display: block; }
  .search input { font-size: 1rem; min-height: 2.75rem; }
  .top nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; background: var(--night-2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .top nav a { display: grid; justify-items: center; align-content: center; gap: 0.2rem; min-height: 3.7rem; padding: 0.4rem 0.1rem; border: 0; font-size: 0.74rem; color: var(--moon-dim); }
  .top nav a:hover { border: 0; }
  .top nav a[aria-current="page"] { color: var(--lamp); }
  .top nav svg { display: block; width: 1.3rem; height: 1.3rem; stroke: currentColor; fill: none; stroke-width: 1.6; }
  .top nav a.only-m { display: grid; }
  .top nav a.only-d { display: none; }
  .top nav .full { display: none; }
  .top nav .short { display: inline; }
  footer { padding-bottom: 0.5rem; }
}

/* offline page */
.off { max-width: 36rem; padding-block: clamp(3rem, 10vw, 6rem); }
.off h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.off p { color: var(--moon-dim); margin-top: 1rem; }
.off .cta .btn { border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.off .cta .btn.ghost { border: 1px solid var(--line); }

/* the verse that opens the home page */
.hero .verse { margin: 0; text-align: center; }
.hero h1[lang="ar"] { font-family: var(--f-quran); font-weight: 400; direction: rtl; font-size: clamp(2rem, 4.3vw, 3.5rem); line-height: 2.2; letter-spacing: 0; text-wrap: balance; color: var(--moon); }
.hero .verse-en { margin: 1rem auto 0; max-width: 31rem; color: var(--moon-dim); font-size: 1.1rem; }
.hero .verse-ref { margin-top: 0.7rem; color: var(--lamp); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.hero .verse + .lede { margin-top: 2rem; }

/* how to add the site to the home screen on iPhone and iPad */
.ios-help { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(var(--tabh, 0px) + 0.8rem); z-index: 70; max-width: 26rem; margin-inline: auto; background: var(--night-3); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; }
.ios-help > b { font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; }
.ios-help ol { margin: 0.7rem 0 1rem; padding-left: 1.2rem; color: var(--moon-dim); display: grid; gap: 0.4rem; }
.ios-help ol b { color: var(--moon); font-weight: 600; }
.ios-help .shr { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--moon); font-weight: 600; }
.ios-help .shr svg { width: 1.1rem; height: 1.1rem; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ios-help .btn { min-height: 2.75rem; font: inherit; font-weight: 600; cursor: pointer; }

.ios-help p { margin: -0.4rem 0 1rem; color: var(--moon-dim); font-size: 0.92rem; }
.ios-help p b { color: var(--moon); font-weight: 600; }

/* theme toggle: the moon offers dark while the page is light, the sun offers light while it is dark */
.tbtn { flex: none; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; background: transparent; color: var(--moon-dim); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: color .2s, border-color .2s; }
.tbtn:hover { color: var(--moon); border-color: var(--lamp); }
.tbtn svg { width: 1.15rem; height: 1.15rem; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tbtn .i-sun { display: block; }
.tbtn .i-moon { display: none; }
[data-theme="light"] .tbtn .i-sun { display: none; }
[data-theme="light"] .tbtn .i-moon { display: block; }
@media (max-width: 880px) { .tbtn { order: 2; } }
@media (max-width: 600px) { .tbtn { width: 2.75rem; height: 2.75rem; } }

/* year picker on the home page: a dropdown that opens that year's recordings */
.yearpick { display: flex; gap: 0.6rem; margin-top: 1.8rem; max-width: 18rem; }
.yearpick select { flex: 1; min-width: 0; font: inherit; font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--moon); background-color: var(--night-3); border: 1px solid var(--line); border-radius: 8px; min-height: 2.75rem; padding: 0.5rem 2.4rem 0.5rem 0.9rem; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 1rem; transition: border-color .2s; }
.yearpick select:hover, .yearpick select:focus-visible { border-color: var(--lamp); }

/* section heading with a button on the right (home, Read and recite) */
.sechead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 2rem; }

/* programme not published yet: same row as a link, but muted and not clickable */
.list .soon { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 1rem; padding: 1.15rem 0; border-top: 1px solid var(--line); }
.list .soon b { font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; color: var(--moon-dim); }
.list .soon small { display: block; color: var(--moon-dim); font-size: 0.92rem; }
.list .soon .tag { color: var(--moon-dim); }

/* next gathering line in the home page programme list */
.list a small.nextline { display: block; width: fit-content; max-width: 100%; margin-top: 0.55rem; padding: 0.3rem 0.7rem; border-radius: 8px; background: color-mix(in srgb, var(--lamp) 12%, transparent); color: var(--moon); font-weight: 500; }
.list a small.nextline strong { color: var(--lamp); font-weight: 700; }

/* next gathering, right under the verse: one solid band, its label is the row's heading */
.nextband { padding-block: 0.4rem 0; }
.nextband .wrap { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; gap: 0.6rem 2rem; align-items: center; background: var(--night-3); border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem clamp(1.1rem, 3vw, 2.2rem); max-width: min(70rem, calc(100% - 2rem)); }
.nextband h2 { font-size: 1.3rem; font-weight: 500; color: var(--lamp); }
.nextband .nb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 2.2rem; }
.nextband .nd { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.2; }
.nextband .nc { margin: 0; font-size: 1.25rem; font-weight: 600; }
[data-theme="light"] .nextband .wrap { background: var(--band); border-color: transparent; color: var(--band-ink); }
[data-theme="light"] .nextband h2 { color: var(--band-accent); }
[data-theme="light"] .nextband .btn { background: var(--band-accent); color: #1c2431; }
/* App invitation: shown by site.js only where the browser can install the app */
.appband-wrap { max-width: min(70rem, calc(100% - 2rem)); margin: 1rem auto 0; }
.appband { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.9rem 1.2rem; padding: 1rem clamp(1rem, 3vw, 1.6rem); border: 1px solid color-mix(in srgb, var(--lamp) 45%, var(--line)); border-radius: 14px; background: var(--night-3); color: var(--moon); text-decoration: none; transition: border-color .2s, transform .2s; }
.appband[hidden] { display: none; }
.appband:hover { border-color: var(--lamp); }
.appband .dl { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--lamp); color: var(--night); }
.appband .dl svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.appband .tx { display: grid; gap: 0.15rem; }
.appband b { font-size: 1.12rem; font-weight: 600; }
.appband small { color: var(--moon-dim); font-size: 0.92rem; line-height: 1.55; }
.appband .go { padding: 0.55rem 1.1rem; border-radius: 999px; background: var(--lamp); color: var(--night); font-weight: 600; white-space: nowrap; }
[data-theme="light"] .appband { background: color-mix(in srgb, #fff 62%, transparent); }
@media (max-width: 760px) { .appband { grid-template-columns: auto minmax(0, 1fr); } .appband .go { grid-column: 1 / -1; text-align: center; padding-block: 0.7rem; } }
@media (max-width: 760px) { .nextband .wrap { grid-template-columns: minmax(0, 1fr); padding: 1.1rem 1.2rem; } .nextband .btn { justify-content: center; min-height: 2.9rem; } }
.btn.wazaif { gap: 0.9rem; padding: 0.55rem 1.3rem 0.55rem 0.55rem; background: var(--night-3); color: var(--moon); border: 1px solid color-mix(in srgb, var(--lamp) 55%, var(--line)); border-radius: 10px; font-weight: 400; transition: border-color .2s, background .2s; }
.btn.wazaif:hover { background: var(--night-2); border-color: var(--lamp); }
.btn.wazaif img { width: 2.7rem; height: auto; border-radius: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.45); flex: none; }
.btn.wazaif .wt { display: grid; gap: 0.1rem; text-align: start; }
.btn.wazaif .wt b { font-size: 1.1rem; font-weight: 600; line-height: 1.5; }
.btn.wazaif .wt small { color: var(--lamp); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; }

/* the last two links branch off the line and stand side by side, level with each other */
.fork { list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-columns: 1fr 1fr; }
.fork::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 2px; background: var(--line); }
.fork .link, .fork .link:nth-child(even) { grid-template-columns: 1fr; padding-block: 0 1.1rem; }
.fork .link::before { left: 50%; top: 2.1rem; }
.fork .link::after { content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 2.1rem; background: var(--line); transform: translateX(-50%); }
.fork .link.lit::after { background: var(--lamp); }
.fork::before { transition: background .4s; }
.fork.lit::before { background: var(--lamp); }
.fork .link .body, .fork .link:nth-child(even) .body { grid-column: 1; text-align: center; padding: 3.2rem 0.8rem 0; }
.fork .link .ur, .fork .link:nth-child(even) .ur { text-align: center; font-size: clamp(1.25rem, 2vw, 1.7rem); }
.fork .link .en { text-align: center; }
@media (max-width: 880px) {
  .fork::before { left: 8px; right: auto; width: 50%; }
  .fork .link::before, .fork .link::after { left: 8px; }
  .fork .link .body, .fork .link:nth-child(even) .body { text-align: left; padding: 1.1rem 0.4rem 0 2.2rem; }
  .fork .link .ur, .fork .link:nth-child(even) .ur, .fork .link .en { text-align: left; }
  .fork .link .ur { font-size: 1.15rem; }
  .fork .link .en { font-size: 0.85rem; }
}

/* the home player reads right to left in Urdu: button, title, numbers and tags move to the right */
html[data-lang="ur"] .player { direction: rtl; }
html[data-lang="ur"] .player .t { font-family: var(--f-urdu); line-height: 1.9; font-size: 1.2rem; }
html[data-lang="ur"] .player .more { justify-content: flex-end; gap: 0.4rem; } /* the link sits at the left edge, the arrow beside it */
html[data-lang="ur"] .player .more > span[aria-hidden] { display: inline-block; transform: scaleX(-1); } /* and points left, the way Urdu reads on */
/* Soft Square on the player's "Browse more" link: the full-width top-rule row becomes a button; in Urdu it sits at the left edge */
.player .more.btn-soft { display: flex; width: fit-content; margin-top: 1rem; padding: 0.55rem 1rem; min-height: 0; border: 1px solid var(--line); color: var(--moon); font-weight: 600; text-decoration: none; }
.player .more.btn-soft:hover { border-color: var(--lamp); text-decoration: none; }
.player .more.btn-soft > span[aria-hidden] { color: var(--lamp); }
html[data-lang="ur"] .player .more.btn-soft { margin-inline-start: auto; }

/* "Soft Square" button (class btn-soft): grey outline, plain text, amber icon, amber outline and tint on hover. Not applied anywhere until asked for. */
.btn-soft { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.55rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--moon); font: inherit; font-size: 0.92rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: border-color .2s, background .2s; }
.btn-soft svg { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: var(--lamp); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn-soft:hover { border-color: var(--lamp); background: color-mix(in srgb, var(--lamp) 10%, transparent); }
.btn-soft:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }

/* heading ornaments. Main section headings: a small star with a short fading line under it. Sub-headings in the library: a very faint star behind the first letters. */
.start h2, .tree h2, .library h2, .audio h2, .visit h2, h2.orn { position: relative; padding-bottom: 1.4rem; }
.start h2::before, .tree h2::before, .library h2::before, .audio h2::before, .visit h2::before, h2.orn::before { content: ""; position: absolute; bottom: 0; inset-inline-start: 0; width: 1rem; height: 1rem; background: var(--lamp);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.4' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='12' height='12'/%3E%3Crect x='4' y='4' width='12' height='12' transform='rotate(45 10 10)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.4' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='12' height='12'/%3E%3Crect x='4' y='4' width='12' height='12' transform='rotate(45 10 10)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.start h2::after, .tree h2::after, .library h2::after, .audio h2::after, .visit h2::after, h2.orn::after { content: ""; position: absolute; bottom: calc(0.5rem - 0.5px); inset-inline-start: 1.5rem; width: 3.5rem; height: 1px; background: linear-gradient(to right, var(--lamp), transparent); }
/* D: a small label above a heading (class "eb" on a div before the h2, "ehead" on the h2). Used on at most three headings a page; it replaces A on that heading. */
.eb { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; font: 600 0.72rem/1 var(--f-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--lamp); }
.eb::after { content: ""; width: 1.6rem; height: 1px; background: var(--lamp); opacity: 0.6; }
.eb .lu { font: 400 1rem/1.4 var(--f-urdu); letter-spacing: 0; text-transform: none; }
.tree .eb { justify-content: center; }
h2.ehead { padding-bottom: 0; }
h2.ehead::before, h2.ehead::after { display: none; }
html[data-lang="ur"] .bi h2::after { background: linear-gradient(to left, var(--lamp), transparent); }
.tree h2::before { inset-inline-start: calc(50% - 2.5rem); }
.tree h2::after { inset-inline-start: calc(50% - 1rem); }

.row h3 { position: relative; isolation: isolate; }
.row h3::before { content: ""; position: absolute; z-index: -1; top: 50%; inset-inline-start: -1rem; width: 4.6rem; height: 4.6rem; transform: translateY(-50%); background: var(--lamp); opacity: 0.11;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0l2.3 4.4L17 3l-1.4 4.7L20 10l-4.4 2.3L17 17l-4.7-1.4L10 20l-2.3-4.4L3 17l1.4-4.7L0 10l4.4-2.3L3 3l4.7 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0l2.3 4.4L17 3l-1.4 4.7L20 10l-4.4 2.3L17 17l-4.7-1.4L10 20l-2.3-4.4L3 17l1.4-4.7L0 10l4.4-2.3L3 3l4.7 1.4z'/%3E%3C/svg%3E") center / contain no-repeat; }
