/* Tadabbur — design tokens & base styles */
@font-face {
  font-family: "DigitalKhatt IndoPak";
  src: url("../fonts/DigitalKhatt-IndoPak.woff2") format("woff2");
  font-display: block;   /* never draw the Quran in a substitute font; see quranFont() in js/common.js */
}
:root {
  --bg: #f7f3ea;
  --bg-2: #efe8d8;
  --surface: #fffdf8;
  --ink: #1f1b14;
  --ink-2: #5b5346;
  --ink-3: #6d665a;        /* 4.65:1 on the lightest background (WCAG AA) */
  --line: #e2d9c6;
  --accent: #0f6b5c;        /* deep green */
  --accent-2: #86601f;      /* gold, 4.64:1 */
  --makkah: #8d5c20;
  --madinah: #277365;
  --hl: #fff1c9;
  --on-accent: #ffffff;     /* text on accent / Makkah / Madinah fills */
  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 8px 24px rgba(60, 45, 20, .06);
  --r: 14px;
  --ar-size: 34px;
  --tr-size: 17px;          /* translation text; the reader can change it (U5) */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Naskh Arabic", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --font-uthmani: "Amiri Quran", "Scheherazade New", serif;
  --font-indopak: "DigitalKhatt IndoPak", "Noto Naskh Arabic", serif;
  --font-naskh: "Noto Naskh Arabic", "Scheherazade New", serif;
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
}
:root[data-scheme="lajward"] {   /* Lajward (lapis): cool white, lapis blue and turquoise */
  --bg: #f2f4f8;
  --bg-2: #e6eaf2;
  --surface: #ffffff;
  --ink: #121a2e;
  --ink-2: #3d4763;
  --ink-3: #58627d;
  --line: #dbe1ec;
  --accent: #1d4b9b;
  --accent-2: #0d6f6c;
  --makkah: #8a4b12;
  --madinah: #0d6f6c;
  --hl: #fff1c9;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(18, 26, 46, .06), 0 8px 24px rgba(18, 26, 46, .07);
}
:root[data-theme="dark"] {        /* Shab (night): deep ink-blue with warm gold and teal */
  --bg: #0e1320;
  --bg-2: #141b2a;
  --surface: #161d2c;
  --ink: #ede7da;
  --ink-2: #bdb5a5;
  --ink-3: #9a9284;
  --line: #283247;
  --accent: #e0b45c;
  --accent-2: #6cc4b2;
  --makkah: #e3a95d;
  --madinah: #6cc4b2;
  --hl: #3a3220;
  --on-accent: #1a1406;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font-ui);
}
a { color: var(--accent); text-decoration: none; }
:where(p, li, .note, .foot, .muted, .source, .ref, .tiny, .lead, .intro-body, .h-txt, .ft-ev-row, .pc-rel) a:not(.btn):not(.chip):not(.tab):not(.report-link) {
  text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px;
}
/* visible keyboard focus everywhere (WCAG 2.4.7) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; }
.skip-link:focus { top: 10px; }
/* read by screen readers, not shown */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); }
.tiny { font-size: 13px; color: var(--ink-3); }
.hidden { display: none !important; }

/* ---------- header */
.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
header.top { min-height: 61px; }
/* U4: keep the footer below the first screen while content loads, so it doesn't jump (CLS) */
body > main { min-height: calc(100vh - 61px); }
/* U4: the surah header's space is reserved before its data arrives */
.gate:has(> .skeleton) { min-height: 300px; }
@media (max-width: 520px) { .gate:has(> .skeleton) { min-height: 270px; } }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-family: var(--font-uthmani); font-size: 20px; line-height: 1;
}
.brand .t { font-family: var(--font-display); font-size: 20px; letter-spacing: .2px; }
.brand .ar { font-family: var(--font-uthmani); color: var(--accent-2); font-size: 18px; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a { white-space: nowrap; }
.nav a, .icon-btn {
  padding: 8px 12px; border-radius: 10px; color: var(--ink-2); background: none; border: 0; font-size: 14px;
}
.nav a.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600; }
.nav a:hover, .icon-btn:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.icon-btn svg { width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- generic */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); white-space: nowrap;
}
.chip.makkah { color: var(--makkah); border-color: color-mix(in srgb, var(--makkah) 40%, var(--line)); }
.chip.madinah { color: var(--madinah); border-color: color-mix(in srgb, var(--madinah) 40%, var(--line)); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn {
  border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 10px; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn svg { width: 16px; height: 16px; }
input[type=search] {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 14px; border-radius: 10px; font: inherit; font-size: 14px; min-width: 0;
}
.source {
  font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap;
}
.source a { display: inline-flex; align-items: center; min-height: 24px; }
.source::before { content: "Source"; font-weight: 600; color: var(--accent-2); text-transform: uppercase; letter-spacing: .6px; font-size: 13px; }

.ar-uthmani, .ar-tajweed { font-family: var(--font-uthmani); }
.ar-indopak { font-family: var(--font-indopak); }
.urdu { font-family: var(--font-urdu); direction: rtl; line-height: 2.3; }

/* ---------- home */
.hero { padding: 56px 0 28px; text-align: center; }
.hero h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 5vw, 46px); line-height: 1.15; margin: 0 0 10px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p.lead { max-width: 640px; margin: 0 auto; color: var(--ink-2); font-size: 17px; }
.hero-ayah { margin: 34px auto 0; max-width: 760px; padding: 26px 22px; text-align: center; }
.hero-ayah .arabic { font-size: 30px; line-height: 2; direction: rtl; }
.hero-ayah .tr { margin-top: 10px; color: var(--ink-2); }
.hero-ayah .tr.urdu { font-size: 18px; }
.hero-ayah .ref { margin-top: 10px; font-size: 13px; }

.section-h { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 46px 0 14px; }
.section-h h2 { font-family: var(--font-display); font-weight: 500; font-size: 26px; margin: 0; }
.section-h p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; max-width: 620px; }

/* revelation journey */
.journey { padding: 18px 18px 12px; }
.journey-bars {
  display: flex; align-items: flex-end; gap: 2px; height: 150px; position: relative;
}
.journey-bars a {
  flex: 1 1 0; min-width: 2px; border-radius: 3px 3px 0 0; position: relative; display: block;
  background: var(--makkah); opacity: .85; transition: opacity .15s, transform .15s;
}
.journey-bars a.madinah { background: var(--madinah); }
.journey-bars a:hover, .journey-bars a.cur { opacity: 1; transform: scaleY(1.04); transform-origin: bottom; outline: 2px solid var(--ink); outline-offset: 1px; }
.journey-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--ink-3); }
.journey-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.tip {
  position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--bg);
  padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; max-width: 240px; box-shadow: var(--shadow);
}
.tip b { font-size: 13px; }

