/* ==========================================================================
   Quran Web — Islamic theme
   Emerald & gold palette, girih (8-fold star) patterns, arches, cartouches,
   ayah medallions and an illuminated Mushaf frame.
   ========================================================================== */

/* ---------- Ornament assets (used as CSS masks so they take theme colours) ---------- */
:root {
  --girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='black' stroke-width='1.1'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='5'/%3E%3Cpath d='M0 0l20 20M64 0L44 20M0 64l20-20M64 64L44 44M32 0v15M32 64V49M0 32h15M64 32H49'/%3E%3C/g%3E%3C/svg%3E");
  --octagram: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='black'%3E%3Crect x='8' y='8' width='24' height='24'/%3E%3Crect x='8' y='8' width='24' height='24' transform='rotate(45 20 20)'/%3E%3C/g%3E%3C/svg%3E");
  --medallion: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='7' y='7' width='26' height='26' rx='1.5'/%3E%3Crect x='7' y='7' width='26' height='26' rx='1.5' transform='rotate(45 20 20)'/%3E%3Ccircle cx='20' cy='20' r='11'/%3E%3C/g%3E%3C/svg%3E");
  --divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 24'%3E%3Cg fill='black'%3E%3Cpath d='M0 11.4h96v1.2H0zM144 11.4h96v1.2h-96z'/%3E%3Crect x='113' y='5' width='14' height='14'/%3E%3Crect x='113' y='5' width='14' height='14' transform='rotate(45 120 12)'/%3E%3Cpath d='M99 12l4-4 4 4-4 4zM133 12l4-4 4 4-4 4z'/%3E%3Ccircle cx='92' cy='12' r='2'/%3E%3Ccircle cx='148' cy='12' r='2'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Colour schemes (accent) ---------- */
:root, html[data-accent="emerald"] { --p: #0b5d45; --p-deep: #062e22; --p-light: #4cc39a; --gold: #c9a44c; --gold-2: #e8cf8a; }
html[data-accent="iznik"]  { --p: #1b4f8c; --p-deep: #0c2547; --p-light: #7fb1ec; --gold: #c9a44c; --gold-2: #e8cf8a; }
html[data-accent="maroon"] { --p: #7d1f2c; --p-deep: #3e0d14; --p-light: #e58a97; --gold: #caa153; --gold-2: #ecd29a; }
html[data-accent="teal"]   { --p: #1f6f5c; --p-deep: #0d3a30; --p-light: #6fd3b8; --gold: #b99a52; --gold-2: #e4d3a1; }
html[data-accent="gold"]   { --p: #6b4f12; --p-deep: #2a1e05; --p-light: #e3c46b; --gold: #d4af37; --gold-2: #f3dc8c; }

/* ---------- Light (Ivory) ---------- */
:root {
  --bg: #fbf8f1;
  --bg-soft: #f4efe2;
  --surface: #fffdf8;
  --surface-2: #f3eee1;
  --text: #1f2520;
  --muted: #5c6358;
  --faint: #6b6e62;
  --border: #e6dcc4;
  --accent: var(--p);
  --accent-2: var(--gold);
  --accent-soft: color-mix(in srgb, var(--p) 9%, var(--surface));
  --accent-text: #fffdf5;
  --gold-soft: color-mix(in srgb, var(--gold) 18%, transparent);
  --highlight: color-mix(in srgb, var(--gold) 16%, transparent);
  --word-hl: var(--p);
  --page: #fffcf2;
  --pattern-op: .07;
  --shadow: 0 1px 2px rgba(60, 45, 10, .06), 0 6px 18px rgba(60, 45, 10, .07);
  --shadow-lg: 0 24px 60px rgba(30, 22, 5, .22);
  --radius: 16px;
  --radius-sm: 12px;
  --ar-size: 2rem;
  --tr-size: 1.05rem;
  --ar-font: "Amiri Quran", "Amiri", "Scheherazade New", serif;
  --ui-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head-font: "Cormorant Garamond", Georgia, serif;
  --ur-font: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif;
  --player-h: 0px;
  color-scheme: light;
}

/* ---------- Sepia (Manuscript) ---------- */
html[data-mode="sepia"] {
  --bg: #f1e6cc;
  --bg-soft: #eadcbc;
  --surface: #f8efd9;
  --surface-2: #ecdfc0;
  --text: #3a2c1a;
  --muted: #6c5a40;
  --faint: #6e5a3e;
  --border: #dcc9a0;
  --page: #f7ecd2;
  --pattern-op: .09;
}

/* ---------- Dark (Night) ---------- */
html[data-mode="dark"] {
  --bg: #0b1210;
  --bg-soft: #0f1916;
  --surface: #121d1a;
  --surface-2: #182622;
  --text: #ece6d6;
  --muted: #b1ab98;
  --faint: #807b6b;
  --border: #283630;
  --accent: var(--p-light);
  --accent-soft: color-mix(in srgb, var(--p-light) 12%, var(--surface));
  --accent-text: #0a1411;
  --highlight: color-mix(in srgb, var(--gold) 13%, transparent);
  --word-hl: var(--gold-2);
  --page: #141f1b;
  --pattern-op: .06;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
html[data-mode="dark"][data-accent="emerald"] { --bg: #08130f; --surface: #0f1c17; --surface-2: #15261f; }
html[data-mode="dark"][data-accent="iznik"]   { --bg: #0a0f18; --bg-soft: #0e1520; --surface: #111a27; --surface-2: #172233; --border: #243247; }
html[data-mode="dark"][data-accent="maroon"]  { --bg: #140a0c; --bg-soft: #1a0f12; --surface: #1d1215; --surface-2: #26181c; --border: #3a262b; }
html[data-mode="dark"][data-accent="gold"]    { --bg: #110e07; --bg-soft: #17130a; --surface: #1b160c; --surface-2: #241d10; --border: #3a301b; }

/* Font + size preferences (classes on <html>) */
html.font-scheherazade { --ar-font: "Scheherazade New", "Amiri Quran", serif; }
html.font-naskh { --ar-font: "Noto Naskh Arabic", "Amiri Quran", serif; }
html.ar-1 { --ar-size: 1.35rem } html.ar-2 { --ar-size: 1.6rem } html.ar-3 { --ar-size: 1.8rem }
html.ar-4 { --ar-size: 2rem }    html.ar-5 { --ar-size: 2.3rem } html.ar-6 { --ar-size: 2.6rem }
html.ar-7 { --ar-size: 2.95rem } html.ar-8 { --ar-size: 3.3rem } html.ar-9 { --ar-size: 3.7rem } html.ar-10 { --ar-size: 4.2rem }
html.tr-1 { --tr-size: .85rem }  html.tr-2 { --tr-size: .95rem } html.tr-3 { --tr-size: 1.05rem }
html.tr-4 { --tr-size: 1.15rem } html.tr-5 { --tr-size: 1.25rem } html.tr-6 { --tr-size: 1.38rem }
html.tr-7 { --tr-size: 1.5rem }  html.tr-8 { --tr-size: 1.65rem } html.tr-9 { --tr-size: 1.8rem } html.tr-10 { --tr-size: 2rem }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 140px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ui-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--player-h) + var(--tab-h, 0px));
  transition: background-color .25s, color .25s;
  position: relative;
}
/* faint girih pattern across the whole page */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--gold); opacity: calc(var(--pattern-op) * .55);
  -webkit-mask: var(--girih) 0 0 / 96px 96px repeat; mask: var(--girih) 0 0 / 96px 96px repeat;
}
::selection { background: color-mix(in srgb, var(--gold) 35%, transparent); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.i { width: 20px; height: 20px; flex: none; vertical-align: middle; }
[lang="ar"] { font-family: var(--ar-font); }
[lang="ur"] { font-family: var(--ur-font); line-height: 2.3; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--head-font); letter-spacing: .005em; }

html { scrollbar-color: color-mix(in srgb, var(--gold) 55%, var(--border)) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--gold) 50%, var(--border)); border-radius: 10px; border: 2px solid var(--bg); }

.skip { position: absolute; left: -999px; top: 0; background: var(--p); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container--read { max-width: 920px; }

/* Reusable ornaments */
.ornament-divider {
  height: 24px; width: min(360px, 80%); margin: 0 auto;
  background: var(--gold);
  -webkit-mask: var(--divider) center / contain no-repeat; mask: var(--divider) center / contain no-repeat;
}
.ornament-divider--sm { width: min(240px, 70%); height: 18px; margin: 4px auto 10px; }

/* Reading progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.progress__bar { height: 100%; width: 100%; transform: scaleX(0); transform-origin: left center; background: linear-gradient(90deg, var(--gold), var(--gold-2), var(--gold)); transition: transform .1s linear; will-change: transform; }
[dir="rtl"] .progress__bar { transform-origin: right center; }

/* ---------- Buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 500; font-size: .92rem; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { border-color: var(--gold); text-decoration: none; box-shadow: 0 0 0 3px var(--gold-soft); }
.btn:active { transform: scale(.98); }
.btn .i { width: 17px; height: 17px; }
.btn--primary {
  background: linear-gradient(180deg, var(--p), var(--p-deep));
  border-color: color-mix(in srgb, var(--gold) 70%, var(--p)); color: #fffdf5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
html[data-mode="dark"] .btn--primary { background: linear-gradient(180deg, var(--p), var(--p-deep)); color: #fffdf5; }
.btn--primary:hover { filter: brightness(1.1); }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--gold-soft); color: var(--accent); }
.icon-btn .i { width: 18px; height: 18px; }
.icon-btn--lg { width: 40px; height: 40px; }
.icon-btn--lg .i { width: 21px; height: 21px; }
.icon-btn.is-on { color: var(--gold); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: .85rem; cursor: pointer; color: var(--muted);
}
.chip .i { width: 16px; height: 16px; }
.chip[aria-pressed="true"] { color: var(--accent); border-color: var(--gold); background: var(--gold-soft); }

.pill {
  display: inline-block; padding: 6px 15px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: .88rem; font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.pill:hover { text-decoration: none; border-color: var(--gold); }
.pill--static { background: var(--surface-2); color: var(--muted); margin: 3px; }

.input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
.input--sm { padding: 7px 12px; font-size: .9rem; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; color: #f6efdc;
  background: linear-gradient(180deg, var(--p-deep), color-mix(in srgb, var(--p-deep) 85%, var(--p)));
  box-shadow: 0 2px 14px rgba(0, 0, 0, .18);
  transition: transform .25s ease;
}
.topbar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--gold); opacity: .12;
  -webkit-mask: var(--girih) 0 0 / 56px 56px repeat; mask: var(--girih) 0 0 / 56px 56px repeat;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 15%, var(--gold-2) 50%, var(--gold) 85%, transparent);
}
.topbar.is-hidden { transform: translateY(calc(-100% - 4px)); }
.topbar__inner { position: relative; max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 62px; display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff8e6; }
.brand:hover { text-decoration: none; }
.brand { gap: 10px; }
.brand__emblem { width: 44px; height: 44px; flex: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35)); transition: transform .5s ease; }
.brand:hover .brand__emblem { transform: rotate(45deg); }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name {
  font-family: var(--head-font); font-weight: 700; font-size: 1.42rem; letter-spacing: .01em;
  background: linear-gradient(180deg, #fff6d8, var(--gold-2) 55%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__sub { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #d8ceb0; }
.brand__sub [lang="ur"] { font-family: "Aref Ruqaa", "Amiri", serif; font-weight: 400; font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--gold-2); line-height: 1; }
.brand__sep { color: var(--gold); font-size: .7rem; letter-spacing: 0; }
.topbar__nav { display: flex; align-items: center; gap: 2px; }
.topbar__nav a, .nav-more > summary { padding: 7px 12px; border-radius: 8px; color: #e6dfca; font-weight: 500; font-size: .93rem; white-space: nowrap; }
/* "More ▾": the less used pages in a small menu, so the bar stays on one line */
.nav-more { position: relative; }
.nav-more > summary { display: flex; align-items: center; gap: 3px; cursor: pointer; list-style: none; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary .i { width: 14px; height: 14px; transition: transform .2s; }
.nav-more[open] > summary .i { transform: rotate(180deg); }
.nav-more > summary:hover, .nav-more[open] > summary { background: rgba(255, 255, 255, .08); color: var(--gold-2); }
.nav-more__menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 46; min-width: 210px; padding: 6px;
  display: flex; flex-direction: column; background: var(--p-deep); border: 1px solid var(--gold); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.nav-more__menu a { padding: 9px 12px; }
.topbar__nav a:hover { background: rgba(255, 255, 255, .08); color: var(--gold-2); text-decoration: none; }
.topbar__actions { margin-left: auto; display: flex; gap: 2px; }
.topbar .icon-btn { color: #e6dfca; }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: var(--gold-2); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center; color: #fbf5e4;
  padding: 64px 0 70px;
  background:
    radial-gradient(700px 360px at 50% 0%, color-mix(in srgb, var(--p) 80%, #fff 8%), transparent 70%),
    linear-gradient(180deg, var(--p-deep), var(--p) 140%);
}
.hero__pattern {
  position: absolute; inset: 0; background: var(--gold); opacity: .16; pointer-events: none;
  -webkit-mask: var(--girih) center / 72px 72px repeat; mask: var(--girih) center / 72px 72px repeat;
  -webkit-mask-composite: source-in;
}
.hero::after { /* soft vignette + bottom scallop line */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  background: var(--bg);
  -webkit-mask: radial-gradient(14px 14px at 14px 0, transparent 97%, #000) 0 0 / 28px 26px repeat-x;
  mask: radial-gradient(14px 14px at 14px 0, transparent 97%, #000) 0 0 / 28px 26px repeat-x;
}
.hero__arch {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(820px, 96%); height: 94%; pointer-events: none;
}
.hero__arch path { fill: none; stroke: var(--gold); stroke-width: 1.6; vector-effect: non-scaling-stroke; opacity: .75; }
.hero__arch path + path { stroke-width: 1; opacity: .45; }
.hero__inner { position: relative; max-width: 700px; margin: 0 auto; padding: 0 24px; }
.hero__star {
  width: 44px; height: 44px; margin: 0 auto 6px; background: linear-gradient(135deg, var(--gold-2), var(--gold));
  -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3));
}
.hero__cal {
  font-family: "Amiri Quran", serif; font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1.55;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .15);
}
.hero__title { font-size: clamp(1.45rem, 3.2vw, 2.1rem); font-weight: 600; margin: 0 0 24px; color: #fbf5e4; }
.hero__search {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--gold); border-radius: 999px; padding: 6px 6px 6px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25), 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent);
}
.hero__search:focus-within { box-shadow: 0 10px 30px rgba(0, 0, 0, .25), 0 0 0 5px color-mix(in srgb, var(--gold) 40%, transparent); }
.hero__search .i { color: var(--faint); }
.hero__search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--text); padding: 8px 0; }
.hero__search input:focus { outline: none; }
.hero__search--inline { max-width: 680px; margin-top: 14px; box-shadow: var(--shadow); }
.hero__quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.hero .pill { background: rgba(255, 255, 255, .08); color: #f6ecd0; border-color: color-mix(in srgb, var(--gold) 60%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.hero .pill:hover { background: color-mix(in srgb, var(--gold) 25%, transparent); color: #fff; }

/* ---------- Home cards ---------- */
.home-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 20px 0 34px; }
.card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
}
.card::after { /* corner rosette */
  content: ""; position: absolute; right: -26px; top: -26px; width: 110px; height: 110px; background: var(--gold); opacity: .12;
  pointer-events: none; /* decoration only: taps go through to the buttons under it */
  -webkit-mask: var(--medallion) center / contain no-repeat; mask: var(--medallion) center / contain no-repeat;
}
.card__label { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.card__label::before { content: ""; width: 12px; height: 12px; background: var(--gold); -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat; }
.card__link { display: flex; flex-direction: column; color: var(--text); }
.card__link strong { font-family: var(--head-font); font-size: 1.45rem; }
.card__link span { color: var(--muted); font-size: .9rem; }
.card--continue { border-inline-start: 4px solid var(--gold); }
.card--votd { grid-column: span 2; background: linear-gradient(135deg, var(--surface), var(--accent-soft)); border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.votd__ar { font-size: 1.95rem; line-height: 2.15; margin: 4px 0 8px; position: relative; }
.votd__tr { color: var(--muted); margin: 0 0 10px; position: relative; }
.votd__ref { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: .92rem; }
.votd__ref .i { width: 16px; height: 16px; }
@media (max-width: 720px) { .card--votd { grid-column: auto; } }

/* ---------- Index (surah list) ---------- */
.index__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.index__tools { display: flex; gap: 8px; align-items: center; }
.index__tools .input { width: 220px; }
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; border: 1px solid var(--border); }
.tabs button { border: 0; background: transparent; padding: 7px 17px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: .9rem; color: var(--muted); }
.tabs button[aria-selected="true"] { background: linear-gradient(180deg, var(--p), var(--p-deep)); color: #fffdf5; box-shadow: var(--shadow); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-bottom: 52px; }
.grid--compact { margin-bottom: 24px; }
.surah-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.surah-card::after {
  content: ""; position: absolute; inset: 0; background: var(--gold); opacity: 0; transition: opacity .2s; pointer-events: none;
  -webkit-mask: var(--girih) 0 0 / 48px 48px repeat; mask: var(--girih) 0 0 / 48px 48px repeat;
}
.surah-card:hover { border-color: var(--gold); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.surah-card:hover::after { opacity: .08; }

/* 8-point star number badge */
.surah-card__num {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; position: relative;
  font-weight: 700; font-size: .86rem; color: var(--accent);
}
.surah-card__num::before {
  content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--gold) 80%, var(--p));
  -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat;
  transition: transform .4s ease;
}
.surah-card__num::after {
  content: ""; position: absolute; inset: 3px; background: var(--surface);
  -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat;
}
.surah-card__num span { position: relative; z-index: 1; }
.surah-card:hover .surah-card__num::before, .juz-card__row:hover .surah-card__num::before { transform: rotate(45deg); }
.surah-card:hover .surah-card__num::after, .juz-card__row:hover .surah-card__num::after { background: var(--p); }
.surah-card:hover .surah-card__num span, .juz-card__row:hover .surah-card__num span { color: #fffdf5; }
.surah-card__num--sm { width: 36px; height: 36px; font-size: .78rem; }
.surah-card__names { display: flex; flex-direction: column; min-width: 0; flex: 1; position: relative; }
.surah-card__names strong { font-weight: 600; }
.surah-card__names small, .surah-card__ar small { color: var(--faint); font-size: .78rem; }
.surah-card__ar { display: flex; flex-direction: column; align-items: flex-end; text-align: right; position: relative; }
.surah-card__ar [lang="ar"] { font-family: "Amiri", serif; font-size: 1.35rem; line-height: 1.25; margin-bottom: 4px; color: var(--accent); }

.juz-grid { columns: 3 300px; column-gap: 12px; margin-bottom: 52px; }
.juz-card { break-inside: avoid; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.juz-card__head {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 16px;
  font-family: var(--head-font); font-size: 1.15rem; font-weight: 700; color: #fbf5e4;
  background: linear-gradient(90deg, var(--p-deep), var(--p));
  border-bottom: 2px solid var(--gold);
}
.juz-card__head:hover { text-decoration: none; color: var(--gold-2); }
.juz-card__row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--text); border-top: 1px solid var(--border); }
.juz-card__row:first-of-type { border-top: 0; }
.juz-card__row:hover { background: var(--bg-soft); text-decoration: none; }
.juz-card__row > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.juz-card__row small { color: var(--faint); font-size: .78rem; }
.juz-card__ar { font-family: "Amiri", serif; font-size: 1.2rem; color: var(--accent); }

/* ---------- Home index: a "Fihrist" like the contents page of a printed Quran ---------- */
.fihrist {
  position: relative; isolation: isolate; margin: 36px 0 56px; padding: 26px 30px 22px;
  background: var(--page); border: 1px solid var(--gold); border-radius: 6px;
  outline: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); outline-offset: 6px;
  box-shadow: var(--shadow);
}
.fihrist::before { /* corner rosettes */
  content: ""; position: absolute; inset: 8px; z-index: -1; pointer-events: none; background: var(--gold);
  -webkit-mask:
    var(--medallion) left top / 24px 24px no-repeat, var(--medallion) right top / 24px 24px no-repeat,
    var(--medallion) left bottom / 24px 24px no-repeat, var(--medallion) right bottom / 24px 24px no-repeat;
  mask:
    var(--medallion) left top / 24px 24px no-repeat, var(--medallion) right top / 24px 24px no-repeat,
    var(--medallion) left bottom / 24px 24px no-repeat, var(--medallion) right bottom / 24px 24px no-repeat;
}
.fihrist__head { text-align: center; margin-bottom: 18px; }
.fihrist__title { display: flex; flex-direction: column; align-items: center; gap: 0; margin-bottom: 14px; }
.fihrist__title-ur { font-family: "Aref Ruqaa", "Amiri", serif; font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--accent); line-height: 1.6; }
.fihrist__title-en { font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.fihrist__title-en::before, .fihrist__title-en::after { content: "۞"; margin: 0 10px; letter-spacing: 0; }
.fihrist__bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); }
.fihrist__tabs { display: flex; gap: 4px; }
.fihrist__tabs button {
  border: 0; background: none; cursor: pointer; padding: 6px 14px 8px; margin-bottom: -1px;
  display: flex; flex-direction: column; align-items: center; line-height: 1.25;
  font-size: .88rem; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent;
}
.fihrist__tabs button span { font-family: "Amiri", serif; font-weight: 400; font-size: 1rem; }
.fihrist__tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--gold); }
.fihrist__tabs button:hover { color: var(--text); }
.fihrist__bar .index__tools { padding-bottom: 8px; }

.fihrist__list { columns: 2; column-gap: 44px; column-rule: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.fihrist-row {
  break-inside: avoid; display: grid; align-items: baseline; column-gap: 10px;
  grid-template-columns: 2.1rem auto minmax(12px, 1fr) auto;
  grid-template-areas: "num en dots ar" "num meta meta ar";
  padding: 9px 6px 8px; color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--gold) 22%, var(--border));
}
.fihrist-row:hover { background: var(--gold-soft); text-decoration: none; }
.fihrist-row__num {
  grid-area: num; align-self: center; width: 30px; height: 30px; display: grid; place-items: center;
  border: 1.5px solid var(--gold); border-radius: 50%; font-size: .78rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums;
}
.fihrist-row:hover .fihrist-row__num { background: var(--p); color: #fffdf5; border-color: var(--p); }
.fihrist-row__en { grid-area: en; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fihrist-row__en strong { font-weight: 600; }
.fihrist-row__en small { color: var(--faint); font-size: .8rem; }
.fihrist-row__dots { grid-area: dots; align-self: end; height: 1px; margin-bottom: .45em; border-bottom: 2px dotted color-mix(in srgb, var(--gold) 60%, transparent); }
.fihrist-row__ar { grid-area: ar; align-self: center; font-family: "Amiri", serif; font-weight: 700; font-size: 1.45rem; line-height: 1.3; color: var(--accent); }
.fihrist-row__meta { grid-area: meta; font-size: .75rem; color: var(--faint); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.fihrist-row__place { padding: 0 7px; border-radius: 4px; font-weight: 600; font-size: .7rem; letter-spacing: .03em; }
.fihrist-row__place--makki { background: var(--gold-soft); color: color-mix(in srgb, var(--gold) 55%, var(--text)); }
.fihrist-row__place--madani { background: var(--accent-soft); color: var(--accent); }
.fihrist-row__rev { display: none; color: var(--accent); font-weight: 600; }
.fihrist__list.is-revelation .fihrist-row__rev { display: inline; }

.para-grid { columns: 3 280px; column-gap: 16px; }
.para-card { break-inside: avoid; margin-bottom: 16px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--border)); border-radius: 10px; overflow: hidden; }
.para-card__head {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "num name" "num label"; align-items: center; column-gap: 12px;
  padding: 10px 14px; color: var(--text); background: var(--bg-soft); border-bottom: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.para-card__head:hover { text-decoration: none; background: var(--gold-soft); }
.para-card__num {
  grid-area: num; position: relative; isolation: isolate; width: 40px; height: 40px; display: grid; place-items: center;
  font-weight: 700; font-size: .9rem; color: #fbf5e4;
}
.para-card__num::before, .para-card__num::after { content: ""; position: absolute; -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat; }
.para-card__num::before { inset: 0; z-index: -1; background: linear-gradient(180deg, var(--p), var(--p-deep)); }
.para-card__num::after { inset: -3px; z-index: -2; background: var(--gold); }
.para-card__name { grid-area: name; font-family: "Amiri", serif; font-weight: 700; font-size: 1.5rem; line-height: 1.5; color: var(--accent); text-align: right; }
.para-card__label { grid-area: label; font-size: .74rem; color: var(--faint); letter-spacing: .04em; }
.para-card__label [lang="ur"] { font-family: "Amiri", serif; font-size: 1.05em; }
.para-card__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; color: var(--text); border-top: 1px dashed var(--border); font-size: .9rem; }
.para-card__row:first-of-type { border-top: 0; }
.para-card__row:hover { background: var(--bg-soft); text-decoration: none; }
.para-card__row small { color: var(--faint); font-size: .76rem; }
.para-card__ar { font-family: "Amiri", serif; font-size: 1.15rem; color: var(--accent); }
@media (max-width: 860px) {
  .fihrist__list { columns: 1; }
}
@media (max-width: 640px) {
  .fihrist { padding: 18px 12px 14px; outline-offset: 3px; margin-top: 24px; }
  .fihrist__tabs { width: 100%; }
  .fihrist__tabs button { flex: 1; padding: 6px 4px 8px; font-size: .78rem; }
  .fihrist__bar .index__tools { width: 100%; }
  .fihrist__bar .index__tools .input { flex: 1; width: auto; }
  .fihrist-row { grid-template-columns: 1.9rem minmax(0, 1fr) auto; grid-template-areas: "num en ar" "num meta ar"; }
  .fihrist-row__dots { display: none; }
  .fihrist-row__ar { font-size: 1.3rem; }
}

/* ---------- Reader ---------- */
.reader-nav {
  position: sticky; top: 62px; z-index: 30;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); transition: top .25s ease;
}
.topbar.is-hidden ~ .main .reader-nav { top: 0; }
.reader-nav__inner { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 8px; }
.reader-nav__select select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--border); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23b8963f' stroke-width='3' d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text); padding: 7px 30px 7px 12px; border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; max-width: 220px;
}
.reader-nav__select select:focus { outline: none; border-color: var(--gold); }
.reader-nav__modes { margin-left: auto; display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; border: 1px solid var(--border); }
.reader-nav__modes a { padding: 5px 14px; border-radius: 999px; color: var(--muted); font-size: .86rem; font-weight: 500; }
.reader-nav__modes a:hover { text-decoration: none; color: var(--text); }
.reader-nav__modes a [lang="ur"] { font-family: "Amiri", serif; font-size: 1.05em; margin-left: 3px; }
.reader-nav__modes a.is-active { background: linear-gradient(180deg, var(--p), var(--p-deep)); color: #fffdf5; box-shadow: var(--shadow); }

/* Surah heading: illuminated cartouche */
.chapter-head { text-align: center; padding: 34px 0 14px; margin-bottom: 8px; }
.verses .chapter-head { margin-top: 36px; }
.cartouche {
  position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  max-width: 700px; margin: 0 auto 18px; padding: 8px 46px;
  border: 2px solid var(--gold); border-radius: 999px;
  outline: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 4px;
  background: linear-gradient(180deg, var(--p), var(--p-deep)); color: #fbf5e4;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cartouche::before {
  content: ""; position: absolute; inset: 0; background: var(--gold); opacity: .16; pointer-events: none;
  -webkit-mask: var(--girih) center / 44px 44px repeat; mask: var(--girih) center / 44px 44px repeat;
}
.cartouche::after { /* star medallions at both ends */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(var(--gold-2), var(--gold-2)) left 14px center / 18px 18px no-repeat,
    linear-gradient(var(--gold-2), var(--gold-2)) right 14px center / 18px 18px no-repeat;
  -webkit-mask: var(--octagram) left 14px center / 18px 18px no-repeat, var(--octagram) right 14px center / 18px 18px no-repeat;
  mask: var(--octagram) left 14px center / 18px 18px no-repeat, var(--octagram) right 14px center / 18px 18px no-repeat;
}
.cartouche__name { position: relative; font-family: "Amiri", serif; font-weight: 700; font-size: clamp(1.5rem, 4vw, 2.1rem); color: var(--gold-2); line-height: 1.7; }
.cartouche__side { position: relative; font-family: "Amiri", serif; font-size: 1rem; color: #e9dfc2; opacity: .9; }
.cartouche__side:first-child { text-align: left; }
.cartouche__side:last-child { text-align: right; }
.chapter-head__title { margin: 0; font-size: 1.8rem; font-weight: 700; }
.chapter-head__num { color: var(--gold); font-weight: 600; }
.chapter-head__meta { color: var(--muted); font-size: .9rem; }
.chapter-head__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 6px; }
.bismillah {
  display: flex; align-items: center; justify-content: center; gap: .6em;
  font-family: "Amiri Quran", serif; font-size: calc(var(--ar-size) * 1.08); margin: 24px 0 6px; line-height: 2;
  color: var(--text);
}
/* while the Qari recites it */
.bismillah.is-playing { color: var(--word-hl, var(--accent)); text-shadow: 0 0 18px var(--gold-soft); }
.bismillah::before, .bismillah::after {
  content: ""; flex: 0 1 110px; height: 18px; background: var(--gold); transform: translateY(.3em);
  -webkit-mask: var(--divider) center / auto 18px no-repeat; mask: var(--divider) center / auto 18px no-repeat;
}

/* Surah header: framed like the opening of a printed Mushaf */
.surah-frame {
  position: relative; isolation: isolate; max-width: 760px; margin: 0 auto; padding: 16px 24px 14px;
  background: var(--surface); border: 1px solid var(--gold); border-radius: 6px;
  outline: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); outline-offset: 5px;
  box-shadow: var(--shadow);
}
.surah-frame::before { /* corner rosettes */
  content: ""; position: absolute; inset: 6px; z-index: -1; pointer-events: none; background: var(--gold);
  -webkit-mask:
    var(--medallion) left top / 22px 22px no-repeat, var(--medallion) right top / 22px 22px no-repeat,
    var(--medallion) left bottom / 22px 22px no-repeat, var(--medallion) right bottom / 22px 22px no-repeat;
  mask:
    var(--medallion) left top / 22px 22px no-repeat, var(--medallion) right top / 22px 22px no-repeat,
    var(--medallion) left bottom / 22px 22px no-repeat, var(--medallion) right bottom / 22px 22px no-repeat;
}
.surah-frame::after { /* faint girih ground */
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none; background: var(--gold); opacity: .07;
  -webkit-mask: var(--girih) center / 56px 56px repeat; mask: var(--girih) center / 56px 56px repeat;
}
.surah-frame .cartouche { margin-bottom: 12px; }
.surah-frame__top { display: flex; align-items: center; gap: 12px; margin: 0 14px 12px; }
.surah-frame__tag { flex: 1 1 0; font-size: .8rem; font-weight: 600; color: var(--accent); letter-spacing: .03em; }
.surah-frame__tag:first-child { text-align: left; }
.surah-frame__tag:last-child { text-align: right; }
.surah-frame__tag [lang="ur"], .surah-facts [lang="ur"] { font-family: "Amiri", serif; font-weight: 400; font-size: 1.05em; letter-spacing: 0; text-transform: none; }
.surah-frame__num {
  position: relative; isolation: isolate; flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  font-family: var(--head-font); font-weight: 700; font-size: 1.15rem; color: #fbf5e4;
}
.surah-frame__num::before, .surah-frame__num::after {
  content: ""; position: absolute; z-index: -1;
  -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat;
}
.surah-frame__num::before { inset: 0; background: linear-gradient(180deg, var(--p), var(--p-deep)); }
.surah-frame__num::after { inset: -3px; z-index: -2; background: var(--gold); }
.surah-facts {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 14px 0 0; padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border));
}
.surah-facts div { padding: 2px 8px; }
.surah-facts div + div { border-left: 1px solid color-mix(in srgb, var(--gold) 35%, var(--border)); }
.surah-facts dt { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.surah-facts dd { margin: 0; font-family: var(--head-font); font-size: 1.4rem; font-weight: 700; color: var(--accent); line-height: 1.3; }

/* Para (juz) and ruku markers between verses */
.verse__marks { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; margin: -8px 0 4px; }
.verse__marks::before, .verse__marks::after { content: ""; flex: 1 1 0; max-width: 180px; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 70%, transparent)); }
.verse__marks::after { transform: scaleX(-1); }
.mark {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 14px; border-radius: 999px; white-space: nowrap;
  font-size: .78rem; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
}
.mark [lang="ur"] { font-family: "Amiri", serif; font-weight: 400; font-size: 1.08em; }
.mark--para { color: #fbf5e4; background: linear-gradient(90deg, var(--p-deep), var(--p)); border-color: var(--gold); }
.mark--para [lang="ur"] { color: var(--gold-2); }
.mark b {
  position: relative; isolation: isolate; display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; margin-left: -8px;
  font-family: "Amiri", serif; font-size: 1rem; line-height: 1; color: var(--accent);
}
.mark b::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--gold);
  -webkit-mask: var(--medallion) center / contain no-repeat; mask: var(--medallion) center / contain no-repeat;
}
.verse__sajdah { font-family: "Amiri", serif; font-size: 1.35rem; line-height: 1; color: var(--gold); padding: 2px 0 4px; cursor: help; }

/* Side-by-side layout: Arabic on the right, translation on the left (wide screens) */
@media (min-width: 760px) {
  html.layout-side .verse__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: 24px; align-items: start; }
  html.layout-side .verse__ar {
    grid-column: 2; grid-row: 1 / span 3; margin-bottom: 0; padding-left: 24px;
    border-left: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  }
  html.layout-side .verse__tr { grid-column: 1; margin: 0 0 12px; padding-top: calc(var(--ar-size) * .35); }
  html.layout-side .verse__tr + .verse__tr { padding-top: 10px; border-top: 1px dashed var(--border); }
  html.layout-side .verse__body:not(:has(.verse__tr)) { grid-template-columns: minmax(0, 1fr); }
  html.layout-side .verse__body:not(:has(.verse__tr)) .verse__ar { grid-column: 1; border-left: 0; padding-left: 0; }
}
/* With the player docked beside the page (TVs, laptops) there is no room for two columns: stacked */
@media (min-width: 1100px) and (max-width: 1499px) {
  html.layout-side body.player-docked .verse__body { display: block; }
  html.layout-side body.player-docked .verse__ar { border-left: 0; padding-left: 0; margin-bottom: 14px; }
  html.layout-side body.player-docked .verse__tr { margin: 10px 0 0; padding-top: 0; }
  html.layout-side body.player-docked .verse__tr + .verse__tr { padding-top: 10px; }
}

.page-head { padding: 32px 0 12px; }
.page-head h1 { margin: 0; font-size: 2.2rem; }
.page-head p { color: var(--muted); margin: 6px 0 0; }
.page-head__ar { color: var(--gold); font-weight: 400; margin-left: 10px; font-family: "Amiri", serif; }
.continued { margin: 18px 0 0; font-weight: 600; color: var(--muted); }
.continued span { font-weight: 400; color: var(--faint); font-size: .9rem; }

.load-prev { text-align: center; padding: 16px 0 0; }

.verse {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px;
  padding: 24px 16px 14px; border-radius: 14px; transition: background .3s;
}
.verse + .verse::before { /* hairline with a centre star between verses */
  content: ""; position: absolute; top: 0; left: 12px; right: 12px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 15%, var(--border) 85%, transparent);
}
.verse.is-target { animation: flash 2s ease; }
.verse.is-playing { background: var(--highlight); box-shadow: inset 3px 0 0 var(--gold); }
@keyframes flash { 0%, 40% { background: var(--highlight); } 100% { background: transparent; } }

/* Verse footer: reference on the left, labelled actions on the right */
.verse__tools {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed color-mix(in srgb, var(--gold) 40%, var(--border));
}
.verse__key {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px 2px 4px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); font-variant-numeric: tabular-nums;
}
.verse__key span { font-weight: 500; color: var(--muted); padding-left: 8px; }
.verse__key:hover { text-decoration: none; border-color: var(--gold); }
.verse__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-left: auto; }
.verse__tools .icon-btn { display: inline-flex; align-items: center; width: auto; min-width: 32px; justify-content: center; height: 32px; padding: 0 8px; gap: 5px; border-radius: 8px; }
.verse__tools .icon-btn .i { width: 17px; height: 17px; }
.verse__tools .lbl { font-size: .78rem; font-weight: 500; }
.verse:hover .verse__tools .icon-btn { opacity: 1; }
.verse__tools .icon-btn.is-on { opacity: 1; color: var(--gold); }
@media (max-width: 900px) {
  .verse__tools .lbl, .verse__key span { display: none; }
  .verse__key { padding: 2px 10px; }
}

.verse__ar {
  font-size: var(--ar-size); line-height: 2.3; text-align: right; margin-bottom: 14px;
  word-spacing: .05em; color: var(--text);
}
.w { display: inline-block; cursor: pointer; border-radius: 6px; padding: 0 .06em; transition: color .12s, background .12s; vertical-align: top; text-align: center; }
.w:hover { color: var(--accent); }
.w.is-active { color: var(--word-hl); background: var(--gold-soft); }
.w-ar { display: block; }
.w-tl, .w-tr { display: none; font-family: var(--ui-font); direction: ltr; line-height: 1.3; font-size: max(.72rem, calc(var(--ar-size) * .28)); color: var(--muted); max-width: 11em; margin: 0 auto; }
.w-tl { font-style: italic; color: var(--faint); }
html.show-wbw .w-tr, html.show-wbt .w-tl { display: block; }
html.show-wbw .w, html.show-wbt .w { margin: 0 .12em .35em; }
html.show-wbw .verse__ar, html.show-wbt .verse__ar { line-height: 1.9; }
html:is(.show-wbw, .show-wbt) .w-ar { margin-bottom: 2px; }

/* Ayah end medallion */
.end {
  position: relative; isolation: isolate;
  display: inline-grid; place-items: center; min-width: 1.45em; height: 1.45em; margin: 0 .12em;
  font-family: "Amiri", serif; font-size: .62em; font-weight: 700; line-height: 1;
  color: var(--accent); vertical-align: middle;
}
.end::before {
  content: ""; position: absolute; inset: -.18em; z-index: -1; background: var(--gold);
  -webkit-mask: var(--medallion) center / contain no-repeat; mask: var(--medallion) center / contain no-repeat;
}
html:is(.show-wbw, .show-wbt) .verse__ar .end { margin-top: .5em; }

.verse__tr { font-size: var(--tr-size); line-height: 1.8; margin-top: 10px; }
.verse__tr p { margin: 0; }
.verse__tr cite { display: block; font-style: normal; font-size: .78rem; color: var(--faint); margin-top: 4px; }
.verse__tr.is-rtl { text-align: right; font-family: var(--ur-font); line-height: 2.4; }
.verse__tr.is-rtl cite { font-family: var(--ui-font); }
.fn { color: var(--gold); cursor: pointer; font-weight: 700; padding: 0 2px; font-size: .7em; }
mark { background: color-mix(in srgb, var(--gold) 32%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

.loader { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 32px; color: var(--muted); }
.spinner {
  width: 22px; height: 22px; background: var(--gold); animation: spin 1.4s linear infinite;
  -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chapter-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 36px 0 56px; }
.hadith-nearby { margin: -24px 0 56px; padding: 20px 22px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.hadith-nearby h2 { font-size: 1.05rem; margin: 0 0 12px; }
.hadith-nearby ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hadith-nearby__more { margin: 12px 0 0; font-size: .92rem; }

/* ---------- Mushaf (reading mode) ---------- */
.mushaf-stage { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 30px 12px 12px; }
.mushaf-page {
  width: 100%; max-width: 660px; position: relative;
  padding: 30px 34px 20px;
  border: 12px solid transparent; border-radius: 6px;
  background:
    linear-gradient(var(--page), var(--page)) padding-box,
    repeating-conic-gradient(from 45deg, var(--gold) 0 25%, var(--p) 0 50%) border-box;
  background-size: auto, 12px 12px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--gold);
  outline: 1px solid var(--gold); outline-offset: -8px;
}
.mushaf-page::before { /* corner rosettes */
  content: ""; position: absolute; inset: 4px; pointer-events: none; background: var(--gold);
  -webkit-mask:
    var(--medallion) left top / 26px 26px no-repeat, var(--medallion) right top / 26px 26px no-repeat,
    var(--medallion) left bottom / 26px 26px no-repeat, var(--medallion) right bottom / 26px 26px no-repeat;
  mask:
    var(--medallion) left top / 26px 26px no-repeat, var(--medallion) right top / 26px 26px no-repeat,
    var(--medallion) left bottom / 26px 26px no-repeat, var(--medallion) right bottom / 26px 26px no-repeat;
}
.mushaf-page__top { display: flex; justify-content: space-between; font-family: "Amiri", serif; font-size: 1.05rem; color: var(--accent); padding: 0 16px 10px; border-bottom: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); margin-bottom: 8px; }
.mushaf-line {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: nowrap; gap: .12em;
  font-size: clamp(1.1rem, 4.2vw, calc(var(--ar-size) * .85)); line-height: 2.1; white-space: nowrap;
}
.mushaf-page--center .mushaf-line { justify-content: center; gap: .3em; }
.mushaf-line .w { padding: 0 .04em; }
/* one translation under each line of the Arabic, in a strip of its own, as printed Urdu Qurans */
.mushaf-tr { margin: .1rem 6px .5rem; padding: .1rem .8rem; border: 1.5px solid #79c28f; border-radius: 14px; background: #fff; color: #10201a; font: 400 1rem/1.9 var(--en-font, sans-serif); text-align: center; text-wrap: balance; }
.mushaf-tr[dir="rtl"] { font-family: var(--ur-font), serif; font-size: 1.02rem; line-height: 2.25; }
.mushaf-page--lines { background-color: #dff3e4; }
.mushaf-page--lines .mushaf-line { color: #0a120e; }
html[data-mode="dark"] .mushaf-page--lines { background-color: transparent; }
html[data-mode="dark"] .mushaf-page--lines .mushaf-line { color: inherit; }
html[data-mode="dark"] .mushaf-tr { background: rgba(255, 255, 255, .06); color: inherit; border-color: rgba(121, 194, 143, .55); }
.mfs .mushaf-tr { font-size: 17px; }
.mushaf-trpick { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 0 auto 14px; padding: 0 16px; color: var(--muted); font-size: .9rem; }
.mushaf-trpick__label [lang="ur"] { font-family: var(--ur-font), serif; }
.mushaf-trpick__btn { min-height: 38px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line, rgba(127, 127, 127, .4)); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.mushaf-trpick__btn[lang="ur"] { font-family: var(--ur-font), serif; }
.mushaf-trpick__btn:hover { border-color: var(--gold); }
.mushaf-trpick__btn[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); color: var(--text); font-weight: 600; }
.mushaf-trpick select { min-height: 38px; max-width: min(300px, 70vw); padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line, rgba(127, 127, 127, .4)); background: var(--surface, transparent); color: inherit; font: inherit; }
.mushaf-line .end { font-size: .6em; }
.mushaf-line .w.is-active, .mushaf-line .w.is-verse-hl { background: var(--highlight); color: inherit; }
.mushaf-line .w.is-active { color: var(--word-hl); }
.mushaf-line .w.is-selected { background: var(--gold-soft); }
.mushaf-surah { text-align: center; margin: 12px 0 4px; }
.mushaf-surah__frame {
  position: relative; overflow: hidden;
  display: block; padding: 3px 0; font-family: "Amiri", serif; font-weight: 700; font-size: 1.45rem; color: var(--gold-2);
  border: 2px solid var(--gold); border-radius: 999px;
  outline: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 3px;
  background: linear-gradient(180deg, var(--p), var(--p-deep));
}
.mushaf-bismillah { font-size: 1.5rem; line-height: 2.2; }
.mushaf-page__num {
  display: grid; place-items: center; width: 44px; height: 44px; margin: 8px auto 0; position: relative; isolation: isolate;
  font-family: "Amiri", serif; color: var(--accent); font-size: 1.05rem;
}
.mushaf-page__num::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--gold);
  -webkit-mask: var(--medallion) center / contain no-repeat; mask: var(--medallion) center / contain no-repeat;
}
.mushaf-arrow { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 1px solid var(--gold); color: var(--accent); flex: none; box-shadow: var(--shadow); }
.mushaf-arrow:hover { background: var(--p); color: #fffdf5; text-decoration: none; }
.mushaf-arrow--next .i { transform: rotate(180deg); }
.mushaf-hint { text-align: center; color: var(--faint); font-size: .82rem; margin: 10px 0 40px; }

/* Script switch above the page (Classic / Tajweed / IndoPak) */
.script-switch { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin: 18px auto 0; padding: 0 12px; }
.script-switch button {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer;
  padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600;
}
.script-switch button span { font-family: "Amiri", serif; font-weight: 400; margin-left: 4px; }
.script-switch button[aria-checked="true"] { background: linear-gradient(180deg, var(--p), var(--p-deep)); color: #fffdf5; border-color: var(--gold); }
@media (max-width: 480px) {
  .script-switch { gap: 3px; margin-top: 12px; }
  .script-switch button { padding: 5px 9px; font-size: .76rem; }
  .script-switch button span { display: none; }
}

/* ---------- Ornate Mushaf page (Tajweed and IndoPak scripts) ----------
   An original floral border drawn as a small repeating tile, with gold rules inside. */
@font-face {
  font-family: "DK IndoPak"; font-display: swap;
  src: url("../fonts/indopak/DigitalKhattIndoPak.otf") format("opentype");
}
.mushaf-page--ornate {
  --flower: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Crect width='44' height='44' fill='%2317336e'/%3E%3Cg fill='%2334a065'%3E%3Cpath d='M0 0q12 3 15 15Q3 12 0 0z'/%3E%3Cpath d='M44 0q-12 3-15 15Q41 12 44 0z'/%3E%3Cpath d='M0 44q12-3 15-15Q3 32 0 44z'/%3E%3Cpath d='M44 44q-12-3-15-15 12 3 15 15z'/%3E%3C/g%3E%3Cg fill='%23cf3a3a'%3E%3Cellipse cx='22' cy='12.5' rx='4.6' ry='7'/%3E%3Cellipse cx='22' cy='31.5' rx='4.6' ry='7'/%3E%3Cellipse cx='12.5' cy='22' rx='7' ry='4.6'/%3E%3Cellipse cx='31.5' cy='22' rx='7' ry='4.6'/%3E%3C/g%3E%3Ccircle cx='22' cy='22' r='5' fill='%23f2c14e'/%3E%3Ccircle cx='22' cy='22' r='2.1' fill='%2317336e'/%3E%3C/svg%3E");
  max-width: 700px; padding: 26px 30px 18px; border: 26px solid transparent; border-radius: 4px;
  background: linear-gradient(var(--page), var(--page)) padding-box, var(--flower) 0 0 / 26px 26px repeat border-box;
  box-shadow: 0 0 0 2px #c9a44c, 0 0 0 5px #17336e, var(--shadow-lg);
  outline: 2px solid #c9a44c; outline-offset: -8px;
}
.mushaf-page--ornate::before { /* thin inner double rule */
  inset: 12px; background: none; -webkit-mask: none; mask: none;
  border: 1px solid color-mix(in srgb, #c9a44c 70%, transparent); border-radius: 2px;
}
.mushaf-page--ornate .mushaf-page__top { color: #17336e; border-bottom-color: #c9a44c; }
html[data-mode="dark"] .mushaf-page--ornate .mushaf-page__top { color: var(--gold-2); }
.mushaf-page--ornate .mushaf-surah__frame {
  position: relative; border-radius: 3px; border: 2px solid #c9a44c; outline-offset: 2px; padding: 4px 60px;
  background: linear-gradient(180deg, #1c6b45, #0e3f28); color: #fbe7a8;
}
.mushaf-page--ornate .mushaf-surah__frame::before, .mushaf-page--ornate .mushaf-surah__frame::after { /* gold rosettes at both ends */
  content: ""; position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px; background: #f2c14e;
  -webkit-mask: var(--medallion) center / contain no-repeat; mask: var(--medallion) center / contain no-repeat;
}
.mushaf-page--ornate .mushaf-surah__frame::before { right: 14px; }
.mushaf-page--ornate .mushaf-surah__frame::after { left: 14px; }
.mushaf-page--ornate .end { color: #17336e; }
.mushaf-page--ornate .end::before { background: #c9a44c; }
html[data-mode="dark"] .mushaf-page--ornate .end { color: var(--gold-2); }
.mushaf-page--indopak .mushaf-line, .mushaf-page--indopak .mushaf-bismillah { font-family: "DK IndoPak", "Noto Naskh Arabic", serif; line-height: 2.35; }
.mushaf-page--indopak .mushaf-line .end { font-family: "Amiri", serif; }
@media (max-width: 640px) {
  .mushaf-page--ornate { padding: 16px 10px 12px; border-width: 16px; background-size: auto, 16px 16px; outline-offset: -5px; }
  .mushaf-page--ornate::before { inset: 7px; }
  .mushaf-page--ornate .mushaf-surah__frame { padding: 2px 40px; font-size: 1.2rem; }
  .mushaf-page--ornate .mushaf-surah__frame::before, .mushaf-page--ornate .mushaf-surah__frame::after { width: 18px; height: 18px; margin-top: -9px; }
}

/* Tajweed colours */
:root {
  --tj-lazim: #9b1b1b; --tj-wajib: #d8232e; --tj-munfasil: #e8581e; --tj-arid: #ee9612;
  --tj-tabii: #b98a12; --tj-ghunnah: #13964a; --tj-silent: #9a9a9a; --tj-qalqalah: #1e79d0;
}
html[data-mode="dark"] {
  --tj-lazim: #ff6b6b; --tj-wajib: #ff5a64; --tj-munfasil: #ff8a4c; --tj-arid: #ffb547;
  --tj-tabii: #e8c35a; --tj-ghunnah: #4fd38a; --tj-silent: #8a8a8a; --tj-qalqalah: #6cb6ff;
}
.tj-lazim { color: var(--tj-lazim); } .tj-wajib { color: var(--tj-wajib); } .tj-munfasil { color: var(--tj-munfasil); }
.tj-arid { color: var(--tj-arid); } .tj-tabii { color: var(--tj-tabii); } .tj-ghunnah { color: var(--tj-ghunnah); }
.tj-silent { color: var(--tj-silent); } .tj-qalqalah { color: var(--tj-qalqalah); }
.tj-legend {
  list-style: none; margin: 10px 0 0; padding: 10px 4px 0; border-top: 1px solid color-mix(in srgb, #c9a44c 60%, transparent);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 10px; direction: rtl;
}
.tj-legend li { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "dot ur" "dot en"; align-items: center; column-gap: 6px; line-height: 1.25; }
.tj-legend span { grid-area: ur; font-family: "Amiri", serif; font-size: .92rem; }
.tj-legend small { grid-area: en; font-family: var(--ui-font); font-size: .66rem; color: var(--faint); text-align: right; }
.tj-dot { grid-area: dot; width: 12px; height: 12px; border-radius: 50%; }
.tj-dot--lazim { background: var(--tj-lazim); } .tj-dot--wajib { background: var(--tj-wajib); } .tj-dot--munfasil { background: var(--tj-munfasil); }
.tj-dot--arid { background: var(--tj-arid); } .tj-dot--tabii { background: var(--tj-tabii); } .tj-dot--ghunnah { background: var(--tj-ghunnah); }
.tj-dot--silent { background: var(--tj-silent); } .tj-dot--qalqalah { background: var(--tj-qalqalah); }
@media (max-width: 640px) { .tj-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .mushaf-stage { padding: 12px 6px; gap: 0; }
  .mushaf-arrow { display: none; }
  .mushaf-page { padding: 20px 12px 12px; border-width: 8px; background-size: auto, 8px 8px; outline-offset: -5px; }
  .mushaf-page::before { -webkit-mask-size: 18px 18px; mask-size: 18px 18px; }
}

/* ---------- Search results ---------- */
.section-title { font-size: 1.4rem; margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 16px; height: 16px; background: var(--gold); -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat; }
.section-title small { color: var(--faint); font-weight: 400; font-size: .85rem; font-family: var(--ui-font); }
.results { list-style: none; padding: 0; margin: 0; }
.result { padding: 18px 0; border-bottom: 1px solid var(--border); }
.result__ref { font-size: .88rem; color: var(--muted); }
.result__ref b { color: var(--accent); }
.result__ar { font-size: 1.7rem; line-height: 2.1; text-align: right; margin: 6px 0; }
.result__tr { margin: 0; color: var(--text); }
.result__tr cite { font-style: normal; color: var(--faint); font-size: .8rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 28px 0 48px; color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); background: var(--bg-soft); border: 1px dashed color-mix(in srgb, var(--gold) 50%, var(--border)); border-radius: var(--radius); margin: 20px 0 48px; }
.empty .i { width: 16px; height: 16px; }

.error-page { text-align: center; padding: 80px 0; }
.error-page__ar { font-family: "Amiri Quran", serif; font-size: 2.4rem; color: var(--gold); }
.error-page h1 { font-size: 2.8rem; margin: 8px 0; }
.error-page p { color: var(--muted); margin-bottom: 24px; }

/* ---------- Footer ---------- */
.footer {
  position: relative; overflow: hidden; margin-top: 36px; color: #e9e1c9;
  background: linear-gradient(180deg, var(--p-deep), color-mix(in srgb, var(--p-deep) 70%, #000));
  border-top: 3px solid var(--gold);
}
.footer::before {
  content: ""; position: absolute; inset: 0; background: var(--gold); opacity: .1; pointer-events: none;
  -webkit-mask: var(--girih) 0 0 / 64px 64px repeat; mask: var(--girih) 0 0 / 64px 64px repeat;
}
.footer .ornament-divider { margin-top: 18px; position: relative; }
.footer__inner { position: relative; max-width: 1180px; margin: 0 auto; padding: 20px 20px 28px; display: flex; flex-wrap: wrap; gap: 20px 48px; justify-content: space-between; align-items: flex-start; }
.footer__ar { font-family: "Amiri Quran", serif; font-size: 1.6rem; color: var(--gold-2); line-height: 1.8; }
.footer__brand { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.footer__brand img { filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .4)); }
.footer__brand div { display: flex; flex-direction: column; line-height: 1.15; }
.footer__sub { color: #cfc6ad; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; }
.footer__sub [lang="ur"] { font-family: "Aref Ruqaa", serif; letter-spacing: 0; text-transform: none; color: var(--gold-2); font-size: 1.05rem; }
.footer strong { font-family: var(--head-font); font-size: 1.4rem; color: #fff8e6; }
.footer__inner p { margin: 4px 0 0; color: #cfc6ad; font-size: .9rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 10px; }
.footer nav a { color: #e9e1c9; font-size: .92rem; }
.footer nav a:hover { color: var(--gold-2); }
.footer__yt { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(201, 162, 74, .45); color: #fff8e6; font-weight: 600; font-size: .92rem; text-decoration: none; }
.footer__yt:hover { background: rgba(255, 255, 255, .12); color: #fff8e6; }
.footer__yt small { font-family: "Noto Nastaliq Urdu", serif; font-weight: 400; color: var(--gold-2); font-size: .85rem; white-space: nowrap; }
.footer__yt small::before { content: "· "; }
/* phones: the three buttons the same, full width, the English above and the whole Urdu below it */
@media (max-width: 640px) {
  .footer__yt, .footer__yt.footer__fb { display: flex; width: 100%; margin-left: 0; padding: 8px 18px; border-radius: 18px; }
  .footer__yt span { display: flex; flex-direction: column; line-height: 1.35; }
  .footer__yt small { line-height: 1.9; }
  .footer__yt small::before { content: none; }
}
.footer__credit { flex-basis: 100%; font-size: .8rem !important; color: #a9a189 !important; text-align: center; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.footer__credit--small { font-size: .7rem !important; border-top: 0; padding-top: 0; margin-top: -6px; }
.footer__credit--small a { color: inherit; }

/* ---------- Drawer (settings) ---------- */
.drawer, .modal, .palette { position: fixed; inset: 0; z-index: 80; visibility: hidden; }
.drawer::before, .modal::before, .palette::before {
  content: ""; position: absolute; inset: 0; background: rgba(6, 14, 11, .55); opacity: 0; transition: opacity .25s;
}
.drawer.is-open, .modal.is-open, .palette.is-open { visibility: visible; }
.drawer.is-open::before, .modal.is-open::before, .palette.is-open::before { opacity: 1; }

.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(410px, 100%);
  background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  border-left: 3px solid var(--gold);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head, .modal__head {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 20px; color: #fbf5e4;
  background: linear-gradient(90deg, var(--p-deep), var(--p)); border-bottom: 2px solid var(--gold);
}
.drawer__head .icon-btn, .modal__head .icon-btn { color: #efe6cc; }
.drawer__head .icon-btn:hover, .modal__head .icon-btn:hover { background: rgba(255, 255, 255, .1); color: var(--gold-2); }
.drawer__head h2, .modal__head h2 { margin: 0; font-size: 1.35rem; flex: 1; color: #fff8e6; }
.drawer__body { overflow-y: auto; padding: 8px 20px 20px; flex: 1; }
.drawer__foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.setting { padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting h3 { margin: 0 0 10px; font-family: var(--ui-font); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.setting h3::before { content: ""; width: 10px; height: 10px; background: var(--gold); -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat; }
.setting h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }
.setting .setting__sub { margin-top: 16px; }
.setting__preview { font-size: var(--ar-size); text-align: center; line-height: 2; margin-top: 8px; padding: 6px; background: var(--bg-soft); border-radius: 10px; border: 1px solid var(--border); }
.seg { display: flex; background: var(--surface-2); padding: 3px; border-radius: 10px; gap: 2px; border: 1px solid var(--border); }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 4px; border-radius: 8px; cursor: pointer; font-size: .83rem; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); font-weight: 600; outline: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: .7rem; color: var(--muted); }
.swatch i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid; box-shadow: inset 0 0 0 3px var(--surface); }
.swatch[aria-checked="true"] { border-color: var(--gold); color: var(--text); box-shadow: 0 0 0 3px var(--gold-soft); font-weight: 600; }
.swatch--emerald i { background: #0b5d45; border-color: #c9a44c; }
.swatch--iznik i   { background: #1b4f8c; border-color: #c9a44c; }
.swatch--maroon i  { background: #7d1f2c; border-color: #caa153; }
.swatch--teal i    { background: #1f6f5c; border-color: #b99a52; }
.swatch--gold i    { background: #6b4f12; border-color: #d4af37; }
.range { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); margin-top: 12px; }
.range input { accent-color: var(--gold); width: 100%; }
.switch { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: .93rem; }
.switch input { accent-color: var(--p); width: 18px; height: 18px; }
.select { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--muted); margin-top: 8px; }
.select select, .player__reciter { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; }
.checklist { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; font-size: .9rem; border-bottom: 1px solid var(--border); }
.checklist label:last-child { border-bottom: 0; }
.checklist label:hover { background: var(--bg-soft); }
.checklist input { accent-color: var(--p); width: 16px; height: 16px; flex: none; }
.checklist span { flex: 1; }
.checklist em { font-style: normal; font-size: .75rem; color: var(--faint); }

/* ---------- Modal ---------- */
.modal { display: grid; place-items: center; padding: 20px; }
.modal__panel {
  position: relative; width: min(780px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
  border: 1px solid var(--gold);
  transform: translateY(16px) scale(.98); opacity: 0; transition: transform .22s, opacity .22s;
}
.modal.is-open .modal__panel { transform: none; opacity: 1; }
.modal__tools { display: flex; align-items: center; gap: 2px; }
.modal__tools select { max-width: 220px; }
.modal__body { overflow-y: auto; padding: 22px 26px 30px; line-height: 1.85; }
.modal__body h2, .modal__body h3 { font-size: 1.3rem; margin: 1.4em 0 .4em; color: var(--accent); }
.modal__body.is-rtl { direction: rtl; text-align: right; font-family: var(--ur-font); line-height: 2.4; font-size: 1.05rem; }
.info-rtl { text-align: right; font-family: var(--ur-font); line-height: 2.4; font-size: 1.05rem; }
.info-rtl h2, .info-rtl h3, .info-rtl h4 { font-family: var(--ur-font); }
.modal__verse { background: var(--bg-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border)); border-radius: 12px; padding: 12px 18px; margin-bottom: 16px; }
.modal__verse [lang="ar"] { font-size: 1.75rem; line-height: 2.15; text-align: right; }
.modal__note { color: var(--faint); font-size: .85rem; }

/* ---------- Command palette ---------- */
.palette { display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.palette__panel {
  position: relative; width: min(640px, 100%); background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--gold);
  transform: translateY(-10px); opacity: 0; transition: transform .2s, opacity .2s;
}
.palette.is-open .palette__panel { transform: none; opacity: 1; }
.palette__form { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.palette__form .i { color: var(--gold); }
.palette__form input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 1.05rem; color: var(--text); }
.palette__form input:focus { outline: none; }
kbd { font-family: var(--ui-font); font-size: .72rem; padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--faint); }
.palette__list { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
.palette__list li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.palette__list li a:hover, .palette__list li[aria-selected="true"] a { background: var(--gold-soft); text-decoration: none; }
.palette__list .num { width: 28px; text-align: center; color: var(--gold); font-size: .85rem; font-weight: 700; }
.palette__list .meta { margin-left: auto; color: var(--faint); font-size: .8rem; }
.palette__list .ar { font-family: "Amiri", serif; font-size: 1.25rem; color: var(--accent); }
.palette__list .hint { padding: 10px 12px; color: var(--faint); font-size: .85rem; }

/* ---------- Recitation panel (audio player) ----------
   Phones/tablets: a bottom bar; the chevron opens the panel as a sheet above it.
   Wide screens (>= 1100px): docked on the right as a card, and the page makes room for it. */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; flex-direction: column-reverse;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 2px solid var(--gold); box-shadow: 0 -8px 30px rgba(0, 0, 0, .12);
  padding-bottom: env(safe-area-inset-bottom);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } }
@keyframes slideIn { from { transform: translateX(110%); } }
.player__bar { display: flex; flex-direction: column; }
.player__seek { order: -1; }
.player__seek input {
  display: block; width: 100%; margin: 0; height: 4px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background: linear-gradient(to right, var(--gold) var(--pct, 0%), var(--border) var(--pct, 0%));
}
.player__seek input::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--gold); border: 2px solid var(--surface); }
.player__seek input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--gold); }
.player__inner { width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.player__medal {
  position: relative; isolation: isolate; width: 42px; height: 42px; display: grid; place-items: center;
  font-family: "Amiri", serif; font-weight: 700; font-size: .95rem; color: var(--accent); font-variant-numeric: tabular-nums;
}
.player__medal::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--gold);
  -webkit-mask: var(--medallion) center / contain no-repeat; mask: var(--medallion) center / contain no-repeat;
}
.player.is-holding .player__medal { animation: pulse 1s ease infinite; }
.player.is-holding .player__sub { color: var(--accent); font-weight: 600; }
.player__now { display: flex; flex-direction: column; min-width: 0; }
.player__title { font-family: var(--head-font); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__controls { display: flex; align-items: center; gap: 8px; }
.player__mini { display: flex; align-items: center; gap: 2px; }
.player__expand .i { transform: rotate(-90deg); transition: transform .2s; }
.player.is-expanded .player__expand .i { transform: rotate(90deg); }
.player__loopbar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 3px 12px 5px; font-size: .76rem; font-weight: 600; color: var(--accent); background: var(--gold-soft); }
.player__loopbar .i { width: 14px; height: 14px; }
.player__panel { display: none; padding: 14px 16px 16px; border-bottom: 1px solid var(--border); overflow-y: auto; overscroll-behavior: contain; }
.player.is-expanded .player__panel { display: block; max-height: min(42vh, 560px); } /* leave room to follow the verse on the page */
.player__ayah { background: var(--bg-soft); border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border)); border-radius: 12px; padding: 8px 14px 10px; margin-bottom: 12px; max-height: 36vh; overflow-y: auto; }
.player__ayah:has(.player__ayah-ar:empty) { display: none; }
.player__ayah-ar { font-family: var(--ar-font); font-size: 1.55rem; line-height: 2.1; text-align: right; }
.player__ayah-tr { font-size: .9rem; line-height: 1.7; color: var(--muted); margin-top: 4px; }
.player__ayah-tr:empty { display: none; }
.player__ayah-tr.is-rtl { font-family: var(--ur-font); line-height: 2.3; text-align: right; }
.player__field { margin: 12px 0 0; }
.player__field .player__reciter { max-width: none; width: 100%; height: auto; padding: 8px 10px; font-size: .9rem; }
.hifz { margin-top: 14px; padding-top: 12px; border-top: 1px dashed color-mix(in srgb, var(--gold) 50%, var(--border)); }
.hifz h3 { margin: 0 0 10px; font-family: var(--ui-font); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.hifz h3::before { content: ""; width: 10px; height: 10px; background: var(--gold); -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat; }
.hifz h3 [lang="ur"] { font-family: "Amiri", serif; font-size: 1rem; letter-spacing: 0; text-transform: none; }
.hifz__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hifz__grid label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--muted); min-width: 0; }
.hifz__grid select { width: 100%; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; }
.hifz__wide { grid-column: 1 / -1; }
.hifz__go { width: 100%; justify-content: center; margin-top: 12px; }
.player.is-looping .hifz__go { background: var(--surface-2); color: var(--text); border-color: var(--gold); }
.hifz__status { margin: 8px 0 0; font-size: .82rem; color: var(--accent); text-align: center; }
.hifz__status:empty { display: none; }

@media (min-width: 1100px) {
  body.player-docked .main, body.player-docked .footer__inner { padding-right: 376px; }
  .player {
    left: auto; right: 16px; top: 78px; bottom: auto; width: 344px; max-height: calc(100vh - 94px);
    flex-direction: column; overflow: hidden; padding-bottom: 0;
    border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent); border-top: 3px solid var(--gold); border-radius: 18px;
    box-shadow: var(--shadow-lg); animation: slideIn .28s ease; transition: top .25s ease, max-height .25s ease;
  }
  .topbar.is-hidden ~ .player { top: 16px; max-height: calc(100vh - 32px); }
  .player__bar {
    position: relative; flex: none; color: #fbf5e4;
    background: linear-gradient(160deg, var(--p-deep), var(--p));
  }
  .player__bar::before {
    content: ""; position: absolute; inset: 0; background: var(--gold); opacity: .12; pointer-events: none;
    -webkit-mask: var(--girih) center / 44px 44px repeat; mask: var(--girih) center / 44px 44px repeat;
  }
  .player__bar > * { position: relative; }
  .player__seek { order: 0; padding: 0 16px 12px; }
  .player__seek input { background: linear-gradient(to right, var(--gold-2) var(--pct, 0%), rgba(255, 255, 255, .22) var(--pct, 0%)); border-radius: 4px; }
  .player__seek input::-webkit-slider-thumb { border-color: var(--p-deep); }
  .player__inner { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "medal now mini" "ctrl ctrl ctrl"; padding: 14px 14px 8px 16px; row-gap: 10px; }
  .player__medal { grid-area: medal; color: var(--gold-2); }
  .player__medal::before { background: var(--gold-2); }
  .player__now { grid-area: now; }
  .player__title { color: #fff8e6; font-size: 1.2rem; }
  .player__sub { color: #d9d0b4; }
  .player.is-holding .player__sub { color: var(--gold-2); }
  .player__mini { grid-area: mini; align-self: start; }
  .player__controls { grid-area: ctrl; justify-content: center; gap: 18px; }
  .player__bar .icon-btn { color: #efe6cc; }
  .player__bar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: var(--gold-2); }
  .player__bar .play-btn { width: 56px; height: 56px; color: var(--p-deep); }
  .player__bar .play-btn::before { background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
  .player__bar .play-btn::after { background: rgba(255, 255, 255, .5); }
  .player__expand { display: none; }
  .player__loopbar { color: var(--gold-2); background: rgba(0, 0, 0, .18); }
  .player__panel, .player.is-expanded .player__panel { display: block; flex: 1 1 auto; max-height: none; border-bottom: 0; }
}
.play-btn {
  width: 50px; height: 50px; border: 0; color: #fffdf5; display: grid; place-items: center; cursor: pointer; position: relative; isolation: isolate;
  background: none;
}
.play-btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--p), var(--p-deep));
  -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat;
  transition: transform .3s;
}
.play-btn::after {
  content: ""; position: absolute; inset: -3px; z-index: -2; background: var(--gold);
  -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat;
}
.play-btn:hover::before { transform: rotate(45deg); }
.play-btn .i { width: 22px; height: 22px; }
.player__opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.player__time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: auto; white-space: nowrap; }
.chip--tr { white-space: nowrap; min-width: 44px; justify-content: center; font-weight: 700; }
.player__reciter { max-width: 180px; height: 32px; padding: 0 8px; font-size: .82rem; }
.player.is-loading .play-btn .i { animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- Toast & popover ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--player-h) + var(--tab-h, 0px) + 24px); transform: translate(-50%, 20px);
  background: var(--p-deep); color: #fbf5e4; border: 1px solid var(--gold); padding: 10px 20px; border-radius: 999px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; box-shadow: var(--shadow-lg);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.popover {
  position: absolute; z-index: 70; max-width: 340px; background: var(--surface); color: var(--text);
  border: 1px solid var(--gold); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 12px 14px; font-size: .9rem; line-height: 1.6;
}
.popover--actions { display: flex; gap: 2px; padding: 6px; align-items: center; }
.popover--actions strong { font-size: .8rem; color: var(--muted); padding: 0 8px; }

/* ---------- Hadith ---------- */
.hero--sm { padding: 48px 0 60px; }
.hero--sm .hero__cal { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.hero__search--center { max-width: 560px; margin: 18px auto 4px; }
.card--hotd { grid-column: 1 / -1; }
.hotd__ar { font-family: "Amiri", serif; font-size: 1.35rem; line-height: 2; margin: 2px 0 8px; position: relative; }
.votd__ref--more { margin-left: 18px; color: var(--muted); }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 36px; }
.book-card {
  position: relative; overflow: hidden; display: flex; gap: 16px; align-items: flex-start;
  padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.book-card::after {
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 120px; height: 120px; background: var(--gold); opacity: .1;
  -webkit-mask: var(--medallion) center / contain no-repeat; mask: var(--medallion) center / contain no-repeat;
}
.book-card:hover { border-color: var(--gold); transform: translateY(-2px); text-decoration: none; }
.book-card:hover .surah-card__num::before { transform: rotate(45deg); }
.book-card__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; position: relative; }
.book-card__ar { font-family: "Amiri", serif; font-weight: 700; font-size: 1.6rem; color: var(--accent); line-height: 1.5; text-align: right; }
.book-card strong { font-family: var(--head-font); font-size: 1.4rem; line-height: 1.2; }
.book-card small { color: var(--faint); font-size: .82rem; }
.book-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; color: var(--muted); font-size: .84rem; }

.chapter-list {
  list-style: none; margin: 0 0 48px; padding: 14px 22px; columns: 2 340px; column-gap: 40px;
  column-rule: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  background: var(--page); border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent); border-radius: 6px;
}
.chapter-list li { break-inside: avoid; }
.chapter-list a { display: flex; align-items: center; gap: 10px; padding: 8px 4px; color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--gold) 22%, var(--border)); }
.chapter-list a:hover { background: var(--gold-soft); text-decoration: none; }
.chapter-list a:hover .fihrist-row__num { background: var(--p); color: #fffdf5; border-color: var(--p); }
.chapter-list .fihrist-row__num { flex: none; }
.chapter-list .fihrist-row__dots { flex: 1 1 12px; min-width: 12px; align-self: flex-end; }
.chapter-list__name { font-weight: 500; }
.chapter-list__range { color: var(--faint); font-size: .8rem; white-space: nowrap; }
.index__bar .section-title { margin: 0; }
.index__bar > .input { width: 240px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 20px 0 0; font-size: .88rem; color: var(--faint); }
.chapter-head--compact { padding-top: 16px; }
.tts-note { color: var(--faint); font-size: .8rem; margin: 4px 0 0; }

.hadiths { margin-bottom: 12px; }
.hadith {
  position: relative; margin: 18px 0; padding: 20px 24px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: background .3s, border-color .3s;
}
.hadith::before { /* gold corner rosette */
  content: ""; position: absolute; top: 10px; left: 10px; width: 16px; height: 16px; background: var(--gold); opacity: .6;
  -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat;
}
.hadith.is-target { animation: flash 2s ease; }
.hadith.is-reading { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft), var(--shadow); }
.hadith__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 0 0 12px 16px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.hadith__ref { font-weight: 600; color: var(--text); }
.hadith__ref b { color: var(--accent); }
.hadith__inbook { color: var(--faint); font-size: .8rem; }
.hadith__tools { margin-left: auto; display: flex; gap: 2px; }
.hadith__ar { font-size: calc(var(--ar-size) * .78); line-height: 2.1; text-align: right; margin-bottom: 14px; }
.hadith__ar p, .hadith__tr p { margin: 0; }
.hadith__tr { font-size: var(--tr-size); line-height: 1.8; margin-top: 12px; }
.hadith__tr.is-rtl { font-family: var(--ur-font); line-height: 2.5; text-align: right; }
.hadith__tr cite { display: block; font-style: normal; font-size: .75rem; color: var(--faint); margin-top: 4px; font-family: var(--ui-font); }
.hadith__narrator { color: var(--accent); font-weight: 600; }
.hadith__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: .85rem; }
.hadith__grades summary { cursor: pointer; color: var(--muted); }
.hadith__grades ul { list-style: none; padding: 8px 0 0; margin: 0; display: grid; gap: 6px; }
.hadith__grades li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.hadith__chapter { font-weight: 500; }
.hadiths--single .hadith { margin-top: 8px; }