/* surah grid */
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 14px 0 60px; }
.s-card {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 14px; color: var(--ink); transition: border-color .15s, transform .15s;
}
.s-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.s-num {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: var(--bg-2); font-weight: 600; font-size: 14px; color: var(--ink-2);
  transform: rotate(45deg);
}
.s-num span { transform: rotate(-45deg); }
.s-name { font-weight: 600; line-height: 1.3; }
.s-meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.s-meta .pl { font-weight: 600; }
.s-meta .pl.makkah { color: var(--makkah); }
.s-meta .pl.madinah { color: var(--madinah); }
.s-ar { font-family: var(--font-uthmani); font-size: 22px; color: var(--ink-2); text-align: right; }
.s-ar .m { font-family: var(--font-urdu); font-size: 15px; display: block; color: var(--ink-3); line-height: 2.1; }

/* ---------- surah gateway */
.gate { padding: 34px 0 10px; }
.gate-card { padding: 28px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
.gate-wrap { padding: 20px 24px; }
.gate-wrap .gate-card { padding: 20px 0 4px; border-top: 1px solid var(--line); margin-top: 14px; }
.gate-head { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: flex-end; justify-content: space-between; }
.gh-names { display: flex; gap: 16px; align-items: center; min-width: 0; }
.gh-ar { font-family: var(--font-uthmani); font-size: 44px; line-height: 1.5; color: var(--accent); }
.gate-head .num { font-size: 13px; color: var(--ink-3); letter-spacing: 1px; text-transform: uppercase; }
.gate-head h1 { font-family: var(--font-display); font-weight: 500; font-size: 28px; margin: 0; line-height: 1.2; }
.gate-head .mean { color: var(--ink-2); font-size: 14px; }
.gate-head .mean .urdu { font-size: 16px; }
.gh-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.gh-facts .chip { white-space: nowrap; }
.gh-row { margin-top: 12px; }
.about-btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.about-chev svg { width: 16px; height: 16px; transition: transform .15s; }
.about-btn[aria-expanded="true"] .about-chev svg { transform: rotate(90deg); }
.gate-details[hidden] { display: none; }
.gate-title .num { font-size: 13px; color: var(--ink-3); letter-spacing: 1px; text-transform: uppercase; }
.gate-title .ar { font-family: var(--font-uthmani); font-size: 54px; line-height: 1.4; color: var(--accent); }
.gate-title h1 { font-family: var(--font-display); font-weight: 500; font-size: 34px; margin: 0; line-height: 1.2; }
.gate-title .mean { color: var(--ink-2); margin-top: 4px; }
.gate-title .mean .urdu { font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.stat { background: var(--bg-2); border-radius: 12px; padding: 12px; }
.stat .v { font-size: 22px; font-weight: 600; font-family: var(--font-display); }
.stat .l { font-size: 13px; color: var(--ink-3); }
.stat.makkah .v { color: var(--makkah); }
.stat.madinah .v { color: var(--madinah); }
.mini-journey { margin-top: 16px; }
.mini-journey .journey-bars { height: 46px; gap: 1px; }
.mini-journey .journey-bars a { opacity: .35; }
.mini-journey .journey-bars a.cur { opacity: 1; outline: 2px solid var(--ink); }
.intro h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-3); font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.intro-body { max-height: 260px; overflow: hidden; position: relative; font-size: 15px; color: var(--ink-2); }
.intro-body.open { max-height: none; }
.intro-body:not(.open)::after { content: ""; position: absolute; inset: auto 0 0 0; height: 80px; background: linear-gradient(transparent, var(--surface)); }
.intro-body h2 { font-size: 15px; color: var(--ink); margin: 14px 0 4px; font-family: var(--font-ui); }
.intro-body p { margin: 0 0 8px; }
.intro-body { max-width: 72ch; }
.intro-body.urdu { font-size: 16px; line-height: 2.2; margin-left: auto; }
/* Quran.com's Urdu intros interleave <p> and bare text; flow them inline */
.intro-body.urdu p { display: inline; margin: 0; }
.intro-body.urdu h2 { display: block; }
.intro-body .ar, .intro-body .arabic { font-family: var(--font-naskh); }
.ar-indopak { line-height: 2.3; }
.w > span:first-child { unicode-bidi: isolate; }
.intro-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; }

.reader-more { height: 1px; }
@media (max-width: 1099px) { .wide-only { display: none; } }
/* rule 8: Quran text is hidden until its own font has loaded (js/common.js → quranFont) */
.qf-wait-indopak .ar-indopak, .qf-wait-indopak .ar-indopak *,
.qf-wait-uthmani .ar-uthmani, .qf-wait-uthmani .ar-uthmani * { visibility: hidden; }
#reader { overflow-anchor: none; }      /* U4: the page keeps the reader's place itself when ayahs are added above */

/* ---------- ayahs */
.bismillah { text-align: center; font-size: 32px; direction: rtl; margin: 26px 0 8px; color: var(--ink-2); }
@media (min-width: 1100px) {
  .side-by-side .ayah { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 32px; align-items: start; }
  .side-by-side .ayah > .ayah-head { grid-column: 1 / -1; }
  .side-by-side .ayah > .arabic-line { grid-column: 2; grid-row: 2; }
  .side-by-side .ayah > .trs { grid-column: 1; grid-row: 2; align-self: center; }
  .side-by-side .ayah > .my-note, .side-by-side .ayah > .tip-card { grid-column: 1 / -1; }
}
.ayah { padding: 22px 6px 22px; border-bottom: 1px solid var(--line); scroll-margin-top: 140px; transition: background .3s; border-radius: 10px; }
.ayah.playing { background: var(--hl); }
.ayah-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; row-gap: 4px; }
.ayah-key { font-size: 13px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 3px 9px; border-radius: 8px; }
.ayah-head .sp { flex: 1; }
.ayah-head .icon-btn { padding: 6px 8px; }
.hadith-chip { border: 1px solid color-mix(in srgb, var(--accent-2) 45%, var(--line)); color: var(--accent-2); background: none; }
.hadith-chip:hover { background: color-mix(in srgb, var(--accent-2) 12%, transparent); }