.grade {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .02em; border: 1px solid;
}
.grade--sahih { color: #0f6b3f; background: #e3f4ea; border-color: #9fd3b3; }
.grade--hasan { color: #8a5d00; background: #fbf0d6; border-color: #e6c77a; }
.grade--daif  { color: #a0332b; background: #fbe6e3; border-color: #eab0a9; }
.grade--mawdu { color: #fff; background: #7a1f24; border-color: #7a1f24; }
.grade--other { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
a.grade { text-decoration: none; }
a.grade:hover { border-color: var(--gold); color: var(--text); }
html[data-mode="dark"] .grade--sahih { color: #7fe0a6; background: rgba(40, 160, 90, .14); border-color: rgba(127, 224, 166, .35); }
html[data-mode="dark"] .grade--hasan { color: #f0cf7a; background: rgba(200, 150, 30, .14); border-color: rgba(240, 207, 122, .35); }
html[data-mode="dark"] .grade--daif  { color: #f3a39a; background: rgba(200, 60, 50, .14); border-color: rgba(243, 163, 154, .35); }

/* sentence being read aloud */
.tts-chunk { border-radius: 4px; transition: background .2s; }
.tts-w { border-radius: 4px; transition: background-color .1s, color .1s; }
.tts-w.is-said { color: var(--word-hl); background: var(--gold-soft); box-shadow: 0 0 0 2px var(--gold-soft); }
.tts-block.is-speaking { background: color-mix(in srgb, var(--gold) 16%, transparent); border-radius: 6px; }
.tts-chunk.is-speaking {background: color-mix(in srgb, var(--gold) 28%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 28%, transparent); }
.player--tts .player__seek, .player--tts .player__ayah, .player--tts .hifz, .player--tts .player__field, .player--tts .player__loopbar,
.player--tts [data-action="audio-tr"], .player--tts .player__time, .player--tts .player__medal { display: none !important; }
.player--tts .player__inner { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: none; }
/* Duas / naat recordings in the same bar: no reciter, Hifz loop or translation chip */
.player--dua .hifz, .player--dua .player__field, .player--dua .player__loopbar, .player--dua [data-action="audio-tr"] { display: none !important; }
.player--dua .player__ayah-tr[dir="rtl"] { font-family: var(--ur-font); line-height: 2.2; text-align: right; }
.player--dua .player__opts .chip { white-space: nowrap; }
@media (min-width: 1100px) {
  .player--tts .player__inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "now mini" "ctrl ctrl"; }
  .player--tts .player__controls { padding-bottom: 6px; }
}

.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.select--inline { flex-direction: row; align-items: center; margin: 0; }
.result__lang { margin-left: 8px; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.result__snip { margin: 6px 0 0; line-height: 1.8; }
.result__snip.is-rtl { text-align: right; font-family: var(--ur-font); line-height: 2.4; }
.result__snip[lang="ar"] { font-family: "Amiri", serif; font-size: 1.2rem; line-height: 2; }

.admin-card p { margin-top: 0; }
.admin-progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 12px 0; border: 1px solid var(--border); }
.admin-progress__bar { height: 100%; background: linear-gradient(90deg, var(--p), var(--gold)); transition: width .3s; }
.admin-log .is-warn { color: var(--gold); }
.sync-groups { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.sync-groups legend { font-weight: 600; margin-bottom: 8px; }
.sync-group { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.sync-group input { margin-top: 4px; }
.sync-group small { display: block; font-size: .8rem; }
.sync-group .is-ok { color: var(--accent); }
.sync-group .is-missing { color: var(--faint); }
.sync-note { font-size: .85rem; color: var(--muted); }
.sync-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.setup-needed { max-width: 640px; margin: 40px auto; text-align: center; }
.admin-log { max-height: 260px; overflow-y: auto; font-size: .85rem; color: var(--muted); padding-left: 22px; }
code { font-size: .88em; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }

.btn--sm { padding: 6px 12px; font-size: .84rem; margin-top: 10px; }
.setting__note { color: var(--faint); font-size: .85rem; margin: 0 0 8px; }
.checklist--short { max-height: none; }
.voice-list { display: grid; gap: 4px; }
.voice-list .select { margin-top: 6px; }
.voice-list .select em { font-style: normal; color: #a0332b; font-size: .78rem; }

/* ---------- Landing / welcome ---------- */
.landing { padding: 54px 0 84px; min-height: min(92vh, 860px); display: flex; align-items: flex-start; }
/* The mihrab arch rises from the emblem (its point hidden behind it) and everything sits inside
   its inner line: the content is 79% of the arch's width, the inner line is at 10.3% on each side */
.landing .hero__arch { top: calc(54px + 42px); height: auto; width: min(1080px, 100%); }
.landing .hero__inner { width: 100%; min-width: 0; max-width: min(856px, 79%); } /* flex item: never wider than the screen */
.landing__emblem { width: 84px; height: 84px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .4)); animation: emblem-in 1.2s ease both; }
/* Entrance motion without fading in: content that starts invisible counts as "shown late" for Google */
@keyframes emblem-in { from { transform: scale(.85) rotate(-25deg); } }
.landing__salam {
  font-family: "Amiri Quran", serif; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.7; margin-top: 14px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fade-up .9s .15s ease both;
}
.landing__greet { display: inline-block; margin: 0 0 6px; padding: 4px 16px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 22%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); color: #fff3cc; font-weight: 600; font-size: .9rem; }
.landing__title { margin: 4px 0 6px; font-size: clamp(1.5rem, 3.6vw, 2.4rem); font-weight: 600; color: #fbf5e4; line-height: 1.3; animation: fade-up .9s .3s ease both; }
.landing__brand { color: var(--gold-2); }
.landing__place { display: block; margin-top: 8px; font-size: .62em; animation: fade-up .7s ease both; }
.landing__from { display: block; font-family: var(--ui-font); font-size: .6em; letter-spacing: .14em; text-transform: uppercase; color: #cfc6ad; margin-bottom: 2px; }
.landing__where { display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); color: #fff; }
.flag { object-fit: cover; }
.landing__where .flag { border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.landing__src { margin: 8px 0 22px; font-size: .8rem; color: #bdb49a; }
.landing__src .link-btn { color: var(--gold-2); }
@keyframes fade-up { from { transform: translateY(10px); } }

.landing__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 auto 24px; max-width: 760px; animation: fade-up .9s .45s ease both; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; border-radius: 14px; text-align: center;
  background: rgba(255, 255, 255, .07); border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.stat__label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); font-weight: 700; }
.stat__value { font-size: 1.35rem; color: #fff; font-variant-numeric: tabular-nums; font-weight: 600; }
.stat__value--ar { font-family: "Amiri", serif; font-size: 1.4rem; font-weight: 700; line-height: 1.5; }
.stat small { color: #cfc6ad; font-size: .78rem; }
.stat--next { background: color-mix(in srgb, var(--gold) 16%, transparent); border-color: var(--gold); }

.landing__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.btn--gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); color: #2a1e05; font-weight: 700; }
.btn--gold:hover { filter: brightness(1.06); }
.btn--glass { background: rgba(255, 255, 255, .08); color: #fbf5e4; border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.btn--glass:hover { background: rgba(255, 255, 255, .15); color: #fff; }

/* hanging lanterns */
.landing__lanterns span {
  position: absolute; top: 0; width: 34px; height: 150px; pointer-events: none; transform-origin: top center; animation: swing 5s ease-in-out infinite;
  background:
    linear-gradient(var(--gold), var(--gold)) center top / 1.5px 70px no-repeat,
    radial-gradient(circle at 50% 50%, rgba(255, 214, 120, .95), rgba(255, 170, 60, .5) 45%, transparent 70%) center 96px / 34px 44px no-repeat;
  filter: drop-shadow(0 0 14px rgba(255, 190, 80, .55));
}
.landing__lanterns span::after {
  content: ""; position: absolute; left: 5px; top: 70px; width: 24px; height: 50px;
  border: 2px solid var(--gold); border-radius: 12px 12px 6px 6px / 16px 16px 6px 6px;
  background: linear-gradient(180deg, rgba(255, 220, 140, .35), rgba(255, 180, 70, .15));
}
.landing__lanterns span:first-child { left: 7%; }
.landing__lanterns span:last-child { right: 7%; height: 190px; animation-delay: -2.5s; background-size: 1.5px 110px, 34px 44px; background-position: center top, center 136px; }
.landing__lanterns span:last-child::after { top: 110px; }
@keyframes swing { 0%, 100% { transform: rotate(3deg); } 50% { transform: rotate(-3deg); } }

.landing__scroll { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid color-mix(in srgb, var(--gold) 70%, transparent); border-radius: 14px; z-index: 1; }
.landing__scroll span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold-2); animation: scroll-dot 1.8s ease infinite; }
@keyframes scroll-dot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
/* ==========================================================================
   The sky of the day (landing). islamic.js sets data-sky from the visitor's
   prayer times - tahajjud, dawn (Fajr), morning (Duha), noon (Dhuhr),
   afternoon (Asr), evening (Maghrib), night (Isha) - and places the sun and
   the moon (its phase from the Hijri date) with --sun-x/-y and --moon-x/-y.
   The colours are registered properties, so one sky melts into the next.
   ========================================================================== */
@property --sky-a { syntax: "<color>"; inherits: true; initial-value: #062e22; }
@property --sky-b { syntax: "<color>"; inherits: true; initial-value: #0f5a43; }
@property --sky-c { syntax: "<color>"; inherits: true; initial-value: #0f5a43; }
@property --glow { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --skyline { syntax: "<color>"; inherits: true; initial-value: #03140e; }
@property --skyline-far { syntax: "<color>"; inherits: true; initial-value: #0a2a20; }
@property --cloud { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
.sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; display: none; }
.landing[data-sky] .sky { display: block; }
.landing[data-sky] {
  --sun-x: 50%; --sun-y: 30%; --moon-x: 74%; --moon-y: 22%;
  --sun-o: 0; --moon-o: 0; --stars-o: 0; --cloud-o: 0; --glow-x: 50%; --scrim: .2; --lantern: 1; --pattern: .1;
  background: linear-gradient(180deg, var(--sky-a) 0%, var(--sky-b) 52%, var(--sky-c) 100%);
  transition: --sky-a 3s ease, --sky-b 3s ease, --sky-c 3s ease, --glow 3s ease, --skyline 3s ease, --skyline-far 3s ease, --cloud 3s ease;
}
.landing[data-sky] .hero__pattern { opacity: var(--pattern); transition: opacity 3s ease; }
.landing[data-sky] .landing__lanterns { opacity: var(--lantern); transition: opacity 3s ease; }
/* a soft shade behind the words, stronger under bright skies, so the text always reads */
.landing[data-sky] .hero__inner::before {
  content: ""; position: absolute; inset: -40px -8% -20px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 50% 42%, rgba(2, 8, 20, var(--scrim)), transparent 72%);
}

/* Tahajjud: the last part of the night */
.landing[data-sky="tahajjud"] { --sky-a: #04051a; --sky-b: #0a0f33; --sky-c: #1a1545; --skyline: #020309; --skyline-far: #0b0c24;
  --stars-o: 1; --moon-o: 1; --scrim: .1; --pattern: .07; }
/* Fajr: dawn breaking in the east */
.landing[data-sky="dawn"] { --sky-a: #0d1538; --sky-b: #3d2b66; --sky-c: #c8667c; --glow: rgba(255, 176, 120, .6); --glow-x: 12%;
  --skyline: #120b21; --skyline-far: #3a2546; --cloud: #f6b9c4; --stars-o: .45; --moon-o: .5; --cloud-o: .35; --scrim: .15; --lantern: .7; }
/* Duha: the morning sun */
.landing[data-sky="morning"] { --sky-a: #154a8a; --sky-b: #2f73b8; --sky-c: #e9b97c; --glow: rgba(255, 214, 150, .45); --glow-x: 18%;
  --skyline: #14283f; --skyline-far: #3f6187; --cloud: #ffffff; --sun-o: 1; --cloud-o: .75; --scrim: .38; --lantern: .25; --pattern: .12; }
/* Dhuhr: the sun at its height */
.landing[data-sky="noon"] { --sky-a: #08468f; --sky-b: #156bbf; --sky-c: #5aa7df; --glow: rgba(255, 255, 230, .25); --glow-x: 50%;
  --skyline: #102a47; --skyline-far: #3a6c99; --cloud: #ffffff; --sun-o: 1; --cloud-o: .65; --scrim: .42; --lantern: .2; --pattern: .12; }
/* Asr: golden afternoon light */
.landing[data-sky="afternoon"] { --sky-a: #2c4a85; --sky-b: #b77a3c; --sky-c: #eeaa52; --glow: rgba(255, 190, 90, .5); --glow-x: 80%;
  --skyline: #2e1b10; --skyline-far: #7a4f2c; --cloud: #ffe2b8; --sun-o: 1; --cloud-o: .5; --scrim: .4; --lantern: .35; --pattern: .12; }
/* Maghrib: sunset */
.landing[data-sky="evening"] { --sky-a: #161a49; --sky-b: #6e2c5c; --sky-c: #ea6236; --glow: rgba(255, 120, 60, .55); --glow-x: 88%;
  --skyline: #170b1b; --skyline-far: #4a1f35; --cloud: #ffb08a; --stars-o: .3; --moon-o: .85; --cloud-o: .3; --scrim: .2; --lantern: .85; }
/* Isha: night */
.landing[data-sky="night"] { --sky-a: #061331; --sky-b: #0c234e; --sky-c: #14395c; --skyline: #030916; --skyline-far: #0d2340;
  --stars-o: .8; --moon-o: 1; --scrim: .1; --lantern: 1; --pattern: .08; }

/* horizon glow (dawn in the east, sunset in the west) */
.sky__glow { position: absolute; inset: 0; background: radial-gradient(ellipse 55% 45% at var(--glow-x) 100%, var(--glow), transparent 70%); }

/* the sun: travels from sunrise to Maghrib */
.sky__sun {
  position: absolute; left: var(--sun-x); top: var(--sun-y); width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%;
  opacity: var(--sun-o); transition: opacity 3s ease;
  background: radial-gradient(circle, #fffdf0 0 26%, #ffe9a8 34%, rgba(255, 214, 120, .55) 46%, rgba(255, 200, 90, 0) 70%);
  filter: drop-shadow(0 0 30px rgba(255, 220, 140, .7));
}
.landing[data-sky="afternoon"] .sky__sun { background: radial-gradient(circle, #fff6dc 0 24%, #ffcf7a 34%, rgba(255, 170, 70, .55) 48%, rgba(255, 150, 60, 0) 70%); }
/* light rays in the morning and at noon */
.sky__sun::before {
  content: ""; position: absolute; inset: -110px; border-radius: 50%; opacity: 0; transition: opacity 3s ease;
  background: repeating-conic-gradient(from 0deg, rgba(255, 250, 220, .16) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%);
  animation: sky-spin 120s linear infinite;
}
.landing[data-sky="noon"] .sky__sun::before, .landing[data-sky="morning"] .sky__sun::before { opacity: 1; }
@keyframes sky-spin { to { transform: rotate(360deg); } }

/* once placed, the sun and the moon glide on with the time (not on the first paint) */
.landing.sky-live .sky__sun, .landing.sky-live .sky__moon { transition: opacity 3s ease, left 30s linear, top 30s linear; }
/* the moon, as it is tonight (islamic.js draws the lit part from the Hijri date) */
.sky__moon {
  position: absolute; left: var(--moon-x); top: var(--moon-y); width: 58px; height: 58px; margin: -29px 0 0 -29px;
  opacity: var(--moon-o); transition: opacity 3s ease;
  filter: drop-shadow(0 0 14px rgba(255, 244, 200, .55));
}
.sky__moon-dark { fill: rgba(200, 210, 240, .08); }
.sky__moon-lit { fill: #fff6d6; }

/* stars: two layers that twinkle out of step (islamic.js scatters them) */
.sky__stars { position: absolute; inset: 0 0 30% 0; opacity: var(--stars-o); transition: opacity 3s ease; }
.sky__stars i { position: absolute; left: 0; top: 0; width: 2.4px; height: 2.4px; border-radius: 50%; background: transparent; animation: sky-twinkle 4s ease-in-out infinite; }
.sky__stars i + i { width: 1.7px; height: 1.7px; animation-duration: 6.5s; animation-delay: -2s; }
@keyframes sky-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

/* clouds drifting slowly across */
.sky__clouds { position: absolute; inset: 0; opacity: var(--cloud-o); transition: opacity 3s ease; }
.sky__clouds i {
  position: absolute; top: 150px; left: -30%; /* (px, not % of the hero: % moved the clouds whenever the hero grew while loading, CLS 0.17 on Google's test, 2026-11-17) */ width: 280px; height: 60px; border-radius: 50%; background: var(--cloud); opacity: .55;
  filter: blur(14px); animation: sky-drift 160s linear infinite;
  box-shadow: 90px -18px 0 4px var(--cloud), 180px 6px 0 -4px var(--cloud);
}
.sky__clouds i:nth-child(2) { top: 300px; width: 200px; height: 44px; opacity: .4; animation-duration: 210s; animation-delay: -90s; }
.sky__clouds i:nth-child(3) { top: 75px; width: 160px; height: 36px; opacity: .35; animation-duration: 240s; animation-delay: -170s; }
@keyframes sky-drift { to { transform: translateX(170vw); } }

/* the mosque skyline on the horizon */
.sky__skyline { position: absolute; left: 0; right: 0; bottom: 20px; width: 100%; height: clamp(70px, 11vw, 150px); }
.sky__far { fill: var(--skyline-far); opacity: .85; }
.sky__near { fill: var(--skyline); }

/* the name of this time of day */
.landing__phase {
  display: flex; width: fit-content; align-items: center; gap: 8px; margin: 12px auto -4px; padding: 4px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); color: #fff8e6;
  font-size: .78rem; font-weight: 600; letter-spacing: .04em; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.landing__phase[hidden] { display: flex !important; visibility: hidden; } /* its place is kept: showing it moves nothing (layout shift) */
.landing__phase-dot { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle, #fff7d6, #ffcf6a); box-shadow: 0 0 8px #ffd98a; }
.landing[data-sky="tahajjud"] .landing__phase-dot, .landing[data-sky="night"] .landing__phase-dot, .landing[data-sky="evening"] .landing__phase-dot { background: radial-gradient(circle at 35% 40%, #fff6d6 45%, transparent 47%); box-shadow: 0 0 8px rgba(255, 244, 200, .7); }
.landing__phase-ar { font-family: "Amiri", serif; font-size: 1.05em; font-weight: 700; color: var(--gold-2); letter-spacing: 0; }

@media (max-width: 640px) {
  .sky__sun { width: 70px; height: 70px; margin: -35px 0 0 -35px; }
  .sky__moon { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .sky__skyline { height: 64px; bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .sky__clouds i, .sky__stars i, .sky__sun::before { animation: none; }
  .landing[data-sky], .sky__sun, .sky__moon { transition: none; }
}


/* ---------- Prayer times & calendar panels ---------- */
.islamic-panels { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin: 26px 0 16px; align-items: start; }
.islamic-panels--pt { grid-template-columns: 1.3fr 1fr; margin-top: 8px; }
.islamic-panels--cal { grid-template-columns: 1.4fr 1fr; margin-top: 8px; }
.islamic-panels .card { padding: 20px 22px; }

.pt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; position: relative; }
.pt-place { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; font-family: var(--head-font); font-size: 1.45rem; font-weight: 700; color: var(--text); text-align: left; }
.pt-place .flag { border-radius: 2px; }
.pt-place .i { width: 16px; height: 16px; color: var(--gold); }
.pt-place:hover span { text-decoration: underline; text-decoration-color: var(--gold); }
.pt-date { color: var(--muted); font-size: .85rem; }
.pt-date span { color: var(--accent); font-weight: 600; }
.pt-next { flex: none; text-align: center; padding: 8px 14px; border-radius: 12px; background: linear-gradient(180deg, var(--p), var(--p-deep)); color: #fbf5e4; border: 1px solid var(--gold); }
.pt-next span { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); }
.pt-next strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }

.pt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pt-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); transition: background .2s; }
.pt-row time { margin-left: auto; font-weight: 700; font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.pt-name { display: flex; align-items: baseline; gap: 10px; font-weight: 600; }
.pt-name small { font-family: "Amiri", serif; font-size: 1.05rem; color: var(--faint); font-weight: 400; }
.pt-icon { width: 22px; height: 22px; color: var(--gold); flex: none; }
.pt-row.is-past { opacity: .55; }
.pt-row.is-info { background: var(--bg-soft); font-size: .92rem; }
.pt-row.is-info time { font-weight: 500; }
.pt-row.is-next { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 22%, var(--surface)), var(--surface)); border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.pt-row.is-next .pt-name { color: var(--accent); }

.pt-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.pt-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.pt-meta small { color: var(--faint); font-size: .78rem; }
.qibla { display: flex; align-items: center; gap: 12px; }
.qibla > div:last-child { display: flex; flex-direction: column; }
.qibla small { color: var(--faint); font-size: .78rem; }
/* 🧭 the 3D compass: a brass dial lying back, its needle pointing to a small Kaaba standing on it */
.qibla__3d { flex: none; width: 112px; height: 96px; display: grid; place-items: center; perspective: 420px; }
.qibla__dial { --h: 0deg; position: relative; width: 104px; height: 104px; border-radius: 50%; transform-style: preserve-3d; transform: rotateX(46deg) rotateZ(var(--h)); transition: transform .25s linear;
  background: radial-gradient(closest-side, #0f3a2c 0 76%, rgba(0, 0, 0, .55) 77%, transparent 79%), repeating-conic-gradient(from -.8deg, rgba(70, 46, 10, .8) 0 1.6deg, transparent 1.6deg 30deg), conic-gradient(from 210deg, #8a6420, #f2d98f, #b3862f, #fff0bd, #8f6822, #e9cc7c, #8a6420);
  box-shadow: 0 0 0 1px rgba(90, 62, 16, .8), 0 16px 14px -6px rgba(0, 0, 0, .5), inset 0 0 8px rgba(0, 0, 0, .5); }
.qibla__n { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); font-size: .68rem; font-weight: 800; color: #f2d98f; }
.qibla__needle { position: absolute; inset: 14px; transform-style: preserve-3d; }
.qibla__needle::before { content: ""; position: absolute; left: 50%; top: 13px; bottom: 50%; width: 5px; margin-left: -2.5px; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: linear-gradient(90deg, #fff0bd 50%, #b3862f 50%); transform: translateZ(3px); filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .5)); }
.qibla__needle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff0bd, #8a6420); transform: translateZ(4px); }
.qibla__kaaba { --s: 15px; position: absolute; left: 50%; top: -1px; width: var(--s); height: var(--s); margin-left: calc(var(--s) / -2); transform-style: preserve-3d; transform: translateZ(0); }
.qibla__kaaba i { --band: linear-gradient(var(--to, 180deg), #17171a 0 22%, #d9b65c 22% 33%, #17171a 33%); position: absolute; inset: 0; background: var(--band); box-shadow: inset 0 0 0 .5px #3b3320; } /* each wall hinged on the base; the gold band near the top */
.qibla__kaaba i:nth-child(1) { transform-origin: 50% 100%; transform: rotateX(-90deg); }
.qibla__kaaba i:nth-child(2) { --to: 0deg; transform-origin: 50% 0; transform: rotateX(90deg); }
.qibla__kaaba i:nth-child(3) { --to: 270deg; transform-origin: 0 50%; transform: rotateY(-90deg); }
.qibla__kaaba i:nth-child(4) { --to: 90deg; transform-origin: 100% 50%; transform: rotateY(90deg); }
.qibla__kaaba i:nth-child(5) { transform: translateZ(var(--s)); background: #101013; }
.pt-disclaimer { color: var(--faint); font-size: .82rem; text-align: center; margin: 14px auto 40px; max-width: 720px; }

/* Hijri calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cal-title { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cal-title strong { font-family: var(--head-font); font-size: 1.45rem; }
.cal-title span { font-family: "Amiri", serif; color: var(--accent); font-size: 1.1rem; line-height: 1.4; }
.cal-title small { color: var(--faint); font-size: .78rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 4px 0; }
.cal-wd.is-fri { color: var(--accent); }
.cal-day { position: relative; min-height: 50px; padding: 5px 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; }
.cal-day.is-empty { border: 0; background: none; }
.cal-h { font-weight: 700; font-size: 1.02rem; }
.cal-g { font-size: .66rem; color: var(--faint); text-align: right; }
.cal-day.is-fri { background: var(--accent-soft); }
.cal-day.is-white .cal-h::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: #d9d2bd; box-shadow: 0 0 0 1px var(--gold); vertical-align: middle; }
.cal-day.is-today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.cal-day.has-event { border-width: 2px; }
.cal-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; }
.ev-eid .cal-dot, .ev-eid.cal-day { --ev: #1f8a55; }
.ev-ramadan .cal-dot, .ev-ramadan.cal-day { --ev: #6c4bb8; }
.ev-hajj .cal-dot, .ev-hajj.cal-day { --ev: #b8892f; }
.ev-major .cal-dot, .ev-major.cal-day { --ev: #1b6fa8; }
.ev-observed .cal-dot, .ev-observed.cal-day { --ev: #5f7a8a; }
.ev-fast .cal-dot, .ev-fast.cal-day { --ev: #a0527a; }
.cal-dot { background: var(--ev, var(--gold)); }
.cal-day.has-event { border-color: var(--ev, var(--gold)); }
.cal-events { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: .86rem; }
.cal-events li { padding-left: 12px; border-left: 3px solid var(--ev, var(--gold)); }
.cal-events li.ev-eid { --ev: #1f8a55; } .cal-events li.ev-ramadan { --ev: #6c4bb8; } .cal-events li.ev-hajj { --ev: #b8892f; } .cal-events li.ev-major { --ev: #1b6fa8; } .cal-events li.ev-fast { --ev: #a0527a; } .cal-events li.ev-observed { --ev: #5f7a8a; }
.cal-events [lang="ar"], .ev-body [lang="ar"] { font-family: "Amiri", serif; color: var(--muted); margin-left: 6px; }
.cal-note { color: var(--faint); font-size: .76rem; margin: 10px 0 0; }
.cal-card--lg .cal-day { min-height: 74px; padding: 8px; }
.cal-card--lg .cal-h { font-size: 1.3rem; }
.cal-card--lg .cal-g { font-size: .76rem; }

/* upcoming events */
.ev-list { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.ev-card { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); border-left: 4px solid var(--ev, var(--gold)); background: var(--surface); }
.ev-card.ev-eid { --ev: #1f8a55; } .ev-card.ev-ramadan { --ev: #6c4bb8; } .ev-card.ev-hajj { --ev: #b8892f; } .ev-card.ev-major { --ev: #1b6fa8; } .ev-card.ev-fast { --ev: #a0527a; } .ev-card.ev-observed { --ev: #5f7a8a; }
.ev-when { flex: none; width: 70px; text-align: center; display: flex; flex-direction: column; }
.ev-when strong { font-size: 1.05rem; color: var(--accent); }
.ev-when small { color: var(--faint); font-size: .7rem; }
.ev-body { display: flex; flex-direction: column; min-width: 0; }
.ev-body small { color: var(--faint); font-size: .78rem; }

/* legend */
.legend { margin-bottom: 20px; }
.legend__list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--border); }
.lg--today { border: 2px solid var(--gold); } .lg--fri { background: var(--accent-soft); } .lg--white { border-radius: 50%; background: #d9d2bd; border-color: var(--gold); }
.lg--eid { background: #1f8a55; } .lg--ramadan { background: #6c4bb8; } .lg--major { background: #1b6fa8; }

/* monthly timetable */
.tt-card { margin-bottom: 8px; }
.tt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tt-head > div { flex: 1; text-align: center; display: flex; flex-direction: column; }
.tt-head strong { font-family: var(--head-font); font-size: 1.5rem; }
.tt-head small { color: var(--faint); font-size: .8rem; display: inline-flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.tt-head .btn--sm { margin-top: 0; }
.tt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; min-width: 640px; }
.tt th { position: sticky; top: 0; background: linear-gradient(180deg, var(--p), var(--p-deep)); color: #fbf5e4; font-weight: 600; padding: 9px 8px; text-align: left; font-size: .8rem; letter-spacing: .04em; }
.tt th:first-child { border-radius: 8px 0 0 0; } .tt th:last-child { border-radius: 0 8px 0 0; }
.tt td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.tt tr.is-fri td { background: var(--accent-soft); }
.tt tr.is-today td { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); font-weight: 700; }
.tt-hijri { color: var(--accent); font-size: .82rem; }

.page-head--center { text-align: center; }
.page-head--center .page-head__ar { display: block; margin: 4px 0 0; font-size: 1.4rem; }
.page-head__ornament { width: 48px; height: 48px; margin: 0 auto 6px; background: var(--gold); -webkit-mask: var(--octagram) center / contain no-repeat; mask: var(--octagram) center / contain no-repeat; }

/* ---------- Ramadan ---------- */
.ramadan-card {
  position: relative; overflow: hidden; margin: 26px 0 0; padding: 22px 24px; color: #f6efdc;
  background: radial-gradient(600px 260px at 85% 0%, rgba(90, 120, 200, .35), transparent 70%), linear-gradient(160deg, #0b1d3a, var(--p-deep) 70%);
  border: 1px solid var(--gold);
}
.ramadan-card::before { /* stars */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff, transparent), radial-gradient(1px 1px at 30% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 18%, #fff, transparent), radial-gradient(1px 1px at 72% 60%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 90% 35%, #fff, transparent), radial-gradient(1px 1px at 42% 42%, #fff, transparent);
}
.ramadan-card::after { display: none; }
.ramadan-card > * { position: relative; }
.ramadan-card .card__label { color: var(--gold-2); }
.ramadan-card .card__label::before { background: var(--gold-2); }
.rc-head { display: flex; justify-content: space-between; gap: 16px; }
.rc-title { margin: 2px 0; font-size: clamp(1.6rem, 4vw, 2.2rem); color: #fff; }
.rc-title small { font-size: .55em; color: #cfc6ad; font-family: var(--ui-font); }
.rc-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #cfc6ad; font-size: .88rem; }
.rc-sub[lang="ar"] { font-family: "Amiri", serif; font-size: 1.3rem; color: var(--gold-2); }
.rc-moon { /* crescent */
  flex: none; width: 74px; height: 74px; border-radius: 50%;
  box-shadow: inset -16px 6px 0 0 var(--gold-2); transform: rotate(-20deg);
  filter: drop-shadow(0 0 14px rgba(255, 214, 120, .45));
}
.rc-progress { height: 6px; margin: 14px 0 16px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.rc-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 999px; }
.rc-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.rc-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px; border-radius: 14px; text-align: center; background: rgba(255, 255, 255, .07); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.rc-tile span { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); font-weight: 700; }
.rc-tile strong { font-size: clamp(1.6rem, 4.5vw, 2.2rem); color: #fff; font-variant-numeric: tabular-nums; }
.rc-tile small { color: #cfc6ad; font-size: .76rem; }
.rc-tile.is-next { background: color-mix(in srgb, var(--gold) 22%, transparent); border-color: var(--gold-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.rc-next { margin-top: 14px; text-align: center; color: #e9e1c9; font-size: 1rem; }
.rc-next strong { font-size: 1.5rem; color: var(--gold-2); font-variant-numeric: tabular-nums; margin-left: 6px; }
.rc-note { color: #cfc6ad; font-size: .82rem; margin: 10px 0 0; }
.dua-card .rc-note { color: var(--faint); }
.rc-dua { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, .18); border: 1px solid rgba(255, 255, 255, .08); }
.rc-dua summary { cursor: pointer; color: var(--gold-2); font-weight: 600; }
.rc-dua p { margin: 6px 0; }
.rc-dua__ar { font-family: "Amiri Quran", serif; font-size: 1.5rem; line-height: 2; text-align: center; }
.rc-dua__tl { font-style: italic; color: #cfc6ad; }
.dua-card .rc-dua__tl { color: var(--muted); }
.rc-dua__ur { font-family: var(--ur-font); line-height: 2.3; }
.rc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; }
.rc-foot .btn--sm { margin-top: 0; }
.ramadan-card .link-btn { color: var(--gold-2); }
.dua-card .rc-dua__ar { color: var(--text); }
.rt td.rt-n { font-weight: 800; color: var(--accent); width: 60px; }
.rt td.rt-time { font-size: 1.05rem; font-weight: 700; }
.rt-night { display: block; font-size: .74rem; color: #6c4bb8; font-weight: 600; }
html[data-mode="dark"] .rt-night { color: #b9a2f0; }
.rt tr.ashra-2 td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.rt tr.ashra-3 td:first-child { box-shadow: inset 3px 0 0 #6c4bb8; }
.tt-head small + small { margin-top: 2px; }
.nav-ramadan { color: var(--gold-2) !important; font-weight: 700 !important; }
@media (max-width: 640px) {
  .ramadan-card { padding: 18px 16px; }
  .rc-moon { width: 52px; height: 52px; box-shadow: inset -11px 4px 0 0 var(--gold-2); }
}

/* ---------- Azan alerts ---------- */
.pt-bell { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: 6px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--faint); cursor: pointer; flex: none; }
.pt-bell svg { width: 18px; height: 18px; }
.pt-bell:hover { background: var(--gold-soft); color: var(--accent); }
.pt-bell.is-on { color: var(--gold); }
.pt-bell--none { cursor: default; }
.pt-row time { margin-left: auto; }
.azan-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font-size: .84rem; margin-bottom: 4px; }
.azan-toggle svg { width: 16px; height: 16px; }
.azan-toggle.is-on { border-color: var(--gold); background: var(--gold-soft); color: var(--accent); }
.az-prayers { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; font-size: .9rem; }
.az-prayers label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.az-prayers input { accent-color: var(--p); width: 16px; height: 16px; }

.azan-banner {
  position: fixed; left: 50%; top: 76px; z-index: 95; width: min(560px, calc(100% - 24px));
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px;
  color: #fbf5e4; border: 1px solid var(--gold); border-radius: 18px;
  background: linear-gradient(160deg, var(--p), var(--p-deep)); box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  transform: translate(-50%, -30px); opacity: 0; visibility: hidden; transition: transform .35s ease, opacity .35s ease, visibility .35s;
}
.azan-banner.is-show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.azan-banner__icon { width: 54px; height: 54px; flex: none; animation: azan-pulse 2.4s ease-in-out infinite; }
@keyframes azan-pulse { 50% { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(255, 214, 120, .6)); } }
.azan-banner__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.azan-banner__ar { font-family: "Amiri", serif; font-size: 1.25rem; color: var(--gold-2); line-height: 1.6; }
.azan-banner strong { font-size: 1.08rem; }
.azan-banner__tr { font-size: .82rem; color: #e9dfc2; margin-top: -4px; }
[data-sec="azan"] .switch [lang="ar"] { font-family: "Amiri", serif; font-size: 1.05rem; color: var(--accent); }
[data-sec="azan"] .switch small { color: var(--faint); }
.azan-banner small { color: #cfc6ad; display: inline-flex; align-items: center; gap: 6px; }
.azan-banner__warn { margin: 6px 0 0; font-size: .82rem; color: #ffe2a8; }
.azan-banner details { margin-top: 6px; font-size: .88rem; }
.azan-banner summary { cursor: pointer; color: var(--gold-2); }
.azan-banner__dua { font-family: "Amiri", serif; font-size: 1.2rem; line-height: 2; margin: 6px 0; }
.azan-banner__actions { display: flex; flex-direction: column; gap: 6px; }
.azan-banner__actions .btn--sm { margin-top: 0; }
.azan-banner .btn:not(.btn--gold) { background: rgba(255, 255, 255, .1); color: #fff; border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
@media (max-width: 640px) {
  .azan-banner { top: 66px; flex-wrap: wrap; }
  .azan-banner__actions { flex-direction: row; width: 100%; justify-content: flex-end; }
}

/* Scheduled Tilawat and Takbeer notice: sits at the bottom so it never covers the Azan banner */
.qw-notice { top: auto; bottom: calc(var(--player-h, 0px) + var(--tab-h, 0px) + 16px); transform: translate(-50%, 30px); z-index: 94; }
.qw-notice.is-show { transform: translate(-50%, 0); }
.qw-notice__ur { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; font-size: 1rem; line-height: 2.1; color: #f1e7c9; }
.qw-notice__tip { font-style: italic; }
@media (max-width: 640px) { .qw-notice { top: auto; } }

/* Custom Azan, Scheduled Tilawat and Takbeer settings */
.setting__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.setting__btns .btn--sm { margin-top: 0; }
.az-more { margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.az-more summary, .til-form summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .92rem; }
.az-more[open] summary { margin-bottom: 8px; }
.az-per { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; }
.az-file { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: .9rem; }
.az-file small { color: var(--faint); }
.az-file [lang="ar"], .til-form [lang="ar"] { font-family: "Amiri", serif; }
.az-file__state { color: var(--p); font-size: .82rem; }
.az-file .btn--sm { margin: 0 0 0 auto; cursor: pointer; }
.til-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.til-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2, transparent); }
.til-list .switch { flex: 1; min-width: 200px; margin: 0; }
.til-list .switch small { display: block; color: var(--faint); }
.til-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.til-presets b { width: 100%; font-size: .85rem; color: var(--faint); font-weight: 600; }
.chip-btn { font: inherit; font-size: .82rem; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink, inherit); cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.til-form { margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.til-form[open] summary { margin-bottom: 8px; }
.til-chosen small { color: var(--faint); }
.til-days { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 8px 0; font-size: .88rem; }
.til-days label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.til-days input, .til-list input, [data-sec="takbeer"] input[type="checkbox"] { accent-color: var(--p); }
.tk-times { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 6px 0; }
.tk-time { display: inline-flex; align-items: center; gap: 2px; }
.tk-time .input { width: auto; }
[data-sec="takbeer"] .switch small, [data-sec="tilawat"] h3 [lang], [data-sec="takbeer"] h3 [lang] { color: var(--faint); }
[data-sec="tilawat"] h3 [lang="ur"] { font-family: "Noto Nastaliq Urdu", serif; font-weight: 400; font-size: .9rem; }

/* Dhul Hijjah card */
.tk-ar { font-family: "Amiri", serif; font-size: 1.45rem; line-height: 2; text-align: center; margin: 10px 0 0; color: var(--gold-2); }
.tk-ar--sm { font-size: 1.15rem; color: var(--accent); }
.tk-tl { text-align: center; font-style: italic; margin: 0; font-size: .92rem; opacity: .9; }
.tk-ur { text-align: center; font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; line-height: 2.2; margin: 4px 0 0; opacity: .9; }
.takbeer-card .rc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.takbeer-card .rc-foot .btn--sm { margin-top: 0; }
.takbeer-card .btn:not(.btn--gold) { background: rgba(255, 255, 255, .1); color: #fff; border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.takbeer-card .rc-foot small { color: #cfc6ad; }
.tk-kaaba { /* a small Kaaba with its gold band */
  width: 56px; height: 56px; flex: none; border-radius: 6px; background: #14110d;
  background-image: linear-gradient(to bottom, transparent 22%, var(--gold-2) 22%, var(--gold-2) 30%, transparent 30%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent), 0 10px 26px rgba(0, 0, 0, .35);
  transform: perspective(160px) rotateY(-14deg);
}

/* location / settings dialog */
.qw-dialog { padding: 0; border: 1px solid var(--gold); border-radius: var(--radius); width: min(540px, calc(100% - 24px)); max-height: 88vh; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.qw-dialog::backdrop { background: rgba(6, 14, 11, .6); }
.qw-dialog__panel { display: flex; flex-direction: column; max-height: 88vh; }
.qw-dialog__body { overflow-y: auto; padding: 4px 20px 20px; }
.qw-current { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; margin: 0 0 10px; }
.qw-current small { color: var(--faint); font-weight: 400; }
.qw-loc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qw-results { list-style: none; margin: 6px 0 0; padding: 0; max-height: 240px; overflow-y: auto; }
.qw-results button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--border); background: none; cursor: pointer; text-align: left; color: var(--text); }
.qw-results button:hover { background: var(--gold-soft); }
.qw-results small { color: var(--faint); }

/* mobile menu (desktop hides the button) */
.topbar__menu { display: none; }

/* ---------- AI assistant ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-ai { display: inline-flex; align-items: center; gap: 5px; color: var(--gold-2) !important; }
.nav-ai .i { width: 15px; height: 15px; }
.icon-btn--ai { color: var(--gold); }
.btn--ai .i { color: var(--gold-2); }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.ai-badge .i { width: 15px; height: 15px; }
.ai-lang { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 3px 6px; font: inherit; font-size: .8rem; }

.ai-text { line-height: 1.75; }
.ai-text p { margin: 0 0 12px; }
.ai-text h3 { margin: 18px 0 6px; font-size: 1.05rem; color: var(--accent); }
.ai-text h3:first-child { margin-top: 0; }
.ai-text ul { margin: 0 0 12px; padding-inline-start: 22px; }
.ai-text li { margin: 4px 0; }
.ai-text.is-rtl { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Amiri", serif; font-size: 1.08rem; line-height: 2.1; text-align: right; }
.ai-cite { display: inline-block; padding: 0 7px; margin: 0 1px; border-radius: 999px; font-size: .8em; font-weight: 700; line-height: 1.6; direction: ltr; unicode-bidi: isolate;
  background: var(--gold-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); text-decoration: none; }
a.ai-cite:hover { background: var(--gold); color: #2a1e05; text-decoration: none; }
.ai-cite--plain { opacity: .75; }
.ai-note { margin-top: 14px; }

.ai-reflect { margin-top: 16px; padding-top: 14px; border-top: 1px dashed color-mix(in srgb, var(--gold) 50%, var(--border)); }
.ai-reflect__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ai-reflect__body .loader { padding: 12px 0; justify-content: flex-start; }
.ai-reflect .ai-text { font-size: .98rem; color: var(--text); }
.ai-reflect .ai-text p:last-child { margin-bottom: 0; }

.ask-hero { padding: 40px 0 52px; }
.ask-hero__badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #fff3cc; background: color-mix(in srgb, var(--gold) 22%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); margin-bottom: 10px; }
.ask-hero__badge .i { width: 15px; height: 15px; }
.ask-hero .hero__title { margin-bottom: 8px; }
.ask-hero__sub { max-width: 560px; margin: 0 auto; color: #d9d1b8; }
.ask { padding-bottom: 40px; }
.ask__form { margin-top: -30px; position: relative; padding: 14px; }
.ask__form textarea { width: 100%; resize: vertical; min-height: 92px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.05rem; line-height: 1.6; padding: 6px 4px; }
.ask__form textarea:focus { outline: none; }
.ask__bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.ask__bar .select { margin: 0; }
.ask__count { margin-left: auto; color: var(--faint); font-size: .8rem; }
.ask__examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 6px; }
.ask__examples > span { color: var(--muted); font-size: .88rem; }
.ask__examples .pill { cursor: pointer; font: inherit; font-size: .88rem; }
.ask__result { margin-top: 18px; scroll-margin-top: 90px; }
.ask__result .loader { padding: 26px; }
.ask__note { margin: 22px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--bg-soft); color: var(--muted); font-size: .86rem; border: 1px solid var(--border); }
.ai-answer { padding: 20px 22px; }
.ai-answer__q { font-weight: 700; font-size: 1.1rem; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); color: var(--accent); }
.ai-answer__tools { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-answer__tools .btn--sm { margin-top: 0; }
.ai-sources__title { margin: 22px 0 8px; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.ai-sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ai-src { padding: 12px 14px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--border); }
.ai-src > a { font-weight: 700; }
.ai-src .grade { margin-left: 6px; }
.ai-src__ar { font-family: "Amiri Quran", "Amiri", serif; font-size: 1.35rem; line-height: 2; margin: 6px 0 2px; text-align: right; }
.ai-src p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }

/* ---------- Disclaimer ---------- */
.legal { padding-bottom: 48px; line-height: 1.75; }
.legal__bismillah { font-family: "Amiri Quran", "Amiri", serif; font-size: 1.6rem; color: var(--gold) !important; margin: 8px 0 0 !important; }
.legal .card { padding: 18px 22px; margin: 16px 0; }
.legal__intro p { margin: 0 0 8px; }
.legal__jump { text-align: right; margin: 0 !important; }
/* the country whose details the Disclaimer shows, and a choice of another */
.legal__country { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 18px; margin-bottom: 16px; }
.legal__country .select { margin: 0; min-width: 200px; }
.legal__toc ol { margin: 8px 0 0; padding-inline-start: 22px; columns: 2; column-gap: 32px; }
.legal__toc li { break-inside: avoid; margin: 2px 0; }
.legal section { scroll-margin-top: 90px; }
.legal section > h2 { font-size: 1.25rem; margin: 28px 0 8px; padding-bottom: 6px; border-bottom: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border)); color: var(--accent); }
.legal ul { padding-inline-start: 22px; }
.legal li { margin: 6px 0; }
.legal__urdu { margin-top: 32px !important; font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Amiri", serif; font-size: 1.05rem; line-height: 2.2; }
.legal__urdu h2 { margin-top: 0 !important; font-size: 1.3rem; }
@media (max-width: 640px) {
  .legal__toc ol { columns: 1; }
  .legal .card { padding: 14px 16px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .islamic-panels, .islamic-panels--pt, .islamic-panels--cal { grid-template-columns: 1fr; }
}
/* Wide screens with less room: a little less space between the menu items */
@media (max-width: 1360px) {
  .topbar__nav a, .nav-more > summary { padding: 7px 9px; font-size: .9rem; }
}
@media (max-width: 1180px) {
  .topbar__menu { display: inline-grid; }
  /* In the ☰ menu the "More" pages are listed with the others */
  .nav-more > summary { display: none; }
  .nav-more { display: block; }
  .nav-more__menu { position: static; display: flex; flex-direction: column; min-width: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .nav-more__menu a { padding: 10px 14px; font-size: 1rem; }
  .topbar__nav {
    display: none; position: absolute; top: calc(100% + 3px); right: 12px; left: auto; z-index: 45;
    flex-direction: column; align-items: stretch; min-width: 220px; padding: 8px;
    background: var(--p-deep); border: 1px solid var(--gold); border-radius: 14px; box-shadow: var(--shadow-lg);
  }
  .topbar__nav.is-open { display: flex; }
  .topbar__nav a { padding: 10px 14px; font-size: 1rem; text-align: left; justify-content: flex-start; }
}
@media (max-width: 860px) {
  .landing__lanterns span:first-child { left: 2%; }
  .landing__lanterns span:last-child { right: 2%; }
}
@media (max-width: 640px) {
  html { scroll-padding-top: 125px; }
  .container { padding: 0 14px; }
  .brand__emblem { width: 38px; height: 38px; }
  .brand__name { font-size: 1.2rem; }
  .brand__sub { font-size: .62rem; letter-spacing: .08em; }
  .topbar__inner { gap: 10px; padding: 0 12px; }
  .topbar .icon-btn--lg { width: 36px; height: 36px; }
  .verse { padding: 18px 4px 12px; }
  .verse.is-playing { box-shadow: inset 0 3px 0 var(--gold); }
  .verse__tools { gap: 4px; }
  .verse__tools .icon-btn { opacity: 1; padding: 0 6px; }
  .index__tools .input { width: 150px; }
  .reader-nav__inner { gap: 6px; }
  .reader-nav__select { flex: 1 1 0; min-width: 0; }
  .reader-nav__select--sm { flex: 0 1 92px; }
  .reader-nav__select select { max-width: none; width: 100%; padding: 6px 24px 6px 8px; font-size: .84rem; background-position: right 6px center; }
  .reader-nav__modes { flex: none; }
  .reader-nav__modes a { padding: 5px 9px; font-size: .8rem; }
  .reader-nav__modes a [lang="ur"] { display: none; }
  .hero { padding: 44px 0 56px; }
  .hero__search .btn { padding: 9px 12px; }
  .cartouche { padding: 6px 36px; grid-template-columns: 1fr; }
  .surah-frame { padding: 14px 12px 12px; outline-offset: 3px; }
  .surah-frame__top { margin: 0 8px 10px; gap: 8px; }
  .surah-frame__tag { font-size: .72rem; }
  .surah-frame__num { width: 40px; height: 40px; font-size: 1rem; }
  .surah-facts { grid-auto-flow: row; grid-template-columns: 1fr 1fr; row-gap: 8px; }
  .surah-facts div:nth-child(odd) { border-left: 0; }
  .surah-facts dd { font-size: 1.2rem; }
  .verse__marks { margin: -4px 0 6px; }
  .mark { font-size: .72rem; padding: 2px 10px; }
  .cartouche__side { display: none; }
  .bismillah::before, .bismillah::after { display: none; }
  .modal { padding: 0; align-items: end; }
  .modal__panel { max-height: 90vh; border-radius: var(--radius) var(--radius) 0 0; }
  .modal__body { padding: 16px 16px 28px; }
  .player__inner { gap: 8px; padding: 6px 10px; }
  .player__controls { gap: 2px; }
  .swatch span { font-size: .62rem; }
  .hadith { padding: 16px 14px 18px; margin: 12px 0; }
  .hadith__tools { margin-left: 0; width: 100%; }
  .chapter-list { columns: 1; padding: 8px 12px; }
  .book-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .landing { padding: 32px 0 64px; min-height: 0; }
  .landing .hero__inner { padding: 0 16px; max-width: 100%; }
  /* Phones: only the inner line shows, just inside the screen edges (the outer line is off-screen) */
  .landing .hero__arch { top: calc(32px + 34px); width: 122%; opacity: .6; }
  .landing__emblem { width: 68px; height: 68px; }
  .landing__salam { font-size: 1.9rem; line-height: 1.6; }
  .landing__title { font-size: 1.55rem; }
  .landing__place { font-size: .7em; }
  .landing__where { max-width: 100%; padding: 6px 14px; text-align: left; line-height: 1.35; }
  .landing__where .flag { flex: none; }
  .landing__src { font-size: .76rem; text-wrap: balance; margin-bottom: 18px; line-height: 1.6; min-height: 3.2em; } /* (two lines kept from the start: "Finding your location…" becomes a two-line source and moved the stats down, CLS 0.11 on Google's mobile test, 2026-11-17) */
  .landing__stats { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
  .stat { align-items: flex-start; text-align: left; padding: 12px 16px; gap: 1px; }
  .stat__label { font-size: .64rem; }
  .stat__value { font-size: 1.25rem; }
  .stat__value--ar { font-size: 1.3rem; line-height: 1.45; }
  .stat small { font-size: .76rem; }
  .landing__cta { gap: 8px; margin-top: 16px; }
  .landing__cta .btn { flex: 1 1 40%; justify-content: center; }
  .landing__lanterns { display: none; }
  .landing__scroll { display: none; }
  .pt-head { flex-direction: column; }
  .pt-next { align-self: stretch; }
  .pt-foot { flex-direction: column; }
  .pt-meta { align-items: flex-start; text-align: left; }
  .cal-day { min-height: 44px; padding: 4px; }
  .cal-g { font-size: .6rem; }
  .tt-head { flex-wrap: wrap; }
  .tt-head > div { order: -1; flex-basis: 100%; }
}
@media (max-width: 480px) {
  .topbar [data-action="toggle-theme"] { display: none; } /* theme stays available in Settings */
}
@media (max-width: 420px) {
  .brand__sub .brand__sep, .brand__sub [lang="ur"] { display: none; }
  .player__medal { display: none; }
  .player__inner { grid-template-columns: minmax(0, 1fr) auto auto; }
  .player--tts .player__inner { grid-template-columns: minmax(0, 1fr) auto auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .topbar, .reader-nav, .player, .footer, .verse__tools, .chapter-head__actions, .progress,
  .islamic-panels--pt, .tt-head button, .tt-head .link-btn, .pt-disclaimer, .page-head__ornament, .ramadan-card { display: none !important; }
  .card { box-shadow: none; border: 0; }
  .tt th { background: #eee !important; color: #000 !important; }
  body { padding: 0; background: #fff; color: #000; }
  body::before { display: none; }
}

/* Android app: download page and the banner for Android visitors */
/* App suggestion for Android phone browsers: a bottom sheet (not a full-screen interstitial) */
.app-sheet { position: fixed; inset: 0; z-index: 120; }
.app-sheet[hidden] { display: none; }
.app-sheet__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .25s ease; }
.app-sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto;
  padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; text-align: center;
  color: #fbf5e4; background: linear-gradient(160deg, var(--p), var(--p-deep)); border-top: 2px solid var(--gold);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, .4); transform: translateY(100%); transition: transform .3s ease;
}
.app-sheet.is-open .app-sheet__backdrop { opacity: 1; }
.app-sheet.is-open .app-sheet__panel { transform: none; }
.app-sheet__panel img { border-radius: 18px; box-shadow: 0 8px 22px rgba(0, 0, 0, .35); }
.app-sheet__panel h2 { margin: 10px 0 6px; font-size: 1.3rem; color: #fff; }
.app-sheet__panel h2 [lang="ur"] { display: block; font-family: "Noto Nastaliq Urdu", serif; font-size: .8em; color: var(--gold-2); font-weight: 400; line-height: 2; }
.app-sheet__panel ul { list-style: none; padding: 0; margin: 4px auto 16px; display: grid; gap: 6px; text-align: start; max-width: 340px; font-size: .92rem; }
.app-sheet__open { display: block; width: 100%; max-width: 340px; margin: 0 auto; padding: 13px 18px; font-size: 1.05rem; }
.app-sheet__note { display: block; margin-top: 8px; color: #cfc6ad; font-size: .78rem; }
.app-sheet__ios-icon { border-radius: 16px; }
.ios-steps { text-align: left; margin: 4px 0 16px; padding-left: 22px; font-size: .9rem; color: #f3ecd6; line-height: 1.55; }
.ios-steps li { margin: 4px 0; }
.ios-share { width: 1.15em; height: 1.15em; vertical-align: -.2em; color: #4da3ff; }
.ios-plus { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; border: 1.5px solid currentColor; border-radius: 4px; font-size: .8em; vertical-align: -.1em; }
.app-iphone .ios-share { color: #0a84ff; }
.browser-list { display: grid; gap: 8px; margin: 14px 0 18px; }
.browser-list details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 0 14px; }
.browser-list details.is-current { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.browser-list summary { cursor: pointer; padding: 11px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.browser-list summary span { color: var(--faint); font-size: .82rem; }
.browser-list details.is-current summary::after { content: "Your browser"; margin-left: auto; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.browser-list details p { margin: 0 0 12px; }
.kbd { display: inline-block; min-width: 1.6em; padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); font-size: .85em; text-align: center; line-height: 1.5; }
.browser-table { width: 100%; border-collapse: collapse; font-size: .86rem; margin-top: 4px; }
.browser-table caption { text-align: left; font-weight: 700; padding: 0 0 8px; }
.browser-table th, .browser-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.browser-table thead th { font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.app-browsers__done { color: var(--p); font-weight: 600; }
@media (max-width: 640px) {
  .browser-table thead { display: none; }
  .browser-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .browser-table th, .browser-table td { border: 0; padding: 2px 0; }
  .browser-table tbody th { grid-column: 1 / -1; }
  .browser-table td::before { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
  .browser-table td:nth-of-type(1)::before { content: "Install"; }
  .browser-table td:nth-of-type(2)::before { content: "Notification, closed"; }
  .browser-table td:nth-of-type(3)::before { content: "Full Azan"; }
  .browser-table td:nth-of-type(4)::before { content: "Offline"; }
}
.app-sheet__stay { margin-top: 10px; color: #e9dfc2; text-decoration: underline; }
/* 🤲 Durood & Dua (layout.php, app.js): the same sheet, taller, the Arabic large, scrolls on a small phone */
.dua-sheet__panel { max-height: min(88vh, 760px); overflow-y: auto; overscroll-behavior: contain; padding-top: 18px; }
.dua-sheet__panel h2 { margin-top: 2px; }
.dua-sheet__part { margin: 10px auto 12px; padding: 12px 6px 4px; max-width: 460px; border-top: 1px solid rgba(232, 207, 138, .28); }
.dua-sheet__lead { margin: 0 0 6px; color: var(--gold-2); font-weight: 600; font-size: .95rem; }
.dua-sheet__ar { margin: 4px 0 6px; font-family: "Amiri Quran", Amiri, serif; font-size: 1.32rem; line-height: 2.1; color: #fff; }
.dua-sheet__ur { margin: 2px 0 6px; font-family: "Noto Nastaliq Urdu", serif; font-size: .98rem; line-height: 2.15; color: #f3ecd6; }
.dua-sheet__note { margin: 4px 0 6px; font-size: .84rem; line-height: 1.5; color: #e2d9be; }
.dua-sheet__note cite { display: block; margin-top: 2px; font-style: normal; font-size: .76rem; color: var(--gold-2); opacity: .9; }
.dua-sheet__fri { color: #fff; }
.dua-sheet [data-dua-ameen] { position: sticky; bottom: 0; z-index: 1; margin-top: 12px; box-shadow: 0 -10px 22px 6px rgba(6, 46, 34, .92); } /* always in reach, however long the text */
.dua-sheet .app-sheet__stay { display: block; margin: 12px auto 0; }
.dua-sheet__later { display: block; margin: 10px auto 0; color: #cfc6ad; font-size: .8rem; }
@media (prefers-reduced-motion: reduce) { .dua-sheet .app-sheet__panel, .dua-sheet .app-sheet__backdrop { transition: none; } }
.app-sheet__x { position: absolute; top: 10px; right: 10px; color: #fbf5e4; }.nav-app { color: var(--accent); }

.app-page { padding-block: 28px 40px; }
.app-hero { display: flex; gap: 24px; align-items: center; margin-bottom: 28px; }
.app-hero__icon { border-radius: 26px; box-shadow: 0 14px 36px rgba(0, 0, 0, .25); flex: none; }
.app-hero h1 { margin: 4px 0 6px; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.app-hero h1 [lang="ur"] { font-family: "Noto Nastaliq Urdu", serif; font-size: .7em; color: var(--accent); font-weight: 400; }
.app-hero__lead { margin: 0 0 16px; color: var(--muted, inherit); max-width: 52ch; }
.app-hero__btn { display: inline-flex; align-items: center; gap: 8px; font-size: 1.05rem; padding: 12px 22px; }
.app-hero__meta, .app-hero__ios { margin: 10px 0 0; font-size: .85rem; color: var(--faint); }
.app-hero__installed { color: var(--p); font-weight: 600; }
.app-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 24px; }
.app-feature { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--surface, transparent); }
.app-feature > span { font-size: 1.6rem; }
.app-feature h3 { margin: 6px 0 4px; font-size: 1.02rem; }
.app-feature p { margin: 0; font-size: .9rem; color: var(--faint); }
.app-steps h2 { margin-top: 0; font-size: 1.25rem; }
.app-steps h2 [lang="ur"], .app-steps__ur { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; }
.app-steps h2 [lang="ur"] { font-size: .8em; color: var(--accent); font-weight: 400; }
.app-steps ol { padding-inline-start: 22px; display: grid; gap: 8px; }
.app-steps__ur { line-height: 2.2; border-top: 1px dashed var(--line); padding-top: 10px; }
.app-verify { margin-top: 16px; }
.app-verify summary { cursor: pointer; font-weight: 600; }
.app-verify dl { display: grid; gap: 4px; margin: 10px 0 0; }
.app-verify dt { font-size: .82rem; color: var(--faint); margin-top: 6px; }
.app-verify dd { margin: 0; }
.app-verify code { font-size: .78rem; word-break: break-all; }
@media (max-width: 600px) {
  .app-hero { flex-direction: column; text-align: center; }
  .app-hero__lead { margin-inline: auto; }
}
/* Inside an older version of the app: "A new version is available" */
.app-update { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px;
  background: var(--gold-2); color: #1c1608; font-size: .9rem; font-weight: 600; text-align: center; }
.app-update[hidden] { display: none; }
.app-update .btn--sm { margin: 0; background: #062e22; color: #fbf5e4; border-color: #062e22; }
/* ==========================================================================
   TV (Android TV app, Smart TV browsers): a 10-foot design, read from the sofa,
   moved with the remote. A menu rail on the left, rows of large cards, a clear
   gold focus, safe margins for TVs that cut the screen's edges.
   ========================================================================== */
html.tv {
  font-size: 118%;
  --tv-rail: 92px;          /* the menu, folded */
  --tv-rail-open: 300px;    /* the menu, open */
  --tv-safe-x: 56px;        /* TVs may hide the outer 5% of the picture */
  --tv-safe-y: 32px;
  --tv-focus: var(--gold-2, #e6c66e);
  --tv-ease: cubic-bezier(.2, .8, .2, 1);
}
html.tv body { padding-left: var(--tv-rail); background:
  radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--p) 24%, transparent), transparent 60%),
  radial-gradient(900px 500px at 0% 110%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 60%),
  var(--bg); background-attachment: fixed; }
html.tv, html.tv body { overflow-x: hidden; max-width: 100vw; }
html.tv body { box-sizing: border-box; }
html.tv .topbar, html.tv .footer, html.tv .skip, html.tv .progress { display: none; }
html.tv .main { padding-top: 0; }
html.tv .main > .container:first-child { padding-top: var(--tv-safe-y); }
html.tv .container { max-width: none; padding-left: var(--tv-safe-x); padding-right: var(--tv-safe-x); }
html.tv ::-webkit-scrollbar { width: 0; height: 0; }

/* Focus: one clear golden frame, everywhere */
html.tv :focus, html.tv .tv-focus {
  outline: 3px solid var(--tv-focus); outline-offset: 3px;
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--gold) 22%, transparent), 0 12px 40px rgba(0, 0, 0, .45);
}
html.tv a, html.tv button, html.tv select, html.tv input { transition: transform .18s var(--tv-ease), box-shadow .18s var(--tv-ease), background-color .18s; }
html.tv .btn:focus, html.tv .pill:focus, html.tv .chip:focus, html.tv .btn.tv-focus, html.tv .pill.tv-focus, html.tv .chip.tv-focus { transform: scale(1.07); }
html.tv .icon-btn { min-width: 48px; min-height: 48px; }
html.tv .verse:focus-within { background: var(--highlight); border-radius: var(--radius-sm); }
html.tv .verse__tools .icon-btn { opacity: 1; }
html.tv .card:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 60%, transparent), var(--shadow); }
html.tv .landing__lanterns, html.tv .landing__scroll, html.tv .hero__search, html.tv .landing__cta,
html.tv .hero__quick, html.tv .index__tools input { display: none; }

/* ---- The menu rail ---- */
.tv-rail {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--tv-rail);
  display: flex; flex-direction: column; gap: 2px; padding: calc(var(--tv-safe-y) - 8px) 16px;
  background: #05281e; border-right: 1px solid rgba(201, 162, 39, .22);
  background: linear-gradient(90deg, color-mix(in srgb, var(--p-deep, #062e22) 92%, #000) 0%, color-mix(in srgb, var(--p-deep, #062e22) 80%, transparent) 100%);
  border-right: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  transition: width .28s var(--tv-ease), box-shadow .28s var(--tv-ease);
  overflow: hidden auto; scrollbar-width: none;
}
.tv-rail:focus-within, .tv-rail.is-open { width: var(--tv-rail-open); box-shadow: 30px 0 80px rgba(0, 0, 0, .55); background: #04231a; background: color-mix(in srgb, var(--p-deep, #062e22) 96%, #000); }
.tv-rail__brand { flex: none; display: flex; align-items: center; gap: 14px; padding: 4px 6px 14px; color: #f6eedb; white-space: nowrap; }
.tv-rail__brand img { flex: none; width: 48px; height: 48px; }
.tv-rail__brand span { display: flex; flex-direction: column; opacity: 0; transition: opacity .2s; }
.tv-rail__brand b { font-family: var(--head-font); font-size: 1.35rem; color: var(--gold-2, #e6c66e); line-height: 1.1; }
.tv-rail__brand small { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.tv-rail__item {
  position: relative; flex: none; display: flex; align-items: center; gap: 18px; height: 50px; padding: 0 16px; border-radius: 14px;
  color: rgba(246, 238, 219, .72); text-decoration: none; white-space: nowrap;
  background: transparent; border: 0; font: inherit; font-size: 1.02rem; cursor: pointer; text-align: left;
}
.tv-rail__item svg { flex: none; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tv-rail__item span { opacity: 0; transform: translateX(-8px); transition: opacity .2s, transform .2s var(--tv-ease); }
.tv-rail:focus-within .tv-rail__item span, .tv-rail:focus-within .tv-rail__brand span,
.tv-rail.is-open .tv-rail__item span, .tv-rail.is-open .tv-rail__brand span { opacity: 1; transform: none; }
.tv-rail__item.is-current { color: var(--gold-2, #e6c66e); }
.tv-rail__item.is-current::before { content: ""; position: absolute; left: 0; width: 4px; height: 30px; border-radius: 0 4px 4px 0; background: var(--gold-2, #e6c66e); }
html.tv .tv-rail__item:focus, html.tv .tv-rail__item.tv-focus { outline: none; box-shadow: none; color: #1c1608; background: linear-gradient(135deg, var(--gold-2, #e6c66e), var(--gold, #c9a227)); transform: none; }
.tv-rail__sep { flex: none; height: 1px; margin: 6px 8px; background: rgba(201, 162, 39, .25); }

/* ---- Home: the welcome as a TV hero ---- */
html.tv .landing { min-height: 0; padding: 18px 0 8px; border-radius: 0 0 0 28px; }
html.tv .landing__inner { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 8px 48px; text-align: left; padding: 8px var(--tv-safe-x) 24px; max-width: none; }
html.tv .landing__emblem { display: none; }
html.tv .landing__phase { grid-column: 1; margin: 0 0 4px; }
/* TV app: the sky of the day fills the whole home screen behind the welcome and the rows of cards,
   like a TV home screen's ambient background; the skyline stands along the bottom of the screen */
html.tv .landing[data-sky] { background: transparent; overflow: visible; }
html.tv .landing[data-sky]::after { display: none; }
html.tv .landing[data-sky] .sky {
  position: fixed; inset: 0 0 0 var(--tv-rail); z-index: 0;
  background: linear-gradient(180deg, var(--sky-a) 0%, var(--sky-b) 52%, var(--sky-c) 100%);
}
/* a gentle shade towards the bottom, so the rows' titles read on every sky */
html.tv .landing[data-sky] .sky::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, rgba(3, 8, 18, .18) 40%, rgba(3, 8, 18, .5) 100%); }
html.tv body:has(.landing[data-sky]) .landing .hero__inner, html.tv body:has(.landing[data-sky]) .tv-home,
html.tv body:has(.landing[data-sky]) .main > .container { position: relative; z-index: 1; }
html.tv .landing[data-sky] .sky__skyline { height: 110px; bottom: 0; z-index: 1; }
html.tv .landing[data-sky] .sky__stars { inset: 0 0 25% 0; }
html.tv .landing[data-sky] .hero__pattern { display: none; }
html.tv .sky__sun { width: 80px; height: 80px; margin: -40px 0 0 -40px; }
html.tv .sky__moon { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
html.tv .landing__salam { grid-column: 1; font-size: clamp(2.2rem, 4.4vw, 3.6rem); text-align: left; }
html.tv .landing__inner .ornament-divider { display: none; }
html.tv .landing__greet, html.tv .landing__title, html.tv .landing__src { grid-column: 1; text-align: left; margin-left: 0; }
html.tv .landing__title { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
html.tv .landing__stats { grid-column: 2; grid-row: 1 / span 4; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0; }
html.tv .landing__stats .stat--next { grid-column: 1 / -1; }
html.tv .landing__stats .stat { padding: 18px 22px; text-align: left; border-radius: 18px; }
html.tv .landing__stats .stat--next .stat__value { font-size: 2.2rem; }
html.tv .hero__arch { opacity: .35; }
html.tv .landing__stats .stat__value { white-space: nowrap; }
@media (max-width: 1100px) { /* TVs that report a 960-pixel-wide screen */
  html.tv .landing__inner { grid-template-columns: 1fr; gap: 4px; padding-bottom: 16px; }
  html.tv .landing__salam { font-size: 2.1rem; }
  html.tv .landing__title { font-size: 1.45rem; }
  html.tv .landing__stats { grid-column: 1; grid-row: auto; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
  html.tv .landing__stats .stat--next { grid-column: auto; }
  html.tv .landing__stats .stat { padding: 12px 16px; }
  html.tv .landing__stats .stat__value, html.tv .landing__stats .stat--next .stat__value { font-size: 1.3rem; }
  html.tv .landing__stats small { font-size: .78rem; }
}

/* ---- Rows of colourful cards (home: phones swipe, computers use ‹ ›, TVs the remote) ---- */
:root { --row-x: max(20px, calc((100vw - 1180px) / 2 + 20px)); --tv-ease: cubic-bezier(.2, .8, .2, 1); }
html.tv { --row-x: var(--tv-safe-x); }
.tv-home { padding: 14px 0 4px; }
html.tv .tv-home { padding: 8px 0 24px; }
.tv-row { margin: 12px 0 0; }
html.tv .tv-row { margin: 22px 0 6px; }
.tv-row__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 var(--row-x); }
.tv-row__title { margin: 0; font-family: var(--head-font); font-size: 1.45rem; font-weight: 600; color: var(--text); display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 14px; }
html.tv .tv-row__title { font-size: 1.55rem; margin-bottom: 6px; }
.tv-row__title [lang] { font-family: var(--ur-font); font-size: 1rem; color: var(--gold-2, var(--gold)); font-weight: 400; }
.tv-row:focus-within .tv-row__title, .tv-row.is-active .tv-row__title { color: var(--gold-2, var(--gold)); }
.tv-row__nav { display: flex; gap: 8px; flex: none; }
.tv-row__nav button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 1.6rem; line-height: 1; padding: 0 0 4px; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); transition: border-color .15s, color .15s, opacity .15s; }
.tv-row__nav button:hover:not(:disabled) { border-color: var(--gold); color: var(--accent); }
.tv-row__nav button:disabled { opacity: .3; cursor: default; }
@media (hover: none) { .tv-row__nav { display: none; } }
html.tv .tv-row__nav { display: none; }
.tv-row__track { display: flex; gap: 16px; overflow-x: auto; overflow-y: visible; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  scroll-padding: 0 var(--row-x); padding: 12px var(--row-x) 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tv-row__track::-webkit-scrollbar { display: none; }
html.tv .tv-row__track { gap: 22px; scroll-snap-type: none; scroll-behavior: smooth; padding: 14px var(--row-x) 22px; }
/* Computers: each row stays inside the page's width (even margins, like the sections below), scrolled with ‹ ›,
   with a soft edge where more cards are waiting; phones keep the swipe rows that run to the screen's edge */
@media (min-width: 900px) {
  html:not(.tv) .tv-row__track { margin: 0 calc(var(--row-x) - 10px); padding: 12px 10px 18px; scroll-padding: 0 10px; }
  html:not(.tv) .tv-row.can-next .tv-row__track { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent); }
  html:not(.tv) .tv-row.can-prev .tv-row__track { -webkit-mask-image: linear-gradient(90deg, transparent, #000 64px); mask-image: linear-gradient(90deg, transparent, #000 64px); }
  html:not(.tv) .tv-row.can-prev.can-next .tv-row__track { -webkit-mask-image: linear-gradient(90deg, transparent, #000 64px, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(90deg, transparent, #000 64px, #000 calc(100% - 64px), transparent); }
  html:not(.tv) .tv-row.no-scroll .tv-row__nav { visibility: hidden; }
}
.tv-card {
  position: relative; flex: none; width: 236px; height: 154px; border-radius: 18px; overflow: hidden; scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 14px 16px; text-decoration: none; color: #f6eedb;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .10), transparent 55%),
    linear-gradient(150deg, var(--card-a, #0f5a43), var(--card-b, #062e22));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: transform .22s var(--tv-ease), box-shadow .22s var(--tv-ease);
}
.tv-card:hover { text-decoration: none; color: #f6eedb; }
.tv-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (hover: hover) {
  html:not(.tv) .tv-card:hover { transform: translateY(-6px); box-shadow: 0 18px 38px rgba(0, 0, 0, .32), inset 0 0 0 1px rgba(255, 255, 255, .1); }
}
html.tv .tv-card { width: 272px; height: 176px; border-radius: 20px; padding: 16px 18px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .06); }
.tv-card::after { /* the site's rosette, as a watermark */
  content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; background: var(--gold); opacity: .10;
  -webkit-mask: var(--medallion) center / contain no-repeat; mask: var(--medallion) center / contain no-repeat; pointer-events: none;
}
html.tv .tv-card:focus, html.tv .tv-card.tv-focus { transform: scale(1.08); z-index: 2; outline: 3px solid var(--tv-focus); outline-offset: 0;
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--gold) 25%, transparent), 0 22px 50px rgba(0, 0, 0, .6); }
/* TV boxes have slow graphics chips: no frosted glass, no endless sky animations or blurred clouds redrawn every frame,
   lighter shadows (the look stays the same: the sky still shows the time of day, the stars and the sun stand still) */
html.tv *, html.tv *::before, html.tv *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.tv .stat, html.tv .landing__phase { background-color: rgba(3, 10, 20, .42); }
html.tv .player { background: #0f1c17; }
html.tv .sky, html.tv .sky *, html.tv .sky *::before, html.tv .sky *::after { animation: none !important; }
/* and the opening: the sky's colours set at once (not faded over 3 s, a full-screen repaint each frame), the welcome shown in place */
html.tv .landing, html.tv .landing * { transition: none !important; }
html.tv .landing, html.tv .landing *, html.tv .landing *::before, html.tv .landing *::after { animation: none !important; }
html.tv .sky__clouds { display: none; }
html.tv .landing[data-sky] .sky { transform: translateZ(0); contain: strict; }
html.tv .tv-card { box-shadow: 0 6px 14px rgba(0, 0, 0, .3); transition: transform .14s var(--tv-ease); }
html.tv .tv-card:focus, html.tv .tv-card.tv-focus { box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 25%, transparent), 0 10px 24px rgba(0, 0, 0, .5); }
html.tv :focus, html.tv .tv-focus { box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 22%, transparent); }
html.tv .tv-row__track { scroll-behavior: auto; }
/* TV: the end of a row (or the page): the chosen item nudges that way and its frame flashes, so the remote is seen to answer */
html.tv .tv-bump { animation: tv-flash .4s ease; }
html.tv .tv-bump--right { animation: tv-flash .4s ease, tv-nudge-r .4s var(--tv-ease); }
html.tv .tv-bump--left { animation: tv-flash .4s ease, tv-nudge-l .4s var(--tv-ease); }
html.tv .tv-bump--down { animation: tv-flash .4s ease, tv-nudge-d .4s var(--tv-ease); }
html.tv .tv-bump--up { animation: tv-flash .4s ease, tv-nudge-u .4s var(--tv-ease); }
@keyframes tv-flash { 40% { outline-color: #fff; } }
@keyframes tv-nudge-r { 40% { translate: 12px 0; } }
@keyframes tv-nudge-l { 40% { translate: -12px 0; } }
@keyframes tv-nudge-d { 40% { translate: 0 10px; } }
@keyframes tv-nudge-u { 40% { translate: 0 -10px; } }
/* TV: ‹ › at a row's edges while more cards wait that way (the row's own arrows are for computers) */
html.tv .tv-row { position: relative; }
html.tv .tv-row.can-next::after, html.tv .tv-row.can-prev::before {
  position: absolute; bottom: 70px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-size: 2rem; line-height: 1; padding-bottom: 4px; color: var(--gold-2, #e6c66e); background: rgba(3, 8, 18, .6); pointer-events: none;
}
html.tv .tv-row.can-next::after { content: "\203A"; right: 10px; }
html.tv .tv-row.can-prev::before { content: "\2039"; left: 10px; }
.tv-card__num { position: absolute; left: 14px; top: 12px; min-width: 36px; height: 36px; padding: 0 8px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(0, 0, 0, .25); color: var(--gold-2, #e6c66e); font-weight: 700; font-size: .92rem; }
.tv-card__ar { position: absolute; inset: 12px 16px auto auto; max-width: calc(100% - 66px); font-family: var(--ar-font); font-size: 1.95rem; line-height: 1.5;
  color: var(--gold-2, #e6c66e); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.tv .tv-card__ar { font-size: 2.1rem; }
.tv-card__ar--sm, html.tv .tv-card__ar--sm { font-size: 1.3rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; inset: 10px 14px auto 14px; max-width: none; }
.tv-card__body { position: relative; display: flex; flex-direction: column; gap: 2px; }
.tv-card__body strong { font-size: 1.06rem; line-height: 1.25; color: #fff8e8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.tv .tv-card__body strong { font-size: 1.12rem; }
.tv-card__body small { color: rgba(246, 238, 219, .72); font-size: .8rem; }
.tv-card__body small[lang="ur"] { font-family: var(--ur-font); font-size: .88rem; line-height: 1.9; text-align: left; }
.tv-card__icon { position: absolute; left: 16px; top: 14px; font-size: 2.4rem; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.tv-card--dua { --card-a: #3b2a6b; --card-b: #1b1238; }
.tv-card--book { --card-a: #6b2a2a; --card-b: #2c0f12; }
.tv-card--tile { --card-a: #134a5e; --card-b: #0a2430; }
.tv-card--kursi { --card-a: #7a5a12; --card-b: #2e2105; }
.tv-card--more { --card-a: #2a3a34; --card-b: #121b17; }
.tv-card--continue { --card-a: #0f6a4f; --card-b: #08392b; width: 300px; }
html.tv .tv-card--continue { width: 360px; }
.tv-card--continue .tv-card__icon { font-size: 2.1rem; }
/* each card in a row gets its own shade, so a row is lively without being loud */
.tv-row__track .tv-card--surah:nth-child(5n+2) { --card-a: #136150; --card-b: #072f27; }
.tv-row__track .tv-card--surah:nth-child(5n+3) { --card-a: #0e5566; --card-b: #062830; }
.tv-row__track .tv-card--surah:nth-child(5n+4) { --card-a: #1d5e3a; --card-b: #0a2d1b; }
.tv-row__track .tv-card--surah:nth-child(5n+5) { --card-a: #0f4d5e; --card-b: #072530; }
.tv-row__track .tv-card--dua:nth-child(4n+2) { --card-a: #4a2a6b; --card-b: #1f1236; }
.tv-row__track .tv-card--dua:nth-child(4n+3) { --card-a: #2f2f78; --card-b: #12123a; }
.tv-row__track .tv-card--dua:nth-child(4n+4) { --card-a: #5a2a62; --card-b: #26102a; }
.tv-row__track .tv-card--book:nth-child(4n+2) { --card-a: #7a3a22; --card-b: #2e130a; }
.tv-row__track .tv-card--book:nth-child(4n+3) { --card-a: #6b2a45; --card-b: #2a0f1b; }
.tv-row__track .tv-card--book:nth-child(4n+4) { --card-a: #5e3326; --card-b: #24120c; }
.tv-row__track .tv-card--tile:nth-child(6n+2) { --card-a: #6b2a52; --card-b: #2b0f22; }
.tv-row__track .tv-card--tile:nth-child(6n+3) { --card-a: #0f5a43; --card-b: #062e22; }
.tv-row__track .tv-card--tile:nth-child(6n+4) { --card-a: #233a7a; --card-b: #0e1838; }
.tv-row__track .tv-card--tile:nth-child(6n+5) { --card-a: #6b4a12; --card-b: #2c1e05; }
.tv-row__track .tv-card--tile:nth-child(6n+6) { --card-a: #5a2a2a; --card-b: #240f0f; }
.home-cards .card--continue { display: none !important; } /* now the "Continue" row */
@media (max-width: 600px) {
  .tv-card { width: 200px; height: 134px; padding: 12px 14px; border-radius: 16px; }
  .tv-card--continue { width: 250px; }
  .tv-card__ar { font-size: 1.6rem; }
  .tv-card__ar--sm { font-size: 1.1rem; }
  .tv-card__body strong { font-size: .97rem; }
  .tv-card__icon { font-size: 2rem; }
  .tv-row__title { font-size: 1.25rem; }
  .tv-row__track { gap: 12px; }
}
@media (max-width: 1100px) { /* TVs that report a 960-pixel-wide screen */
  html.tv .tv-card { width: 236px; height: 156px; }
  html.tv .tv-card--continue { width: 300px; }
  html.tv .tv-card__ar { font-size: 1.8rem; }
}

/* ---- Home: the rest, sized for TV ---- */
html.tv .islamic-panels { gap: 22px; }
html.tv .home-cards { display: none; } /* shown as the "Continue" row */
html.tv .fihrist__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
html.tv .fihrist-row { border-radius: 16px; border: 1px solid var(--border); padding: 14px 18px; content-visibility: visible; }
html.tv .fihrist-row__dots { display: none; }
html.tv .fihrist-row:focus, html.tv .fihrist-row.tv-focus { transform: scale(1.04); background: var(--surface); }

/* ---- Reading pages ---- */
html.tv .container--read { max-width: 1240px; }
html.tv .verse { scroll-margin: 140px 0; }
@media (max-width: 1099px) { html.tv .player { left: var(--tv-rail); } }
@media (min-width: 1100px) { html.tv .player { top: var(--tv-safe-y); max-height: calc(100vh - 2 * var(--tv-safe-y)); right: 24px; } }
html.tv .drawer__panel { width: min(560px, 46vw); }
html.tv .seg button, html.tv .switch, html.tv .select select { min-height: 48px; }
/* TV drop-down list (app.js opens it for a <select>) */
.tv-pick { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px; background: rgba(4, 12, 9, .66); }
.tv-pick__panel { width: min(560px, 80vw); max-height: 82vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--text); border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent);
  border-top: 3px solid var(--gold); border-radius: 20px; box-shadow: var(--shadow-lg); }
.tv-pick__title { padding: 16px 24px 12px; font-weight: 700; font-size: 1.15rem; color: var(--accent); border-bottom: 1px solid var(--border); }
.tv-pick__list { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.tv-pick__group { padding: 12px 14px 4px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.tv-pick__opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 18px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; font: inherit; font-size: 1.1rem; text-align: start; cursor: pointer; }
.tv-pick__opt::before { content: ""; flex: none; width: 1.1em; text-align: center; color: var(--gold); font-weight: 700; }
.tv-pick__opt.is-selected { font-weight: 700; color: var(--accent); }
.tv-pick__opt.is-selected::before { content: "✓"; }
.tv-pick__opt:disabled { opacity: .45; }
html.tv .tv-pick__opt:focus, html.tv .tv-pick__opt.tv-focus { outline: 3px solid var(--tv-focus); outline-offset: -3px; background: var(--gold-soft); transform: none; }

/* Faster first paint on phones: the 114-row surah index is drawn as it scrolls into view */
.fihrist-row { content-visibility: auto; contain-intrinsic-size: auto 63px; }

/* Home page: the parts below the first screen are drawn (and their fonts loaded) as they scroll into view */
.landing ~ .container > .islamic-panels, .home-cards { content-visibility: auto; contain-intrinsic-size: auto 720px; }

/* Main headings that reuse a decorative title (hadith cartouche): no extra browser heading spacing */
h1.cartouche__name { margin: 0; font-size: clamp(1.5rem, 4vw, 2.1rem); }

/* ---------- Duas & Hamd o Naat ---------- */
.hero__title-ur { display: block; font-family: var(--ur-font); font-size: .62em; color: var(--gold-2); font-weight: 400; line-height: 2; }
.duas-page { padding-top: 18px; padding-bottom: 40px; }
.dua-feature { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; padding: 18px 22px; margin: 6px 0 18px; text-decoration: none; color: inherit; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.dua-feature:hover { border-color: var(--gold); text-decoration: none; }
.dua-feature__ar { grid-column: 1 / -1; font-family: var(--ar-font); font-size: 1.6rem; color: var(--accent); line-height: 1.8; }
.dua-feature__body { display: flex; flex-direction: column; gap: 2px; }
.dua-feature__body strong { font-size: 1.1rem; }
.dua-feature__body strong [lang="ur"] { font-size: .95em; color: var(--accent); margin-left: 6px; line-height: 1.6; }
.dua-feature__body small { color: var(--muted); }
.dua-feature__go { font-size: 1.6rem; color: var(--gold); }
.dua-cat { margin-top: 22px; }
.dua-cat .section-title span[aria-hidden] { margin-right: 4px; }
.dua-cat__ur { font-size: .85em; color: var(--accent); margin-left: 8px; font-weight: 400; line-height: 1.8; }
.dua-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.dua-link { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "en n" "ur n" "ar n"; gap: 0 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-decoration: none; }
.dua-link:hover { border-color: var(--gold); text-decoration: none; }
.dua-link__en { grid-area: en; font-weight: 500; }
.dua-link__ar { grid-area: ar; font-family: "Amiri", serif; color: var(--faint); font-size: .95rem; text-align: left; }
.dua-link__ur { grid-area: ur; font-family: var(--ur-font); color: var(--accent); font-size: 1rem; line-height: 2.1; text-align: left; }
.dua-link__n { grid-area: n; min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 700; }
.dua-empty { text-align: center; color: var(--muted); padding: 24px 0; }
.dua-source { margin-top: 28px; }
.dua-head { text-align: center; margin: 8px 0 18px; }
.dua-head__title { margin: 10px 0 4px; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.dua-head__title [lang="ur"] { display: block; font-size: .7em; color: var(--accent); font-weight: 400; line-height: 2; }
.dua-head__meta { color: var(--muted); margin: 0 0 12px; }
.dua-items { display: grid; gap: 14px; }
.dua { padding: 16px 18px; scroll-margin: 120px; transition: box-shadow .2s, border-color .2s; }
.dua.is-playing { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft), var(--shadow); }
.dua__top { display: flex; align-items: center; gap: 10px; }
.dua__num { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: .85rem; }
.dua__title { font-weight: 600; flex: 1; min-width: 0; }
.dua__title [lang="ur"] { display: block; font-weight: 400; color: var(--accent); line-height: 1.9; }
.dua__repeat { padding: 2px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--accent); font-weight: 700; font-size: .8rem; }
.dua__tools { margin-left: auto; display: flex; gap: 2px; }
.dua__ar { font-family: var(--ar-font); font-size: calc(var(--ar-size) * .9); line-height: 2.1; text-align: right; margin: 12px 0 8px; color: var(--text); }
.dua__ayah { color: var(--gold); font-size: .8em; }
.dua__tl { font-style: italic; color: var(--muted); margin: 0 0 8px; }
.dua__en { margin: 0 0 6px; line-height: 1.7; }
.dua__ur { font-family: var(--ur-font); line-height: 2.3; text-align: right; }
.dua__note { margin: 6px 0 0; color: var(--accent); font-size: .88rem; font-weight: 600; }
.dua__ref { display: inline-block; margin-top: 6px; font-size: .85rem; }
.naats-lead { max-width: 620px; margin: 0 auto; color: #e9dfc2; }
.naat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.naat-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; text-decoration: none; color: var(--text); text-align: center; }
.naat-card:hover { border-color: var(--gold); text-decoration: none; }
.naat-card__title { font-family: var(--ur-font); font-size: 1.25rem; color: var(--accent); line-height: 2.1; }
.naat-card__title[lang="ar"] { font-family: var(--ar-font); }
.naat-card small { color: var(--muted); }
.naat { padding: 24px clamp(16px, 4vw, 40px); margin-bottom: 26px; text-align: center; }
.naat__type { display: inline-block; padding: 3px 14px; border-radius: 999px; background: var(--gold-soft); color: var(--accent); font-weight: 600; font-size: .85rem; }
.naat__title { margin: 12px 0 2px; }
.naat__title [lang] { display: block; font-family: var(--ur-font); font-weight: 400; font-size: clamp(1.5rem, 4vw, 2.1rem); color: var(--accent); line-height: 2.2; }
.naat__title [lang="ar"] { font-family: var(--ar-font); }
.naat__roman-title { display: block; font-size: 1.1rem; color: var(--muted); }
.naat__poet { margin: 4px 0 14px; color: var(--muted); }
.naat__poet [lang] { font-family: var(--ur-font); color: var(--text); }
.naat__tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.naat__tools [aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); }
.naat__status { color: var(--muted); font-size: .88rem; margin: 10px 0 0; }
.naat__body { margin: 24px auto 8px; max-width: 640px; }
.naat__couplet { padding: 14px 0; border-bottom: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent); }
.naat__couplet:last-child { border-bottom: 0; }
.naat__line { margin: 0; font-family: var(--ur-font); font-size: clamp(1.2rem, 3vw, 1.5rem); line-height: 2.4; }
.naat__line[lang="ar"] { font-family: var(--ar-font); line-height: 2; }
.naat__roman { display: none; margin: -4px 0 6px; color: var(--muted); font-style: italic; font-size: .95rem; }
.naat__body.show-roman .naat__roman { display: block; }
.naat__part { color: var(--accent); font-weight: 600; font-size: .88rem; }
.naat__part [lang] { font-family: var(--ur-font); font-weight: 400; }
.naat__about { max-width: 640px; margin: 10px auto 0; color: var(--muted); }
@media (max-width: 640px) {
  .dua-list { grid-template-columns: 1fr; }
  .dua { padding: 14px; }
  .dua__ar { font-size: calc(var(--ar-size) * .8); }
}
.naat-recs__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.naat-recs__head .setting__note { margin: 0; }
.naat-recs { gap: 10px; }
.naat-rec { padding: 12px 16px; }
.naat-rec__title { font-family: var(--ur-font); font-weight: 400; color: var(--accent); font-size: 1.15rem; margin-right: 8px; line-height: 2; }
.naat-rec__title[lang="ar"] { font-family: var(--ar-font); }
.naat-rec__min { color: var(--faint); font-size: .82rem; white-space: nowrap; }
.naat-rec__by { margin: 4px 0 0 40px; color: var(--muted); font-size: .82rem; }
.naat-more { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 16px 20px; color: var(--text); text-decoration: none; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.naat-more:hover { border-color: var(--gold); text-decoration: none; }
.naat-more > span:first-child { font-size: 1.6rem; }
.naat-more strong { display: block; }
.naat-more small { color: var(--muted); }
.naat-more small [lang] { font-family: var(--ur-font); color: var(--accent); }
.naat-more__go { margin-left: auto; font-size: 1.3rem; color: var(--gold); }
.dua__urbtn { padding: 3px 10px; gap: 4px; font-size: .85rem; }
.dua__urbtn .i { width: 14px; height: 14px; }
.dua__urbtn [lang="ur"] { font-family: var(--ur-font); line-height: 1.6; }
.dua__by { margin: -2px 0 8px; color: var(--faint); font-size: .78rem; text-align: right; }
.dua-head__title [lang="ur"] { display: block; }

/* Duas: languages shown (Settings → Duas, or the bar on each Duas page). Set on <html> by the server. */
html.dm-ar .dua__en, html.dm-ar .dua__by,
html.dm-arur .dua__eng,
html.dm-aren .dua__ur, html.dm-aren .dua__by,
html.dm-en .dua__ar, html.dm-en .dua__tl, html.dm-en .dua__ur, html.dm-en .dua__by,
html.dm-ur .dua__ar, html.dm-ur .dua__tl, html.dm-ur .dua__eng,
html.no-dtl .dua__tl { display: none; }
/* a dua without the chosen translation keeps what it has */
html.dm-arur .dua:not(:has(.dua__ur)) .dua__eng, html.dm-aren .dua:not(:has(.dua__eng)) .dua__ur,
html.dm-en .dua:not(:has(.dua__eng)) .dua__ar, html.dm-ur .dua:not(:has(.dua__ur)) .dua__ar { display: block; }
.dua-modes { display: flex; align-items: center; gap: 6px; justify-content: center; margin: 14px auto 0; max-width: 660px; }
.dua-modes .seg { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); }
.dua-modes .seg button { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 4px 4px; line-height: 1.25; }
.dua-modes .seg button [lang="ur"] { font-family: var(--ur-font); font-size: .78rem; line-height: 1.9; opacity: .85; }
@media (max-width: 560px) { .dua-modes .seg { grid-template-columns: repeat(3, 1fr); } }
.seg--wrap { flex-wrap: wrap; }
.seg--wrap button { flex: 1 1 auto; white-space: nowrap; padding: 7px 10px; }
/* word by word, as the voice recites */
.dw { border-radius: 4px; transition: background-color .12s, color .12s; }
.dw.is-active { color: var(--word-hl); background: var(--gold-soft); box-shadow: 0 0 0 2px var(--gold-soft); }
.dua__ar .dw.is-active { box-shadow: 0 0 0 3px var(--gold-soft); }
/* in the Arabic: instructions – (ثلاث مرات) – and optional [ ] wording, which the reciter may not say */
.dua__aside { color: var(--muted); }
.dua__aside[data-skip] { font-size: .72em; }
.dua__alt.is-unrecited { opacity: .7; }
.dua .is-reading-part { background: color-mix(in srgb, var(--gold) 7%, transparent); border-radius: 8px; }
.player--dua .player__ayah-ar.is-translation { font-family: var(--ui-font, inherit); font-size: 1.05rem; line-height: 1.8; text-align: start; }
.player--dua .player__ayah-ar.is-translation[lang="ur"] { font-family: var(--ur-font); line-height: 2.3; font-size: 1.15rem; }

/* ==========================================================================
   Colourful cards across the site (the TV app's look): Hadith collections,
   Hamd o Naat, Duas. Rich jewel tones, gold Arabic, light text.
   ========================================================================== */
.book-card, .naat-card, .dua-feature {
  --card-a: #6b2a2a; --card-b: #2c0f12;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .10), transparent 55%),
    linear-gradient(150deg, var(--card-a), var(--card-b));
  border-color: transparent; color: #f6eedb;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: transform .22s var(--tv-ease), box-shadow .22s var(--tv-ease);
}
.book-card:hover, .naat-card:hover, .dua-feature:hover {
  color: #f6eedb; border-color: transparent; transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(255, 255, 255, .1);
}
/* Hadith collections */
.book-grid .book-card:nth-child(6n+2) { --card-a: #0f5a43; --card-b: #062e22; }
.book-grid .book-card:nth-child(6n+3) { --card-a: #3b2a6b; --card-b: #1b1238; }
.book-grid .book-card:nth-child(6n+4) { --card-a: #134a5e; --card-b: #0a2430; }
.book-grid .book-card:nth-child(6n+5) { --card-a: #7a5a12; --card-b: #2e2105; }
.book-grid .book-card:nth-child(6n+6) { --card-a: #233a7a; --card-b: #0e1838; }
.book-card .book-card__ar { color: var(--gold-2, #e6c66e); }
.book-card strong { color: #fff8e8; }
.book-card small { color: rgba(246, 238, 219, .7); }
.book-card .book-card__meta { color: rgba(246, 238, 219, .85); }
.book-card .book-card__meta > span:not(.grade) { padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .22); }
.book-card .surah-card__num { color: var(--gold-2, #e6c66e); }
/* Hamd o Naat */
.naat-card { --card-a: #6b2a52; --card-b: #2b0f22; }
.naat-grid .naat-card:nth-child(5n+2) { --card-a: #3b2a6b; --card-b: #1b1238; }
.naat-grid .naat-card:nth-child(5n+3) { --card-a: #0f5a43; --card-b: #062e22; }
.naat-grid .naat-card:nth-child(5n+4) { --card-a: #7a3a22; --card-b: #2e130a; }
.naat-grid .naat-card:nth-child(5n+5) { --card-a: #134a5e; --card-b: #0a2430; }
.naat-card .naat-card__title { color: var(--gold-2, #e6c66e); }
.naat-card strong { color: #fff8e8; }
.naat-card small { color: rgba(246, 238, 219, .72); }
/* Duas: the Quran duas banner, and a colour for each group of topics */
.dua-feature { --card-a: #3b2a6b; --card-b: #1b1238; }
.dua-feature .dua-feature__ar, .dua-feature .dua-feature__go { color: var(--gold-2, #e6c66e); }
.dua-feature .dua-feature__body strong [lang="ur"] { color: var(--gold-2, #e6c66e); }
.dua-feature .dua-feature__body small { color: rgba(246, 238, 219, .75); }
.dua-cat { --cat: #0f8a64; }
.dua-cat:nth-of-type(7n+2) { --cat: #6a4fc0; }
.dua-cat:nth-of-type(7n+3) { --cat: #c0603a; }
.dua-cat:nth-of-type(7n+4) { --cat: #1f8aa8; }
.dua-cat:nth-of-type(7n+5) { --cat: #b8862a; }
.dua-cat:nth-of-type(7n+6) { --cat: #b0457a; }
.dua-cat:nth-of-type(7n+7) { --cat: #3f6fd0; }
.dua-cat .section-title { border-left: 5px solid var(--cat); padding-left: 12px; }
.dua-cat .dua-link {
  border-left: 4px solid var(--cat);
  background: var(--surface);
  background: linear-gradient(100deg, color-mix(in srgb, var(--cat) 14%, var(--surface)), var(--surface) 70%);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.dua-cat .dua-link:hover { border-color: var(--cat); transform: translateX(3px); box-shadow: var(--shadow); }
.dua-cat .dua-link__n { background: var(--cat); color: #fff; border-radius: 999px; min-width: 28px; padding: 1px 8px; text-align: center; font-size: .8rem; font-weight: 600; }

/* ==========================================================================
   Full-screen Mushaf: an open book on the TV (and big screens)
   ========================================================================== */
html.mfs-open, html.mfs-open body { overflow: hidden; }
.mfs {
  position: fixed; inset: 0; z-index: 200; overflow: hidden; color: #f6eedb;
  background:
    radial-gradient(70% 90% at 50% 45%, rgba(201, 162, 39, .10), transparent 70%),
    radial-gradient(120% 120% at 50% 50%, #0c2a20 0%, #04140f 70%, #020a07 100%);
  animation: mfsIn .3s ease;
}
@keyframes mfsIn { from { opacity: 0; } to { opacity: 1; } }
.mfs__scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; cursor: pointer; scrollbar-width: thin; scrollbar-color: rgba(201, 162, 39, .5) transparent; }
.mfs__sizer { position: relative; margin: 0 auto 3vh; }
.mfs__book { position: absolute; left: 0; top: 0; display: flex; align-items: stretch; transform-origin: 0 0; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .6)); }
.mfs__slot { display: flex; }
.mfs .mushaf-page { width: 600px; max-width: none; margin: 0; flex: none; color: var(--text); }
.mfs .mushaf-line { font-size: 27px; }
.mfs .mushaf-page--ornate { width: 640px; }
/* the book's spine between the two pages */
.mfs__book:not(.is-single)::after {
  content: ""; position: absolute; top: 2%; bottom: 2%; left: 50%; width: 46px; margin-left: -23px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .18) 42%, rgba(0, 0, 0, .32) 50%, rgba(0, 0, 0, .18) 58%, transparent);
}
.mfs__bar {
  position: absolute; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px 28px; flex-wrap: wrap;
  padding: 14px 76px; font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
.mfs.is-bar .mfs__bar { opacity: 1; pointer-events: auto; transform: none; }
.mfs__bar--top { top: 0; transform: translateY(-12px); background: linear-gradient(rgba(2, 10, 7, .92), rgba(2, 10, 7, 0)); padding-bottom: 34px; }
.mfs__bar--bottom { bottom: 0; transform: translateY(12px); background: linear-gradient(rgba(2, 10, 7, 0), rgba(2, 10, 7, .92)); padding-top: 34px; color: rgba(246, 238, 219, .8); }
.mfs__surah { font-family: var(--ar-font); font-size: 1.5rem; color: var(--gold-2, #e6c66e); }
.mfs__juz { font-family: var(--ar-font); font-size: 1.15rem; color: rgba(246, 238, 219, .85); }
.mfs__pages { color: rgba(246, 238, 219, .75); }
.mfs__close { position: absolute; right: 18px; top: 10px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(201, 162, 39, .5);
  background: rgba(0, 0, 0, .35); color: #f6eedb; display: grid; place-items: center; cursor: pointer; }
.mfs__close:hover { background: rgba(201, 162, 39, .3); }
.mfs__lang { position: absolute; left: 18px; top: 14px; max-width: min(240px, 38vw); height: 38px; padding: 0 8px; border-radius: 10px; border: 1px solid rgba(201, 162, 39, .5); background: #04140f; color: #f6eedb; font-size: 14px; }
html.tv .mfs__lang { display: none; }
.mfs__zoom { position: absolute; right: 76px; top: 10px; display: flex; gap: 6px; }
.mfs__zoom button { min-width: 46px; height: 46px; border-radius: 12px; border: 1px solid rgba(201, 162, 39, .5); background: rgba(2, 10, 7, .6); color: #f6eedb; font: 700 15px/1 var(--head-font, serif); cursor: pointer; }
.mfs__zoom button:hover { background: rgba(201, 162, 39, .3); }
.mfs kbd { display: inline-block; min-width: 30px; padding: 2px 8px; margin-right: 6px; border-radius: 8px; border: 1px solid rgba(201, 162, 39, .55);
  background: rgba(255, 255, 255, .06); color: var(--gold-2, #e6c66e); font: 600 .85rem var(--ui-font); text-align: center; }
html.tv .mfs__close, html.tv .mfs__zoom { display: none; } /* the remote does it */
.mushaf-full-btn { display: inline-flex; align-items: center; gap: 6px; }
.mushaf-full-btn [lang="ur"] { font-family: var(--ur-font); font-size: .85em; line-height: 1.6; opacity: .85; }
@media (max-width: 900px) { .mushaf-full-btn [lang="ur"] { display: none; } }
.mfs__touch { display: none; }
@media (pointer: coarse) {
  html:not(.tv) .mfs__bar--bottom > span { display: none; }
  html:not(.tv) .mfs__bar--bottom > .mfs__touch { display: inline; }
}

/* iPhone / iPad: Safari zooms the whole page in when a text field or menu with text under 16px
   is tapped, and doesn't zoom back out. Only iOS has -webkit-touch-callout, so other devices keep
   the smaller sizes. */
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: max(16px, 1em) !important; }
}

/* ==========================================================================
   Noor, the lantern guide (noor.js): floats in the corner, sways, its flame
   flickers; it glows brighter while it speaks. The bubble speaks beside it,
   and a ring of light points at the feature being explained.
   ========================================================================== */
.noor { position: fixed; right: 16px; bottom: calc(var(--player-h, 0px) + var(--tab-h, 0px) + 14px); z-index: 73; width: 62px; height: 93px; transition: bottom .3s ease; }
.noor[hidden] { display: none; }
.noor__btn { position: relative; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 30px;
  animation: noor-float 6s ease-in-out infinite; transform-origin: 50% 4%; filter: drop-shadow(0 8px 14px rgba(60, 30, 0, .35)); }
.noor__btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.noor__svg { width: 100%; height: 100%; display: block; overflow: visible; }
@keyframes noor-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-7px) rotate(3deg); } }
.noor__halo { position: absolute; left: 50%; top: 56%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 200, 100, .45), rgba(255, 170, 60, .12) 45%, transparent 70%); animation: noor-halo 4s ease-in-out infinite; }
@keyframes noor-halo { 0%, 100% { transform: scale(.9); opacity: .75; } 50% { transform: scale(1.05); opacity: 1; } }
.noor__flame { transform-origin: 50px 90px; animation: noor-flicker 1.6s ease-in-out infinite; }
@keyframes noor-flicker { 0%, 100% { transform: scale(1, 1); } 25% { transform: scale(.94, 1.06); } 50% { transform: scale(1.04, .95); } 75% { transform: scale(.97, 1.04); } }
.noor__inner { animation: noor-halo 2.4s ease-in-out infinite; transform-origin: 50px 82px; }
/* speaking: the light swells */
.noor.is-speaking .noor__halo { animation-duration: 1.6s; background: radial-gradient(circle, rgba(255, 214, 120, .7), rgba(255, 170, 60, .2) 45%, transparent 70%); }
.noor.is-speaking .noor__flame { animation-duration: .9s; }

.noor-bubble {
  position: fixed; right: 88px; bottom: calc(var(--player-h, 0px) + var(--tab-h, 0px) + 30px); z-index: 72; width: min(340px, calc(100vw - 112px));
  padding: 14px 16px 14px; border-radius: 16px; background: var(--surface); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); border-top: 3px solid var(--gold);
  box-shadow: 0 18px 40px rgba(20, 12, 0, .28); animation: noor-pop .28s ease;
}
.noor-bubble[hidden] { display: none; }
.noor-bubble::after { /* the tail towards the lantern */
  content: ""; position: absolute; right: -8px; bottom: 26px; width: 14px; height: 14px; background: var(--surface);
  border-right: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); border-top: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); transform: rotate(45deg);
}
@keyframes noor-pop { from { transform: translateY(8px) scale(.97); opacity: 0; } }
.noor-bubble__x { position: absolute; right: 6px; top: 4px; width: 30px; height: 30px; border: 0; background: none; color: var(--faint); font-size: 1.3rem; cursor: pointer; border-radius: 50%; }
.noor-bubble__x:hover { color: var(--text); background: var(--surface-2, rgba(0, 0, 0, .05)); }
.noor-bubble__title { display: block; padding-right: 26px; margin-bottom: 4px; font-family: var(--head-font, inherit); font-size: 1.05rem; color: var(--accent); }
.noor-bubble__text { margin: 0 0 4px; font-size: .92rem; line-height: 1.55; }
.noor-bubble__ur { margin: 2px 0 0; font-family: var(--ur-font); font-size: .95rem; line-height: 2.1; color: var(--muted); }
.noor-bubble__actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.noor-bubble--menu .noor-bubble__actions { flex-direction: column; align-items: stretch; gap: 4px; }
.noor-bubble__item { justify-content: flex-start; text-align: left; border-color: transparent; background: transparent; }
.noor-bubble__item:hover { border-color: var(--gold); background: var(--gold-soft); }

.noor-spot { position: fixed; z-index: 71; pointer-events: none; border-radius: 16px; border: 3px solid var(--gold-2, #e6c66e);
  box-shadow: 0 0 0 200vmax rgba(3, 8, 18, .42), 0 0 22px rgba(255, 210, 120, .7); transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease; }
.noor-spot[hidden] { display: none; }

@media (max-width: 640px) {
  .noor { right: 10px; width: 50px; height: 75px; }
  .noor-bubble { right: 10px; left: 10px; width: auto; bottom: calc(var(--player-h, 0px) + var(--tab-h, 0px) + 98px); }
  .noor-bubble::after { right: 26px; bottom: -8px; transform: rotate(135deg); }
}
html.tv [data-noor-setting] { display: none; }
@media print { .noor, .noor-bubble, .noor-spot { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .noor__btn, .noor__halo, .noor__flame, .noor__inner { animation: none; }
  .noor-bubble { animation: none; }
  .noor-spot { transition: none; }
}

/* ==========================================================================
   Qaris, Translators & Voices (/qaris, people.js): 3D cards that tilt
   towards the pointer and flip over to the biography.
   ========================================================================== */
.people { padding-bottom: 40px; }
.people__bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin: 10px 0 26px; }
.people__filter { flex: 0 1 auto; flex-wrap: wrap; }
.people__filter button { flex: 0 0 auto; padding: 8px 14px; font-size: .9rem; }
.people__n { display: inline-block; min-width: 1.6em; padding: 0 5px; margin-left: 3px; border-radius: 9px; background: var(--gold-soft, rgba(201, 164, 76, .18)); font-size: .75rem; font-weight: 600; }
.people__photos { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; color: var(--muted); cursor: pointer; }
.people__group { margin: 0 0 38px; }
.people__group[hidden] { display: none; }
.people__heading { display: flex; gap: 12px; align-items: baseline; justify-content: center; flex-wrap: wrap; margin: 0; text-align: center; font-size: 1.6rem; }
.people__heading span { font-family: var(--ur-font); font-size: 1.15rem; font-weight: 400; color: var(--gold); }
.people__intro { margin: 4px 0 18px; text-align: center; color: var(--muted); }
.people__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px 22px; }
.people__note { max-width: 760px; margin: 10px auto 0; text-align: center; font-size: .85rem; color: var(--muted); }

.person { perspective: 1100px; }
.person__card {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  position: relative; display: block; height: 430px; border-radius: 20px; cursor: pointer; outline: none;
  transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.person__card.is-tilting { transition: transform .12s ease-out; }
.person__card.is-flipped { transform: rotateX(var(--rx)) rotateY(calc(180deg + var(--ry))); }
.person__card:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; }
.person__face {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--border));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 22px 40px -18px rgba(30, 20, 0, .45), 0 4px 10px rgba(30, 20, 0, .08);
}
.person__back { transform: rotateY(180deg); padding: 20px 18px 16px; overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface) 70%); }

/* front: an arched frame (mihrab) holding the photo or the calligraphy */
.person__frame { position: relative; flex: 1 1 auto; margin: 12px 12px 0; overflow: hidden; border-radius: 110px 110px 12px 12px;
  background: linear-gradient(160deg, var(--p), var(--p-deep)); box-shadow: 0 0 0 2px var(--gold) inset, 0 0 0 5px color-mix(in srgb, var(--gold) 25%, transparent) inset;
  transform: translateZ(30px); }
.person__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: transform .5s ease; }
.person__card:hover .person__img { transform: scale(1.04); }
.person__mono { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 26px 16px; text-align: center; color: var(--gold-2);
  background: radial-gradient(circle at 50% 38%, rgba(255, 230, 160, .22), transparent 60%),
    repeating-conic-gradient(from 22.5deg at 50% 40%, rgba(255, 255, 255, .04) 0 22.5deg, transparent 0 45deg), linear-gradient(160deg, var(--p), var(--p-deep)); }
.person__mono--alt, .people.no-photos .person__img { display: none; }
.people.no-photos .person__mono--alt { display: flex; }
.person__mono-ar { font-family: var(--ar-font); font-size: 1.85rem; line-height: 1.7; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.person__mono-en { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--gold-2);
  font-family: var(--head-font, Georgia, serif); font-size: 1.15rem; letter-spacing: .06em; opacity: .9; }
.person__shine { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .75), transparent 45%); }
.person__card.is-tilting .person__shine { opacity: 1; }
.person__caption { flex: 0 0 auto; padding: 12px 14px 16px; text-align: center; transform: translateZ(20px); }
.person__name { margin: 0; font-size: 1.08rem; line-height: 1.3; }
.person__native { margin: 2px 0 0; font-family: var(--ar-font); font-size: 1.1rem; line-height: 1.6; color: var(--gold); }
.person__native[lang="ur"] { font-family: var(--ur-font); font-size: .98rem; line-height: 2; }
.person__role { margin: 4px 0 0; font-size: .8rem; color: var(--muted); }
.person__hint { position: absolute; right: 12px; top: 12px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0, 0, 0, .35); color: #fff; font-size: 1rem; transform: translateZ(40px); backdrop-filter: blur(3px); }

/* back: the biography */
.person__back .person__name { color: var(--accent); }
.person__desc { margin: 2px 0 10px; font-size: .82rem; color: var(--gold); font-weight: 600; }
.person__bio { margin: 0 0 12px; font-size: .9rem; line-height: 1.6; }
.person__bio[lang="ar"] { font-family: var(--ar-font); font-size: 1.05rem; line-height: 1.9; }
.person__bio[lang="ur"] { font-family: var(--ur-font); font-size: .95rem; line-height: 2.2; }
.person__bio--none { color: var(--muted); font-style: italic; }
.person__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.person__links .btn { padding: 6px 12px; font-size: .82rem; }
.person__credit { margin: 10px 0 0; font-size: .7rem; line-height: 1.45; color: var(--muted); word-break: break-word; }
.person__credit a { color: inherit; }

@media (max-width: 520px) {
  .people__grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 12px; }
  .person__card { height: 340px; }
  .person__frame { margin: 8px 8px 0; border-radius: 80px 80px 10px 10px; }
  .person__mono-ar { font-size: 1.35rem; }
  .person__caption { padding: 8px 8px 12px; }
  .person__name { font-size: .95rem; }
  .person__back { padding: 14px 12px 12px; }
  .person__bio { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  .person__card, .person__card.is-tilting { transition: none; transform: none; }
  .person__card.is-flipped { transform: rotateY(180deg); }
  .person__img { transition: none; }
}
@media print {
  .person__card { height: auto; transform: none !important; }
  .person__face { position: relative; backface-visibility: visible; }
  .person__back { transform: none; }
}

/* ==========================================================================
   YouTube video maker (admin, video-maker.js)
   ========================================================================== */
.vm { max-width: 980px; padding-bottom: 40px; }
.vm__form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; padding: 20px; margin: 16px 0; }
.vm__field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.vm__field > span { font-weight: 600; color: var(--muted); }
.vm__field--wide { grid-column: 1 / -1; }
.vm__field input[type="text"], .vm__field select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; }
.vm__checks { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.vm__checks label { display: inline-flex; gap: 6px; align-items: center; }
.vm__go { display: flex; gap: 10px; align-items: end; justify-content: flex-end; }
.vm__go .btn--primary { font-size: 1.05rem; padding: 12px 26px; }
.vm__need { grid-column: 1 / -1; margin: 0; color: #b3261e; }
.vm__progress p { margin: 8px 0 12px; color: var(--muted); font-size: .92rem; }
.vm__bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.vm__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--p), var(--gold)); transition: width .3s; }
.vm__canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; box-shadow: var(--shadow); background: #04170f; }
.vm__tip { font-size: .85rem; color: var(--muted); }
.vm__done { padding: 20px; margin-top: 18px; }
.vm__done h2 { margin-top: 0; }
.vm__files { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.vm__files [hidden] { display: none; }
.vm__saved { color: var(--accent); font-weight: 600; }
.vm__thumb { display: block; width: min(100%, 480px); border-radius: 10px; margin-bottom: 16px; box-shadow: var(--shadow); }
.vm__meta { margin-bottom: 14px; }
.vm__meta-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.vm__meta-head small { color: var(--muted); }
.vm__meta-head .btn { margin-left: auto; padding: 5px 12px; font-size: .82rem; }
.vm__meta textarea { width: 100%; box-sizing: border-box; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: .88rem/1.5 ui-monospace, Consolas, monospace; resize: vertical; }
@media (max-width: 640px) { .vm__form { grid-template-columns: 1fr; } }
.vm__match { min-height: 1.2em; color: var(--accent); font-weight: 600; }

/* ==========================================================================
   Admin: sign in and dashboard (/admin)
   ========================================================================== */
.adm-login { display: grid; place-items: center; min-height: 60vh; }
.adm-login__card { width: min(420px, 100%); padding: 28px; display: grid; gap: 14px; text-align: center; }
.adm-login__card h1 { margin: 0; }
.adm-login__card p { margin: 0; color: var(--muted); }
.adm-login__card input { padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.adm-login__error { color: #b3261e !important; font-weight: 600; }
.adm-login__hint { font-size: .85rem; }
.adm-login__card .vm__field { text-align: start; }
.adm { padding-bottom: 40px; }
.adm__head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; padding: 28px 0 18px; }
.adm__head h1 { margin: 0; font-size: 2.1rem; }
.adm__head-actions { display: flex; gap: 8px; }
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--gold); box-shadow: var(--shadow); }
.adm-kpi span { font-size: .78rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; }
.adm-kpi b { font-size: 1.9rem; line-height: 1.2; color: var(--accent); font-variant-numeric: tabular-nums; }
.adm-kpi small { color: var(--muted); font-size: .8rem; }
.adm-trend { font-weight: 700; }
.adm-trend.is-up { color: #1e8e3e; }
.adm-trend.is-down { color: #c5221f; }
.adm-card { padding: 18px 20px; min-width: 0; }
.adm-card h2 { margin: 0 0 12px; font-size: 1.15rem; }
.adm-card h3 { margin: 16px 0 8px; font-size: .95rem; color: var(--muted); }
.adm-card--wide { margin-bottom: 16px; }
.adm-card__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.adm-legend { font-size: .8rem; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.adm-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.adm-legend .is-visitors, .adm-chart__visitors { background: var(--accent); fill: var(--accent); }
.adm-legend .is-views, .adm-chart__views { background: color-mix(in srgb, var(--gold) 45%, transparent); fill: color-mix(in srgb, var(--gold) 45%, transparent); }
.adm-chart { display: block; width: 100%; height: auto; }
.adm-chart__grid { stroke: var(--border); stroke-dasharray: 3 4; }
.adm-chart__axis { font-size: 11px; fill: var(--muted); font-family: var(--sans, inherit); }
.adm-chart g:hover .adm-chart__visitors { fill: var(--gold); }
.adm-note { margin: 8px 0 0; font-size: .8rem; color: var(--muted); }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; margin-bottom: 16px; }
.adm-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.adm-bars li { position: relative; display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 8px; font-size: .88rem; overflow: hidden; }
.adm-bars__fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; }
.adm-bars__name { position: relative; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.adm-bars__name a { color: inherit; overflow: hidden; text-overflow: ellipsis; }
.adm-bars b { position: relative; font-variant-numeric: tabular-nums; }
.adm-dl { margin: 0; display: grid; gap: 6px; }
.adm-dl div { display: flex; gap: 12px; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.adm-dl dt { color: var(--muted); }
.adm-dl dd { margin: 0; text-align: right; }
.adm-ok { color: #1e8e3e; font-weight: 700; }
.adm-bad { color: #c5221f; font-weight: 700; }
.adm-ai { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.adm-ai li { font-size: .85rem; }
.adm-ai p { margin: 3px 0 0; color: var(--text); line-height: 1.5; }
.adm-ai small { color: var(--muted); }
.adm-tag { display: inline-block; padding: 1px 8px; border-radius: 9px; background: var(--gold-soft, rgba(201, 164, 76, .18)); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.adm-checks { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; font-size: .88rem; }
.adm-checks li.is-ok span { color: #1e8e3e; font-weight: 700; }
.adm-checks li.is-missing { color: var(--muted); }
.adm-checks small { color: var(--muted); margin-left: 4px; }
.adm-log { max-height: 220px; overflow: auto; margin: 0; padding: 10px; border-radius: 8px; background: var(--surface-2); font-size: .72rem; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.adm-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.adm-tool { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .2s, transform .2s; }
.adm-tool:hover { border-color: var(--gold); transform: translateY(-2px); }
.adm-tool b { color: var(--accent); }
.adm-tool span { font-size: .8rem; color: var(--muted); }
@media (max-width: 520px) { .adm-grid { grid-template-columns: 1fr; } .adm-kpi b { font-size: 1.5rem; } }
@media (min-width: 640px) and (max-width: 1099px) { .adm-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .adm-kpis { grid-template-columns: repeat(6, 1fr); } }
.adm-back { margin: 18px 0 0; font-size: .9rem; }
.adm-back a { color: var(--muted); text-decoration: none; }
.adm-back a:hover { color: var(--accent); }
.vm__yt { gap: 10px; padding: 14px; border: 1px solid var(--border) !important; border-radius: 12px; background: var(--surface-2); }
.vm__yt-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.vm__yt-row label { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; max-width: 100%; }
.vm__yt-row select { max-width: 100%; min-width: 0; }
.vm__yt-row small { color: var(--muted); }
.vm__yt-row select, .vm__yt-row input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.vm__yt-auto { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.vm__ytres { margin-bottom: 16px; padding: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--border)); }
.vm__ytres p { margin: 8px 0; }
.vm__ytres[hidden], .vm__ytres [hidden] { display: none; }
.vm__format-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vm__format-row label { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.vm__format-row label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent); }
.vm__format-row small { flex-basis: 100%; color: var(--muted); padding-left: 24px; }
.vm__range[hidden] { display: none; }
.vs__open-row { margin-top: 8px; }
.vm__broll-moods { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; }
.vm__broll-moods label { display: inline-flex; gap: 6px; align-items: center; }
/* the API keys: hidden as typed, but not password fields (a password field makes the browser fill in the admin login elsewhere on the page) */
.bf__key { -webkit-text-security: disc; text-security: disc; }
.bf__log { max-height: 160px; overflow: auto; margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, .25); font-size: .78rem; white-space: pre-wrap; }
.bf__log:empty { display: none; }
.vb__body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.vb__mood h3 { margin: 4px 0 8px; font-size: 1rem; }
.vb__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.vb__clip { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.vb__clip video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.vb__clip div { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 8px; font-size: .78rem; }
.vb__clip button { border: 0; background: none; color: #d0463b; cursor: pointer; font-size: .85rem; }
.vs { width: min(1180px, 96vw); max-height: 94vh; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--text); }
.vs::backdrop { background: rgba(0, 0, 0, .55); }
.vs__head { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.vs__head h2 { margin: 0; font-size: 1.15rem; }
.vs__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; }
.vs .btn--sm { margin-top: 0; }
.vs__nav input[type=number] { width: 6em; }
.vs__x { margin-left: auto; border: 0; background: none; color: inherit; font-size: 1.3rem; cursor: pointer; padding: 4px 8px; }
.vs__body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; padding: 16px; }
@media (max-width: 860px) { .vs__body { grid-template-columns: 1fr; } }
.vs__prompt { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vs__prompt-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.vs__text { height: min(56vh, 520px); overflow-y: auto; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); line-height: 2; white-space: pre-wrap; }
.vs__text--ur { font-family: var(--ur-font); line-height: 2.5; }
.vs__text--ar { font-family: var(--ar-font); line-height: 2.2; }
.vs__text span { border-radius: 4px; transition: background .08s; }
.vs__text .is-said { background: color-mix(in srgb, var(--gold) 45%, transparent); color: var(--text); }
.vs__desk { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.vs__box { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.vs__box h3 { margin: 0 0 8px; font-size: .95rem; }
.vs__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.vs__row select { max-width: 100%; }
.vs__meter { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.vs__meter canvas { flex: 1; width: 100%; height: 14px; border-radius: 4px; background: rgba(0, 0, 0, .25); }
.vs__clip { font: 700 .7rem Inter, sans-serif; padding: 2px 6px; border-radius: 4px; background: rgba(208, 70, 59, .2); color: #d0463b; opacity: .35; }
.vs__clip.is-on { opacity: 1; background: #d0463b; color: #fff; }
.vs__rec.is-live { background: #c0392b; border-color: #c0392b; animation: vs-pulse 1.2s infinite; }
@keyframes vs-pulse { 50% { filter: brightness(1.3); } }
.vs__time { font: 600 1.1rem Inter, sans-serif; font-variant-numeric: tabular-nums; }
.vs__count { font: 800 1.6rem Inter, sans-serif; color: var(--gold); }
.vs__takes { display: flex; flex-wrap: wrap; gap: 6px; }
.vs__take { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; font-size: .85rem; }
.vs__take.is-on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, transparent); }
.vs__wave { display: block; width: 100%; height: 120px; border-radius: 8px; background: rgba(0, 0, 0, .25); cursor: pointer; touch-action: none; }
.vs__ab { display: inline-flex; }
.vs__ab .btn { border-radius: 0; }
.vs__ab .btn:first-child { border-radius: 8px 0 0 8px; }
.vs__ab .btn:last-child { border-radius: 0 8px 8px 0; }
.vs .btn.is-on { background: var(--gold); color: #2a1e05; border-color: var(--gold); }
.vs__fx { margin: 6px 0; }
.vs__fx summary { cursor: pointer; font-weight: 600; }
.vs__fx label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 1.2fr) 64px; align-items: center; gap: 8px; margin: 6px 0; font-size: .88rem; }
.vs__fx label:has(input[type=checkbox]) { display: flex; }
.vs__fx output { font-variant-numeric: tabular-nums; font-size: .82rem; text-align: right; }
.vs__savebox audio { height: 32px; vertical-align: middle; max-width: 100%; }
.vs__msg { margin: 8px 0; min-height: 1.2em; }
.vs__msg.is-bad { color: #d0463b; }
.vs__lib { padding: 10px 16px 14px; border-top: 1px solid var(--line); font-size: .88rem; line-height: 2; }
.vs__chip { display: inline-block; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); }
.vm__range-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.vm__range-row label { display: inline-flex; gap: 8px; align-items: center; }
.vm__range-row input { width: 90px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.vm__range-row small { color: var(--muted); }
.vm__picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.vm__pick { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 6px 12px; border-radius: 99px; font: inherit; font-size: .84rem; cursor: pointer; }
.vm__pick small { color: var(--muted); }
.vm__pick:hover { border-color: var(--gold); background: var(--gold-soft, rgba(201, 164, 76, .15)); }
.vm__canvas.vm__canvas--short { aspect-ratio: 9 / 16; width: auto; height: min(70vh, 640px); max-width: 100%; margin: 0 auto; }
.vm__thumb[hidden], .vm__files [hidden] { display: none; }
@media (max-width: 640px) { .vm__format-row { grid-template-columns: 1fr; } }

/* Share panel (app.js qwShare): Facebook, WhatsApp, X, Telegram, copy link, more */
.share-sheet { position: fixed; inset: 0; z-index: 90; display: grid; place-items: end center; background: rgba(4, 12, 9, .45); backdrop-filter: blur(2px); animation: share-fade .2s ease; }
.share-sheet[hidden] { display: none; }
@keyframes share-fade { from { opacity: 0; } }
.share-sheet__panel { width: min(460px, 100%); margin: 0 0 max(12px, env(safe-area-inset-bottom)); padding: 16px 18px 20px; border-radius: 20px; background: var(--surface); color: var(--text);
  border-top: 3px solid var(--gold); box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); animation: share-up .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes share-up { from { transform: translateY(30px); opacity: 0; } }
.share-sheet__head { display: flex; align-items: center; justify-content: space-between; }
.share-sheet__head b { font-size: 1.05rem; }
.share-sheet__x { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: 1.3rem; cursor: pointer; }
.share-sheet__what { margin: 2px 0 14px; color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-sheet__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px 6px; }
.share-sheet__btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 2px; border: 0; background: none; color: var(--text); font: inherit; font-size: .8rem; text-decoration: none; cursor: pointer; border-radius: 12px; }
.share-sheet__btn[hidden] { display: none; }
.share-sheet__btn span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); transition: transform .15s; }
.share-sheet__btn svg { width: 26px; height: 26px; }
.share-sheet__btn:hover span, .share-sheet__btn:focus-visible span { transform: scale(1.08); }
.share-sheet__btn:focus-visible { outline: 2px solid var(--gold); }
@media (min-width: 700px) { .share-sheet { place-items: center; } .share-sheet__panel { margin: 0; } }
.footer__fb { margin-left: 8px; }
/* video maker: the Publish box */
.vm__pub { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.vm__pub small { color: var(--muted); flex: 1 1 220px; }
.vm__pub-opt { display: inline-flex; gap: 8px; align-items: center; }
.vm__pub-opt[hidden] { display: none; }
.vm__pub select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.vm__pub input[type="text"] { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; width: 14em; }
.vm__pub--setup small a { color: var(--accent, inherit); }
.vm__ig-help { flex: 1 1 100%; font-size: .85rem; color: var(--muted); }
.vm__ig-help summary { cursor: pointer; }
.vm__ig-help ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }

/* Islamic calendar: the dates in the page itself (months table, today's date, questions) */
h2.card__label { margin: 0 0 8px; font-family: inherit; line-height: inherit; }
.cal-today { margin: 10px 0 0; font-size: 1rem; color: var(--text); }
.cal-today span[lang="ar"] { font-family: var(--ar-font); color: var(--gold); font-size: 1.1em; }
.cal-months { margin-top: 18px; }
.cal-months__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.cal-months__table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cal-months__table caption { text-align: left; font-weight: 700; font-size: 1.05rem; padding: 0 0 8px; color: var(--accent); }
.cal-months__table caption span { font-family: var(--ar-font); color: var(--gold); margin-left: 8px; font-weight: 400; }
.cal-months__table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.cal-months__table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cal-months__table td span[lang="ar"] { font-family: var(--ar-font); color: var(--gold); margin-left: 6px; }
.cal-months__table td:last-child { color: var(--muted); font-size: .84rem; }
.cal-faq { margin-top: 18px; }
.cal-faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.cal-faq summary { cursor: pointer; font-weight: 600; }
.cal-faq details p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.vm__thumb.vm__thumb--short { width: min(100%, 260px); }
.vm__log { margin-top: 10px; font-size: .82rem; }
.vm__log[hidden] { display: none; }
.vm__log pre { max-height: 200px; overflow: auto; padding: 10px; border-radius: 8px; background: var(--surface-2); white-space: pre-wrap; word-break: break-all; font-size: .75rem; }
.vm__kind-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.vm__kind-row label { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.vm__kind-row label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent); }
.vm__hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
[data-only][hidden] { display: none !important; }
@media (max-width: 640px) { .vm__kind-row { grid-template-columns: 1fr 1fr; } }
/* video maker: Surah or Para, and the surah list by Mushaf order or order of revelation */
.vm__kind-row--two, [data-only="quran"] > .vm__kind-row { grid-template-columns: repeat(2, 1fr); }
.vm__kind-row small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }
.vm__order { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 8px; }
.vm__order label { display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .86rem; }
.vm__order label small { color: var(--muted); font-weight: 400; font-size: .74rem; }
.vm__order label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent); }
[data-vm-surah-list], [data-vm-juz] { width: 100%; margin-bottom: 8px; }
[data-qmode][hidden] { display: none !important; }
@media (max-width: 640px) { [data-only="quran"] > .vm__kind-row { grid-template-columns: 1fr; } }
/* video maker: Qaris claimed on YouTube */
.vm__claim { display: grid; gap: 4px; margin-top: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid #d9822b; background: color-mix(in srgb, #d9822b 12%, var(--surface)); font-size: .84rem; }
.vm__claim b { color: #b45f06; }
.vm__claim small { color: var(--muted); }
.vm__claim .btn { justify-self: start; margin-top: 4px; font-size: .8rem; padding: 4px 10px; }
.vm__claim[hidden], .vm__claim-mark[hidden] { display: none; }
.vm__claim-mark { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--muted); font-size: .78rem; text-decoration: underline; cursor: pointer; justify-self: start; }
[data-only="quran"] > .vm__kind-row--three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { [data-only="quran"] > .vm__kind-row--three { grid-template-columns: 1fr; } }
.vm__kind-row--three label { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: start; }
.vm__kind-row--three label input { margin-top: 3px; }
.vm__kind-row--three label small { grid-column: 2; }
/* video maker: the "Ready for YouTube" checklist */
.vm__ready { margin: 6px 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.vm__ready[hidden] { display: none; }
.vm__ready-sum { margin: 0 0 8px; font-weight: 700; }
.vm__ready-sum small { margin-left: 6px; color: var(--muted); font-weight: 400; }
.vm__ready-sum--ok { color: #1d8a4e; } .vm__ready-sum--warn { color: #b45f06; } .vm__ready-sum--bad { color: #c0392b; }
.vm__ready ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vm__ready li { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; }
.vm__ready li i { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .72rem; color: #fff; }
.vm__ready li.is-ok i { background: #1d8a4e; } .vm__ready li.is-warn i { background: #d9822b; } .vm__ready li.is-bad i { background: #c0392b; }
.vm__ready li small { display: block; color: var(--muted); font-size: .78rem; }
.vm__msgbar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 10px 0 4px; }
.vm__msgbar small { color: var(--muted); flex: 1 1 220px; }
.vm__msgbar[hidden] { display: none; }
/* video maker: Review before posting (the switch, and the approval box after the video is made) */
.vm__review-on { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 10px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, #b45f06 45%, var(--border)); background: color-mix(in srgb, #d9822b 8%, var(--surface)); }
.vm__review-on small { color: var(--muted); flex: 1 1 260px; }
.vm__review { margin: 6px 0 16px; padding: 14px; border-radius: 12px; border: 2px solid #d9822b; background: color-mix(in srgb, #d9822b 7%, var(--surface)); display: grid; gap: 10px; }
.vm__review[hidden] { display: none; }
.vm__rv-head { margin: 0; font-size: 1.05rem; }
.vm__rv-head small { color: var(--muted); margin-left: 6px; font-size: .82rem; }
.vm__rv-video { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; }
.vm__rv-checks { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.vm__rv-checks label { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.vm__rv-msg { margin: 0; color: #c0392b; font-size: .86rem; }
.vm__rv-msg:empty { display: none; }
/* home: nothing moves while the page fills in (Cumulative Layout Shift): the lines revealed by islamic.js keep their place */
.landing__phase { min-height: 28px; }
.landing__mid { display: grid; place-items: center; min-height: 34px; margin: 4px 0 6px; }
.landing__mid > * { grid-area: 1 / 1; margin: 0; }
.landing__mid:has(.landing__greet:not([hidden])) .ornament-divider { visibility: hidden; }
.landing__place[hidden] { display: block !important; visibility: hidden; } /* (over the site-wide [hidden] rule) */
.stat small { display: block; min-height: 1.35em; }
html.tv .landing__mid { grid-column: 1; justify-items: start; min-height: 0; }
/* home, layout shift: the small lines of the stats keep the height of their text; the flag has its place before it loads */
.stat small { line-height: 1.5; min-height: 1.5em; }
.flag-ph { display: inline-block; width: 32px; height: 24px; vertical-align: middle; }
/* the sun and moon move with transform in the sky's own units (cqw/cqh): their gliding never counts as a layout shift */
@supports (width: 1cqw) {
  .sky { container-type: size; }
  .landing[data-sky] { --sun-x: 50cqw; --sun-y: 30cqh; --moon-x: 74cqw; --moon-y: 22cqh; }
  .sky__sun, .sky__moon { left: 0; top: 0; }
  .sky__sun { transform: translate(var(--sun-x), var(--sun-y)); }
  .sky__moon { transform: translate(var(--moon-x), var(--moon-y)); }
  .landing.sky-live .sky__sun, .landing.sky-live .sky__moon { transition: opacity 3s ease, transform 30s linear; }
}
/* video maker: a small preview of the chosen background */
.vm__swatch { margin-top: 8px; aspect-ratio: 16 / 9; max-width: 220px; border-radius: 10px; background-size: cover; border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
/* video maker: Shorts under one minute; copyright-claim watch after upload */
.vm__safe { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: .86rem; }
.vm__len[hidden], .vm__len-row[hidden] { display: none; }
.vm__len-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; margin-top: 8px; }
.vm__len-row input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--gold); }
.vm__len-row output { font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vm__len-row small { grid-column: 1 / -1; }
.vm__safe small { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }
.vm__claims { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, #1d8a4e 10%, var(--surface)); font-size: .86rem; }
.vm__claims.is-bad { background: color-mix(in srgb, #c0392b 12%, var(--surface)); border: 1px solid #c0392b; }
.vm__claims .btn { margin-left: 6px; font-size: .8rem; padding: 3px 10px; }
.vm__claims[hidden] { display: none; }
/* video maker: what the channel has posted already (above Create) */
.vm__posted { grid-column: 1 / -1; display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, #1d8a4e 45%, var(--line)); background: color-mix(in srgb, #1d8a4e 8%, var(--surface)); font-size: .88rem; }
.vm__posted.is-dup { border-color: #d9822b; background: color-mix(in srgb, #d9822b 12%, var(--surface)); }
.vm__posted p { margin: 0; }
.vm__upd { grid-column: 1 / -1; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.vm__upd > summary { cursor: pointer; font-weight: 600; }
.vm__upd textarea { width: 100%; font: inherit; font-size: .85rem; }
.vm__upd-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.vm__upd-card { border-top: 1px solid var(--line); padding: 10px 0; }
.vm__upd-h { margin: 0 0 6px; }
.vm__upd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vm__upd-old pre { white-space: pre-wrap; max-height: 340px; overflow: auto; font-size: .78rem; margin: 4px 0; padding: 8px; background: color-mix(in srgb, var(--line) 25%, transparent); border-radius: 8px; }
.vm__upd-t { font-weight: 600; margin: 4px 0; }
.vm__upd-f { display: block; margin: 4px 0; }
@media (max-width: 760px) { .vm__upd-cols { grid-template-columns: 1fr; } }
.vm__posted.is-dup > p:first-child b { color: #b45f06; }
.vm__posted ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vm__src { display: inline-block; padding: 0 6px; margin-right: 4px; border-radius: 4px; font-size: .72rem; font-weight: 700; color: #fff; background: #c4302b; vertical-align: 1px; }
.vm__src--fb { background: #1877f2; }
.vm__posted-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); }
.vm__posted-add input { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; flex: 1 1 220px; min-width: 0; }
.vm__posted li { display: grid; gap: 1px; min-width: 0; }
.vm__posted li a { overflow-wrap: anywhere; }
.vm__posted li small, .vm__posted-when { color: var(--muted); font-size: .78rem; }
.vm__posted-also { color: var(--muted); font-size: .82rem; }
.vm__posted .btn { margin-left: 6px; font-size: .8rem; padding: 4px 10px; }
/* home: the visitor's place under the heading (out of the H1), spaced as before */
.landing__title--place { margin-top: -10px; }
.landing__title--place .landing__place { margin-top: 4px; }
/* surah pages: the spellings people search for, under the name; dua pages: the Urdu name */
.chapter-head__aka { margin-top: 2px; font-size: .8rem; color: var(--muted); }
.dua-head__roman { font-weight: 600; }
.page-head__sub { font-size: .55em; font-weight: 500; color: var(--muted); }
/* Ayatul Kursi page */
.ak__ayah { margin: 8px 0 18px; }
.ak__card { margin: 0 0 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ak__card h2 { margin: 0 0 10px; font-size: 1.25rem; }
.ak__card h2 span[lang="ur"] { display: block; font-size: .85em; color: var(--muted); margin: 2px 0 0; }
.ak__card h3 { margin: 14px 0 6px; font-size: 1rem; }
.ak__roman { font-size: 1.08rem; line-height: 1.8; margin: 0; }
.ak__ur { font-family: var(--ur-font); font-size: 1.25rem; line-height: 2.3; margin: 0; }
.ak__cite, .ak__src { color: var(--muted); font-size: .82rem; margin: 6px 0 0; }
.ak__audio { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.ak__audio li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px; align-items: center; }
.ak__audio audio { width: 100%; height: 36px; }
.ak__phrases { margin: 8px 0 0; padding-inline-start: 22px; display: grid; gap: 10px; }
.ak__phrase { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: none; }
.ak__phrase-ar { font-size: 1.6rem; line-height: 2; }
.ak__phrase-ar .w-tl, .ak__phrase-ar .w-tr { display: none; }
.ak__phrase-tl { font-weight: 600; }
.ak__phrase-en { color: var(--muted); font-size: .9rem; }
.ak__list { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; }
.ak__faq { border-top: 1px solid var(--line); padding: 10px 0; }
.ak__faq summary { cursor: pointer; font-weight: 600; }
.ak__faq p { margin: 8px 0 0; }
.ak__related { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
@media (max-width: 560px) { .ak__audio li { grid-template-columns: 1fr; gap: 4px; } .ak__card { padding: 14px 14px; } }
/* the 2:255 reader page: the link to the Ayatul Kursi page */
.famous-link { display: block; margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--gold, #c9a227) 50%, var(--line)); background: color-mix(in srgb, var(--gold, #c9a227) 10%, var(--surface)); text-decoration: none; font-weight: 600; }
/* dua chapters grown into full pages: the routine, children, waking, FAQ */
.pillar { margin: 0 0 16px; padding: 18px 20px; }
.pillar h2 { margin: 0 0 8px; font-size: 1.2rem; }
.pillar h2 span[lang="ur"] { display: block; font-size: .85em; color: var(--muted); margin: 2px 0 0; }
.pillar__steps { margin: 10px 0 0; padding-inline-start: 22px; display: grid; gap: 8px; }
.pillar__steps li { display: grid; gap: 1px; }
.pillar__what { font-weight: 600; }
.pillar__meta, .pillar__note { color: var(--muted); font-size: .85rem; }
.pillar__note { margin: 10px 0 0; }
.pillar__links { margin: 6px 0 0; padding-inline-start: 20px; display: grid; gap: 6px; }
/* Char Qul page */
.cq__actions { margin: 14px 0 6px; }
.cq__jump { justify-content: center; }
.cq__surah { margin: 22px 0 8px; scroll-margin-top: 80px; }
.cq__surah h2 { margin: 0; font-size: 1.4rem; }
.cq__num { color: var(--muted); font-weight: 400; }
.cq__ar { display: block; font-size: 1.3rem; color: var(--muted); margin-top: 2px; }
.cq__meaning { color: var(--muted); font-size: .88rem; margin: 4px 0 8px; }
.cq__roman h3 { margin: 0 0 6px; font-size: 1rem; }
.cq__roman ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 4px; }
/* last 2 ayat of Surah Baqarah: each Qari's two ayat, one player each */
.l2__pair { display: grid; gap: 6px; min-width: 0; }
/* Ayat-e-Karima: the dua on its own, large */
.ek__dua-v { display: block; padding: 0; border: 0; background: none; }
.ek__dua-ar { font-size: 2rem; line-height: 2.1; text-align: center; margin: 4px 0 10px; }
.ek__dua-ar .w-tl, .ek__dua-ar .w-tr { display: none; }
.ek__dua > p { text-align: center; }
.ek__h { font-size: 1.25rem; margin: 18px 0 4px; }
/* Durood Ibrahimi: the text in its two halves */
.di__audio audio { width: 100%; height: 36px; }
.di__half { padding: 10px 0; border-bottom: 1px solid var(--line); }
.di__half:last-of-type { border-bottom: 0; }
.di__ar { font-size: 1.75rem; line-height: 2.2; margin: 0 0 6px; text-align: center; }
.di__ar--sm { font-size: 1.35rem; text-align: right; }
.di__half .ak__roman { text-align: center; }
.di__ur { display: block; margin: 4px 0 0; font-family: var(--ur-font); font-size: 1.05rem; line-height: 2; color: var(--muted); }
/* Subah Shaam Ke Azkar: the summary table */
.pillar__table-wrap { overflow-x: auto; margin: 8px 0 0; }
.pillar__table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pillar__table th, .pillar__table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.pillar__table th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.pillar__table td:first-child, .pillar__table td:nth-child(3) { white-space: nowrap; }
@media (max-width: 560px) { .pillar__table { font-size: .85rem; } .pillar__table th, .pillar__table td { padding: 6px 5px; } }
/* Video maker Autopilot (?autopilot=1, from the Growth page): today's pick, where it goes, one Start button */
.vm-ap { display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.vm-ap__head small, .vm-ap__pick small, .vm-ap__when, .vm-ap li > span { color: var(--muted); }
.vm-ap__pick { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.vm-ap__pick > span { flex-basis: 100%; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.vm-ap__pick b { font-size: 1.1rem; }
.vm-ap ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vm-ap li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .9rem; }
.vm-ap li > span { flex: 1 1 220px; }
.vm-ap li.is-ok > b { color: #1d8a4e; } .vm-ap li.is-bad > b, .vm-ap li.is-bad > span:only-child, .vm-ap__sum.is-bad > p > b { color: #b45f06; }
.vm-ap__when, .vm-ap__sum p { margin: 0; font-size: .88rem; }
.vm-ap__go { justify-self: start; font-size: 1.1rem; padding: 12px 28px; }
.vm-ap__sum { display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.vm-ap__sum[hidden] { display: none; }
.vm__today { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 10px; }
.vm__today > small { flex-basis: 100%; color: var(--muted); }
.vm-ap__today { display: inline-flex; flex-wrap: wrap; gap: 6px; }
/* Video maker: 📈 Trends */
.vm__trends { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.vm__trends[hidden] { display: none; }
.vm__tr-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.vm__tr-head small { color: var(--muted); }
.vm__tr-head .btn { margin-left: auto; padding: 5px 12px; font-size: .82rem; }
.vm__tr-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.vm__tr-row input { flex: 1 1 220px; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg, var(--surface)); color: var(--text); font: inherit; }
.vm__tr-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.vm__tr-status { margin: 6px 0; color: var(--muted); font-size: .86rem; }
.vm__tr-sec { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.vm__tr-sec > small, .vm__tr-sec p > small:first-child { color: var(--muted); margin-right: 6px; }
.vm__tr-sec p { margin: 6px 0; line-height: 1.9; }
.vm__tr-list { margin: 8px 0; padding-left: 22px; display: grid; gap: 6px; font-size: .9rem; }
.vm__tr-list small { display: block; color: var(--muted); }
.vm__tr-list .btn { padding: 3px 10px; font-size: .8rem; margin-top: 2px; }
.vm__tr-sug .vm__tr-list li small { display: inline; margin: 0 6px; }
.vm__tr-kw { display: inline-block; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--border); font-size: .82rem; line-height: 1.6; overflow-wrap: anywhere; }
.vm__tr-pre { margin: 10px 0 4px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--border); font-size: .86rem; overflow-wrap: anywhere; }
/* video maker: Square format, Preview, subtitles */
.vm__format-row:has(> label:nth-child(3)) { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .vm__format-row:has(> label:nth-child(3)) { grid-template-columns: 1fr; } }
.vm__canvas.vm__canvas--square { aspect-ratio: 1 / 1; width: auto; height: min(70vh, 640px); max-width: 100%; margin: 0 auto; }
.vm__thumb.vm__thumb--square { width: min(100%, 360px); }
.vm__safe[hidden] { display: none; }
.vm__preview { grid-column: 1 / -1; display: grid; gap: 8px; justify-items: start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.vm__preview[hidden] { display: none; }
.vm__pv-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; max-width: 100%; }
.vm__pv-canvas { display: block; width: min(100%, 480px); height: auto; aspect-ratio: 16 / 9; border-radius: 10px; background: #04170f; box-shadow: var(--shadow); }
.vm__pv-canvas.is-tall { width: auto; height: 420px; max-width: 100%; aspect-ratio: 9 / 16; }
.vm__pv-canvas.is-square { width: min(100%, 360px); aspect-ratio: 1 / 1; }
.vm__pv-thumb { display: block; width: min(100%, 240px); border-radius: 8px; box-shadow: var(--shadow); }
.vm__pv-thumb.is-tall { width: auto; height: 260px; max-width: 100%; }
.vm__pv-thumb:not([src]) { display: none; }
/* video maker: presets, Simple / Advanced, 📚 Batch */
.vm__form.is-simple [data-adv] { display: none !important; }
/* video maker: the form in 6 numbered steps, each with a "How to use" lesson; a step with nothing to show is hidden */
.vm__group { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px 16px; background: color-mix(in srgb, var(--p) 3%, var(--surface)); display: grid; gap: 10px; }
.vm__group-head { display: flex; gap: 12px; align-items: flex-start; }
.vm__group-head h2 { margin: 0; font-size: 1.12rem; }
.vm__group-head p { margin: 2px 0 0; color: var(--muted); font-size: .86rem; }
.vm__step { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--p), var(--p-deep)); box-shadow: 0 0 0 2px var(--gold); }
.vm__group-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
@media (max-width: 640px) { .vm__group-body { grid-template-columns: 1fr; } }
.vm__group:not(:has(.vm__group-body > :not([hidden]))) { display: none; }
.vm__adv-note { display: none; margin: 0; color: var(--muted); font-size: .86rem; }
/* Simple: a step whose options are all Advanced stays in the list (numbers in order), folded to a note */
.vm__form.is-simple .vm__group:not(:has(.vm__group-body > :not([hidden]):not([data-adv]))) :is(.vm__learn, .vm__group-body) { display: none; }
.vm__form.is-simple .vm__group:not(:has(.vm__group-body > :not([hidden]):not([data-adv]))) .vm__adv-note { display: block; }
.vm__form.is-simple .vm__group:not(:has(.vm__group-body > :not([hidden]):not([data-adv]))) { opacity: .8; }
.vm__learn { font-size: .86rem; border-radius: 10px; background: var(--surface); border: 1px dashed color-mix(in srgb, var(--gold) 60%, var(--border)); padding: 6px 12px; }
.vm__learn summary { cursor: pointer; font-weight: 600; color: var(--p); }
.vm__learn ol, .vm__learn ul { margin: 8px 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.vm__tip-line { margin: 6px 0 4px; }
.vm__guide { border-radius: 14px; border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--border)); background: color-mix(in srgb, var(--gold) 7%, var(--surface)); padding: 10px 16px; font-size: .88rem; }
.vm__guide > summary { cursor: pointer; font-weight: 700; font-size: 1rem; }
.vm__guide > summary small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.vm__guide h3 { margin: 12px 0 6px; font-size: .98rem; }
.vm__guide ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.vm__flow { list-style: none; margin: 12px 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vm__flow li { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.vm__flow li b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; color: #fff; background: var(--p); }
.vm__flow li.is-go { border-color: var(--gold); font-weight: 600; }
.vm__guide-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px 24px; }
@media (max-width: 760px) { .vm__guide-cols { grid-template-columns: 1fr; } }
.vm__links { width: 100%; border-collapse: collapse; font-size: .84rem; }
.vm__links th, .vm__links td { text-align: start; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.vm__links th { color: var(--muted); font-weight: 600; }
.vm__links td:first-child { white-space: nowrap; }
@media (max-width: 640px) { .vm__links td:first-child { white-space: normal; } }
.vm__presets { gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.vm__presets[hidden] { display: none; }
.vm__presets-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.vm__presets-head > span { font-weight: 600; color: var(--muted); }
.vm__mode { display: inline-flex; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.vm__mode button { border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: .84rem; padding: 6px 14px; cursor: pointer; }
.vm__mode button[aria-pressed="true"] { background: var(--gold); color: #1a1405; font-weight: 600; }
.vm__preset-row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.vm__preset-mine { display: contents; }
.vm__preset { display: inline-flex; align-items: center; }
.vm__preset .vm__pick { border-radius: 99px 0 0 99px; }
.vm__preset-x { border: 1px solid var(--border); border-left: 0; background: var(--surface); color: var(--muted); padding: 6px 10px; border-radius: 0 99px 99px 0; font: inherit; font-size: .84rem; cursor: pointer; }
.vm__preset-x:hover { color: #b45f06; border-color: var(--gold); }
.vm__pick--save { border-style: dashed; }
.vm__presets .vm__hint.err { color: #b45f06; }
.vm__batch { display: grid; gap: 12px; padding: 20px; margin: 16px 0; }
.vm__batch[hidden] { display: none; }
.vm__batch-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.vm__batch-head h2 { margin: 0; font-size: 1.25rem; }
.vm__batch-head small { color: var(--muted); font-weight: 400; font-size: .86rem; }
.vm__batch-add { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vm__batch-way { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: .9rem; }
.vm__batch-way > small { color: var(--muted); }
.vm__batch-way .vm__range-row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: auto; }
.vm__batch-way input[type="number"] { width: 4.5em; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.vm__batch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: vb; }
.vm__bi { counter-increment: vb; display: grid; grid-template-columns: 8.5em 1fr auto auto; gap: 4px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: .9rem; }
.vm__bi-name::before { content: counter(vb) ". "; color: var(--muted); }
.vm__bi-name small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.vm__bi-st { font-weight: 600; white-space: nowrap; }
.vm__bi-est { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.vm__bi-act { display: inline-flex; gap: 4px; }
.vm__bi-act button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; min-width: 30px; padding: 3px 6px; font: inherit; cursor: pointer; }
.vm__bi-act button:disabled { opacity: .35; cursor: default; }
.vm__bi.is-making, .vm__bi.is-uploading { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 30%, transparent); }
.vm__bi.is-done .vm__bi-st { color: #1d8a4e; }
.vm__bi.is-failed .vm__bi-st, .vm__bi.is-skipped .vm__bi-st { color: #b45f06; }
.vm__batch-empty { margin: 0; color: var(--muted); font-size: .9rem; }
.vm__batch-empty[hidden], .vm__batch-warn[hidden] { display: none; }
.vm__batch-spread { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .92rem; }
.vm__batch-spread input[type="time"], .vm__batch-spread input[type="date"] { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.vm__batch-warn { margin: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid #b45f06; color: #b45f06; font-size: .9rem; }
.vm__batch-go { justify-content: flex-start; flex-wrap: wrap; }
@media (max-width: 720px) {
  .vm__batch-add { grid-template-columns: 1fr; }
  .vm__bi { grid-template-columns: 1fr auto; }
  .vm__bi-name { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Reader fonts (Settings: Quran, Urdu and English font). The extra fonts' @font-face rules are in
   assets/fonts/extra.css, linked only when one is chosen; each was checked against the site's own text. ---------- */
html.font-lateef, html.font-indopak { --ar-font: "Lateef", "Amiri Quran", "Amiri", serif; }
/* (Lateef draws smaller than Amiri Quran at the same size) */
html.font-lateef .verse__ar, html.font-indopak .verse__ar, html.font-lateef .dua__ar, html.font-indopak .dua__ar,
html.font-lateef .player__ayah-ar, html.font-indopak .player__ayah-ar { font-size: calc(var(--ar-size) * 1.18); }
html.font-lateef .player__ayah-ar, html.font-indopak .player__ayah-ar { font-size: 1.8rem; }
html.uf-gulzar { --ur-font: "Gulzar", "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif; }
html.uf-mehr { --ur-font: "Mehr Nastaliq", "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif; }
html.uf-naskh { --ur-font: "Noto Naskh Arabic", serif; }
html.uf-lateef { --ur-font: "Lateef", "Noto Naskh Arabic", serif; }
html.uf-naskh .verse__tr.is-rtl, html.uf-lateef .verse__tr.is-rtl, html.uf-naskh .hadith__tr.is-rtl, html.uf-lateef .hadith__tr.is-rtl { line-height: 2; }
html.uf-lateef .verse__tr.is-rtl, html.uf-lateef .hadith__tr.is-rtl, html.uf-lateef .dua__ur { font-size: calc(var(--tr-size) * 1.2); }
html.uf-mehr .verse__tr.is-rtl, html.uf-mehr .hadith__tr.is-rtl, html.uf-mehr .dua__ur { font-size: calc(var(--tr-size) * 1.15); }
/* English: the translation text only (headings and the interface keep the site's fonts) */
html.ef-cormorant { --tr-font: "Cormorant Garamond", Georgia, serif; }
html.ef-ebgaramond { --tr-font: "EB Garamond", Georgia, serif; }
html.ef-lora { --tr-font: Lora, Georgia, serif; }
html.ef-merriweather { --tr-font: Merriweather, Georgia, serif; }
html.ef-playfair { --tr-font: "Playfair Display", Georgia, serif; }
html.ef-poppins { --tr-font: Poppins, var(--ui-font); }
html.ef-montserrat { --tr-font: Montserrat, var(--ui-font); }
html.ef-lato { --tr-font: Lato, var(--ui-font); }
html.ef-nunito { --tr-font: Nunito, var(--ui-font); }
html[class*="ef-"] .verse__tr:not(.is-rtl), html[class*="ef-"] .hadith__tr:not(.is-rtl), html[class*="ef-"] .dua__en:not(.dua__ur):not([lang="ur"]),
html[class*="ef-"] .player__ayah-tr:not(.is-rtl):not([dir="rtl"]) { font-family: var(--tr-font, "Inter"), "Noto Sans Devanagari", "Noto Sans Bengali", var(--ui-font); }
html.ef-cormorant .verse__tr:not(.is-rtl), html.ef-ebgaramond .verse__tr:not(.is-rtl), html.ef-cormorant .hadith__tr:not(.is-rtl),
html.ef-ebgaramond .hadith__tr:not(.is-rtl) { font-size: calc(var(--tr-size) * 1.12); }
/* Hindi and Bengali translations: Noto Sans Devanagari / Bengali (their own unicode-range: downloaded only for those letters) */
:root { --ui-font: "Inter", "Noto Sans Devanagari", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* Video maker: copyright-claim risk of the chosen Qari and translation voice (docs/reciters-copyright-research.md) */
.vm__risk { display: block; margin-top: 6px; padding: 6px 10px; border-radius: 8px; font-size: .8rem; line-height: 1.4; border: 1px solid var(--border, #ddd); background: var(--surface); }
.vm__risk small { display: block; color: var(--muted); word-break: break-word; }
.vm__risk[data-level="safe"], .vm__risk[data-level="low"] { border-color: #1d8a4e; background: color-mix(in srgb, #1d8a4e 9%, var(--surface)); }
.vm__risk[data-level="medium"] { border-color: #d9822b; background: color-mix(in srgb, #d9822b 10%, var(--surface)); }
.vm__risk[data-level="high"], .vm__risk[data-level="claimed"] { border-color: #c0392b; background: color-mix(in srgb, #c0392b 10%, var(--surface)); }
.vm__risk[hidden] { display: none; }
/* For Qaris: share your recitation (templates/share_recitation.php) and its banner on the Qaris page */
.share-rec__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 14px 0 0; }
.share-rec__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 18px 0; }
.share-rec__card { padding: 16px 18px; }
.share-rec__card b { display: block; font-size: 1.05rem; margin-bottom: 6px; }
.share-rec__card p { margin: 0; color: var(--muted); font-size: .92rem; }
.share-rec__how, .share-rec__faq { padding: 18px 20px; margin: 0 0 16px; }
.share-rec__how h2, .share-rec__faq h2 { margin: 0 0 10px; font-size: 1.25rem; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.share-rec__how h2 span, .share-rec__faq h2 span { font-family: var(--ur-font); font-size: .9rem; color: var(--gold); font-weight: 400; }
.share-rec__how ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 10px; }
.share-rec__perm { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--gold) 60%, var(--border)); background: color-mix(in srgb, var(--gold) 6%, var(--surface)); }
.share-rec__perm-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.share-rec__perm-head small { color: var(--muted); flex: 1; }
.share-rec__perm p { margin: 8px 0 0; font-size: .92rem; line-height: 1.6; }
.share-rec__faq details { border-top: 1px solid var(--border); padding: 10px 0; }
.share-rec__faq summary { cursor: pointer; font-weight: 600; }
.share-rec__faq details p { margin: 8px 0 0; color: var(--muted); }
.share-rec__banner { display: flex; gap: 14px; align-items: center; padding: 14px 18px; margin: 0 0 18px; text-decoration: none; color: var(--text);
  border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--border)); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.share-rec__banner:hover { text-decoration: none; border-color: var(--gold); }
.share-rec__banner > span:first-child { font-size: 1.8rem; }
.share-rec__banner b { display: block; }
.share-rec__banner small { color: var(--muted); }
.share-rec__banner small [lang] { font-family: var(--ur-font); }
.share-rec__go { margin-inline-start: auto; font-size: 1.4rem; color: var(--gold); }
/* video maker: Sound (Step 2) */
.vm__sound-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.vm__sound-row label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; color: var(--muted); }
.vm__sound-pv { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 4px; }
.vm__sound-pv small { color: var(--muted); flex: 1 1 220px; }
.vm__sound-pv [hidden] { display: none; }
/* image maker (/admin/image) */
.im__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; margin: 16px 0 40px; }
@media (max-width: 900px) { .im__layout { grid-template-columns: 1fr; } }
.im__controls { padding: 18px; display: grid; gap: 18px; }
/* (a long Hisn chapter name must not widen the panel: the two columns keep their share, a long option is cut with …) */
.im__layout > *, .im__controls > *, .im__step, .im__row > * { min-width: 0; }
.im__controls select { max-width: 100%; text-overflow: ellipsis; }
.im__step h2 { margin: 0 0 10px; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.im__step h2 span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--p), var(--p-deep)); box-shadow: 0 0 0 2px var(--gold); }
.im__step h2 small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.im__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.im__pills label { position: relative; display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .9rem; }
.im__pills label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent); }
.im__pills input { position: absolute; opacity: 0; pointer-events: none; }
.im__pills small { color: var(--muted); }
.im__row { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; }
.im__row[hidden], .im__picks[hidden], [data-im-only][hidden] { display: none; }
.im__row label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.im__row input[type=number] { width: 84px; }
.im__grow { flex: 1 1 200px; }
.im__row select, .im__row input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; min-width: 0; }
.im__picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.im__pick { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .82rem; cursor: pointer; }
.im__pick small { color: var(--muted); }
.im__checks { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .9rem; }
.im__checks label { display: inline-flex; gap: 6px; align-items: center; }
.im__sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.im__size { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.im__size:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent); }
.im__size input { position: absolute; opacity: 0; pointer-events: none; }
.im__size i { grid-row: span 2; justify-self: center; border: 2px solid var(--gold); border-radius: 3px; width: 24px; height: 30px; }
.im__size--square i { height: 24px; } .im__size--story i { width: 18px; height: 32px; } .im__size--landscape i { width: 32px; height: 17px; } .im__size--pin i { width: 20px; height: 30px; }
.im__size b { font-size: .9rem; } .im__size small { color: var(--muted); font-size: .75rem; line-height: 1.3; }
.im__designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.im__design { position: relative; display: flex; flex-direction: column; gap: 3px; cursor: pointer; font-size: .82rem; }
.im__design input { position: absolute; opacity: 0; pointer-events: none; }
.im__design canvas { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 10px; border: 2px solid transparent; box-shadow: var(--shadow); }
.im__design:has(input:checked) canvas { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 40%, transparent); }
.im__design small { color: var(--muted); font-size: .72rem; line-height: 1.25; }
.im__stage { display: grid; gap: 14px; position: sticky; top: 76px; }
@media (max-width: 900px) { .im__stage { position: static; } }
.im__preview { padding: 14px; display: grid; gap: 10px; justify-items: center; }
.im__preview canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 72vh; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); } /* (its own shape: no bars at the sides) */
.im__nav { display: flex; gap: 12px; align-items: center; }
.im__nav[hidden] { display: none; }
.im__note { margin: 0; color: var(--muted); font-size: .85rem; text-align: center; }
.im__out, .im__post { padding: 14px 16px; display: grid; gap: 10px; }
.im__out-head { display: flex; gap: 10px; align-items: center; }
.im__out-head small { color: var(--muted); flex: 1; }
.im__out textarea { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; resize: vertical; }
.im__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.im__actions [hidden] { display: none; }
.im__ok { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px dashed color-mix(in srgb, #d9822b 60%, var(--border)); background: color-mix(in srgb, #d9822b 7%, var(--surface)); font-size: .9rem; }
.im__pub { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.im__pub small { color: var(--muted); flex: 1 1 200px; }
.im__pub label { display: inline-flex; gap: 6px; align-items: center; font-size: .88rem; }
.im__pub [hidden] { display: none; }
.im__status { margin: 0; font-size: .88rem; word-break: break-word; }
.im__status:empty { display: none; }
.im__sub { margin: 14px 0 8px; font-size: .95rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.im__sub small { color: var(--muted); font-weight: 400; font-size: .78rem; }

/* 🌿 Video maker: realistic nature background and own clip */
.vm__real label { display: grid; gap: 6px; }
.vm__clip { border: 1px solid var(--line, rgba(201,162,74,.35)); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.vm__clip legend { font-weight: 700; padding: 0 6px; }
.vm__clip-up { display: grid; gap: 6px; }
/* ▶ the channel's video on surah, ayah and Para pages; the Roman Urdu line under the heading */
.roman-ur { margin: 8px auto 0; max-width: 760px; text-align: center; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.site-video { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; margin: 16px 0 6px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
@media (max-width: 640px) { .site-video { grid-template-columns: 1fr; } }
.hm__dua { padding: 12px 0; border-top: 1px solid var(--line); }
.hm__dua:first-of-type { border-top: 0; }
.hm__dua h3 { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
.hm__ar { font-family: var(--ar-font); font-size: 1.5rem; line-height: 2; margin: 6px 0; }
.hm__ur { font-family: var(--ur-font); line-height: 2.3; margin: 6px 0; }
.hm__en { color: var(--muted); margin: 6px 0; }
.hm__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 6px 18px; }
.hm__list a { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.wbwp__ayah { padding: 10px 0; border-top: 1px solid var(--line); }
.wbwp__ayah:first-of-type { border-top: 0; }
.wbwp__key { margin: 0 0 6px; font-size: .85rem; }
.wbwp__words { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.wbwp__w { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.wbwp__ar { font-family: var(--ar-font); font-size: 1.6rem; line-height: 1.9; }
.wbwp__ur { font-family: var(--ur-font); font-size: .86rem; line-height: 2; color: var(--muted); }
.recitation__player { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.recitation__player iframe { width: 100%; height: 100%; border: 0; display: block; }
.recitation__facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 16px 0; }
.recitation__facts dt { font-size: .78rem; color: var(--muted); }
.recitation__facts dd { margin: 0; font-weight: 600; }
.recitation__links { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.yt-card { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.yt-card__icon { flex: none; width: 42px; height: 30px; border-radius: 9px; background: #e62117; color: #fff; display: grid; place-items: center; font-size: .9rem; }
.yt-card__text { flex: 1; margin: 0; font-size: .92rem; line-height: 1.5; }
.yt-card__text [lang=ur] { display: block; font-family: var(--ur-font); line-height: 2; color: var(--muted); }
.yt-card__sub { flex: none; background: #e62117; color: #fff; border-color: #e62117; }
.yt-card__sub:hover { background: #c41a12; color: #fff; }
@media (max-width: 520px) { .yt-card { flex-wrap: wrap; } .yt-card__sub { width: 100%; justify-content: center; } }
.site-video__main { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.site-video__play { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: #000; border-radius: 10px; overflow: hidden; }
.site-video__play img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-video__icon { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 64px; height: 44px; border-radius: 12px; background: #e62117; color: #fff; display: grid; place-items: center; font-size: 1.2rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.site-video__frame { width: 100%; height: 100%; border: 0; display: block; }
.site-video__side { display: grid; gap: 10px; align-content: start; }
.site-video__title { margin: 0; font-weight: 600; line-height: 1.4; }
.site-video__more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.site-video__play--sm { aspect-ratio: 9 / 16; height: auto; }
.site-video__play--sm .site-video__icon { width: 34px; height: 24px; font-size: .75rem; border-radius: 7px; }
.gr-seo__num { margin: 0 0 8px; }
.gr-seo__miss { margin: 10px 0 6px; }
.gr-seo__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.gr-seo__weekly ol { margin: 10px 0; padding-left: 20px; display: grid; gap: 8px; }
.gr-seo__chips a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; font-size: .85rem; }

/* 🕌 Prayer times of a city */
.pc-today { margin-top: 12px; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pc-time { display: grid; gap: 2px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); text-align: center; }
.pc-time__name { color: var(--muted); font-size: .9rem; }
.pc-time b { font-size: 1.35rem; }
.pc-time small { color: var(--muted); }
.pc-week, .pc-info, .pc-more { margin-top: 14px; }
.pc-scroll { overflow-x: auto; }
.pc-table { width: 100%; border-collapse: collapse; font-size: .92rem; white-space: nowrap; }
.pc-table th, .pc-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: center; }
.pc-table tbody tr:first-child { font-weight: 700; }
.pc-links { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.page-head .roman-ur { margin-left: auto; margin-right: auto; }

/* 🔎 Whole-website search */
.sr-start { text-align: center; }
.sr-try { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sr-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; margin: 6px 0 14px; scrollbar-width: thin; }
.sr-tabs a { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); font-size: .9rem; white-space: nowrap; }
.sr-tabs a b { margin-left: 4px; color: var(--muted); font-weight: 600; }
.sr-tabs a[aria-current="page"] { background: var(--p, #0b6b4a); border-color: var(--p, #0b6b4a); color: #fff; }
.sr-tabs a[aria-current="page"] b { color: rgba(255, 255, 255, .8); }
.sr-group { margin: 22px 0; }
.sr-group h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 1.15rem; margin: 0 0 10px; }
.sr-more { font-size: .85rem; font-weight: 600; }
.sr-note { color: var(--muted); font-size: .88rem; margin: 0 0 8px; }
.sr-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sr-item a { display: grid; gap: 3px; height: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); }
.sr-item a:hover { border-color: var(--gold, #c9a227); }
.sr-item__t { font-weight: 600; }
.sr-item__s { color: var(--muted); font-size: .85rem; }
.sr-item__ar { font-size: 1.1rem; color: var(--muted); }
.sr-badge { font-weight: 500; font-size: .72rem; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--gold, #c9a227) 18%, transparent); }
.sr-hadith { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sr-hadith li { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.sr-hadith li > a { text-decoration: none; }
.sr-hadith p { margin: 6px 0 0; line-height: 1.6; }
.sr-hadith mark, .result mark { background: color-mix(in srgb, var(--gold, #c9a227) 35%, transparent); color: inherit; border-radius: 3px; }

/* 👤 A Qari's, translator's or voice's own page */
.pf-crumbs { font-size: .85rem; color: var(--muted); margin: 14px 0; }
.pf-crumbs a { color: inherit; }
.pf-hero { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 28px; align-items: center; padding: 24px; }
@media (max-width: 640px) { .pf-hero { grid-template-columns: 1fr; text-align: center; } .pf-portrait { max-width: 220px; margin: 0 auto; } .pf-actions { justify-content: center; } }
.pf-portrait .person__frame { position: relative; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .5); }
.pf-portrait .person__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-kind { margin: 0; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold, #c9a227); font-weight: 700; }
.pf-pos { margin-left: 8px; color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
.pf-name { margin: 6px 0 4px; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.15; }
.pf-native { margin: 0 0 8px; font-size: 1.5rem; font-family: var(--ar, 'Amiri'), serif; }
.pf-desc { margin: 0 0 8px; color: var(--muted); }
.pf-role { margin: 0 0 16px; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 760px) { .pf-cols { grid-template-columns: 1fr; } }
.pf-cols h2 { margin-top: 0; font-size: 1.15rem; }
.pf-bio { line-height: 1.75; }
.pf-muted { color: var(--muted); font-size: .9rem; }
.pf-surahs, .pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chips .pill.is-current { background: var(--p, #0b6b4a); color: #fff; border-color: transparent; }
.pf-pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin: 22px 0; }
.pf-step { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); }
.pf-step small { color: var(--muted); }
.pf-step--next { text-align: right; }
.pf-step:hover { border-color: var(--gold, #c9a227); }
.pf-all { align-self: center; font-size: .88rem; font-weight: 600; }
.pf-more h2 { font-size: 1.05rem; }

/* ❓ FAQ and 🕌 About us */
.info-lead { font-size: 1.08rem; max-width: 720px; margin: 0 auto; }
.info-ayah { margin: 18px auto 0; max-width: 720px; text-align: center; }
.info-ayah p { font-family: var(--ar, 'Amiri Quran', 'Amiri'), serif; font-size: 1.8rem; line-height: 2; margin: 0; }
.info-ayah figcaption { color: var(--muted); font-size: .92rem; }
.info-toc { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 18px; }
.info-faq { margin-bottom: 16px; scroll-margin-top: 80px; }
.info-faq h2 { margin-top: 0; font-size: 1.15rem; }
.info-faq details { border-top: 1px solid var(--border); padding: 12px 0; }
.info-faq summary { cursor: pointer; font-weight: 600; }
.info-faq details p { margin: 8px 0 0; line-height: 1.7; color: var(--text); }
.info-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0; }
.info-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.info-num { display: grid; gap: 2px; text-align: center; padding: 18px 12px; }
.info-num b { font-size: 1.9rem; color: var(--gold, #c9a227); line-height: 1.1; }
.info-num small { color: var(--muted); }
.info-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .info-cols { grid-template-columns: 1fr; } }
.info-cols h2, .info-src h2, .info-join h2, .info-contact h2 { margin-top: 0; font-size: 1.15rem; }
.info-list { margin: 0; padding-left: 18px; display: grid; gap: 10px; line-height: 1.6; }
.info-src, .info-join, .info-contact { margin-top: 16px; }
.info-join__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.info-join__grid a { display: grid; gap: 2px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.info-join__grid a:hover { border-color: var(--gold, #c9a227); }
.info-join__grid span { color: var(--muted); font-size: .88rem; }
.pf-native { text-align: left; } @media (max-width: 640px) { .pf-native { text-align: center; } }
.info-lead { text-align: center; }
.sr .hero__search { margin: 0 auto; max-width: 720px; }
.sr-tabs { justify-content: center; }

/* a turned card, once its turn has finished, lies flat (people.js flip): Chrome works out clicks on a card turned in 3D
   mirror-reversed, so the buttons on its back (Full profile, Listen, Wikipedia) could not be pressed */
.person__card.is-settled, .person__card.is-settled.is-tilting { transform: none; transition: none; }
.person__card.is-settled .person__back { transform: none; }
.person__card.is-settled .person__front { visibility: hidden; }

/* 📜 Folio reading (Settings › Reading style, the default): the ayat in a framed page like a mushaf, their meaning in the
   margin (hashiya) beside them, and no row of buttons under each ayah: tapping an ayah brings its tools in one bar.
   Not on TVs, whose remote moves from ayah to ayah in the classic rows. */
.verse__close { display: none; }
html.reader-folio:not(.tv) .verses {
  position: relative; margin-top: 10px; padding: 14px 12px;
  background: color-mix(in srgb, var(--gold) 5%, var(--surface));
  border: 3px double color-mix(in srgb, var(--gold) 85%, transparent); border-radius: 6px;
  box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--gold) 5%, var(--surface)), inset 0 0 0 6px color-mix(in srgb, var(--gold) 38%, transparent);
}
html.reader-folio:not(.tv) .verses .chapter-head { margin-top: 18px; }
html.reader-folio:not(.tv) .verse { padding: 4px 6px; border-radius: 4px; gap: 0; cursor: pointer; transition: background .25s; }
html.reader-folio:not(.tv) .verse + .verse::before { display: none; }
html.reader-folio:not(.tv) .verse:hover { background: color-mix(in srgb, var(--gold) 6%, transparent); }
html.reader-folio:not(.tv) .verse.is-playing { box-shadow: none; background: color-mix(in srgb, var(--gold) 14%, transparent); }
html.reader-folio:not(.tv) .verse.is-selected { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 60%, transparent); }
html.reader-folio:not(.tv) .verse__marks { margin: 6px 0; }
html.reader-folio:not(.tv) .verse__ar { margin: 0; padding: 10px 4px 8px; text-align: justify; text-align-last: center; line-height: 2.25; }
/* the margin: smaller, quieter, and set off by a gold rule as in a printed hashiya */
html.reader-folio:not(.tv) .verse__tr {
  margin: 0 0 8px; padding: 2px 10px; font-size: calc(var(--tr-size) * .9); line-height: 1.75; color: color-mix(in srgb, var(--text) 86%, var(--muted));
  border-inline-start: 2px solid color-mix(in srgb, var(--gold) 55%, transparent);
}
html.reader-folio:not(.tv) .verse__tr.is-rtl { line-height: 2.25; }
html.reader-folio:not(.tv) .verse__tr cite { font-size: .7rem; margin-top: 0; }
@media (min-width: 760px) {
  html.reader-folio:not(.tv) .verses { padding: 18px 22px; }
  html.reader-folio:not(.tv) .verse { padding: 0 6px; }
  html.reader-folio:not(.tv) .verse__body { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.7fr); column-gap: 0; align-items: start; }
  html.reader-folio:not(.tv) .verse__ar {
    grid-column: 2; grid-row: 1 / span 4; align-self: stretch; padding: 12px 4px 12px 22px;
    border-left: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  }
  html.reader-folio:not(.tv) .verse__tr { grid-column: 1; margin: 12px 18px 2px 0; padding: 0 0 0 10px; border-inline-start: 0; border-left: 2px solid color-mix(in srgb, var(--gold) 40%, transparent); }
  html.reader-folio:not(.tv) .verse__tr + .verse__tr { margin-top: 6px; padding-top: 0; border-top: 0; }
  html.reader-folio:not(.tv) .verse__body:not(:has(.verse__tr)) { grid-template-columns: minmax(0, 1fr); }
  html.reader-folio:not(.tv) .verse__body:not(:has(.verse__tr)) .verse__ar { grid-column: 1; border-left: 0; padding-left: 4px; }
}
/* the tapped ayah's tools: one bar floating at the bottom of the screen (above the player when it is open) */
html.reader-folio:not(.tv) .verse__tools { display: none; }
html.reader-folio:not(.tv) .verse.is-selected .verse__tools {
  display: flex; position: fixed; z-index: 60; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 20px); margin: 0; padding: 6px 6px 6px 8px; gap: 6px; cursor: default;
  color: #fbf5e4; background: var(--p-deep); border: 1px solid var(--gold); border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3); animation: dock-in .22s ease;
}
body:has(#player:not([hidden])) .verse.is-selected .verse__tools { bottom: calc(96px + env(safe-area-inset-bottom)); }
html.reader-folio:not(.tv) .verse.is-selected .verse__key { color: var(--gold-2); background: color-mix(in srgb, #fff 10%, transparent); border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
html.reader-folio:not(.tv) .verse.is-selected .verse__key span { color: #d9e6df; }
html.reader-folio:not(.tv) .verse.is-selected .verse__actions { margin-left: 0; flex-wrap: nowrap; }
html.reader-folio:not(.tv) .verse.is-selected .verse__tools .icon-btn { opacity: 1; color: inherit; border-radius: 999px; }
html.reader-folio:not(.tv) .verse.is-selected .verse__tools .icon-btn:hover { background: color-mix(in srgb, #fff 12%, transparent); }
html.reader-folio:not(.tv) .verse.is-selected .verse__tools .icon-btn.is-on { color: var(--gold-2); }
html.reader-folio:not(.tv) .verse__close { display: inline-flex; }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 12px); } }
@media (max-width: 480px) {
  html.reader-folio:not(.tv) .verse.is-selected .verse__tools { gap: 2px; padding: 5px; }
  html.reader-folio:not(.tv) .verse.is-selected .verse__key { display: none; }
}

/* ✍️ Bain-us-Satoor: word by word in the folio reads like a printed Quran with tarjuma, each meaning written under its word */
html.reader-folio.show-wbw:not(.tv) .verse__ar { text-align: center; text-align-last: center; line-height: 1.5; }
html.reader-folio.show-wbw:not(.tv) .w { margin: 0 .16em .55em; padding: 0 .12em; }
html.reader-folio.show-wbw:not(.tv) .w:hover { background: var(--gold-soft); }
html.reader-folio.show-wbw:not(.tv) .w-tr { color: var(--accent); max-width: 8.5em; }
/* Urdu (and Persian) word meanings are written right to left, in Nastaliq, in either reading style */
html.wbw-rtl .w-tr { direction: rtl; font-family: var(--ur-font); line-height: 2; font-size: max(.8rem, calc(var(--ar-size) * .3)); }

/* 🎬 Tilawat view: the ayah being recited, large, one at a time, over a quiet landscape (opened from the player) */
.stage {
  position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden;
  color: #f3ead0; background: radial-gradient(120% 80% at 50% 0%, #135441 0%, #0b3a2c 55%, #072a20 100%);
}
.stage[hidden] { display: none; }
.stage__scene { position: absolute; left: 0; right: 0; bottom: 0; height: 32vh; pointer-events: none; }
.stage__scene svg { display: block; width: 100%; height: 100%; }
.stage__scene path { fill: #0f4a38; }
.stage__scene .stage__hill2 { fill: #0b3b2d; }
.stage__close { position: absolute; z-index: 2; top: calc(12px + env(safe-area-inset-top)); right: 12px; color: inherit; }
.stage__body { position: relative; z-index: 1; align-self: stretch; display: flex; flex-direction: column; justify-content: safe center; overflow-y: auto; scrollbar-width: none; width: 100%; max-width: 1100px; margin: 0 auto; padding: 56px 6vw 24px; text-align: center; }
.stage__where { margin: 0 0 12px; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: #cdb46a; }
.stage__ar { font-family: var(--ar-font); font-size: clamp(2rem, 5.4vw, 4.4rem); line-height: 2; color: #fff7dc; }
.stage__tr { display: grid; gap: 10px; margin-top: 16px; font-size: clamp(1rem, 1.9vw, 1.4rem); line-height: 1.8; color: #e3eee7; }
.stage__tr .is-rtl { direction: rtl; font-family: var(--ur-font); line-height: 2.4; }
.stage__tr small { display: block; font-family: var(--ui-font); font-size: .7rem; color: #9fbfae; }
.stage__body.is-new .stage__ar, .stage__body.is-new .stage__tr { animation: stage-in .6s ease both; }
.stage__body.is-new .stage__tr { animation-delay: .12s; }
@keyframes stage-in { from { opacity: 0; transform: translateY(10px); } }
.stage__controls { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); }
.stage__controls .icon-btn { color: inherit; }
.stage__play { color: #082a20; background: var(--gold); }
.stage__qari { flex-basis: 100%; text-align: center; font-size: .8rem; color: #cdb46a; }
@media (prefers-reduced-motion: reduce) { .stage__body.is-new .stage__ar, .stage__body.is-new .stage__tr { animation: none; } }
/* 🎬 Tilawat Cinema (app.js showScene): the painted scene drifts very slowly, the ayah stays still in front of it */
.stage__cine { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
.stage.is-cine .stage__cine { opacity: 1; }
.stage.is-cine .stage__scene { display: none; }
.stage__cine canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease; animation: stage-drift 48s ease-in-out infinite alternate; }
.stage__cine canvas.is-in { opacity: 1; }
.stage__cine::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 46%, rgba(0, 0, 0, .46), rgba(0, 0, 0, .22) 70%, rgba(0, 0, 0, .5)); }
@keyframes stage-drift { from { transform: scale(1.02); } to { transform: scale(1.14) translateY(-1.5%); } }
.stage.is-cine .stage__ar { text-shadow: 0 2px 22px rgba(0, 0, 0, .75); }
.stage.is-cine .stage__tr { text-shadow: 0 1px 10px rgba(0, 0, 0, .8); }
.stage__scene-btn { padding: 6px 12px; border: 1px solid rgba(232, 207, 138, .4); border-radius: 999px; background: rgba(0, 0, 0, .25); color: #f3ead0; font: 600 .78rem var(--ui-font); cursor: pointer; }
.stage__scene-btn:hover { border-color: var(--gold); }
html.in-app .stage__cine canvas, html.tv .stage__cine canvas { animation: none; }
@media (prefers-reduced-motion: reduce) { .stage__cine canvas { animation: none; } }
/* 📖 Page-turn Mushaf: the browser's own page transition; the text is still before and after, only the turn moves */
.mushaf-page { view-transition-name: mushaf-page; }
::view-transition-group(mushaf-page) { animation-duration: .6s; }
::view-transition-image-pair(mushaf-page) { isolation: auto; }
::view-transition-old(mushaf-page), ::view-transition-new(mushaf-page) { animation: none; mix-blend-mode: normal; opacity: 1; height: 100%; backface-visibility: hidden; }
html:active-view-transition-type(turn-next)::view-transition-old(mushaf-page) { z-index: 2; transform-origin: 100% 50%; animation: mp-turn-away .6s cubic-bezier(.45, .05, .35, 1) both; }
html:active-view-transition-type(turn-back)::view-transition-new(mushaf-page) { z-index: 2; transform-origin: 100% 50%; animation: mp-turn-away .6s cubic-bezier(.45, .05, .35, 1) reverse both; }
@keyframes mp-turn-away { 0% { transform: perspective(1800px) rotateY(0); filter: brightness(1); } 70% { filter: brightness(.82); } 100% { transform: perspective(1800px) rotateY(102deg); filter: brightness(.7); opacity: .85; } }

/* 🆕 What's new */
.wn-list { list-style: none; margin: 8px auto 0; padding: 0; max-width: 820px; display: grid; gap: 14px; }
.wn-item { padding: 18px 20px; }
.wn-item.is-latest { border-color: var(--gold); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent); }
.wn-item__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.wn-item__head h2 { margin: 0; font-size: 1.15rem; flex: 1 1 auto; }
.wn-item__head time { font-size: .82rem; color: var(--muted); }
.wn-item__v { padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); }
.wn-item ul { margin: 10px 0 0; padding-left: 20px; line-height: 1.7; }
.wn-note { text-align: center; color: var(--muted); font-size: .88rem; margin: 18px auto; max-width: 760px; }
.footer__ver { white-space: nowrap; }

/* ⏰ Video maker: the best times to post (Pakistan time), and 🎵 the TikTok step after a video is made */
.vm__times { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.vm__times-h { flex-basis: 100%; font-weight: 600; font-size: .9rem; }
.vm__times-h small { font-weight: 400; color: var(--muted); }
.vm__times .chip.is-suggested { border-color: var(--gold); }
.vm__times .chip.is-on { color: var(--accent); border-color: var(--gold); background: var(--gold-soft); }
.vm__times-note { flex-basis: 100%; color: var(--muted); }
.vm__tt { flex-basis: 100%; display: grid; gap: 8px; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.vm__tt small { color: var(--muted); }
.vm__tt textarea { width: 100%; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg, var(--surface)); color: var(--text); font: inherit; font-size: .88rem; resize: vertical; }
.vm__tt-go { display: flex; flex-wrap: wrap; gap: 8px; }

/* 🪜 The Video maker step by step (assets/js/vm-wizard.js): one step at a time, larger and bolder text and controls */
.vm__form.vmw-on .vm__group:not(.is-current) { display: none !important; }
.vmw { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; scroll-margin-top: 90px; }
.vmw__step { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 9px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: 600 1rem var(--ui-font, inherit); cursor: pointer; }
.vmw__step i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-style: normal; font-weight: 800; font-size: .95rem; background: color-mix(in srgb, var(--muted) 20%, transparent); }
.vmw__step.is-cur { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.vmw__step.is-cur i { color: #fff; background: var(--p); }
.vmw__step.is-done i { color: #fff; background: #1f8a4c; }
.vmw__step.has-err { border-color: #c0392b; }
.vmw__step.has-err i { color: #fff; background: #c0392b; }
.vmw__step.has-warn i { background: #f0b429; color: #3b2a00; }
.vmw-sum { grid-column: 1 / -1; margin: 6px 0 4px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--p) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--p) 25%, var(--border)); font-size: 1.05rem; font-weight: 700; color: var(--text); }
.vm__form.vmw-on { font-size: 1.04rem; }
.vm__form.vmw-on .vm__group { padding: 20px 22px 22px; gap: 14px; }
.vm__form.vmw-on .vm__group-head h2 { font-size: 1.55rem; }
.vm__form.vmw-on .vm__group-head p { font-size: 1.05rem; color: var(--text); }
.vm__form.vmw-on .vm__step { width: 40px; height: 40px; font-size: 1.15rem; }
.vm__form.vmw-on .vm__learn { font-size: 1.02rem; padding: 10px 16px; }
.vm__form.vmw-on .vm__learn summary { font-size: 1.05rem; }
.vm__form.vmw-on .vm__field > span, .vm__form.vmw-on .vm__field > legend, .vm__form.vmw-on fieldset > span { font-size: 1.06rem; font-weight: 700; color: var(--text); }
.vm__form.vmw-on .vm__hint { font-size: .96rem; line-height: 1.55; color: color-mix(in srgb, var(--text) 70%, var(--muted)); }
.vm__form.vmw-on :is(select, input[type="text"], input[type="number"], input[type="datetime-local"], textarea) { min-height: 46px; font-size: 1rem; }
.vm__form.vmw-on label:has(> input[type="checkbox"]), .vm__form.vmw-on label:has(> input[type="radio"]) { font-size: 1.02rem; }
.vm__form.vmw-on input[type="checkbox"], .vm__form.vmw-on input[type="radio"] { width: 20px; height: 20px; }
.vm__form.vmw-on .vm__group-body { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.vmw-bar { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 14px; border-top: 1px dashed var(--border); }
.vmw-bar .btn { min-height: 50px; padding: 0 24px; font-size: 1.05rem; font-weight: 700; }
.vmw-bar .vmw-next { margin-left: auto; }
.vmw-check .vm__go { grid-column: 1 / -1; }
.vmw-check .vm__go .btn { min-height: 54px; font-size: 1.12rem; font-weight: 800; padding: 0 28px; }
.vmw-list { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vmw-list__head { padding: 14px 16px; border-radius: 12px; font-size: 1.15rem; font-weight: 800; }
.vmw-list__head.is-error { background: #fdecea; color: #8a1c12; }
.vmw-list__head.is-warn { background: #fff6dc; color: #6b4b00; }
.vmw-list__head.is-ok { background: #e7f6ec; color: #145c32; }
.vmw-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 1.02rem; }
.vmw-item span { flex: 1 1 auto; min-width: 0; }
.vmw-item.is-error { border-color: #e2a39b; }
.vmw-item.is-warn { border-color: #ecd08a; }
.vmw-item .btn { flex: none; }
[data-vm-start].is-blocked { opacity: .6; }
.vmw-flash { animation: vmw-flash 2s ease; border-radius: 10px; }
@keyframes vmw-flash { 0%, 60% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 70%, transparent); } 100% { box-shadow: none; } }
@media (max-width: 640px) {
  .vmw__step span { display: none; }
  .vmw__step.is-cur span { display: inline; }
  .vmw-bar .btn { flex: 1 1 0; padding: 0 12px; }
}

/* 🎬 Video maker → Look → Cinematic look */
.vm__cine { border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border)); border-radius: 12px; padding: 12px 16px 14px; background: color-mix(in srgb, var(--gold) 5%, var(--surface)); }
.vm__cine legend { font-weight: 700; padding: 0 6px; }
.vm__cine .vm__hint .btn { margin: 4px 6px 0 0; }
.vm__cine-fx { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.vm__cine-fx label { display: inline-flex; align-items: center; gap: 6px; }
/* Social planner: a hadith's recorded voice, and the website page to share with a post */
.sp-voice, .sp-page { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: none; color: inherit; font-size: .78rem; text-decoration: none; cursor: pointer; }
.sp-voice.is-ready { border-color: #2e9e6a; color: #2e9e6a; cursor: default; }
.sp-idea__extra { display: block; margin: 4px 0; }
.sp-idea__extra .sp-voice:first-child, .sp-idea__extra .sp-page:first-child { margin-left: 0; }
/* 40 Nawawi in Urdu: the review page (admin) */
.nu__jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nu__dot { min-width: 2.2em; text-align: center; padding: 2px 6px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: .85rem; }
.nu__dot--same { background: color-mix(in srgb, #2e9e6a 25%, transparent); }
.nu__dot--similar { background: color-mix(in srgb, #d8b54a 30%, transparent); }
.nu__dot--exclude { background: color-mix(in srgb, #d0463b 25%, transparent); }
.nu__row { margin: 18px 0; padding: 14px 16px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 12px; background: var(--surface); }
.nu__row--same { border-left-color: #2e9e6a; }
.nu__row--similar { border-left-color: #d8b54a; }
.nu__row--exclude { border-left-color: #d0463b; opacity: .8; }
.nu__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.nu__head h2 { margin: 0; font-size: 1.1rem; }
.nu__done { color: #2e9e6a; font-size: .85rem; }
.nu__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; margin-top: 8px; }
.nu__cols h3 { margin: 0 0 6px; font-size: .95rem; color: var(--muted); }
.nu__ar { font-family: var(--ar-font); font-size: 1.25rem; line-height: 2; margin: 0 0 8px; }
.nu__ur { font-family: var(--ur-font); line-height: 2.3; margin: 0; }
.nu__en { color: var(--muted); margin: 0; }
.nu__form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.nu__form .btn--sm { margin-top: 0; }

/* 🧩 Aaj ka Sawal (templates/quiz.php, assets/js/quiz.js) */
.quiz-page__lead { color: var(--muted); margin: 6px 0 0; }
.quiz-page__lead[lang] { font-family: var(--ur-font); margin: 2px 0 0; }
.quiz-langs { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; }
.quiz-langs select { min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--gold); background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; }
.quiz__salam { margin: 0 0 8px; font-weight: 600; font-size: 1.1rem; color: var(--gold); }
.quiz--big { font-size: 1.15rem; }
.quiz--big .quiz__opt { font-size: 1.2rem; min-height: 58px; }
.quiz--big .quiz__ar { font-size: 2rem; }
.quiz--big .quiz__q { font-size: 1.4rem; }
.quiz-f { display: grid; gap: 14px; }
.quiz-f__row { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.quiz-f__row > span, .quiz-f__row legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.quiz-f__row input[type="text"] { min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.quiz-f__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-f__pill { position: relative; }
.quiz-f__pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.quiz-f__pill span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); min-height: 40px; line-height: 1.5; }
.quiz-f__pill input:checked + span { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.quiz-f__pill input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.quiz-f__btns { display: flex; gap: 10px; flex-wrap: wrap; }
.hero__salam { margin: 0 0 12px; color: #fbf5e4; font-size: 1.08rem; }
.hero__salam bdi { color: var(--gold-2); font-weight: 700; }
.hero__salam a { color: var(--gold-2); margin-inline-start: 8px; font-weight: 600; }
.quiz { margin: 18px auto 0; max-width: 680px; padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.quiz[lang="ur"], .quiz[lang="ar"], .quiz[lang="fa"] { font-family: var(--ur-font), var(--ui-font); }
.quiz__top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }
.quiz__top b { color: var(--gold); }
.quiz__dots { display: flex; gap: 6px; margin: 10px 0 4px; }
.quiz__dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); }
.quiz__dots i.now { background: var(--gold); }
.quiz__dots i.ok { background: #2e9e6a; }
.quiz__dots i.no { background: #c0574a; }
.quiz__q { font-size: 1.25rem; margin: 14px 0 10px; line-height: 1.6; }
.quiz__q--sm { font-size: 1.02rem; margin: 0 0 6px; }
.quiz__ar { font-family: var(--ar-font); font-size: 1.7rem; line-height: 2.1; text-align: center; margin: 8px 0 12px; color: var(--text); }
.quiz__ar--sm { font-size: 1.3rem; line-height: 2; }
.quiz__ar mark { background: color-mix(in srgb, var(--gold) 35%, transparent); color: inherit; border-radius: 4px; padding: 0 3px; }
.quiz__word { font-family: var(--ar-font); font-size: 2.4rem; text-align: center; margin: 6px 0 0; color: var(--accent); }
html[data-mode="dark"] .quiz__word { color: var(--gold-2); }
.quiz__from, .quiz__note { text-align: center; color: var(--muted); font-size: .88rem; margin: 0 0 10px; }
.quiz__opts { display: grid; gap: 10px; margin-top: 8px; }
.quiz__opt { min-height: 50px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1.05rem; text-align: start; cursor: pointer; line-height: 1.6; }
.quiz__opt:hover:not(:disabled), .quiz__opt:focus-visible { border-color: var(--gold); background: var(--accent-soft); }
.quiz__opt:disabled { cursor: default; opacity: .75; }
.quiz__opt.is-right { opacity: 1; border-color: #2e9e6a; background: color-mix(in srgb, #2e9e6a 16%, var(--surface)); font-weight: 600; }
.quiz__opt.is-wrong { opacity: 1; border-color: #c0574a; background: color-mix(in srgb, #c0574a 14%, var(--surface)); }
.quiz__after { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.quiz__after[hidden] { display: none; }
.quiz__verdict { margin: 0; font-weight: 600; }
.quiz__verdict.ok { color: #2e9e6a; }
.quiz__verdict.no { color: #c0574a; }
.quiz__mean { margin: 0; color: var(--muted); line-height: 1.8; }
.quiz__mean[lang="ur"] { font-family: var(--ur-font); }
.quiz__link { font-weight: 600; }
.quiz__next { justify-self: center; margin-top: 4px; }
.quiz__score { font-size: 3rem; font-weight: 700; text-align: center; margin: 10px 0 0; color: var(--accent); }
html[data-mode="dark"] .quiz__score { color: var(--gold-2); }
.quiz__marks { text-align: center; font-size: 1.5rem; letter-spacing: 4px; margin: 0; }
.quiz__played { text-align: center; color: var(--muted); }
.quiz__share { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.quiz__rev { font-size: 1.1rem; margin: 22px 0 8px; }
.quiz__review { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.quiz__review li { padding: 12px; border-radius: 12px; border: 1px solid var(--border); }
.quiz__review li.no { border-color: color-mix(in srgb, #c0574a 50%, var(--border)); }
.quiz__yours, .quiz__ans { margin: 4px 0; }
.quiz-page__notes { text-align: center; color: var(--muted); font-size: .85rem; margin: 16px auto 0; max-width: 680px; }
@media (max-width: 520px) { .quiz { padding: 14px; } .quiz__ar { font-size: 1.45rem; } .quiz__word { font-size: 2rem; } }

/* 🔒 Your data & backup (templates/my_data.php) */
.mydata__promise { margin: 16px auto 0; max-width: 720px; padding: 18px; border-radius: 16px; border: 1px solid var(--gold); background: var(--accent-soft); }
.mydata__big { font-size: 1.08rem; line-height: 1.8; margin: 0 0 8px; }
.mydata__big[lang] { font-family: var(--ur-font); font-size: 1.15rem; }
.mydata__card { margin: 16px auto 0; max-width: 720px; padding: 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.mydata__card h2 { margin-top: 0; font-size: 1.15rem; }
.mydata__card h2 [lang], .mydata__card p[lang], .mydata__btns [lang] { font-family: var(--ur-font); }
.mydata__card ul { padding-inline-start: 20px; line-height: 1.7; }
.mydata__now { font-weight: 600; }
.mydata__btns { display: flex; flex-wrap: wrap; gap: 10px; }
.mydata__btns label { cursor: pointer; }
.mydata__hint { color: var(--muted); font-size: .88rem; }
.mydata__msg { font-weight: 600; color: #2e9e6a; }
.mydata__msg.is-bad { color: #c0574a; }
.mydata__link { margin: 4px 0 0; font-size: .92rem; }

/* 📿 Tasbih counter (templates/tasbih.php, assets/js/tasbih.js) */
.tasbih-page__lead { color: var(--muted); margin: 4px 0 0; }
.tasbih-page__lead[lang] { font-family: var(--ur-font); }
.tasbih { margin: 18px auto 0; max-width: 620px; padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); display: grid; justify-items: center; gap: 12px; text-align: center; }
.tasbih[hidden], .tasbih-list[hidden] { display: none; }
.tasbih__text { width: 100%; }
.tasbih__text .tasbih-item__head { justify-content: center; }
.tasbih__free { font-size: 1.3rem; font-weight: 600; margin: 4px 0; }
.tasbih__btn { position: relative; width: min(260px, 72vw); aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; align-content: center;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--gold) 22%, var(--surface)), var(--accent-soft)); color: var(--text); touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
.tasbih__btn:active { transform: scale(.98); }
.tasbih__btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.tasbih__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tasbih__ring circle { fill: none; stroke: color-mix(in srgb, var(--gold) 25%, transparent); stroke-width: 6; }
.tasbih__ring .tasbih__done { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .2s; }
.tasbih.is-done .tasbih__ring .tasbih__done { stroke: #2e9e6a; }
.tasbih__n { position: relative; font-size: clamp(3rem, 14vw, 4.6rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tasbih__of { position: relative; color: var(--muted); font-size: 1.1rem; }
.tasbih__msg { min-height: 1.6em; margin: 0; font-weight: 600; color: #2e9e6a; }
.tasbih__tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tasbih__tools [lang="ur"] { font-family: var(--ur-font); }
.tasbih__hint { color: var(--muted); font-size: .85rem; margin: 0; }
.tasbih-list { margin: 18px auto 0; max-width: 720px; display: grid; gap: 12px; }
.tasbih-list h2 { font-size: 1.15rem; margin: 0; }
.tasbih-list h2 [lang] { font-family: var(--ur-font); }
.tasbih-item { padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: 8px; }
.tasbih-item__head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.tasbih-item__head [lang="ur"] { font-family: var(--ur-font); color: var(--muted); }
.tasbih-page[lang="ur"], .tasbih-page[lang="ar"], .tasbih-page[lang="fa"] { font-family: var(--ur-font), var(--ui-font); }
.tasbih-page .tasbih-item__en, .tasbih-page .tasbih-item__tl { font-family: var(--ui-font); }
.tasbih-item__note { color: var(--muted); font-style: italic; }
.tasbih-item [hidden] { display: none; }
.tasbih-item__x { margin-inline-start: auto; color: var(--gold); font-weight: 700; }
.tasbih-item__ar { font-family: var(--ar-font); font-size: 1.45rem; line-height: 2.1; margin: 0; }
.tasbih-list .tasbih-item__ar { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tasbih-list .tasbih-item__tl, .tasbih-list .tasbih-item__ur, .tasbih-list .tasbih-item__en, .tasbih-list .tasbih-item__src { display: none; }
.tasbih-item__tl { color: var(--muted); font-style: italic; margin: 0; }
.tasbih-item__ur { font-family: var(--ur-font); line-height: 2.1; margin: 0; }
.tasbih-item__en { margin: 0; color: var(--muted); }
.tasbih-item__src { margin: 0; font-size: .9rem; }
.tasbih-item__sub { margin: 0; color: var(--muted); }
.tasbih-item__free { display: flex; flex-wrap: wrap; gap: 10px; }
.tasbih-item__free select, .tasbih-item__free input { min-height: 38px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.tasbih-item .btn { justify-self: start; }
.tasbih-item .btn [lang] { font-family: var(--ur-font); }
.tasbih-item__today { color: var(--muted); }
.tasbih .tasbih-item__ar { font-size: 1.6rem; }
.tasbih-page__notes { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 16px; }
.tasbih-page__notes [lang] { font-family: var(--ur-font); }
.dua__count { white-space: nowrap; font-weight: 600; }
.tasbih__meaning { margin-top: 4px; }
.tasbih__meaning summary { cursor: pointer; color: var(--accent); font-weight: 600; }
html[data-mode="dark"] .tasbih__meaning summary { color: var(--gold-2); }
.tasbih__meaning > p { margin: 6px 0 0; }

/* ---------- 🪟 Glass styles (Settings › Theme › Glass style; data-glass on <html>) ----------
   A soft glow of the theme's own colours lies behind every page, and the surfaces become glass over it: --surface and
   --surface-2 turn see-through (so every card, list and panel of the site follows), with a gold or light edge. What
   floats over the page (the top bar, menus, Settings, search, the player, pop-ups) also blurs what is behind it, so its
   words stay clear. 'off' (Solid) keeps the solid surfaces, as does a device asked for less transparency. TVs get the
   glass's tint, edges and glow but no blur (it slows TV boxes): their floating panels are nearly solid instead. Emerald glass is the site's own; the others are the visitor's choice. */
html:not([data-glass="off"]) {
  --glass-tint: var(--p); --glass-mix: 22%; --glass-solid: 72%; --glass-edge: color-mix(in srgb, var(--gold) 45%, transparent);
  --glass-blur: 16px; --glass-glow: .5; --glass-shine: rgba(255, 255, 255, .07);
}
html:not([data-mode="dark"])[data-glass="emerald"] { --glass-tint: #ffffff; --glass-mix: 35%; --glass-solid: 64%; --glass-edge: color-mix(in srgb, var(--gold) 55%, transparent); --glass-glow: .38; --glass-shine: rgba(255, 255, 255, .6); }
html[data-glass="frost"] { --glass-tint: #ffffff; --glass-mix: 10%; --glass-solid: 62%; --glass-edge: rgba(255, 255, 255, .22); --glass-blur: 14px; --glass-shine: rgba(255, 255, 255, .12); }
html:not([data-mode="dark"])[data-glass="frost"] { --glass-mix: 50%; --glass-solid: 55%; --glass-edge: rgba(60, 45, 10, .12); --glass-glow: .32; --glass-shine: rgba(255, 255, 255, .7); }
html[data-glass="royal"] { --glass-tint: #000000; --glass-mix: 30%; --glass-solid: 66%; --glass-edge: color-mix(in srgb, var(--gold-2) 70%, transparent); --glass-blur: 20px; --glass-glow: .6; --glass-shine: rgba(232, 207, 138, .12); }
html:not([data-mode="dark"])[data-glass="royal"] { --glass-tint: var(--gold-2); --glass-mix: 14%; --glass-solid: 66%; --glass-edge: var(--gold); --glass-glow: .4; --glass-shine: rgba(255, 246, 216, .7); }
html[data-glass="liquid"] { --glass-tint: #ffffff; --glass-mix: 18%; --glass-solid: 56%; --glass-edge: rgba(255, 255, 255, .34); --glass-blur: 24px; --glass-glow: .6; --glass-shine: rgba(255, 255, 255, .28); }
html:not([data-mode="dark"])[data-glass="liquid"] { --glass-mix: 55%; --glass-solid: 50%; --glass-edge: rgba(255, 255, 255, .9); --glass-glow: .45; --glass-shine: rgba(255, 255, 255, .9); }

html:not([data-glass="off"]) {
  --surface: color-mix(in srgb, color-mix(in srgb, var(--bg), var(--glass-tint) var(--glass-mix)) var(--glass-solid), transparent);
  --surface-2: color-mix(in srgb, color-mix(in srgb, var(--bg-soft, var(--bg)), var(--glass-tint) var(--glass-mix)) calc(var(--glass-solid) - 14%), transparent);
  --border: var(--glass-edge);
}
/* the glow behind the page: the theme's green, light green and gold, softly */
html:not([data-glass="off"]) body::after {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: var(--glass-glow);
  background:
    radial-gradient(42vmax 42vmax at 8% 12%, color-mix(in srgb, var(--gold) 55%, transparent), transparent 70%),
    radial-gradient(48vmax 48vmax at 92% 30%, color-mix(in srgb, var(--p-light) 50%, transparent), transparent 70%),
    radial-gradient(46vmax 46vmax at 30% 95%, color-mix(in srgb, var(--p) 60%, transparent), transparent 70%),
    radial-gradient(36vmax 36vmax at 85% 92%, color-mix(in srgb, var(--gold-2) 45%, transparent), transparent 70%);
}
/* a thin light along the top edge of the glass */
html:not([data-glass="off"]) :is(.card, .surah-card, .quiz, .tasbih, .tasbih-item, .mydata__card, .mydata__promise, .sr-item a, .hero__search, .verse, .dua) {
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-shine);
}
html[data-glass="royal"] :is(.card, .quiz, .tasbih, .mydata__card) { box-shadow: var(--shadow), inset 0 0 26px color-mix(in srgb, var(--gold-2) 10%, transparent), inset 0 1px 0 var(--glass-shine); }
html[data-glass="liquid"] :is(.card, .surah-card, .quiz, .tasbih, .tasbih-item, .mydata__card, .hero__search) {
  box-shadow: inset 0 1px 1px var(--glass-shine), inset 0 -1px 1px rgba(0, 0, 0, .12), 0 10px 28px rgba(0, 0, 0, .18);
}
/* what floats over the page blurs what is behind it */
html:not([data-glass="off"]):not(.tv) :is(.drawer__panel, .modal__panel, .palette__panel, .reader-nav, .noor-bubble, .player) {
  background: color-mix(in srgb, color-mix(in srgb, var(--bg), var(--glass-tint) var(--glass-mix)) 82%, transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%); backdrop-filter: blur(var(--glass-blur)) saturate(160%);
}
/* the dark panels (the More menu, notices, the Azan banner, the dua sheet): dark emerald glass, their light words kept */
html:not([data-glass="off"]) :is(.nav-more__menu, .toast, .azan-banner, .dua-sheet__panel) {
  background: color-mix(in srgb, var(--p-deep) 90%, transparent);
}
html:not([data-glass="off"]):not(.tv) :is(.nav-more__menu, .toast, .azan-banner, .dua-sheet__panel) {
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%); backdrop-filter: blur(var(--glass-blur)) saturate(160%);
}
html.tv:not([data-glass="off"]) :is(.nav-more__menu, .toast, .azan-banner, .dua-sheet__panel) { background: var(--p-deep); }
/* the top bar: emerald glass over the page as it scrolls under it */
html:not([data-glass="off"]):not(.tv) .topbar {
  background: linear-gradient(180deg, color-mix(in srgb, var(--p-deep) 86%, transparent), color-mix(in srgb, var(--p-deep) 72%, transparent));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%); backdrop-filter: blur(var(--glass-blur)) saturate(170%);
}
html[data-glass="royal"]:not(.tv) .topbar { background: linear-gradient(180deg, rgba(3, 20, 15, .86), rgba(3, 20, 15, .7)); }
/* TVs: no blur, so what floats over the page is nearly solid */
html.tv:not([data-glass="off"]) :is(.drawer__panel, .modal__panel, .palette__panel, .reader-nav, .noor-bubble, .player) {
  background: color-mix(in srgb, color-mix(in srgb, var(--bg), var(--glass-tint) var(--glass-mix)) 95%, transparent);
}
/* where the device cannot blur, the floating panels stay solid */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html:not([data-glass="off"]) :is(.drawer__panel, .modal__panel, .palette__panel, .reader-nav, .noor-bubble, .player) { background: var(--bg); }
  html:not([data-glass="off"]) .topbar { background: linear-gradient(180deg, var(--p-deep), color-mix(in srgb, var(--p-deep) 85%, var(--p))); }
}
/* less transparency, asked for by the device: solid */
@media (prefers-reduced-transparency: reduce) {
  html:not([data-glass="off"]) { --surface: var(--bg); --surface-2: var(--bg-soft, var(--bg)); }
  html:not([data-glass="off"]) body::after { display: none; }
}
/* Settings: the five styles' swatches */
.swatches--glass { grid-template-columns: repeat(5, 1fr); }
.glass-swatch i { width: 30px; height: 22px; border-radius: 7px; border: 1px solid; }
.glass-swatch--emerald i { background: linear-gradient(135deg, rgba(11, 93, 69, .55), rgba(76, 195, 154, .3)); border-color: #c9a44c; }
.glass-swatch--frost i { background: linear-gradient(135deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .15)); border-color: rgba(120, 120, 120, .45); }
.glass-swatch--royal i { background: radial-gradient(circle at 50% 35%, rgba(232, 207, 138, .5), #06140f); border-color: #e8cf8a; }
.glass-swatch--liquid i { background: linear-gradient(145deg, rgba(255, 255, 255, .8), rgba(180, 220, 210, .35)); border-color: #fff; box-shadow: inset 0 1px 1px #fff; }
.glass-swatch--off i { background: var(--p); border-color: var(--p-deep); }

/* 🧩 Aaj ka Sawal: the listening question, and the season's note (Friday, Ramadan) */
.quiz__listen { display: grid; justify-items: center; gap: 6px; margin: 10px 0 12px; }
.quiz__listen audio { width: min(420px, 100%); }
.quiz__listen small { color: var(--muted); }
.quiz__season { margin: 0 0 8px; padding: 6px 12px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--text); font-size: .92rem; }

/* 📖 My Quran (templates/my_quran.php, assets/js/readlog.js) */
.mq { max-width: 680px; margin: 16px auto 0; display: grid; gap: 14px; }
.mq[lang="ur"], .mq[lang="ar"], .mq[lang="fa"] { font-family: var(--ur-font), var(--ui-font); }
.mq__priv { text-align: center; color: var(--muted); margin: 0; }
.mq__card { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.mq__card h2 { margin: 0 0 10px; font-size: 1.1rem; }
.mq__week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.mq__week span { display: grid; gap: 6px; justify-items: center; font-size: .8rem; color: var(--muted); }
.mq__week i { width: 34px; height: 34px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.mq__week .on i { background: radial-gradient(circle at 40% 35%, var(--gold-2), var(--gold)); border-color: var(--gold); }
.mq__week .now b { color: var(--gold); }
.mq__week .f i { opacity: .45; }
.mq__goal { font-size: 1.5rem; font-weight: 700; margin: 12px 0 0; text-align: center; color: var(--accent); }
html[data-mode="dark"] .mq__goal { color: var(--gold-2); }
.mq__msg { margin: 6px 0 0; text-align: center; color: var(--muted); }
.mq__nums { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.mq__nums p { margin: 0; }
.mq__nums b { font-size: 1.3rem; color: var(--accent); }
html[data-mode="dark"] .mq__nums b { color: var(--gold-2); }
.mq__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mq__noted { margin: 8px 0 0; color: #2e9e6a; font-weight: 600; }
.mq__grid { max-width: 360px; margin: 0 auto; display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.mq__grid i { aspect-ratio: 1; border-radius: 4px; background: color-mix(in srgb, var(--gold) 12%, transparent); }
.mq__grid i.on { background: var(--gold); }
.mq__grid i.f { background: transparent; }
.mq__set { display: grid; gap: 10px; }
.mq__set select { min-height: 36px; padding: 2px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.mq__how { margin: 0; color: var(--muted); font-size: .86rem; }

/* 📗 Khatm planner (templates/khatm.php, assets/js/khatm.js) */
.kh[lang="ur"], .kh[lang="ar"], .kh[lang="fa"] { font-family: var(--ur-font), var(--ui-font); }
.kh__intro { margin: 0 0 12px; color: var(--muted); }
.kh h2 { margin-top: 6px; }
.kh__modes { display: grid; gap: 8px; margin-bottom: 14px; }
.kh__mode { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface-2); }
.kh__mode:has(input[type=radio]:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent); }
.kh__mode > input { margin-top: 4px; accent-color: var(--accent); }
.kh__mode span { display: grid; gap: 4px; }
.kh__mode small { color: var(--muted); }
.kh__in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kh input[type=date], .kh input[type=number], .kh select { min-height: 36px; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.kh input[type=number] { width: 5.5em; }
.kh__from { display: grid; gap: 8px; margin-bottom: 6px; }
.kh__from label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kh__big { font-size: 1.3rem; font-weight: 700; margin: 4px 0; color: var(--accent); }
html[data-mode="dark"] .kh__big { color: var(--gold-2); }
.kh__big small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.kh__upto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: .9rem; color: var(--muted); }
.kh__upto label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kh__note { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.kh__note--ok { background: color-mix(in srgb, #2e9e6a 14%, var(--surface)); border-color: color-mix(in srgb, #2e9e6a 40%, transparent); }
.kh__bar { height: 12px; border-radius: 99px; background: color-mix(in srgb, var(--gold) 15%, transparent); overflow: hidden; margin-bottom: 10px; }
.kh__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.kh > * { min-width: 0; }
.kh__paras { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; max-width: 420px; margin: 0 auto; }
.kh__paras i { font-style: normal; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; border-radius: 7px; font-size: .74rem; font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--gold) 10%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent); }
.kh__paras i.on { background: var(--gold); color: #1b1300; border-color: var(--gold); }
.kh__paras i.now { border: 2px solid var(--gold); color: var(--text); }
.kh__past { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.kh__fin { text-align: center; }
.kh__foot { text-align: center; }

/* 👓 Asaan Mode (Settings → Asaan Mode, or the button on the home page): larger text everywhere (the site's sizes
   are in rem), tap targets of 48px or more, roomier Urdu, calmer motion, and six big tiles on the home page */
.easy-home, .easy-only { display: none; }
html.easy { font-size: 118%; }
html.easy .easy-home { display: grid; gap: 14px; width: 100%; max-width: 640px; margin: 8px auto 4px; }
html.easy .easy-only { display: inline-flex; }
html.easy .btn, html.easy .pill, html.easy .link-btn, html.easy .seg button, html.easy select, html.easy .nav-more__menu a { min-height: 48px; }
html.easy .icon-btn { min-width: 48px; min-height: 48px; }
html.easy .verse__tr[lang="ur"], html.easy [lang="ur"].verse__tr, html.easy .tr-ur { line-height: 2.4; }
html.easy .landing__cta, html.easy .hero__quick, html.easy .cine-motes, html.easy .landing__lanterns, html.easy .cine-beam { display: none; }
html.easy * { scroll-behavior: auto; }
.easy-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .easy-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.easy-tile { display: grid; justify-items: center; gap: 4px; padding: 16px 8px; min-height: 120px; border-radius: 18px; text-decoration: none; color: #fff;
  background: color-mix(in srgb, var(--p-deep) 82%, transparent); border: 1.5px solid color-mix(in srgb, var(--gold) 55%, transparent); box-shadow: 0 6px 18px rgb(0 0 0 / .25); }
.easy-tile:hover, .easy-tile:focus-visible { border-color: var(--gold); outline: none; transform: translateY(-1px); }
.easy-tile__ico { font-size: 2.2rem; line-height: 1; }
.easy-tile b { font-family: var(--ur-font), var(--ui-font); font-size: 1.35rem; font-weight: 600; line-height: 1.9; }
.easy-tile small { font-size: .85rem; opacity: .85; }
.easy-listen__title { margin: 6px 0 0; text-align: center; color: #fff; font-size: 1.25rem; font-family: var(--ur-font), var(--ui-font); font-weight: 600; }
.easy-listen__title small { display: block; font-family: var(--ui-font); font-size: .8rem; opacity: .8; }
.easy-listen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .easy-listen { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.easy-listen__btn { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; min-height: 56px; padding: 8px 10px; border-radius: 14px; cursor: pointer;
  font: inherit; color: #1b1300; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border: 0; box-shadow: 0 4px 12px rgb(0 0 0 / .25); }
.easy-listen__btn b { font-family: var(--ar-font, "Amiri Quran"), serif; font-size: 1.35rem; font-weight: 400; }
.easy-listen__btn small { font-size: .78rem; opacity: .8; }
.easy-toggle { margin: 10px auto 0; display: inline-flex; align-items: center; min-height: 44px; padding: 6px 16px; border-radius: 99px; cursor: pointer; font: inherit; font-size: .9rem;
  color: #fff; background: color-mix(in srgb, #fff 10%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); }
.easy-toggle:hover { border-color: var(--gold); }

/* 🌙 The Ramadan card's khatm, quiz and dua shortcuts (assets/js/islamic.js rcExtra) */
.rc-extra { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rc-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 99px; text-decoration: none; font-weight: 600; font-size: .9rem;
  color: inherit; background: color-mix(in srgb, var(--gold) 12%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.rc-chip:hover { border-color: var(--gold); }
.rc-chip--gold { color: #1b1300; background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); }
.rc-chip--sm { min-height: 34px; padding: 4px 12px; font-size: .82rem; font-weight: 500; }
.rc-chip [lang="ur"] { font-family: var(--ur-font), var(--ui-font); font-weight: 400; }
.rc-duas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.rc-duas__label { width: 100%; font-size: .85rem; opacity: .85; }

/* 🕌 Namaz tracker (templates/salah.php, assets/js/salah.js) */
.sl[lang="ur"], .sl[lang="ar"], .sl[lang="fa"] { font-family: var(--ur-font), var(--ui-font); }
.sl > * { min-width: 0; }
.sl__nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sl__nav h2 { margin: 0; text-align: center; font-size: 1.05rem; }
.sl__nav .icon-btn { font-size: 1.4rem; }
.sl__list { display: grid; gap: 8px; margin-top: 10px; }
.sl__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.sl__p { flex: 1 1 100%; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 14px; border-radius: 14px; cursor: pointer; font: inherit; text-align: start;
  color: var(--text); background: var(--surface-2); border: 1.5px solid var(--border); }
.sl__p i { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-style: normal; font-weight: 700;
  border: 2px solid color-mix(in srgb, var(--gold) 55%, transparent); color: #1b1300; }
.sl__p b { font-size: 1.1rem; }
.sl__p small { margin-inline-start: auto; color: var(--muted); font-size: .85rem; }
.sl__row.on .sl__p { border-color: var(--gold); }
.sl__row.on .sl__p i { background: radial-gradient(circle at 40% 35%, var(--gold-2), var(--gold)); border-color: var(--gold); }
.sl__p:disabled { opacity: .55; cursor: default; }
.sl__x { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--muted); margin-inline-start: 46px; }
.sl__count { text-align: center; margin-top: 12px; }
.sl__qaza { display: grid; gap: 6px; }
.sl__q { display: grid; grid-template-columns: 1fr auto 3.5em auto; align-items: center; gap: 8px; }
.sl__q span { text-align: center; font-weight: 700; font-size: 1.1rem; }
.sl__q .btn { margin: 0; min-width: 40px; }
.sl__month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 420px; margin: 8px auto 0; }
.sl__d { display: grid; gap: 3px; justify-items: center; padding: 5px 0; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); background: color-mix(in srgb, var(--gold) 8%, transparent); border: 1px solid transparent; }
.sl__d b { font-size: .8rem; font-weight: 600; }
.sl__d span { display: flex; gap: 2px; }
.sl__d s { width: 4px; height: 4px; border-radius: 50%; background: color-mix(in srgb, var(--gold) 25%, transparent); }
.sl__d s.on { background: var(--gold); }
.sl__d.sel { border-color: var(--gold); }
.sl__d.f { opacity: .35; cursor: default; }
.sl__month .e { display: block; }
.sl--rest .sl__list { opacity: .5; }

/* Home: the prayer times and the calendar side by side end level (the calendar's days grow to fill its card), and
   the Verse and Hadith of the day each a full row (the "Continue reading" card that once shared the Verse's row is now
   the Continue row above) */
.landing ~ .container > .islamic-panels { align-items: stretch; }
.landing ~ .container > .islamic-panels > .cal-card { display: flex; flex-direction: column; }
.landing ~ .container > .islamic-panels > .cal-card .cal-grid { flex: 1; grid-template-rows: auto; grid-auto-rows: 1fr; }
.landing ~ .container > .islamic-panels > .cal-card .cal-note { margin-top: auto; padding-top: 10px; }
.home-cards .card--votd { grid-column: 1 / -1; }

/* 📖 The printed Mushaf's markers (templates/mushaf.php): in the left margin (the end of an Arabic line), the ruku sign ع with
   its three numbers, the quarters ۞, the manzil and the sajdah ۩; the surah's facts in its header; the manzil at the foot */
.mushaf-page { padding-inline-end: 50px; }
.mushaf-line { position: relative; }
.mk-wrap { position: absolute; inset-inline-end: -48px; top: 50%; transform: translateY(-50%); width: 44px; display: grid; gap: 2px; justify-items: center;
  font-family: "Amiri", serif; line-height: 1.05; color: #17336e; pointer-events: auto; white-space: normal; }
html[data-mode="dark"] .mk-wrap { color: var(--gold-2); }
.mk { display: grid; justify-items: center; text-align: center; font-size: .62rem; }
.mk small { font-size: 1em; display: block; max-width: 44px; overflow-wrap: anywhere; }
.mk b { font-weight: 700; }
.mk--rub b, .mk--sajdah b { font-size: 1.9em; line-height: 1; color: #b0272a; }
html[data-mode="dark"] .mk--rub b, html[data-mode="dark"] .mk--sajdah b { color: #f08a7e; }
.mk--ruku { font-size: .78rem; padding: 2px 3px; border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--gold) 10%, transparent); }
.mk--ruku > span { display: flex; align-items: center; gap: 1px; }
.mk--ruku i { font-style: normal; font-size: 1.5em; line-height: 1; color: #b0272a; }
html[data-mode="dark"] .mk--ruku i { color: #f08a7e; }
.mushaf-surah__frame--facts { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 3px 10px; border-radius: 14px; }
.mushaf-surah__name { flex: 1; text-align: center; }
.mushaf-surah__name small { font-size: .62em; font-weight: 400; opacity: .9; }
.mushaf-surah__box { display: grid; justify-items: center; min-width: 56px; padding: 2px 6px; border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent); border-radius: 10px; font-size: .78em; line-height: 1.2; }
.mushaf-surah__box small { font-size: .62em; font-weight: 400; }
.mushaf-page__foot { display: flex; align-items: center; justify-content: center; gap: 14px; }
.mushaf-page__foot .mushaf-page__num { margin: 8px 0 0; }
.mushaf-page__manzil { font-family: "Amiri", serif; font-size: .82rem; color: var(--accent); padding: 1px 10px; border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); border-radius: 999px; margin-top: 8px; }
.mushaf-page__para b { font-weight: 700; }
@media (max-width: 600px) {
  .mushaf-page, .mushaf-page--ornate { padding-inline-end: 32px; }
  .mushaf-line { font-size: clamp(1rem, 3.85vw, calc(var(--ar-size) * .85)); } /* (the room the margin takes) */
  .mk-wrap { inset-inline-end: -31px; width: 29px; }
  .mk { font-size: .48rem; }
  .mk small { max-width: 29px; }
  .mk--ruku { font-size: .6rem; padding: 1px 2px; }
  .mushaf-surah__frame--facts { padding: 2px 6px; }
  .mushaf-surah__box { min-width: 40px; padding: 1px 4px; }
}

/* 🔒 Privacy Policy table (templates/privacy_policy.php): rows ruled; on phones each row is a small card */
.legal__table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: .92rem; }
.legal__table th, .legal__table td { text-align: start; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.legal__table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid color-mix(in srgb, var(--gold) 55%, transparent); }
@media (max-width: 640px) {
  .legal__table thead { display: none; }
  .legal__table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .legal__table td { display: block; border: 0; padding: 2px 0; }
  .legal__table td:first-child { font-weight: 600; }
  .legal__table td:nth-child(2)::before { content: "Why: "; color: var(--muted); }
  .legal__table td:nth-child(3)::before { content: "Kept: "; color: var(--muted); }
}

/* 🙏 Credits (templates/credits.php) */
.credits__list dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; }
.credits__list dt { font-weight: 700; color: var(--accent); }
.credits__list dd { margin: 0; }
.credits__more { text-align: center; color: var(--muted); font-size: .9rem; }
@media (max-width: 600px) { .credits__list dl { grid-template-columns: 1fr; gap: 2px; } .credits__list dd { margin-bottom: 10px; } }

/* 🧭 Step 2 navigation: the phone tab bar and its sheets (templates/layout.php, nav_sections()), and the footer in
   columns. Phones only (up to 760px), never on TVs; the player and the floating items sit above the bar (--tab-h). */
.tabbar, .tabsheet { display: none; }
@media (max-width: 760px) {
  html:not(.tv) { --tab-h: calc(58px + env(safe-area-inset-bottom)); }
  html:not(.tv) .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr);
    height: var(--tab-h); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--p-deep) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); }
  html:not(.tv) .player { bottom: var(--tab-h); }
  .tabbar__btn { display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 48px; padding: 4px 2px; border: 0; background: none; cursor: pointer;
    font: 600 .7rem/1.1 var(--ui-font, system-ui); color: #e9e1c9; text-decoration: none; }
  .tabbar__btn span { font-size: 1.25rem; line-height: 1.2; }
  .tabbar__btn.is-here, .tabbar__btn[aria-expanded="true"] { color: var(--gold-2); }
  .tabbar__btn[aria-expanded="true"] span { transform: translateY(-2px); }
  html:not(.tv) .tabsheet:not([hidden]) { display: block; position: fixed; inset: 0 0 var(--tab-h) 0; z-index: 59; }
  .tabsheet__backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .45); }
  .tabsheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 70vh; overflow: auto; padding: 16px 16px 18px;
    background: color-mix(in srgb, var(--p-deep) 97%, transparent); border-radius: 18px 18px 0 0; border-top: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
    box-shadow: 0 -12px 30px rgb(0 0 0 / .35); animation: slideUp .2s ease; }
  .tabsheet__panel h2 { margin: 0 0 12px; font-size: 1.05rem; color: var(--gold-2); }
  .tabsheet__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tabsheet__item { display: flex; align-items: center; min-height: 48px; padding: 8px 12px; border-radius: 12px; text-decoration: none; color: #f3ecd6; font-weight: 600; font-size: .92rem;
    background: color-mix(in srgb, #fff 7%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
  .tabsheet__item:hover, .tabsheet__item:focus-visible { border-color: var(--gold); }
  html.tabsheet-open { overflow: hidden; }
  html.tabsheet-open .noor, html.tabsheet-open .noor-bubble { display: none; } /* (Noor waits behind an open sheet) */
  html:not(.tv) .topbar__menu { display: none; } /* (the tab bar holds the menu on phones) */
}
.footer__cols { flex: 1 1 560px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px 24px; }
.footer__col { display: grid !important; align-content: start; gap: 6px !important; padding-top: 4px !important; }
.footer__col h3 { margin: 0 0 4px; font-size: .95rem; color: var(--gold-2); }
.footer__popular { grid-column: 1 / -1; display: flex !important; flex-wrap: wrap; align-items: baseline; gap: 6px 16px !important; padding-top: 12px !important; border-top: 1px solid color-mix(in srgb, var(--gold) 25%, transparent); }
.footer__popular h3 { margin: 0 6px 0 0; font-size: .95rem; color: var(--gold-2); }

/* Phones: the Mushaf's line translation follows the screen's width like the Arabic (and stays smaller than it, also
   with Asaan Mode's larger text); the surah header on one line; Settings' lists never wider than the panel */
@media (max-width: 600px) {
  .mushaf-tr { font-size: 3.3vw; line-height: 1.85; padding: .05rem .6rem; }
  .mushaf-tr[dir="rtl"] { font-size: 3.45vw; line-height: 2.05; }
  .mushaf-surah__frame--facts { font-size: 4.6vw; }
  .mushaf-surah__name { white-space: nowrap; }
  .mushaf-surah__box { display: none; } /* (on phones: the line under the frame instead) */
  .mushaf-surah__facts { display: block !important; }
}
.mushaf-surah__facts { display: none; font-family: "Amiri", serif; font-size: .85rem; color: var(--accent); margin-top: 4px; }
html[data-mode="dark"] .mushaf-surah__facts { color: var(--gold-2); }
.drawer__body { overflow-x: hidden; }
.drawer .select, .drawer .select select { max-width: 100%; min-width: 0; box-sizing: border-box; }
.drawer .select select { width: 100%; }

/* A long word with no spaces (a file name, a link, an e-mail) wraps instead of widening the page past the screen
   (on phones that also pushed the tab bar's "Me" off the edge) */
main p, main li, main dd, main td, main dt, main h1, main h2, main h3 { overflow-wrap: anywhere; }
.dua-modes .seg { min-width: 0; } /* (shrinks beside its settings button instead of pushing it off a phone's screen) */
.dua-modes .icon-btn { flex: none; }
.mydata__btns .btn { max-width: 100%; white-space: normal; height: auto; text-align: center; } /* (long two-language labels wrap) */

/* ☀️ The home page's "Today" card (assets/js/today.js) */
.today { max-width: 1180px; margin: 18px auto 6px; padding: 0 16px; }
.today[hidden] { display: none; }
.today__title { margin: 0 0 10px; font-size: 1.15rem; color: var(--gold-2); }
.today__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.today__tile { display: grid; align-content: start; gap: 2px; min-height: 92px; padding: 12px 14px; border-radius: 16px; text-decoration: none; color: #f3ecd6;
  background: color-mix(in srgb, var(--p-deep) 80%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); box-shadow: 0 6px 16px rgb(0 0 0 / .18); }
.today__tile:hover, .today__tile:focus-visible { border-color: var(--gold); }
.today__ico { font-size: 1.4rem; line-height: 1.2; }
.today__tile small { color: #cfc6ad; font-size: .78rem; }
.today__tile b { font-size: .98rem; line-height: 1.3; }
.today[lang="ur"], .today[lang="ar"], .today[lang="fa"] { font-family: var(--ur-font), var(--ui-font); }
@media (max-width: 760px) { .today__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .today__tile { min-height: 84px; } }
html.tv .today { display: none; } /* (TVs have their own rows) */

/* 🎬 Story studio (templates/admin_story.php, assets/js/story-maker.js): shown when "What to make" is Story */
.vm--story [data-vm-group]:not([data-vm-group="what"]), .vm--story .vm__go, .vm--story .vm__presets, .vm--story .vmw, .vm--story [data-vmw-sum],
.vm--story [data-vm-group="what"] .vm__group-body > :not(.vm__kindbox), .vm--story .vm__kindbox .vm__today, .vm--story [data-vm-group="what"] .vm__learn,
.vm--story [data-vm-group="what"] .vm__adv-note, .vm--story .vm__batch, .vm--story .vm__preview, .vm--story .vm__posted, .vm--story .vm__work, .vm--story .vm__done { display: none !important; }
.vm--story [data-vm-group="what"], .vm--story .vm__form.vmw-on .vm__group[data-vm-group="what"], .vm--story [data-vm-group="what"] .vm__group-body { display: block !important; }
.sm { margin-top: 18px; }
.sm__head h2 { margin: 0 0 4px; }
.sm__head h2 small { font: 600 1rem "Noto Nastaliq Urdu", serif; color: var(--muted); margin-inline-start: 8px; }
.sm__head p { margin: 0 0 10px; color: var(--muted); }
.sm__bar, .sm__row, .sm__add, .sm__seek { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.sm__bar { padding: 8px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sm__bar .btn, .sm__add .btn, .sm__row .btn, .sm__media .btn { margin-top: 0; }
.sm__grow { flex: 1 1 180px; }
.sm__saved { font-size: .82rem; color: var(--muted); margin-inline-start: auto; }
.sm__saved.is-bad { color: #b3261e; }
.sm__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 20px; align-items: start; }
@media (max-width: 980px) { .sm__grid { grid-template-columns: 1fr; } .sm__stage { position: static !important; } }
.sm__tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap; }
.sm__tabs button { border: 0; background: none; color: var(--muted); padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; }
.sm__tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold); }
.sm__stage { position: sticky; top: 12px; display: grid; gap: 8px; }
.sm__screen { position: relative; width: 100%; max-height: 72vh; aspect-ratio: 9 / 16; margin: 0 auto; }
.sm__canvas { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; background: #062e22; box-shadow: 0 8px 24px rgb(0 0 0 / .25); display: block; }
.sm__safe { position: absolute; inset: 11% 13% 20% 3%; border: 2px dashed rgb(255 80 80 / .8); border-radius: 8px; pointer-events: none; }
.sm__safe::after { content: "safe area"; position: absolute; top: 4px; left: 6px; font-size: .7rem; color: #ff8080; }
.sm__seek { align-items: center; }
.sm__seek input { flex: 1; }
.sm__seek span { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); }
.sm__icon { width: 40px; height: 40px; border-radius: 50%; border: 0; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1e05; font-size: 1rem; cursor: pointer; }
.sm__status { margin: 0; color: var(--muted); font-size: .9rem; min-height: 1.2em; }
.sm__out { display: grid; gap: 8px; }
.sm__out video { width: 100%; max-height: 60vh; border-radius: 12px; background: #000; }
.sm__checks { list-style: none; margin: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; display: grid; gap: 4px; font-size: .85rem; background: var(--surface); }
.sm__checks .is-error { color: #b3261e; font-weight: 600; }
.sm__box { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px 12px; margin: 0 0 12px; display: grid; gap: 8px; }
.sm__box legend { font-weight: 700; padding: 0 6px; }
.sm label { display: grid; gap: 3px; font-size: .88rem; }
.sm .sm__check, .sm .sm__row > label:has(> input[type="radio"]) { display: flex; gap: 6px; align-items: center; }
.sm input[type="text"], .sm input[type="number"], .sm select, .sm textarea { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; }
.sm input[type="number"] { width: 90px; }
.sm textarea { resize: vertical; }
.sm__hint { color: var(--muted); font-size: .8rem; }
.sm__cast { display: grid; gap: 6px; }
.sm__castrow { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 6px; align-items: center; }
.sm__x { border: 1px solid var(--border); background: var(--surface-2); color: inherit; border-radius: 8px; padding: 2px 8px; cursor: pointer; }
.sm__timeline { display: flex; gap: 2px; align-items: stretch; height: 34px; margin-bottom: 10px; }
.sm__tl { min-width: 22px; border: 0; border-radius: 6px; cursor: pointer; font-size: .9rem; background: var(--surface-2); }
.sm__tl--shot { background: #f4dfb5; } .sm__tl--intro, .sm__tl--says { background: #cfe8dc; } .sm__tl--recite, .sm__tl--qari { background: #f6e3a0; }
.sm__tl--card, .sm__tl--device { background: #d9e2f5; } .sm__tl--end { background: #e8d6f0; }
.sm__tl-total { align-self: center; font-size: .8rem; color: var(--muted); padding-inline-start: 6px; font-variant-numeric: tabular-nums; }
.sm__scenes { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; counter-reset: sm; }
.sm__scene { border: 1px solid var(--border); border-inline-start: 4px solid var(--gold); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; background: var(--surface); counter-increment: sm; }
.sm__scene-head { display: flex; gap: 6px; align-items: center; }
.sm__scene-head b::before { content: counter(sm) " · "; color: var(--muted); }
.sm__scene-head .sm__when { color: var(--muted); font-size: .8rem; margin-inline-end: auto; }
.sm__scene-head button { border: 1px solid var(--border); background: var(--surface-2); color: inherit; border-radius: 8px; padding: 2px 8px; cursor: pointer; }
.sm__scene-body { display: grid; gap: 8px; }
.sm__times { display: grid; gap: 4px; }
.sm__times div { display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.sm__times span { min-width: 80px; }
.sm__times input { width: 80px !important; }
.sm__times button { border: 1px solid var(--border); background: var(--surface-2); color: inherit; border-radius: 8px; padding: 1px 8px; cursor: pointer; }
.sm__media { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; }
.sm__mi { margin: 0; border: 1px solid var(--border); border-radius: 10px; padding: 6px; display: grid; gap: 4px; font-size: .8rem; }
.sm__mi img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }
.sm__mi audio { width: 100%; }
.sm__mi small { display: block; color: var(--muted); }
.sm__cover { width: 100%; max-width: 280px; border-radius: 10px; border: 1px solid var(--border); }

/* 📖 Quran text (Settings, the reader's bar): Arabic + translation (as always), Arabic only, or the translation only.
   The text stays in the page (search engines, copy); only what is shown changes. The Mushaf with no line translation
   chosen keeps its Arabic in "translation only", so a page is never empty. */
.qmode select {
  appearance: none; -webkit-appearance: none; border: 1px solid var(--border); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23b8963f' stroke-width='3' d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  color: var(--text); padding: 7px 26px 7px 10px; border-radius: 8px; font: inherit; font-size: .86rem; cursor: pointer; max-width: 200px;
}
.qmode select:focus { outline: none; border-color: var(--gold); }
@media (max-width: 640px) { .reader-nav__inner:has(.qmode) { flex-wrap: wrap; row-gap: 6px; } .reader-nav .qmode { order: 9; flex: 1 1 100%; } .qmode select { width: 100%; max-width: none; font-size: .8rem; padding: 5px 24px 5px 10px; } }
html.qm-ar .verse__tr, html.qm-ar .mushaf-tr { display: none !important; }
html.qm-tr .verse__ar { display: none !important; }
html.qm-ar .verse__body, html.qm-tr .verse__body { display: block !important; }
html.qm-ar .verse__ar { border-left: 0 !important; padding-left: 0 !important; }
html.qm-tr .verse__tr { margin: 6px 0 10px !important; padding: 0 !important; border: 0 !important; }
html.qm-tr .verse__tr + .verse__tr { padding-top: 10px !important; border-top: 1px dashed var(--border) !important; }
html.qm-tr .mushaf-page:has(.mushaf-tr) .mushaf-line { display: none; }
html.qm-tr .mushaf-page:has(.mushaf-tr) .mushaf-tr { font-size: calc(var(--tr-size, 1rem) * 1.08); margin: 6px 0; }

/* 🎙 a hadith read aloud by the site's own voice (Voice Studio) */
.hadith__voice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0 4px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--accent-soft); font-size: .85rem; }
.hadith__voice-by { font-weight: 700; }
.hadith__voice-one { display: inline-flex; align-items: center; gap: 6px; }
.hadith__voice audio { height: 32px; max-width: 240px; }
.sm__postboxes { display: grid; gap: 8px; }
.sm__postboxes .vm__ytres { margin: 0; }
/* 🎬 admin/story: the Story maker's own page; the video maker's form is there only as its engine (Voice Studio, posting) */
.vm--story-page .vm__form, .vm--story-page .vm__batch, .vm--story-page .vm__work, .vm--story-page .vm__done { display: none !important; }
.vm--story-page .sm { margin-top: 0; }
/* 📺 Channel tools (admin/channel) */
.ct__lead { color: var(--muted, inherit); margin: 0 0 12px; }
.ct__conn { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 14px; }
.ct__tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ct__tabs button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.ct__tabs button[aria-selected="true"] { background: #1d8a4e; border-color: #1d8a4e; color: #fff; }
.ct__panel h2 { font-size: 1.15rem; margin: 4px 0 8px; }
.ct__qpick { margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct__qpick [aria-pressed="true"] { background: #1d8a4e; border-color: #1d8a4e; color: #fff; }
.ct__qopt { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.ct__qopt.is-right { border-color: #1d8a4e; background: color-mix(in srgb, #1d8a4e 10%, var(--surface)); }
.ct__posted { overflow-x: auto; }
.ct__table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.ct__table th, .ct__table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ct__table td:nth-child(3), .ct__table td:nth-child(4) { text-align: right; white-space: nowrap; }
.ct__badge { padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, #d9822b 18%, var(--surface)); }
.ct .vm__upd-row input[type="search"], .ct .vm__upd-row input[type="text"] { min-width: 200px; padding: 7px 10px; }

/* 🎞 Video maker › My own video clip › Several scenes */
.vm__clip-multi{margin:.6rem 0}.vm__clip-multi summary{cursor:pointer;font-weight:600}.vm__clip-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:.2rem .8rem;max-height:260px;overflow:auto;padding:.3rem 0}.vm__clip-grid label{font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.vm__first-comment{margin-top:.6rem;padding:.6rem;border:1px dashed currentColor;border-radius:.5rem}.vm__first-comment pre{white-space:pre-wrap;margin:.4rem 0 0;font:inherit}