.arabic-line {
  direction: rtl; text-align: right; font-size: var(--ar-size); line-height: 2.1;
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: flex-start;
}
.w { display: inline-flex; flex-direction: column; align-items: center; padding: 2px 4px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.w:hover, .w.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.w.speak { background: color-mix(in srgb, var(--accent-2) 30%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 55%, transparent); }
.w.speak > span:first-child { color: var(--accent-2); }
.w { transition: background .12s, box-shadow .12s; }
.w .g { font-family: var(--font-ui); font-size: 13px; line-height: 1.35; color: var(--ink-2); direction: ltr; text-align: center; max-width: 120px; margin-top: 2px; }
.w .g.ur { font-family: var(--font-urdu); direction: rtl; font-size: 15px; line-height: 2.1; }
.w .g + .g { margin-top: 0; }
.end-mark { font-family: var(--font-uthmani); color: var(--accent-2); align-self: center; }
.trs { margin-top: 14px; display: grid; gap: 12px; }
.tr-item .txt { font-size: var(--tr-size); line-height: 1.7; max-width: 72ch; }
.tr-item .txt.urdu { font-size: calc(var(--tr-size) + 2px); text-align: right; line-height: 2.6; margin-left: auto; }
.tr-item.ur .who { margin-top: 4px; }
.tr-item .who { font-size: 13px; color: var(--ink-3); margin-top: 2px; letter-spacing: .2px; }
.tr-item.ur .who { text-align: right; }

/* word popover */
.pop {
  position: fixed; z-index: 70; width: 280px; padding: 16px; display: none;
}
.pop.show { display: block; }
.pop .w-ar { font-size: 36px; direction: rtl; text-align: center; line-height: 1.8; }
.pop .w-tl { text-align: center; color: var(--ink-3); font-style: italic; }
.pop dl { margin: 12px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.pop dt { color: var(--ink-3); font-size: 13px; padding-top: 3px; }
.pop dd { margin: 0; }
.pop dd.urdu { font-size: 17px; line-height: 2.3; text-align: right; }
.pop .row { display: flex; gap: 8px; margin-top: 12px; justify-content: space-between; align-items: center; }

/* drawers */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 90;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column;
}
.drawer.show { transform: none; }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-h h3 { margin: 0; font-size: 17px; flex: 1; }
.drawer-b { overflow-y: auto; padding: 16px 18px 40px; }
.opt-group { margin-bottom: 22px; }
.opt-group h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-3); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.check:hover { background: var(--bg-2); }
.check input { margin-top: 4px; accent-color: var(--accent); }
.check .ord { margin-left: auto; font-size: 13px; color: var(--accent); font-weight: 600; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input { flex: 1; accent-color: var(--accent); }

.hadith { padding: 16px 0; border-bottom: 1px solid var(--line); }
.hadith .h-ref { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.hadith .h-ref b { color: var(--accent); }
.hadith .h-txt { margin-top: 8px; font-size: 15px; line-height: 1.75; white-space: pre-line; }
.hadith .h-txt.urdu { font-size: 17px; line-height: 2.3; text-align: right; }
.hadith .h-txt.ar { direction: rtl; text-align: right; font-family: var(--font-naskh); font-size: 19px; line-height: 2; }
.note { background: var(--bg-2); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin: 30px 0 70px; }

/* sources page */
.src-list { display: grid; gap: 12px; margin: 20px 0 60px; }
.src-item { padding: 16px 18px; overflow-wrap: anywhere; min-width: 0; }
.src-item h3 { margin: 0 0 4px; font-size: 16px; }
.src-item code { font-size: 13px; color: var(--ink-3); }

/* ---------- tajweed colours (palette follows Quran.com's tajweed colours; lighter in dark mode) */
:root {
  --tj-silent: #9a9a9a; --tj-madd-normal: #537fff; --tj-madd-perm: #4050ff; --tj-madd-oblig: #2144c1;
  --tj-madd-nec: #000ebc; --tj-ghunnah: #ff7e1e; --tj-qalqalah: #dd0008; --tj-ikhfa: #9400a8;
  --tj-ikhfa-shaf: #d500b7; --tj-iqlab: #26bffd; --tj-idgham-g: #169777; --tj-idgham-wo: #169200;
  --tj-idgham-shaf: #58b800; --tj-idgham-other: #a1a1a1;
}
:root[data-theme="dark"] {
  --tj-silent: #8d8d8d; --tj-madd-normal: #7e9fff; --tj-madd-perm: #7f8bff; --tj-madd-oblig: #6c8cff;
  --tj-madd-nec: #9aa3ff; --tj-ghunnah: #ff9a4d; --tj-qalqalah: #ff5a5f; --tj-ikhfa: #d06cff;
  --tj-ikhfa-shaf: #ff6be6; --tj-iqlab: #5fd3ff; --tj-idgham-g: #3fc9a0; --tj-idgham-wo: #4cc84a;
  --tj-idgham-shaf: #8fe34a; --tj-idgham-other: #b5b5b5;
}
.tj-ham_wasl, .tj-laam_shamsiyah, .tj-slnt { color: var(--tj-silent); }
.tj-madda_normal { color: var(--tj-madd-normal); }
.tj-madda_permissible, .tj-madda_obligatory_monfasel { color: var(--tj-madd-perm); }
.tj-madda_obligatory_mottasel, .tj-madda_obligatory { color: var(--tj-madd-oblig); }
.tj-madda_necessary { color: var(--tj-madd-nec); }
.tj-ghunnah { color: var(--tj-ghunnah); }
.tj-qalaqah { color: var(--tj-qalqalah); }
.tj-ikhafa { color: var(--tj-ikhfa); }
.tj-ikhafa_shafawi { color: var(--tj-ikhfa-shaf); }
.tj-iqlab { color: var(--tj-iqlab); }
.tj-idgham_ghunnah { color: var(--tj-idgham-g); }
.tj-idgham_wo_ghunnah { color: var(--tj-idgham-wo); }
.tj-idgham_shafawi { color: var(--tj-idgham-shaf); }
.tj-idgham_mutajanisayn, .tj-idgham_mutaqaribayn { color: var(--tj-idgham-other); }
.tajweed-key { padding: 10px 16px; margin: 0 0 8px; }
.tajweed-key summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.tj-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; }
.tj-key-item { display: inline-flex; align-items: center; gap: 6px; }
.tj-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: currentColor; flex: none; }
.tj-ar { font-family: var(--font-naskh); color: var(--ink-3); }

/* ---------- mushaf page view */
.m-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; margin-top: 18px; position: sticky; top: 60px; z-index: 5; }
.m-info { display: grid; text-align: center; gap: 2px; min-width: 0; }
.m-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.m-surah-select { flex: 1 1 180px; min-width: 150px; max-width: 260px; }
.m-goto input { width: 70px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 8px; font: inherit; }
.m-page {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 22px clamp(12px, 3vw, 34px); max-width: 680px; margin: 0 auto;
  outline: 3px double color-mix(in srgb, var(--accent-2) 45%, transparent); outline-offset: -10px;
  font-size: clamp(17px, 4.3vw, 30px);
}
.m-page.indopak { font-size: clamp(16px, 4.1vw, 28px); }
.m-line { display: flex; justify-content: space-between; align-items: baseline; gap: .18em; white-space: nowrap; line-height: 2.05; min-height: 2.05em; }
.m-page.short .m-line { justify-content: center; gap: .35em; }
.m-blank { min-height: 1em; }
.m-w { cursor: pointer; border-radius: 6px; }
.m-w:hover, .m-w:focus { background: color-mix(in srgb, var(--accent) 12%, transparent); outline: none; }
.m-end { color: var(--accent-2); font-size: .9em; }
.m-end.ar-indopak { font-size: 1.25em; line-height: 1; }
.m-surah {
  justify-content: center; gap: 14px; align-items: center; margin: 4px 0; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.m-surah-name { font-family: var(--font-uthmani); color: var(--accent); }
.m-surah-en { font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); }
.m-bism { justify-content: center; color: var(--ink-2); }
.m-tip { width: auto; max-width: 260px; }
.m-tip.show { display: block; }

/* ---------- reading progress */
.pr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; align-items: start; }
.pr-card { padding: 18px 20px; }
main > .pr-card { margin: 18px 0 60px; }
.pr-card h3 { margin: 0 0 10px; font-size: 16px; }
.pr-big { font-family: var(--font-display); font-size: 40px; line-height: 1.1; }
.pr-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.pr-map { display: grid; grid-template-columns: repeat(19, 1fr); gap: 3px; margin-top: 6px; }
.pr-map a { aspect-ratio: 1; border-radius: 3px; background: linear-gradient(to top, var(--accent) calc(var(--f) * 100%), var(--bg-2) 0); }
.pr-map a.full { background: var(--accent); }
.pr-item { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.pr-ar { font-size: 22px; line-height: 2; text-align: right; }
.my-note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent-2) 10%, transparent); border-left: 3px solid var(--accent-2); white-space: pre-wrap; font-size: 15px; }
.my-note .tiny { display: block; margin-bottom: 2px; color: var(--accent-2); font-weight: 600; }
.note-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: var(--surface); color: var(--ink); resize: vertical; }
.bm-btn.on, .note-btn.on { color: var(--accent-2); }
.continue-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; margin: 24px auto 0; max-width: 760px; flex-wrap: wrap; text-align: left; }
@media (max-width: 820px) { .pr-grid { grid-template-columns: 1fr; } }

/* ---------- word roots */
.pop .grammar { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.root-letters { font-family: var(--font-naskh); font-size: 20px; letter-spacing: 2px; color: var(--accent); }
.lemma { font-family: var(--font-uthmani); font-size: 20px; direction: rtl; text-align: left; }
.r-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 60px; }
.r-card { padding: 14px; text-align: center; color: var(--ink); display: grid; gap: 2px; }
.r-card:hover { text-decoration: none; border-color: var(--accent); }
.r-card .root-letters { font-size: 26px; }
.r-card .lemma { text-align: center; font-size: 17px; color: var(--ink-2); }
.r-head { padding: 24px; margin-top: 12px; }
.r-head .root-letters { font-size: 54px; letter-spacing: 8px; line-height: 1.4; }
.r-lemmas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.r-lemmas .chip { cursor: pointer; font-size: 13px; }
.r-lemmas .chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.r-lemmas .chip .lemma { font-size: 16px; }
.r-occ { display: grid; gap: 10px; margin: 14px 0 60px; }
.r-occ .p-arabic .pw.name { color: var(--accent-2); }
.r-meaning { font-size: 14px; color: var(--ink-2); margin: 2px 0 6px; }
.r-meaning .urdu { font-size: 16px; }

/* ---------- learn (most frequent words) */
.learn-top { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; margin-top: 22px; }
.learn-meter, .learn-curve, .learn-practice { padding: 20px; }
.lm-num { font-family: var(--font-display); font-size: 30px; }
.lm-sub { color: var(--ink-2); margin: 4px 0 6px; }
.progress.big { height: 12px; }
.learn-curve h3, .learn-practice h3 { margin: 0 0 10px; font-size: 16px; }
.lc-row { display: grid; grid-template-columns: 160px 1fr; gap: 10px; align-items: center; font-size: 13px; margin: 5px 0; }
.lc-bar { height: 10px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.lc-bar span { display: block; height: 100%; background: var(--accent-2); border-radius: 6px; }
.learn-practice { margin-top: 14px; }
.flashcard { text-align: center; padding: 22px 10px; margin: 12px 0; background: var(--bg-2); border-radius: var(--r); display: grid; gap: 8px; justify-items: center; }
.fc-word { font-family: var(--font-uthmani); font-size: 56px; line-height: 1.6; color: var(--accent); direction: rtl; }
.fc-back { display: grid; gap: 6px; justify-items: center; width: 100%; }
.fc-meaning { font-size: 18px; }
.fc-meaning.urdu { font-size: 22px; line-height: 2.2; }
.fc-example { margin-top: 8px; width: 100%; text-align: right; }
.fc-example .tiny { text-align: left; }
.fc-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.root-letters.small { font-size: 14px; letter-spacing: 1px; }
.v-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.v-row { display: grid; grid-template-columns: 44px 120px 1fr 170px 64px 70px 54px; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.v-row.v-head { border-top: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3); background: var(--bg-2); }
.v-row.known { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.v-rank { color: var(--ink-3); font-size: 13px; }
.v-word { font-family: var(--font-uthmani); font-size: 24px; direction: rtl; text-align: right; }
.v-mean { display: grid; font-size: 14px; min-width: 0; }
.v-mean .urdu { font-size: 16px; line-height: 2.2; text-align: left; }
.v-count { font-variant-numeric: tabular-nums; text-align: right; }
.v-cum { text-align: right; }
.v-known { text-align: center; }
.v-known input { width: 18px; height: 18px; accent-color: var(--accent); }

@media (max-width: 820px) {
  .learn-top { grid-template-columns: 1fr; }
  .lc-row { grid-template-columns: 140px 1fr; }
  .v-row { grid-template-columns: 34px 84px 1fr 44px; }
  .v-type, .v-cum, .v-count { display: none; }
  .v-row.v-head span:nth-child(4), .v-row.v-head span:nth-child(5), .v-row.v-head span:nth-child(6) { display: none; }
}

/* ---------- report a problem */
.report-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.report-link:hover { color: var(--accent-2); text-decoration: none; }
.report-link svg { width: 13px; height: 13px; }
.report-link.icon { padding: 6px 8px; border-radius: 10px; }
.report-link.icon svg { width: 16px; height: 16px; }
.report-link.icon:hover { background: var(--bg-2); }
.foot-report { white-space: nowrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.foot-report .report-link { font-size: 13px; }

/* ---------- share card */
.share-preview { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); display: block; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.sim-chip { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent); background: none; }
.sim-chip:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.h-how { display: inline-block; margin-top: 6px; font-size: 13px; letter-spacing: .3px; color: var(--accent-2); border: 1px solid color-mix(in srgb, var(--accent-2) 40%, var(--line)); border-radius: 999px; padding: 1px 8px; }

/* ---------- places map */
.pl-card { padding: 12px; margin-top: 18px; }
.pl-map { display: block; width: 100%; height: auto; max-height: 78vh; border-radius: 10px; }
.pl-sea { fill: color-mix(in srgb, var(--madinah) 16%, var(--bg)); }
.pl-land { fill: color-mix(in srgb, var(--ink) 6%, var(--surface)); stroke: color-mix(in srgb, var(--ink-3) 50%, transparent); stroke-width: .8; }
.pl-river { fill: none; stroke: color-mix(in srgb, var(--madinah) 45%, transparent); stroke-width: 1.2; }
.pl-pin { cursor: default; }
.pl-pin[role="button"] { cursor: pointer; }
.pl-pin[role="button"]:focus { outline: none; }
.pl-pin[role="button"]:focus .pl-dot, .pl-pin[role="button"]:hover .pl-dot { stroke-width: 4; }
.pl-dot { fill: var(--accent-2); stroke: var(--surface); stroke-width: 2.5; }
.pl-area { fill: color-mix(in srgb, var(--accent-2) 16%, transparent); stroke: color-mix(in srgb, var(--accent-2) 45%, transparent); stroke-dasharray: 4 4; }
.pl-label { font: 600 15px var(--font-ui); fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.pl-pin.on .pl-dot { fill: var(--accent); r: 9; }
.pl-pin.dim { opacity: .45; }
.pl-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 30px; align-items: center; }
.pl-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.chip.pl-off { color: var(--ink-3); border-style: dashed; }
.pl-head { align-items: start; }
@media (max-width: 820px) { .pl-head { grid-template-columns: 1fr; } }

/* ---------- phone tab bar + More sheet (U1; docs/UX_RESEARCH.md §3.2) */
.tabbar { display: none; }
@media (max-width: 1023px) {
  .nav .nav-link { display: none; }
  .brand .t { display: inline; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px;
    color: var(--ink-2); background: none; border: 0; font: inherit; font-size: 13px; cursor: pointer; padding: 6px 2px;
  }
  .tab:hover { text-decoration: none; color: var(--ink); }
  .tab-ic { display: grid; place-items: center; width: 52px; height: 28px; border-radius: 14px; transition: background .15s; }
  .tab-ic svg { width: 22px; height: 22px; }
  .tab.on { color: var(--accent); font-weight: 600; }
  .tab.on .tab-ic { background: color-mix(in srgb, var(--accent) 16%, transparent); }
  .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 12px; }
  body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
/* action sheets (More menus): bottom sheet on phones, centred panel on wider screens */
.sheet {
  display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; max-height: 85vh; overflow-y: auto;
  background: var(--surface); border-radius: 18px 18px 0 0; border-top: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateY(105%); transition: transform .22s ease;
}
.sheet.show { transform: none; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px; }
.sheet-list { display: grid; }
.sheet-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 6px; border-bottom: 1px solid var(--line); color: var(--ink); }
.sheet-item:hover { text-decoration: none; background: var(--bg-2); }
.sheet-item > span:first-child { flex: 1; display: grid; }
.sheet-item b { font-weight: 600; font-size: 16px; }
.sheet-item.on b { color: var(--accent); }
.sheet-hint { font-size: 13px; color: var(--ink-3); }
.sheet-chev svg { width: 18px; height: 18px; color: var(--ink-3); }
.sheet-foot { display: flex; align-items: center; gap: 8px; padding: 12px 6px 4px; }
.sheet-foot .sp { flex: 1; }
.sheet-foot .icon-btn { min-width: 44px; min-height: 44px; }
.sheet-title { font-weight: 600; padding: 2px 6px 6px; color: var(--ink-2); font-size: 14px; }
.sheet-item { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; text-align: left; cursor: pointer; }
.sheet-ic { display: grid; place-items: center; width: 24px; color: var(--ink-2); }
.sheet-ic svg { width: 20px; height: 20px; }
.sheet-ic:empty { display: none; }
.sheet-item > span.sheet-ic { flex: none; display: grid; }
.sheet-item > span.sheet-ic + span { flex: 1; display: grid; }
.sheet:not(.show) { visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
.sheet-note { font-size: 13px; color: var(--ink-3); padding: 10px 6px 2px; }
.sheet-cancel { width: 100%; min-height: 48px; margin-top: 10px; justify-content: center; }
@media (min-width: 1024px) {
  .sheet { left: 50%; right: auto; width: 440px; bottom: 24px; border-radius: 18px; border: 1px solid var(--line); transform: translate(-50%, 120%); }
  .sheet.show { transform: translate(-50%, 0); }
}
/* U3: ayah controls are at least 44px to tap; chips keep their look with a larger invisible tap area */
.ayah-head .icon-btn { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 0; }
.ayah-head .chip { position: relative; }
.ayah-head .chip::after { content: ""; position: absolute; inset: -7px -3px; }
/* respect "reduce motion" everywhere (WCAG 2.3.3): no sliding, fading or smooth scrolling */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media (min-width: 600px) and (max-width: 1023px) {
  .sheet { left: 50%; right: auto; width: 520px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); border-radius: 18px; border: 1px solid var(--line); transform: translate(-50%, 130%); }
  .sheet.show { transform: translate(-50%, 0); }
}

/* ---------- first-time setup and tips (U7) */
.sheet-content { max-height: 90vh; }
.sheet-h { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 0 6px 6px; }
.setup { padding: 0 6px 6px; }
.setup fieldset { border: 0; padding: 0; margin: 14px 0 0; }
.setup legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.setup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setup-col { display: grid; gap: 8px; }
.setup-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; min-height: 44px; }
.setup-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.setup-opt input { margin-top: 4px; accent-color: var(--accent); }
.setup-opt-t { display: grid; gap: 2px; flex: 1; min-width: 0; }
.setup-prev { font-size: 26px; line-height: 2; text-align: right; color: var(--ink); }
.setup-prev.ar-indopak { font-family: var(--font-indopak); }
.setup-prev.ar-uthmani { font-family: var(--font-uthmani); }
.setup-trs { display: grid; max-height: 34vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 6px; }
.setup-trs .check { min-height: 44px; align-items: center; }
.urdu-name { font-family: var(--font-urdu); line-height: 2; }
.setup-msg { color: var(--makkah); font-weight: 600; min-height: 1em; margin-top: 8px; }
.setup-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.setup-actions .btn { min-height: 44px; }
.tip-card { padding: 16px 18px; margin: 10px 0 18px; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tip-card h3 { margin: 0 0 8px; font-size: 16px; }
.tip-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tip-card li { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; align-items: start; }
.tip-card li > :first-child { justify-self: start; }
.tip-card li.plain { grid-template-columns: 1fr; }
.tip-more svg { width: 18px; height: 18px; vertical-align: -4px; color: var(--ink-2); }
.tip-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.tip-actions .btn { min-height: 44px; }

/* ---------- keyboard shortcuts list (U8) */
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; margin: 4px 6px 10px; }
.keys dt { margin: 0; }
.keys dd { margin: 0; }
kbd { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 8px; background: var(--bg-2); font: 600 14px var(--font-ui); color: var(--ink); }
.ayah:focus { outline: none; }
.ayah:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.has-action { pointer-events: auto; display: flex; gap: 12px; align-items: center; }
.toast-btn { border: 0; background: var(--accent-2); color: #1f1b14; font-weight: 600; padding: 6px 12px; border-radius: 8px; }

/* ---------- install + offline */
#offline { margin-bottom: 60px; }
#offline .section-h { margin-top: 0; }
.install-btn { padding: 6px 12px; font-size: 13px; border-color: var(--accent); color: var(--accent); white-space: nowrap; }
.offline-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.progress { height: 6px; border-radius: 6px; background: var(--bg-2); margin-top: 10px; overflow: hidden; display: none; }
.progress.show { display: block; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

/* ---------- tafsir */
.tafsir-chip { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); background: none; }
.tafsir-chip:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tafsir-bar { display: flex; gap: 8px; align-items: center; position: sticky; top: -16px; background: var(--surface); padding: 4px 0 10px; z-index: 1; }
.tafsir-select {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 10px; border-radius: 10px; font: inherit; font-size: 14px;
}
.tafsir-body { font-size: 15.5px; line-height: 1.8; margin-top: 8px; }
.tafsir-body h1, .tafsir-body h2, .tafsir-body h3, .tafsir-body h4 { font-size: 16px; margin: 18px 0 6px; color: var(--accent); font-family: var(--font-ui); }
.tafsir-body p { margin: 0 0 12px; }
.tafsir-body.urdu { font-size: 17px; line-height: 2.4; text-align: right; }
.tafsir-body.urdu h1, .tafsir-body.urdu h2, .tafsir-body.urdu h3, .tafsir-body.urdu h4 { font-family: var(--font-urdu); line-height: 2.2; }

/* ---------- search */
.search-box { display: flex; gap: 8px; padding: 8px; margin: 20px 0 10px; }
.search-box input { flex: 1; border: 0; background: none; font-size: 18px; padding: 8px 10px; outline: none; }
.search-scope { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg.wrap-seg { flex-wrap: wrap; }
.jump { display: flex; align-items: center; gap: 8px; padding: 14px 16px; margin-top: 14px; color: var(--ink); font-weight: 600; }
.jump-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.results { display: grid; gap: 12px; }
.result { padding: 16px 18px; }
.result-ref { color: var(--ink); font-weight: 600; }
.matched-ar { font-family: var(--font-naskh); font-size: 17px; line-height: 2; color: var(--ink-2); margin: -2px 0 6px; }
mark { background: color-mix(in srgb, var(--accent-2) 30%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
.nav-search svg { width: 18px; height: 18px; vertical-align: -3px; }
.hero-search { max-width: 620px; margin: 24px auto 0; }

/* ---------- prophets */
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 22px 0 60px; }
.p-card { padding: 16px; color: var(--ink); display: grid; gap: 4px; transition: border-color .15s, transform .15s; }
.p-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.p-ar { font-family: var(--font-uthmani); font-size: 30px; line-height: 1.6; color: var(--accent); direction: rtl; text-align: right; }
.p-ar.big { font-size: 48px; text-align: left; }
.p-en { font-weight: 600; font-size: 17px; }
.p-meta { font-size: 13px; color: var(--ink-3); }
.qstrip { display: grid; grid-template-columns: repeat(38, 1fr); gap: 2px; margin-top: 8px; max-width: 460px; }
.qstrip span { aspect-ratio: 1; border-radius: 2px; background: var(--bg-2); }
.qstrip span.on.makkah { background: var(--makkah); }
.qstrip span.on.madinah { background: var(--madinah); }
.p-head { padding: 24px; margin-top: 12px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: end; }
.p-head h1 { font-family: var(--font-display); font-weight: 500; font-size: 34px; margin: 0 0 4px; }
.p-groups { display: grid; gap: 14px; margin-bottom: 60px; }
.p-group { padding: 16px 18px; }
.p-group-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.p-sname { font-weight: 600; color: var(--ink); margin-right: 4px; }
.s-ar-inline { font-family: var(--font-uthmani); margin-left: 8px; color: var(--ink-2); }
.p-ayah { padding: 14px 0; border-bottom: 1px solid var(--line); }
.p-ayah:last-child { border-bottom: 0; padding-bottom: 2px; }
.p-ayah-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.p-arabic { font-size: calc(var(--ar-size) * .85); line-height: 2.2; text-align: right; margin-bottom: 8px; }
.pw.name { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); border-radius: 6px; padding: 0 4px; }
.p-ayah .tr-item { margin-top: 6px; }

@media (max-width: 820px) {
  .p-head { grid-template-columns: 1fr; }
  .qstrip { grid-template-columns: repeat(19, 1fr); }
}

/* ---------- prophets family tree (CSS tree with connector lines) */
.ft-section { margin: 10px 0 60px; }
.ft-forest { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.ft-card { padding: 18px 12px 14px; overflow-x: auto; max-width: 100%; }
.ftree, .ftree ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.ftree ul { padding-top: 18px; position: relative; }
.ftree li { position: relative; padding: 18px 6px 0; display: flex; flex-direction: column; align-items: center; }
.ftree > li { padding-top: 0; }
/* a wide tree is centred when it fits and fully scrollable when it doesn't (centring alone would cut off its left side) */
.ft-card > .ftree { width: max-content; min-width: 100%; margin: 0 auto; }
.ftree li::before, .ftree li::after { content: ""; position: absolute; top: 0; width: 50%; height: 18px; border-top: 2px solid var(--line); }
.ftree li::before { right: 50%; }
.ftree li::after { left: 50%; border-left: 2px solid var(--line); }
.ftree li:only-child::before { display: none; }
.ftree li:only-child::after { border-top: 0; left: 50%; width: 0; }
.ftree li:first-child::before, .ftree li:last-child::after { border-top: 0; }
.ftree li:last-child::before { border-right: 2px solid var(--line); }
.ftree li:first-child:not(:only-child)::after { border-radius: 6px 0 0 0; }
.ftree li:last-child:not(:only-child)::before { border-radius: 0 6px 0 0; }
.ftree > li::before, .ftree > li::after { display: none; }
.ftree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 18px; border-left: 2px solid var(--line); }
.ftree li.rel-adopted-son-of::after, .ftree li.rel-adopted-son-of::before { border-top-style: dashed; }
.ftree li.rel-adopted-son-of::after { border-left-style: dashed; }
.ftree li.rel-adopted-son-of:last-child::before { border-right-style: dashed; }
.ft-node { display: grid; justify-items: center; gap: 0; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-width: 74px; white-space: nowrap; }
.ft-node.prophet { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
a.ft-node:hover { text-decoration: none; border-color: var(--accent); }
.ft-ar { font-family: var(--font-uthmani); font-size: 20px; line-height: 1.9; color: var(--accent); }
.ft-node:not(.prophet) .ft-ar { color: var(--ink-2); }
.ft-en { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.ft-rel { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); margin-bottom: 2px; }
.ft-legend { display: flex; gap: 10px; margin: 12px 0 6px; flex-wrap: wrap; align-items: center; }
.ftree li.rel-ev::after, .ftree li.rel-ev::before, .ftree li.rel-ev > ul::before { border-color: color-mix(in srgb, var(--accent-2) 70%, var(--line)); }
.ftree li.rel-ev > .ft-node { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 45%, transparent); }
.ft-legend-ev { font-size: 13px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-2) 45%, transparent); }
.ft-evidence { padding: 16px 18px; margin-top: 14px; }
button.ft-node { font: inherit; cursor: pointer; }
button.ft-node:hover, button.ft-node:focus-visible { border-color: var(--accent); outline: none; }
button.chip { font: inherit; font-size: 13px; cursor: pointer; }
.pc-head { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pc-head .p-ar { text-align: left; font-size: 40px; }
.pc-h { margin: 18px 0 8px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-3); }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-rel { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.pc-rel:first-of-type { border-top: 0; }
.pc-link { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.pc-link:hover { text-decoration: underline; }
.ft-evidence h3 { margin: 0 0 4px; font-size: 16px; }
.ft-ev-row { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.ft-ev-src { display: flex; flex-wrap: wrap; gap: 6px; }
.ft-ev-quote { font-family: var(--font-naskh); color: var(--ink-2); font-size: 15px; }
.ft-mini { display: inline-block; min-width: 0; font-size: 13px; padding: 4px 10px; }

/* ---------- timeline */
.frame-quote { margin: 22px 0 0; padding: 16px 18px; }
.tl { padding: 20px 20px 16px; margin-top: 22px; }
.tl-periods { display: flex; border-radius: 10px; overflow: hidden; font-size: 13px; }
.period { padding: 8px 12px; color: var(--on-accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.period.makkah { background: var(--makkah); }
.period.madinah { background: var(--madinah); }
.tl-ruler { position: relative; height: 34px; border-bottom: 1px solid var(--line); margin: 0 0 4px; }
.tick { position: absolute; bottom: 0; width: 1px; height: 6px; background: var(--ink-3); }
.tick.major { height: 11px; }
.tick i { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 13px; color: var(--ink-3); }
.ruler-cap { position: absolute; right: 0; top: -2px; font-size: 13px; color: var(--ink-3); display: none; }
.tl-anchors { position: relative; height: 112px; margin-top: -6px; }
.anchor {
  position: absolute; top: 0; transform: translateX(-50%); background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.anchor .stem { width: 1px; background: color-mix(in srgb, var(--accent-2) 60%, transparent); margin: 0 5.5px; }
.anchor.start .stem, .anchor.end .stem { align-self: flex-start; }
.anchor.end .stem { align-self: flex-end; }
.anchor.start { transform: translateX(-6px); align-items: flex-start; }
.anchor.start .lbl { text-align: left; }
.anchor.end { transform: translateX(calc(-100% + 6px)); align-items: flex-end; }
.anchor.end .lbl { text-align: right; }
.anchor .pin { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent); }
.anchor .lbl { font-size: 13px; line-height: 1.25; color: var(--ink); text-align: center; white-space: nowrap; }
.anchor .lbl em { color: var(--ink-3); font-style: normal; }
.anchor:hover .lbl { color: var(--accent); }
@media (max-width: 520px) {
  .tl-anchors { position: static; height: auto; margin-top: 8px; display: grid; gap: 2px; }
  .anchor, .anchor.start, .anchor.end { position: static; transform: none; flex-direction: row; align-items: center; gap: 10px;
    min-height: 36px; padding: 2px 4px; border-radius: 8px; text-align: left; }
  .anchor .stem { display: none; }
  .anchor .lbl, .anchor.start .lbl, .anchor.end .lbl { text-align: left; white-space: normal; }
}
.tl-lane-label { font-size: 13px; font-weight: 600; margin: 10px 0 6px; }
.tl-surahs { position: relative; height: 120px; border-bottom: 1px solid var(--line); }
.sbar {
  position: absolute; bottom: 0; width: 0.62%; min-width: 2px; transform: translateX(-50%);
  border-radius: 2px 2px 0 0; background: var(--makkah); opacity: .85; transition: opacity .15s;
}
.sbar.madinah { background: var(--madinah); }
.sbar:hover { opacity: 1; outline: 2px solid var(--ink); }
.tl-surahs.focus .sbar { opacity: .15; }
.tl-surahs.focus .sbar.hit { opacity: 1; outline: 2px solid var(--accent-2); }
.events { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 60px; }
.ev-col { display: grid; gap: 10px; align-content: start; min-width: 0; }
.ev-h { margin: 0 0 4px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.ev-h.makkah { color: var(--makkah); }
.ev-h.madinah { color: var(--madinah); }
.ev {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; text-align: left; padding: 14px; width: 100%;
  border-left: 3px solid var(--makkah); transition: transform .15s, border-color .15s;
}
.ev.madinah { border-left-color: var(--madinah); }
.ev:hover { transform: translateX(3px); }
.ev-n { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ev-name { font-weight: 600; line-height: 1.3; }
.ev-ur { font-size: 15px; color: var(--ink-2); text-align: left; line-height: 2; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip.dated { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); font-weight: 600; }
.seerah-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

@media (max-width: 820px) {
  .events { grid-template-columns: 1fr; }
  .anchor .lbl { font-size: 13px; }
}

footer.foot { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 13px; color: var(--ink-3); }

.skeleton { color: var(--ink-3); padding: 40px 0; text-align: center; }

@media (max-width: 820px) {
  .gate-card { grid-template-columns: 1fr; padding: 20px; }
  .nav .label { display: none; }
  .brand .ar { display: none; }
}
.gate-card > *, .grid > * { min-width: 0; }
.journey-bars a { min-width: 0; }
.chip.hadith-chip { white-space: normal; }
@media (max-width: 520px) {
  .ayah-head { gap: 4px; }
  .ayah-head .tiny { display: none; }
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a, .icon-btn { padding: 8px 7px; font-size: 13px; }
  .journey-bars { gap: 1px; }
  .gate-card { padding: 16px; }
  .gate-wrap { padding: 14px 16px; }
  .gate { padding: 14px 0 4px; }
  .gh-ar { font-size: 36px; }
  .gate-head h1 { font-size: 24px; }
  .stats { gap: 6px; }
  .stat { padding: 10px 8px; }
  .seg button { padding: 6px 9px; }
  :root { --ar-size: 28px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat .v { font-size: 18px; }
  .gate-title .ar { font-size: 44px; }
}

/* ---------- "Aa": the one settings button (top right on every page) and its sheet */
.top .aa-btn, .aa-btn { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 0 8px;
  font: 600 17px/1 var(--font-display); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 0; border-radius: 12px; }
.top .aa-btn:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.top .icon-btn#open-mushaf { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 0; }
.top .icon-btn#open-mushaf svg { width: 21px; height: 21px; }
.aa-sheet { max-height: 92vh; }
@media (min-width: 1024px) { .aa-sheet { width: 480px; } }
@media (min-width: 600px) and (max-width: 1023px) { .aa-sheet { max-height: calc(100vh - 100px); } }
.aa-head { display: flex; align-items: center; gap: 4px; position: sticky; top: -8px; z-index: 1; background: var(--surface); padding: 2px 0 6px; }
.aa-head .aa-title { flex: 1; margin: 0 6px; }
.aa-back { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 0; }
.aa-back svg { width: 22px; height: 22px; }
.aa-back[hidden] { display: none; }
.aa-done { border: 0; background: none; color: var(--accent); font-weight: 600; min-height: 44px; }
.aa-body { padding: 0 6px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.aa-preview { padding: 6px 14px 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.aa-preview p { margin: 0; }
.aa-ar { font-size: var(--ar-size); line-height: 2; text-align: right; }
.aa-ar.ar-uthmani { font-family: var(--font-uthmani); }
.aa-ar.ar-indopak { font-family: var(--font-indopak); line-height: 2.3; }
.aa-tr { font-size: var(--tr-size); line-height: 1.6; }
.aa-tr.urdu { font-family: var(--font-urdu); font-size: calc(var(--tr-size) + 2px); line-height: 2.3; text-align: right; }
.aa-group { display: grid; gap: 8px; }
.aa-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.aa-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.aa-swatch { min-height: 64px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 500; padding: 6px 2px; }
.aa-swatch.on { border-color: var(--accent); font-weight: 600; }
.aa-sw { width: 36px; height: 22px; border-radius: 6px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 3px; }
.aa-sw i { width: 8px; height: 8px; border-radius: 50%; }
.aa-sw-auto { background: linear-gradient(135deg, #f7f3ea 50%, #0e1320 50%); }
.aa-sw-auto i:first-child { background: #0f6b5c; } .aa-sw-auto i:last-child { background: #e0b45c; }
.aa-sw-sabz { background: #f7f3ea; } .aa-sw-sabz i:first-child { background: #0f6b5c; } .aa-sw-sabz i:last-child { background: #86601f; }
.aa-sw-lajward { background: #f2f4f8; } .aa-sw-lajward i:first-child { background: #1d4b9b; } .aa-sw-lajward i:last-child { background: #0d6f6c; }
.aa-sw-shab { background: #0e1320; } .aa-sw-shab i:first-child { background: #e0b45c; } .aa-sw-shab i:last-child { background: #6cc4b2; }
.aa-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.aa-seg button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 14px; padding: 0 4px; }
.aa-seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.aa-range { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.aa-range-l { width: 88px; font-size: 14px; }
.aa-range input { flex: 1; accent-color: var(--accent); min-height: 32px; }
.aa-big-a { font-size: 20px; color: var(--ink-2); }
.aa-rows { border-top: 1px solid var(--line); }
.aa-row { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); padding: 0 2px; text-align: left; }
.aa-row:hover { background: var(--bg-2); }
.aa-row-l { flex: none; font-weight: 500; }
.aa-row-v { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.aa-pick.on { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.aa-list { display: grid; }

/* ---------- player: one card just above the tab bar (phones, tablets) or along the bottom (desktop).
   Tapping it expands the controls in place; it never covers the text with a second copy of it. */
:root { --player-bg: #123f37; --player-ink: #f7f3ea; --player-ink-2: #c8d9d3; --player-track: #2c5a51; --player-fill: #e9c983; --player-on-fill: #1a1406; }
:root[data-scheme="lajward"] { --player-bg: #14284f; --player-ink: #f2f4f8; --player-ink-2: #c3cde2; --player-track: #2f4570; --player-fill: #7fd6cf; --player-on-fill: #0b1b2e; }
:root[data-theme="dark"] { --player-bg: #232c40; --player-ink: #ede7da; --player-ink-2: #bdb5a5; --player-track: #3a4664; --player-fill: #e0b45c; --player-on-fill: #1a1406; }
.pstrip { position: fixed; z-index: 35; left: 8px; right: 8px; bottom: 12px; max-width: 640px; margin: 0 auto;
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: var(--player-bg); color: var(--player-ink); box-shadow: 0 6px 20px rgba(0, 0, 0, .22); }
.pstrip-row { display: flex; align-items: center; gap: 4px; min-height: 62px; padding: 0 4px 0 14px; }
.pstrip-bar { height: 3px; background: var(--player-track); }
.pstrip-bar i { display: block; height: 3px; width: 0; background: var(--player-fill); }
.pstrip-info { flex: 1; min-width: 0; min-height: 54px; display: flex; flex-direction: column; justify-content: center; align-items: stretch;
  border: 0; background: none; color: inherit; padding: 0; text-align: left; }
.pstrip-l1 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pstrip-l2 { font-size: 13px; color: var(--player-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.pstrip-chev { flex: none; display: grid; place-items: center; width: 20px; color: var(--player-ink-2); transform: rotate(180deg); transition: transform .2s; pointer-events: none; }
.pstrip-chev svg { width: 18px; height: 18px; }
.pstrip.open .pstrip-chev { transform: none; }
.pstrip-play { flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--player-fill); color: var(--player-on-fill); display: grid; place-items: center; }
.pstrip-play svg { width: 20px; height: 20px; }
.pstrip .icon-btn { color: var(--player-ink); background: none; }
.pstrip .icon-btn:hover { background: rgba(255, 255, 255, .1); color: var(--player-ink); }
.pstrip .pstrip-side { flex: none; min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; }
.pstrip .pstrip-side svg { width: 20px; height: 20px; }
.pstrip .pstrip-side[hidden] { display: none; }
.pstrip :focus-visible { outline-color: var(--player-fill); }
/* expanded controls (above the row, inside the same card) */
.pc { display: grid; gap: 6px; padding: 14px 14px 4px; border-bottom: 1px solid var(--player-track); }
.pc[hidden] { display: none; }
.pc-range { width: 100%; margin: 0; min-height: 32px; accent-color: var(--player-fill); }
.pc-times { display: flex; justify-content: space-between; font-size: 13px; color: var(--player-ink-2); font-variant-numeric: tabular-nums; }
.pc-buttons { display: flex; justify-content: space-between; align-items: center; }
.pstrip .pc-btn { min-width: 48px; min-height: 48px; display: grid; place-items: center; padding: 0; border-radius: 12px; }
.pstrip .pc-btn svg { width: 22px; height: 22px; }
.pstrip .pc-btn.on { color: var(--player-on-fill); background: var(--player-fill); }
.pc-rate { font-weight: 600; font-size: 15px; }
.pc-extra { display: flex; gap: 8px; padding-bottom: 10px; }
.pc-chip { min-height: 44px; border-radius: 12px; border: 1px solid var(--player-track); background: none; color: var(--player-ink); font-size: 14px; font-weight: 500; padding: 0 12px; }
.pc-chip:hover { background: rgba(255, 255, 255, .08); }
.pc-chip.on { border-color: var(--player-fill); color: var(--player-fill); }
.pc-rec { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; }
.pc-rec-ic svg { width: 18px; height: 18px; display: block; }
.pc-rec-n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.has-player { padding-bottom: 88px; }
body.has-player .toast { bottom: 90px; }
body.has-player.player-open { padding-bottom: 300px; }
@media (max-width: 1023px) {
  .pstrip { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar.has-player { padding-bottom: calc(146px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar.has-player.player-open { padding-bottom: calc(360px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar.has-player .toast { bottom: calc(146px + env(safe-area-inset-bottom, 0px)); }
}
.ayah.playing { border-radius: 14px; box-shadow: inset 3px 0 0 var(--accent); }
