/* ختم جمعی قرآن — styles. RTL-first, mobile-first, light + dark. */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- color palettes (ported from the Mesbah study site): emerald, ocean, lilac, sunset, graphite × day/night ---------- */
:root {
  --danger: #b33a3a;
  --danger-soft: #fbeaea;
  --radius: 20px;
  --radius-sm: 14px;
  --bg: #f3f7f5;
  --card: #ffffff;
  --soft: #e9f1ed;
  --soft2: #dfe9e4;
  --line: rgba(16,40,34,.10);
  --text: #10231f;
  --muted: #56695f;
  --accent: #0f766e;
  --accent-deep: #0b4f4a;
  --accent-deep-fixed: #0b4f4a;
  --accent-soft: rgba(15,118,110,.11);
  --gold: #d9a13b;
  --gold-2: #d8ae4b;
  --gold-ink: #0b4f4a;
  --gold-text: #7a5410;
  --ring: #e4b653;
  --held: color-mix(in srgb, var(--gold) 82%, black);
  --held-soft: color-mix(in srgb, var(--gold) 17%, var(--card));
  --ok-soft: color-mix(in srgb, var(--accent) 10%, var(--card));
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(217,161,59,.30), transparent 55%), linear-gradient(160deg, #0f766e 0%, #0b4f4a 70%, #093f3b 100%);
  --hero-shadow: 0 24px 50px -28px color-mix(in srgb, #0b4f4a 85%, transparent);
  --glass: rgba(255, 255, 255, .86);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -18px rgba(0,0,0,.22);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --danger: #e27b7b;
  --danger-soft: #3a1c1c;
  --bg: #0a1311;
  --card: #101d1a;
  --soft: #152622;
  --soft2: #1b302b;
  --line: rgba(255,255,255,.07);
  --text: #e6f2ee;
  --muted: #93aca5;
  --accent: #14a194;
  --accent-deep: #7fdcd1;
  --accent-deep-fixed: #0b4a45;
  --accent-soft: rgba(45,212,191,.13);
  --gold: #e3b04b;
  --gold-2: #d8ae4b;
  --gold-ink: #0a1311;
  --gold-text: #e9c16f;
  --ring: #e3b04b;
  --held: color-mix(in srgb, var(--gold) 82%, white);
  --held-soft: color-mix(in srgb, var(--gold) 20%, var(--card));
  --ok-soft: color-mix(in srgb, var(--accent) 16%, var(--card));
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(227,176,75,.22), transparent 55%), linear-gradient(160deg, #0e6a62 0%, #0b4a45 70%, #07302d 100%);
  --hero-shadow: 0 24px 50px -28px color-mix(in srgb, #0b4a45 85%, transparent);
  --glass: color-mix(in srgb, var(--card) 88%, transparent);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 32px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}
:root[data-palette="ocean"] {
  --bg: #f2f6fd;
  --card: #ffffff;
  --soft: #e7eefb;
  --soft2: #dbe5f7;
  --line: rgba(15,30,70,.09);
  --text: #0e1a33;
  --muted: #5b6883;
  --accent: #2563eb;
  --accent-deep: #1e3a8a;
  --accent-deep-fixed: #1e3a8a;
  --accent-soft: rgba(37,99,235,.10);
  --gold: #06b6d4;
  --gold-2: #22d3ee;
  --gold-ink: #083344;
  --gold-text: #0e7490;
  --ring: #67e8f9;
  --held: color-mix(in srgb, var(--gold) 82%, black);
  --held-soft: color-mix(in srgb, var(--gold) 17%, var(--card));
  --ok-soft: color-mix(in srgb, var(--accent) 10%, var(--card));
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(34,211,238,.28), transparent 55%), linear-gradient(160deg, #2563eb 0%, #1e3a8a 70%, #172554 100%);
  --hero-shadow: 0 24px 50px -28px color-mix(in srgb, #1e3a8a 85%, transparent);
  --glass: rgba(255, 255, 255, .86);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -18px rgba(0,0,0,.22);
  color-scheme: light;
}
:root[data-palette="ocean"][data-theme="dark"] {
  --bg: #080d1a;
  --card: #0f172b;
  --soft: #152039;
  --soft2: #1b2946;
  --line: rgba(255,255,255,.07);
  --text: #e5ecfa;
  --muted: #93a1c0;
  --accent: #3b82f6;
  --accent-deep: #93c5fd;
  --accent-deep-fixed: #1e3a8a;
  --accent-soft: rgba(56,189,248,.13);
  --gold: #38bdf8;
  --gold-2: #22d3ee;
  --gold-ink: #082f49;
  --gold-text: #7dd3fc;
  --ring: #38bdf8;
  --held: color-mix(in srgb, var(--gold) 82%, white);
  --held-soft: color-mix(in srgb, var(--gold) 20%, var(--card));
  --ok-soft: color-mix(in srgb, var(--accent) 16%, var(--card));
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(56,189,248,.22), transparent 55%), linear-gradient(160deg, #1d4ed8 0%, #1e3a8a 70%, #0b1533 100%);
  --hero-shadow: 0 24px 50px -28px color-mix(in srgb, #1e3a8a 85%, transparent);
  --glass: color-mix(in srgb, var(--card) 88%, transparent);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 32px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}
:root[data-palette="lilac"] {
  --bg: #f7f4fd;
  --card: #ffffff;
  --soft: #efe9fb;
  --soft2: #e5dcf7;
  --line: rgba(40,20,80,.09);
  --text: #1d1233;
  --muted: #6c6286;
  --accent: #7c3aed;
  --accent-deep: #4c1d95;
  --accent-deep-fixed: #4c1d95;
  --accent-soft: rgba(124,58,237,.10);
  --gold: #ec4899;
  --gold-2: #f472b6;
  --gold-ink: #ffffff;
  --gold-text: #be185d;
  --ring: #f9a8d4;
  --held: color-mix(in srgb, var(--gold) 82%, black);
  --held-soft: color-mix(in srgb, var(--gold) 17%, var(--card));
  --ok-soft: color-mix(in srgb, var(--accent) 10%, var(--card));
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(236,72,153,.28), transparent 55%), linear-gradient(160deg, #7c3aed 0%, #4c1d95 70%, #2e1065 100%);
  --hero-shadow: 0 24px 50px -28px color-mix(in srgb, #4c1d95 85%, transparent);
  --glass: rgba(255, 255, 255, .86);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -18px rgba(0,0,0,.22);
  color-scheme: light;
}
:root[data-palette="lilac"][data-theme="dark"] {
  --bg: #100b1c;
  --card: #19122c;
  --soft: #21183a;
  --soft2: #2a1f48;
  --line: rgba(255,255,255,.07);
  --text: #efe8fc;
  --muted: #a89dc6;
  --accent: #8b5cf6;
  --accent-deep: #c4b5fd;
  --accent-deep-fixed: #4c1d95;
  --accent-soft: rgba(192,132,252,.14);
  --gold: #f472b6;
  --gold-2: #c084fc;
  --gold-ink: #ffffff;
  --gold-text: #f9a8d4;
  --ring: #f0abfc;
  --held: color-mix(in srgb, var(--gold) 82%, white);
  --held-soft: color-mix(in srgb, var(--gold) 20%, var(--card));
  --ok-soft: color-mix(in srgb, var(--accent) 16%, var(--card));
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(244,114,182,.22), transparent 55%), linear-gradient(160deg, #6d28d9 0%, #4c1d95 70%, #1e0b3b 100%);
  --hero-shadow: 0 24px 50px -28px color-mix(in srgb, #4c1d95 85%, transparent);
  --glass: color-mix(in srgb, var(--card) 88%, transparent);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 32px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}
:root[data-palette="sunset"] {
  --bg: #fdf6f1;
  --card: #ffffff;
  --soft: #fbece3;
  --soft2: #f6dfd1;
  --line: rgba(80,30,10,.09);
  --text: #2b160c;
  --muted: #7c6258;
  --accent: #ea580c;
  --accent-deep: #9a3412;
  --accent-deep-fixed: #9a3412;
  --accent-soft: rgba(234,88,12,.10);
  --gold: #e11d48;
  --gold-2: #f43f5e;
  --gold-ink: #ffffff;
  --gold-text: #be123c;
  --ring: #fdba74;
  --held: color-mix(in srgb, var(--gold) 82%, black);
  --held-soft: color-mix(in srgb, var(--gold) 17%, var(--card));
  --ok-soft: color-mix(in srgb, var(--accent) 10%, var(--card));
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(225,29,72,.25), transparent 55%), linear-gradient(160deg, #ea580c 0%, #9a3412 70%, #7c2d12 100%);
  --hero-shadow: 0 24px 50px -28px color-mix(in srgb, #9a3412 85%, transparent);
  --glass: rgba(255, 255, 255, .86);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -18px rgba(0,0,0,.22);
  color-scheme: light;
}
:root[data-palette="sunset"][data-theme="dark"] {
  --bg: #150c08;
  --card: #21130d;
  --soft: #2a1a12;
  --soft2: #352117;
  --line: rgba(255,255,255,.07);
  --text: #fbece3;
  --muted: #bb9d90;
  --accent: #f97316;
  --accent-deep: #fdba74;
  --accent-deep-fixed: #9a3412;
  --accent-soft: rgba(253,186,116,.13);
  --gold: #fb7185;
  --gold-2: #fdba74;
  --gold-ink: #450a0a;
  --gold-text: #fda4af;
  --ring: #fdba74;
  --held: color-mix(in srgb, var(--gold) 82%, white);
  --held-soft: color-mix(in srgb, var(--gold) 20%, var(--card));
  --ok-soft: color-mix(in srgb, var(--accent) 16%, var(--card));
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(251,113,133,.22), transparent 55%), linear-gradient(160deg, #c2410c 0%, #9a3412 70%, #431407 100%);
  --hero-shadow: 0 24px 50px -28px color-mix(in srgb, #9a3412 85%, transparent);
  --glass: color-mix(in srgb, var(--card) 88%, transparent);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 32px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}
:root[data-palette="graphite"] {
  --bg: #f4f4f5;
  --card: #ffffff;
  --soft: #ececee;
  --soft2: #e2e2e5;
  --line: rgba(0,0,0,.08);
  --text: #18181b;
  --muted: #6b6b74;
  --accent: #27272a;
  --accent-deep: #09090b;
  --accent-deep-fixed: #18181b;
  --accent-soft: rgba(24,24,27,.07);
  --gold: #65a30d;
  --gold-2: #84cc16;
  --gold-ink: #ffffff;
  --gold-text: #4d7c0f;
  --ring: #a3e635;
  --held: color-mix(in srgb, var(--gold) 82%, black);
  --held-soft: color-mix(in srgb, var(--gold) 17%, var(--card));
  --ok-soft: color-mix(in srgb, var(--accent) 10%, var(--card));
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(163,230,53,.22), transparent 55%), linear-gradient(160deg, #3f3f46 0%, #18181b 70%, #09090b 100%);
  --hero-shadow: 0 24px 50px -28px color-mix(in srgb, #18181b 85%, transparent);
  --glass: rgba(255, 255, 255, .86);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -18px rgba(0,0,0,.22);
  color-scheme: light;
}
:root[data-palette="graphite"][data-theme="dark"] {
  --bg: #0b0b0c;
  --card: #151517;
  --soft: #1c1c1f;
  --soft2: #242428;
  --line: rgba(255,255,255,.07);
  --text: #ededef;
  --muted: #9c9ca6;
  --accent: #52525b;
  --accent-deep: #d4d4d8;
  --accent-deep-fixed: #18181b;
  --accent-soft: rgba(163,230,53,.12);
  --gold: #a3e635;
  --gold-2: #bef264;
  --gold-ink: #1a2e05;
  --gold-text: #bef264;
  --ring: #a3e635;
  --held: color-mix(in srgb, var(--gold) 82%, white);
  --held-soft: color-mix(in srgb, var(--gold) 20%, var(--card));
  --ok-soft: color-mix(in srgb, var(--accent) 16%, var(--card));
  --hero: radial-gradient(120% 90% at 100% 0%, rgba(163,230,53,.18), transparent 55%), linear-gradient(160deg, #3f3f46 0%, #18181b 70%, #050505 100%);
  --hero-shadow: 0 24px 50px -28px color-mix(in srgb, #18181b 85%, transparent);
  --glass: color-mix(in srgb, var(--card) 88%, transparent);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 14px 32px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.5; margin: 0; }
p { margin: 0; }
.ic { flex-shrink: 0; }
.inline { display: inline; margin: 0; }
.skip { position: absolute; right: -9999px; top: 8px; background: var(--card); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { right: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; padding: 10px 12px 0; }
.topbar__inner {
  max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 14px;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px 12px; min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand:hover { color: var(--text); }
.brand__mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff;
}
:root[data-theme="dark"] .brand__mark { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.brand__text strong { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__text small { font-size: 11.5px; color: var(--muted); }
.topnav { display: none; gap: 4px; margin-inline-start: 8px; }
.topnav a { color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 12px; }
.topnav a:hover { background: var(--soft); color: var(--text); }
.topnav a.is-active { background: var(--accent-soft); color: var(--accent); }
.topbar__tools { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.iconbtn:hover { background: var(--soft); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; }

/* ---------- layout ---------- */
.main { max-width: 1120px; margin: 0 auto; padding: 18px 14px 110px; }
.main--bare { padding: 0; max-width: none; }
.section { margin-top: 26px; }
.section__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section__head h2 { font-size: 18px; font-weight: 800; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(1, minmax(0, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card--soft { background: var(--soft); box-shadow: none; }
.card h2 { font-size: 17px; font-weight: 800; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 2px; transform: rotate(45deg); background: var(--gold); }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 16px 100px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 16px; border: 0; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 15px; text-align: center; text-decoration: none;
  background: var(--accent); color: #fff; transition: filter .15s, transform .05s;
}
.btn:hover { color: #fff; filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn--gold { background: linear-gradient(to left, var(--gold), var(--gold-2)); color: var(--gold-ink); font-weight: 900; }
.btn--gold:hover { color: var(--gold-ink); }
.btn--ghost { background: transparent; color: var(--accent); border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn--soft { background: var(--soft); color: var(--text); }
.btn--soft:hover { background: var(--soft2); color: var(--text); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { color: var(--danger); }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 13.5px; border-radius: 12px; }
.btn--lg { min-height: 58px; font-size: 17px; border-radius: 18px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }
.btnrow > .btn { flex: 1 1 140px; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr; overflow: hidden; border-radius: 26px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero__body { padding: 26px 22px; display: flex; flex-direction: column; gap: 14px; }
.hero__body h1 { font-size: 26px; font-weight: 900; line-height: 1.55; }
.hero__body p { color: var(--muted); font-size: 15.5px; }
.hero__panel {
  position: relative; min-height: 190px; padding: 24px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  background: var(--hero);
}
.hero__panel .pattern { position: absolute; inset: 0; opacity: .13; color: #fff; }
.hero__panel blockquote { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.7; position: relative; }
.hero__panel cite { font-style: normal; font-size: 13px; opacity: .85; position: relative; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--soft); border-radius: 16px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 20px; font-weight: 900; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- khatm cards ---------- */
.kcard { display: flex; flex-direction: column; gap: 10px; color: var(--text); transition: transform .12s, box-shadow .12s; }
.kcard:hover { color: var(--text); transform: translateY(-2px); }
.kcard__top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.kcard__title { font-weight: 800; font-size: 15.5px; line-height: 1.7; }
.kcard__pct { font-weight: 900; color: var(--accent); font-size: 17px; }
.kcard__meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 700; }
.chip--gold { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold-text); }
:root[data-theme="dark"] .chip--gold { color: #f0c76d; }
.chip--muted { background: var(--soft); color: var(--muted); }
.chip--danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- progress ---------- */
.bar { height: 10px; border-radius: 999px; background: var(--soft2); overflow: hidden; display: flex; }
.bar--lg { height: 16px; }
.bar__done { background: linear-gradient(to left, var(--accent), #14907f); }
.bar__held { background: repeating-linear-gradient(135deg, var(--held) 0 3px, var(--held-soft) 3px 7px); }
.legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.legend__item { display: flex; flex-direction: column; gap: 2px; }
.legend__label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.legend__value { font-size: 17px; font-weight: 900; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.sw--done { background: var(--accent); }
.sw--held { background: repeating-linear-gradient(135deg, var(--held) 0 2px, var(--held-soft) 2px 4px); }
.sw--free { background: var(--card); border: 1.5px solid var(--muted); }
.sw--mine { background: var(--card); border: 2.5px solid var(--gold); }
.bigpct { font-size: 44px; font-weight: 900; color: var(--accent); line-height: 1.2; }

/* ---------- khatm page ---------- */
.khead { display: flex; flex-direction: column; gap: 8px; }
.khead h1 { font-size: 24px; font-weight: 900; }
.khead__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 14px; }
.cta { display: flex; flex-direction: column; gap: 10px; }
.myshare { border: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--card)); }
.namefield { display: flex; flex-direction: column; gap: 6px; }
.recent { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.recent li { display: flex; justify-content: space-between; gap: 10px; }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* unit map */
.juzgroup { border-top: 1px solid var(--line); }
.juzgroup:first-of-type { border-top: 0; }
.juzgroup > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 2px; min-height: 48px;
}
.juzgroup > summary::-webkit-details-marker { display: none; }
.juzgroup > summary .strip { flex: 1; display: flex; gap: 2px; height: 8px; }
.juzgroup > summary .strip i { flex: 1; border-radius: 2px; background: var(--soft2); }
.juzgroup > summary .strip i.d { background: var(--accent); }
.juzgroup > summary .strip i.h { background: var(--held); }
.juzgroup > summary .strip i.m { background: var(--gold); }
.juzgroup__name { font-weight: 800; min-width: 62px; }
.juzgroup__free { font-size: 12.5px; color: var(--muted); min-width: 64px; text-align: left; }
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; padding: 4px 0 14px; }
.units--wide { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.unit {
  min-height: 48px; border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--muted) 55%, transparent); background: var(--card);
  font: inherit; font-weight: 800; font-size: 13.5px; color: var(--text); cursor: pointer; padding: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.3;
}
.unit small { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.unit:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-soft); }
.unit--done { background: var(--accent); border-color: var(--accent); color: #fff; cursor: default; }
.unit--done small { color: rgba(255, 255, 255, .85); }
.unit--held { background: repeating-linear-gradient(135deg, var(--held-soft) 0 5px, var(--card) 5px 10px); border-color: var(--held); color: var(--gold-text); cursor: default; }
:root[data-theme="dark"] .unit--held { color: #f0d39c; }
.unit--mine { border: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--card)); }
.unit[disabled] { opacity: 1; }

/* ---------- share page ---------- */
.sharebig { font-size: 30px; font-weight: 900; line-height: 1.45; }
.timer { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--held-soft); color: var(--gold-text); font-weight: 600; }
:root[data-theme="dark"] .timer { color: #f0d39c; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fact { background: var(--soft); border-radius: 14px; padding: 10px 12px; }
.fact span { display: block; font-size: 12px; color: var(--muted); }
.fact b { font-size: 14.5px; }
.copybox { display: flex; gap: 8px; align-items: stretch; }
.copybox input { flex: 1; min-width: 0; direction: ltr; text-align: left; font-size: 13px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-weight: 700; font-size: 14px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea, .copybox input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--soft); color: var(--text); font: inherit; font-size: 15px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 4px var(--accent-soft); }
.input--ltr { direction: ltr; text-align: right; }
.choices { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); min-height: 48px;
}
.choice span b { font-size: 14.5px; }
.choice span small { color: var(--muted); font-size: 12.5px; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
details.advanced { border: 1px dashed var(--line); border-radius: 16px; padding: 4px 14px; background: var(--card); }
details.advanced > summary { cursor: pointer; font-weight: 800; padding: 10px 0; min-height: 44px; display: flex; align-items: center; }
details.advanced[open] > summary { margin-bottom: 8px; }
.errors { background: var(--danger-soft); color: var(--danger); border-radius: 14px; padding: 12px 16px; }
.errors ul { margin: 0; padding-inline-start: 18px; }

/* ---------- flashes ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.main--bare .flashes { position: fixed; top: 12px; inset-inline: 12px; z-index: 30; max-width: 560px; margin: 0 auto; }
.flash { padding: 12px 16px; border-radius: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.flash--success { background: var(--ok-soft); color: var(--accent-deep); }
.flash--error { background: var(--danger-soft); color: var(--danger); }
.flash--info { background: var(--soft); }

/* ---------- auth (split card like the reference) ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth__card {
  width: 100%; max-width: 980px; display: grid; grid-template-columns: 1fr; overflow: hidden;
  background: var(--card); border-radius: 28px; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.auth__form { padding: 30px 24px; display: flex; flex-direction: column; gap: 18px; }
.auth__form h1 { font-size: 26px; font-weight: 900; }
.auth__panel {
  position: relative; min-height: 200px; padding: 28px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  background: var(--hero);
}
.auth__panel .pattern { position: absolute; inset: 0; opacity: .12; color: #fff; }
.auth__panel h2 { font-size: 26px; font-weight: 900; line-height: 1.6; position: relative; }
.auth__panel p { position: relative; opacity: .9; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.tabs a { text-align: center; padding: 12px; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; }
.tabs a.is-active { color: var(--accent-deep); border-color: var(--gold); }
:root[data-theme="dark"] .tabs a.is-active { color: var(--accent); }
.line-input { position: relative; }
.line-input .ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.line-input .input { padding-right: 42px; }

/* ---------- done page ---------- */
.done {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 40px 20px; text-align: center; position: relative; overflow: hidden;
  background: var(--hero); color: #f3f7f5;
}
.done .pattern { position: absolute; width: 520px; height: 520px; top: -160px; opacity: .1; color: #fff; }
.done h1 { font-size: 52px; font-weight: 900; position: relative; }
.done p { font-size: 19px; font-weight: 700; max-width: 520px; position: relative; }
.done .stats { width: 100%; max-width: 480px; position: relative; }
.done .stat { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.done .stat b { color: #fff; }
.done .stat span { color: #cfe6e2; }
.done .next { padding: 8px 18px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-weight: 800; position: relative; }
.done__actions { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.done .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.done .btn--ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- tables (admin/manage) ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 700; font-size: 12.5px; }

/* ---------- bottom nav (mobile) ---------- */
.bottomnav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 4px 0; min-height: 48px; justify-content: center; }
.bottomnav a.is-active { color: var(--accent); }
.bottomnav__add .ic { background: linear-gradient(to left, var(--gold), var(--gold-2)); color: var(--gold-ink); border-radius: 12px; padding: 6px; width: 36px; height: 36px; }
.bottomnav .dot { background: var(--accent); color: #fff; border-radius: 8px; padding: 0 5px; font-size: 10px; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 26px 16px; color: var(--muted); }
.empty .star { color: var(--accent); opacity: .5; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar .input, .toolbar .select { flex: 1 1 160px; }
.undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.share-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ---------- desktop ---------- */
@media (min-width: 760px) {
  body { font-size: 15.5px; }
  .topnav { display: flex; }
  .bottomnav { display: none; }
  .footer { padding-bottom: 30px; }
  .main { padding: 24px 20px 40px; }
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1.2fr 1fr; }
  .hero__body { padding: 40px 36px; }
  .hero__body h1 { font-size: 34px; }
  .hero__panel { min-height: 100%; }
  .auth__card { grid-template-columns: 1fr 1fr; min-height: 560px; }
  .auth__form { padding: 44px 44px; justify-content: center; }
  .auth__panel { order: 2; }
  .choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choices--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .khatm-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
  .share-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kv { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* compact header on small phones */
@media (max-width: 480px) {
  .brand__text small { display: none; }
  .brand__text strong { font-size: 14.5px; }
  .brand__mark { width: 38px; height: 38px; border-radius: 12px; }
  .topbar__inner { gap: 8px; padding: 7px 10px; }
  .login-long { display: none; }
}
@media (min-width: 481px) { .login-short { display: none; } }

/* =====================================================================
   Quran reader
   ===================================================================== */
@font-face {
  font-family: "UthmanicHafs";
  src: url("../fonts/UthmanicHafs-v13.woff2") format("woff2");
  font-display: swap;
}
:root { --paper: #fffdf7; --paper-line: #eadcb8; --hl: #fbefcf; --q-size: 26px; }
:root[data-theme="dark"] { --paper: color-mix(in srgb, var(--card) 94%, #c8962e); --paper-line: color-mix(in srgb, #c8962e 30%, var(--card)); --hl: color-mix(in srgb, #e3b04b 22%, var(--card)); }
.quran-text, .mushaf .ar, .mushaf .flow, .basmala, .surah-frame__name, .sitem__ar, .sresult .ar, .aend {
  font-family: "UthmanicHafs", "Amiri Quran", "Scheherazade New", serif;
  font-feature-settings: normal;
}

.reader { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.rhead { display: flex; flex-direction: column; gap: 12px; }
.rhead__top { display: flex; align-items: center; gap: 12px; }
.rhead__title { flex: 1 1 auto; min-width: 0; }
.rhead__title h1 { font-size: 21px; font-weight: 900; }
.rjump { display: flex; gap: 8px; }
.rjump .input { flex: 1 1 auto; min-height: 44px; }
.rsettings__grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.rsettings__grid + .rsettings__grid { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 14px; padding: 4px; gap: 4px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: grid; place-items: center; min-height: 40px; border-radius: 11px; font-size: 13.5px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 6px; cursor: pointer; }
.seg input:checked + span { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 3px solid var(--gold); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper output { min-width: 34px; text-align: center; font-weight: 800; }
.stepper .btn { min-width: 44px; font-size: 20px; }

.mushaf {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--paper-line); padding: 8px 16px 18px;
  outline: 1px solid var(--paper-line); outline-offset: -7px;
}
.mushaf .ayah { scroll-margin-top: 96px; scroll-margin-bottom: 120px; }
div.ayah { padding: 14px 4px 16px; border-bottom: 1px solid var(--line); border-radius: 14px; transition: background .25s; }
div.ayah:last-child { border-bottom: 0; }
.ayah__bar { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.anum {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit;
  font-size: 12px; font-weight: 800; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 3px 10px 3px 9px; min-height: 28px;
}
.anum:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.mushaf .ar { font-size: var(--q-size); line-height: 2.15; color: var(--text); margin: 2px 0 6px; word-spacing: 1px; }
.mushaf .tr { font-size: 15px; line-height: 2; color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.aend { color: var(--accent); white-space: nowrap; font-size: 1em; }
.sajda { display: inline-block; font-family: "Vazirmatn", sans-serif; font-size: 11.5px; font-weight: 800; color: var(--danger); background: var(--danger-soft); border-radius: 999px; padding: 1px 9px; vertical-align: middle; line-height: 1.9; }

.reader--flow .mushaf { padding: 10px 20px 22px; }
.flow { font-size: var(--q-size); line-height: 2.35; text-align: justify; text-align-last: center; margin: 6px 0 10px; }
span.ayah { border-radius: 8px; cursor: pointer; transition: background .25s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (hover: hover) { span.ayah:hover { background: color-mix(in srgb, var(--hl) 55%, transparent); } }
.ayah.is-playing, .ayah.is-selected { background: var(--hl); }
div.ayah.is-playing { box-shadow: inset -4px 0 0 var(--gold); }

.surah-head { padding: 18px 0 6px; }
.surah-frame {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  border: 2px solid var(--gold); border-radius: 16px; padding: 10px 14px 8px; position: relative;
  background: linear-gradient(to left, color-mix(in srgb, var(--gold) 12%, transparent), color-mix(in srgb, var(--gold) 4%, transparent), color-mix(in srgb, var(--gold) 12%, transparent));
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px color-mix(in srgb, var(--gold) 55%, transparent);
}
.surah-frame__name { font-size: 26px; line-height: 1.8; color: var(--accent-deep); }
.surah-frame__meta { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.basmala { text-align: center; font-size: calc(var(--q-size) * .95); line-height: 2.2; color: var(--text); padding: 4px 0 2px; }
.pagesep, .juzsep { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.pagesep::before, .pagesep::after { content: ""; flex: 1; border-top: 1px dashed var(--paper-line); }
.juzsep { justify-content: center; }
.juzsep span { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold-text); border-radius: 999px; padding: 3px 12px; }
:root[data-theme="dark"] .juzsep span { color: var(--held); }
.rsource { margin-top: 2px; }
.rpager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rdone { border: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--card)); }

/* player */
.player {
  position: fixed; z-index: 30; inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
}
.player__inner {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 22px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .45);
}
.player__btns { display: flex; align-items: center; gap: 4px; }
.player__main {
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(to left, var(--gold), var(--gold-2)); color: var(--gold-ink);
}
.player__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.player__info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__info small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .iconbtn { width: 40px; height: 40px; }
.anum::after { content: ""; border-style: solid; border-width: 5px 0 5px 7px; border-color: transparent transparent transparent currentColor; }
body.has-player .main { padding-bottom: 120px; }
body.no-bottomnav .footer { padding-bottom: 110px; }

/* index */
.qhero { display: flex; flex-direction: column; gap: 14px; background:
  radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 55%), var(--card); }
.qhero h1 { font-size: 28px; font-weight: 900; }
.qsearch { display: flex; gap: 8px; }
.qsearch .input { flex: 1 1 auto; min-width: 0; }
.resume { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.qtabs { margin-top: 18px; }
.qtabs > input { position: absolute; opacity: 0; pointer-events: none; }
.qtabs__bar { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--soft); border-radius: 16px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.qtabs__bar label { display: grid; place-items: center; min-height: 42px; border-radius: 12px; font-weight: 800; color: var(--muted); cursor: pointer; }
#tab-s:checked ~ .qtabs__bar label[for="tab-s"], #tab-j:checked ~ .qtabs__bar label[for="tab-j"], #tab-p:checked ~ .qtabs__bar label[for="tab-p"] { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }
#tab-s:focus-visible ~ .qtabs__bar label[for="tab-s"], #tab-j:focus-visible ~ .qtabs__bar label[for="tab-j"], #tab-p:focus-visible ~ .qtabs__bar label[for="tab-p"] { outline: 3px solid var(--gold); }
.qtab { display: none; }
#tab-s:checked ~ .qtab--s, #tab-j:checked ~ .qtab--j, #tab-p:checked ~ .qtab--p { display: block; }
.qfilter { margin-bottom: 10px; }
.slist, .jlist { display: grid; grid-template-columns: 1fr; gap: 8px; }
.sitem, .jitem {
  display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 10px 12px;
  color: var(--text); box-shadow: var(--shadow); border: 1px solid transparent; transition: border-color .15s, transform .15s;
}
.sitem:hover, .jitem:hover { border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); transform: translateY(-1px); }
.sitem[hidden] { display: none; }
.sitem__num, .jitem__num {
  position: relative; z-index: 0; width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: var(--accent-deep);
}
.sitem__num::before, .jitem__num::before {
  content: ""; position: absolute; inset: 6px; z-index: -1; border-radius: 7px; transform: rotate(45deg);
  background: var(--soft); border: 1.5px solid color-mix(in srgb, var(--gold) 55%, transparent);
}
.sitem__body, .jitem > span:last-child { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.6; }
.sitem__body small, .jitem small { color: var(--muted); font-size: 12.5px; }
.sitem__ar { font-size: 20px; color: var(--accent-deep); white-space: nowrap; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; margin-top: 14px; max-height: 420px; overflow: auto; padding: 2px; }
.pgrid a { display: grid; place-items: center; min-height: 40px; border-radius: 10px; background: var(--soft); color: var(--text); font-size: 13px; font-weight: 700; }
.pgrid a:hover { background: var(--accent-soft); color: var(--accent); }
.qtab--p .row label { font-weight: 700; }

/* search */
.sresult { display: flex; flex-direction: column; gap: 8px; color: var(--text); align-items: flex-start; }
.sresult:hover { color: var(--text); border-color: var(--accent); }
.sresult .ar { font-size: 24px; line-height: 2.1; }
.sresult .tr { color: var(--muted); line-height: 1.95; }
mark { background: var(--hl); color: inherit; border-radius: 4px; padding: 0 2px; }

@media (min-width: 760px) {
  :root { --q-size: 30px; }
  .rsettings__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mushaf { padding: 14px 34px 26px; }
  .reader--flow .mushaf { padding: 18px 44px 30px; }
  .slist { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .jlist { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qhero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 28px; }
  .qhero .resume { grid-column: 1 / -1; }
  .player { bottom: 16px; }
}
.readbtn { flex-wrap: wrap; min-height: 60px; padding: 8px 20px; row-gap: 0; }
.readbtn small { width: 100%; font-size: 12px; font-weight: 600; opacity: .85; margin-top: -4px; }
.qpromo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--text);
  background: radial-gradient(120% 160% at 0% 100%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 60%), var(--card); }
.qpromo:hover { color: var(--text); }
.qpromo__ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: #fff; flex-shrink: 0; }
.qpromo__body { display: flex; flex-direction: column; flex: 1 1 200px; line-height: 1.7; }
.qpromo__body b { font-size: 16.5px; }
.qpromo__body small { color: var(--muted); }
@media (max-width: 480px) { .qpromo .btn { width: 100%; } }

/* =====================================================================
   Mushaf reader (v1.5, Tanzil-style): large single page + sidebar
   ===================================================================== */
:root { --frame: #c8962e; --frame-2: var(--accent); --paper-2: #f6eedb; --qfs: clamp(25px, 1.5vw + 19px, 34px); }
:root[data-theme="dark"] { --frame: #b8903e; --frame-2: var(--accent); --paper-2: color-mix(in srgb, var(--card) 85%, black); }
@media (max-width: 999px) { .only-wide { display: none !important; } }
@media (min-width: 1000px) { .only-narrow { display: none !important; } }
.rbar { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; }
.rbar__row { display: flex; align-items: center; gap: 8px; }
.rbar__title { flex: 1 1 auto; min-width: 0; }
.rbar__title h1 { font-size: 18px; font-weight: 900; line-height: 1.5; }
.rbar__title p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rbar .iconbtn { width: 42px; height: 42px; }

.reader--mushaf { max-width: 1120px; }
.rlayout { display: flex; flex-direction: column; gap: 12px; }
.rmain { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.rside { display: flex; flex-direction: column; gap: 12px; }
.rbox { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px 14px; box-shadow: var(--shadow); }
.rbox__h { display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 900; color: var(--accent-deep); margin: 0 0 10px; }
.rbox__h .ic { color: var(--gold); }
.rbox .select, .rbox .input { min-height: 42px; padding: 6px 12px; font-size: 14.5px; border-radius: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rbrowse { display: flex; flex-direction: column; gap: 8px; }
.rbrowse__row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; }
.rbrowse__row label { font-size: 13.5px; font-weight: 800; color: var(--muted); }
.pstep { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px auto; gap: 6px; }
.pstep .btn { min-height: 42px; padding: 0 10px; }
.pstep .input { text-align: center; padding: 6px 4px; }
.radios { display: flex; flex-direction: column; gap: 2px; }
.radio { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 8px; border-radius: 10px; cursor: pointer; font-size: 14.5px; }
.radio:hover { background: var(--soft); }
.radio input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.radio:has(input:checked) { background: var(--accent-soft); font-weight: 800; }
.stepper { flex-wrap: wrap; }
.stepper output { min-width: 52px; }
@media (min-width: 1000px) {
  .rlayout { display: grid; grid-template-columns: 270px minmax(0, 1fr); align-items: start; gap: 18px; }
  .rside[hidden] { display: flex !important; }
  .rside { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 4px; }
  .rbar__settings { display: none; }
}

/* the page */
.book { display: flex; flex-direction: column; gap: 22px; }
.mpage {
  position: relative; background: var(--paper); border-radius: 12px; padding: 10px 12px 12px;
  box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 18px 40px -26px rgba(60, 40, 0, .45);
  background-image: radial-gradient(130% 90% at 50% 40%, transparent 55%, color-mix(in srgb, var(--paper-2) 80%, transparent) 100%);
  transition: transform .18s ease, opacity .18s ease;
}
.mpage__head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 2px 6px 8px; color: var(--muted); font-size: 13px; font-weight: 700; min-height: 36px; }
.mpage__surah { justify-self: start; color: var(--accent-deep); font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mpage__juz { justify-self: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mpage__nav { display: flex; align-items: center; gap: 8px; }
.mpage__nav b { color: var(--text); font-weight: 900; white-space: nowrap; }
.mpage__nav a { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.mpage__nav a:hover { background: var(--accent); color: #fff; }
.mpage__frame {
  position: relative; padding: 26px 30px;
  border: 2px solid var(--frame); border-radius: 4px;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4.5px var(--frame-2), inset 0 0 0 7px var(--paper), inset 0 0 0 8px color-mix(in srgb, var(--frame) 70%, transparent);
  background:
    url("../img/medallion.svg") top 3px right 3px / 22px no-repeat,
    url("../img/medallion.svg") top 3px left 3px / 22px no-repeat,
    url("../img/medallion.svg") bottom 3px right 3px / 22px no-repeat,
    url("../img/medallion.svg") bottom 3px left 3px / 22px no-repeat;
}
.mpage__body { font-family: "UthmanicHafs", serif; font-size: calc(var(--qfs) * var(--qz, 1)); line-height: 2.3; color: var(--text); }
.mtext { margin: 0; text-align: justify; text-align-last: center; word-spacing: .03em; }
.mpage--open .mpage__body { padding: 2% 6%; }
.mpage--open .mpage__frame { border-radius: 40% 40% 6px 6px / 9% 9% 6px 6px; padding-top: 44px; }
.mpage__num { display: flex; justify-content: center; padding-top: 8px; }
.mpage__num span { min-width: 42px; text-align: center; font-size: 13px; font-weight: 800; color: var(--accent-deep); border: 1.5px solid var(--frame); border-radius: 999px; padding: 0 12px; background: var(--paper); }

.sband {
  position: relative; display: grid; place-items: center; height: 2.05em; margin: .35em .2em .2em;
  border: .055em solid var(--frame); border-radius: .3em;
  background: linear-gradient(90deg, color-mix(in srgb, var(--frame) 22%, var(--paper)), var(--paper) 30%, var(--paper) 70%, color-mix(in srgb, var(--frame) 22%, var(--paper)));
  box-shadow: inset 0 0 0 .1em var(--paper), inset 0 0 0 .15em color-mix(in srgb, var(--frame-2) 70%, transparent);
}
.sband::before, .sband::after { content: ""; position: absolute; top: 50%; width: 1.55em; height: 1.55em; transform: translateY(-50%); background: url("../img/medallion.svg") center / contain no-repeat; }
.sband::before { right: .35em; }
.sband::after { left: .35em; }
.sband__name { font-size: .9em; line-height: 1; color: var(--accent-deep); padding-top: .1em; }
.sband__meta { display: none; }
.mbasmala { text-align: center; line-height: 2.1; }

.mpage span.ayah { border-radius: .25em; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background .2s, opacity .2s; scroll-margin-top: 100px; scroll-margin-bottom: 140px; }
@media (hover: hover) { .mpage span.ayah:hover, .mpage span.ayah.is-hover { background: color-mix(in srgb, var(--hl) 70%, transparent); } }
.mpage span.ayah.is-out { opacity: .3; cursor: default; }
.mpage span.ayah.is-out:hover { background: none; }
.mpage span.ayah.is-selected, .mpage span.ayah.is-playing, .mpage span.ayah.is-target { background: var(--hl); }
.mpage span.ayah.is-playing { box-shadow: 0 .08em 0 var(--frame); }
.ayah.is-sajda .aend { color: var(--danger); }
.mpage--out { opacity: .55; }
.book.turn-next .mpage { transform: translateX(18px); opacity: .5; }
.book.turn-prev .mpage { transform: translateX(-18px); opacity: .5; }

/* translation under each ayah */
.ayrow { padding: .1em 0 .45em; border-bottom: 1px dashed var(--paper-line); }
.ayrow:last-child { border-bottom: 0; }
.ayrow .mtext { text-align: right; text-align-last: auto; }
.ayrow .tritem { font-family: "AbarFa", "Vazirmatn", Tahoma, sans-serif; font-size: calc(16.5px * (1 + (var(--qz, 1) - 1) * .5)); line-height: 2.05; color: color-mix(in srgb, var(--text) 84%, var(--muted)); margin: 0 0 .15em; padding: 2px 6px; border-radius: 10px; transition: background .2s; }
.ayrow .tritem b { display: none; }
.ayrow--out { opacity: .4; }
.ayrow:has(.ayah.is-playing) .tritem, .ayrow:has(.ayah.is-selected) .tritem { background: color-mix(in srgb, var(--hl) 55%, transparent); }

/* tooltip on hover (Tanzil "translate on mouse over") */
.qtip {
  position: absolute; z-index: 40; width: max-content; max-width: min(480px, calc(100vw - 24px));
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: 14px; padding: 7px 14px 9px; box-shadow: 0 18px 44px -16px rgba(0, 0, 0, .45); pointer-events: none;
  animation: qtip-in .12s ease;
}
.qtip b { display: block; font-size: 12px; font-weight: 900; color: var(--accent-deep); line-height: 1.8; }
.qtip p { margin: 0; font-size: 15.5px; line-height: 2; }
@keyframes qtip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* fixed translation box (Tanzil "fixed translation box") */
.trbox {
  position: sticky; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 5;
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 18px;
  padding: 8px 14px 12px; box-shadow: 0 -12px 36px -20px rgba(0, 0, 0, .4); max-height: 36vh; overflow-y: auto;
}
.trbox__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trbox__top b { font-size: 14px; font-weight: 900; color: var(--accent-deep); }
.trbox__top small { font-size: 12px; }
.trbox .iconbtn { width: 36px; height: 36px; }
.trbox__text { margin: 2px 0 0; font-size: 16.5px; line-height: 2.05; }
body.has-player .trbox { bottom: calc(92px + env(safe-area-inset-bottom)); }

.trpanel__list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tritem { line-height: 2; font-size: 14.5px; }
.tritem b { display: inline-block; font-size: 11.5px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0 9px; margin-inline-end: 4px; }

.asheet { position: fixed; z-index: 31; inset-inline: 10px; bottom: calc(92px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; animation: sheet-in .2s ease; }
.asheet__inner { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 20px; padding: 12px 14px 14px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.asheet__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asheet__tr { line-height: 2.05; font-size: 16px; }
@keyframes sheet-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 600px) {
  .reader .main, .reader { gap: 10px; }
  .mpage { padding: 6px 5px 8px; border-radius: 8px; }
  .mpage__head { font-size: 11.5px; padding: 0 4px 6px; gap: 4px; }
  .mpage__nav { gap: 4px; }
  .mpage__nav a { width: 28px; height: 28px; }
  .mpage__frame { padding: 16px 13px; }
  .mpage--open .mpage__frame { padding-top: 30px; }
  .mpage__body { line-height: 2.2; }
}
@media (max-width: 759px) {
  body.is-reader .topbar { display: none; }
  body.is-reader .main { padding-top: 10px; }
}
.rpager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* =====================================================================
   Khatm landing (v1.2): hero with progress ring, quick claim
   ===================================================================== */
.khero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 18px 18px 16px; color: #fff; margin-bottom: 14px;
  background:
    radial-gradient(90% 80% at 0% 100%, rgba(255, 255, 255, .08), transparent 60%),
    var(--hero);
  box-shadow: var(--hero-shadow);
}
.khero::before { content: ""; position: absolute; inset: 0; background: url("../img/girih.svg") center / 64px repeat; opacity: .08; pointer-events: none; }
.khero > * { position: relative; }
.khero__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chip--glass { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px); max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn--glass { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); color: #fff; }
.iconbtn--glass:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.khero__main { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.khero__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.khero__text h1 { font-size: 23px; font-weight: 900; line-height: 1.55; }
.khero__meta { font-size: 13.5px; opacity: .88; }
.khero__people { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: .85; }
.ring { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg) scaleY(-1); }
.ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring__bg { stroke: rgba(255, 255, 255, .14); }
.ring__held { stroke: rgba(246, 226, 180, .55); }
.ring__done { stroke: var(--ring); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ring) 50%, transparent)); animation: ring-in 1.1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ring-in { from { stroke-dasharray: 0 327; } }
.ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.3; }
.ring__label b { font-size: 26px; font-weight: 900; }
.ring__label small { font-size: 11px; opacity: .8; }
.khero__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.khero__stats > div { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; }
.khero__stats b { font-size: 17px; font-weight: 900; }
.khero__stats span { grid-column: 1 / -1; font-size: 11.5px; opacity: .8; }
.khero .sw--free { background: transparent; border-color: rgba(255, 255, 255, .7); }
.khero .sw--done { background: var(--ring); }
.khero .sw--held { background: repeating-linear-gradient(135deg, #f6e2b4 0 2px, transparent 2px 4px); }

.kcta { display: flex; flex-direction: column; gap: 10px; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.btn--stack { flex-direction: column; gap: 0; line-height: 1.5; padding-top: 10px; padding-bottom: 10px; min-height: 64px; }
.btn--stack small { font-size: 12.5px; font-weight: 700; opacity: .8; }
.btn--gold { box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--gold) 90%, black); }
.namefield__row { display: flex; gap: 10px; align-items: center; }
.namefield__row .input { flex: 1 1 auto; min-width: 0; }
.namefield__row .check { min-height: 0; white-space: nowrap; }

.kinvite h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.invite-preview { background: var(--soft); border-radius: 14px; padding: 10px 14px; font-size: 13.5px; line-height: 1.95; color: var(--text); border-inline-start: 3px solid var(--gold); overflow-wrap: anywhere; }
.share-actions--2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

.claimbar {
  position: fixed; z-index: 24; inset-inline: 10px; bottom: calc(74px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px; border-radius: 20px;
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .45); animation: sheet-in .2s ease;
}
.claimbar__info { display: flex; flex-direction: column; line-height: 1.35; padding-inline-start: 8px; }
.claimbar__info b { font-size: 17px; color: var(--accent); font-weight: 900; }
.claimbar__info small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.myshare { box-shadow: 0 14px 30px -22px color-mix(in srgb, var(--gold) 85%, black); }

@media (min-width: 760px) {
  .claimbar { display: none !important; }
  .khero { padding: 26px 30px 22px; }
  .khero__text h1 { font-size: 30px; }
  .ring { width: 150px; height: 150px; }
  .ring__label b { font-size: 34px; }
  .khero__stats { max-width: 560px; }
}
:root[data-theme="dark"] .khero { background:
    var(--hero); }

/* share page (v1.2) */
.shero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 20px 20px 18px; color: #fff; display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  background: var(--hero);
  box-shadow: var(--hero-shadow);
}
.shero::before { content: ""; position: absolute; inset: 0; background: url("../img/girih.svg") center / 64px repeat; opacity: .08; pointer-events: none; }
.shero > * { position: relative; }
.shero__label { font-size: 34px; font-weight: 900; line-height: 1.4; margin-top: 4px; }
.shero__detail { font-size: 15px; opacity: .92; }
.shero__facts { display: flex; gap: 8px; flex-wrap: wrap; }
.shero__facts span { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 2px 12px; font-size: 13px; font-weight: 700; }
.shero__timer { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 10px 14px; border-radius: 14px; background: rgba(0, 0, 0, .16); font-weight: 700; font-size: 14px; }
.sactions { gap: 12px; }
.khero__stats b small { font-size: 11px; font-weight: 700; opacity: .8; }

/* identity (v1.3): dedication to Shahid Mesbah al-Hoda Bagheri */
.brand__mark--portrait { padding: 0; overflow: hidden; background: var(--card) !important; box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 4px color-mix(in srgb, var(--gold) 45%, transparent); }
.brand__mark--portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shahid { color: #dc2626; font-style: normal; }
:root[data-theme="dark"] .shahid { color: #f87171; }
.footer a { color: inherit; }
.footer a:hover { color: var(--accent); }
.hero__panel--shahid { color: #fff; justify-content: center; align-items: center; text-align: center; gap: 8px; padding: 28px 22px; }
.hero__panel--shahid:hover { color: #fff; }
.hero__portrait { position: relative; width: 104px; height: 104px; border-radius: 50%; padding: 4px; background: linear-gradient(135deg, #f3d58a, #c8962e); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .55); }
.hero__portrait img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; border: 3px solid var(--accent-deep-fixed); }
.hero__ded { position: relative; font-size: 20px; font-weight: 900; }
.hero__dedsub { position: relative; font-size: 13px; opacity: .85; max-width: 340px; line-height: 1.9; }
.shahid--light { color: #fecaca; }
.hero__panel--shahid blockquote { font-size: 19px; margin-top: 6px; }
.hero__panel--shahid cite u { text-decoration: none; border-bottom: 1px dashed rgba(255, 255, 255, .6); }
.shahid-page { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.mt-hero { position: relative; overflow: hidden; border-radius: 26px; padding: 30px 22px 26px; color: #fff; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--hero); box-shadow: var(--hero-shadow); }
.mt-hero::before { content: ""; position: absolute; inset: 0; background: url("../img/girih.svg") center / 64px repeat; opacity: .08; pointer-events: none; }
.mt-hero > * { position: relative; }
.mt-hero__portrait { width: 132px; height: 132px; }
.mt-hero h1 { font-size: 24px; font-weight: 900; }
.mt-hero p { opacity: .88; }
.mt-h { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 900; color: var(--accent-deep); }
.mt-facts { margin: 0; display: grid; gap: 10px; }
.mt-facts > div { background: var(--soft); border-radius: 14px; padding: 10px 14px; }
.mt-facts dt { font-weight: 900; color: var(--accent); font-size: 13.5px; }
.mt-facts dd { margin: 2px 0 0; line-height: 2; }
.mt-dedic { text-align: center; border-radius: 22px; padding: 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--gold) 12%, var(--card)); border: 1.5px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.mt-dedic .ic { color: var(--held); }
.mt-dedic h2 { font-size: 19px; font-weight: 900; }
.mt-dedic p { line-height: 2.1; max-width: 620px; }
.mt-dedic b { color: var(--accent-deep); }

/* =====================================================================
   v1.4: dedication ribbon, appearance panel, salawat counter
   ===================================================================== */
.dedic {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 7px 14px; color: #fff;
  background: var(--hero); font-size: 12.5px; font-weight: 600; line-height: 1.8; text-align: center; position: relative; overflow: hidden;
}
.dedic::before { content: ""; position: absolute; inset: 0; background: url("../img/girih.svg") center / 44px repeat; opacity: .07; pointer-events: none; }
.dedic > * { position: relative; }
.dedic:hover { color: #fff; }
.dedic b { color: var(--ring); font-weight: 900; }
.dedic__faces { display: inline-flex; flex-shrink: 0; }
.dedic__faces img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ring); background: #fff; }
.dedic__faces img + img { margin-inline-start: -9px; }
.dedic__text { max-width: 820px; }

/* appearance */
.apanel { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px); animation: fade-in .18s ease; }
.apanel__box { width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .6); display: flex; flex-direction: column; gap: 14px; }
.apanel__head { display: flex; align-items: center; justify-content: space-between; }
.apanel__head h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 900; }
.apanel__head h2 .ic { color: var(--accent); }
.apanel__mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--soft); border-radius: 14px; padding: 4px; }
.apanel__mode button { border: 0; background: transparent; font: inherit; font-weight: 800; color: var(--muted); min-height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.apanel__mode button.on { background: var(--card); color: var(--text); box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .2); }
.apanel__mode button.on .ic { color: var(--accent); }
.apanel__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pal-card { border: 1.5px solid var(--line); background: var(--card); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; cursor: pointer; font: inherit; color: var(--text); text-align: right; transition: border-color .15s, background .15s; }
.pal-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.pal-card.on { border-color: var(--accent); background: var(--accent-soft); }
.pal-previews { display: flex; gap: 6px; width: 100%; }
.pal-mini { flex: 1; height: 46px; border-radius: 10px; padding: 6px; display: flex; border: 1px solid rgba(0, 0, 0, .06); }
.pal-mini i { flex: 1; border-radius: 6px; display: flex; align-items: flex-end; gap: 4px; padding: 4px; }
.pal-mini b { width: 45%; height: 8px; border-radius: 4px; }
.pal-mini em { width: 22%; height: 8px; border-radius: 4px; }
.pal-name { font-weight: 900; display: flex; align-items: center; gap: 6px; }
.pal-name .ic { color: var(--accent); opacity: 0; transform: scale(.5); transition: opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.pal-card.on .pal-name .ic { opacity: 1; transform: none; }
.pal-desc { font-size: 12px; color: var(--muted); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* salawat counter */
.slw { position: fixed; z-index: 26; left: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: calc(100vw - 28px); }
.slw__pill { display: flex; align-items: stretch; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .45); overflow: visible; }
.slw__open { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; font: inherit; color: var(--text); padding: 6px 12px 6px 10px; cursor: pointer; border-radius: 999px; }
.slw__open .ic { color: #e11d48; }
.slw__open b { font-size: 14px; font-weight: 900; color: var(--accent-deep); }
.slw__open small { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.slw__pill form { display: flex; }
.slw__plus { position: relative; border: 0; cursor: pointer; font: inherit; font-weight: 900; font-size: 14px; min-width: 46px; border-radius: 999px; margin: 3px; color: var(--gold-ink); background: linear-gradient(to left, var(--gold), var(--gold-2)); }
.slw__plus:active, .slw__tap:active { transform: scale(.96); }
.slw__panel { width: 280px; max-width: calc(100vw - 28px); background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 12px; box-shadow: 0 24px 50px -22px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 10px; animation: sheet-in .2s ease; }
.slw__head { display: flex; align-items: center; gap: 8px; }
.slw__head .dedic__faces img { width: 30px; height: 30px; border-color: var(--gold); }
.slw__title { flex: 1; min-width: 0; line-height: 1.5; }
.slw__title b { font-size: 14px; font-weight: 900; display: block; }
.slw__title small { font-size: 11px; color: var(--muted); display: block; }
.slw__close { width: 32px; height: 32px; border-radius: 10px; }
.slw__total { text-align: center; background: var(--hero); color: #fff; border-radius: 16px; padding: 10px; display: flex; flex-direction: column; line-height: 1.5; }
.slw__total b { font-size: 28px; font-weight: 900; }
.slw__total span { font-size: 12px; opacity: .85; }
.slw__tap { position: relative; width: 100%; border: 0; cursor: pointer; font: inherit; border-radius: 16px; padding: 10px; color: var(--gold-ink); background: linear-gradient(to left, var(--gold), var(--gold-2)); display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--gold) 90%, black); transition: transform .08s; }
.slw__tap span { font-family: "UthmanicHafs", serif; font-size: 18px; line-height: 1.9; }
.slw__tap small { font-size: 11.5px; font-weight: 800; opacity: .8; }
.slw__many { display: flex; gap: 6px; }
.slw__many .input { min-height: 40px; flex: 1; min-width: 0; font-size: 14px; }
.slw__mine { text-align: center; }
.slw__burst { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); color: var(--accent); font-weight: 900; font-size: 15px; pointer-events: none; animation: burst .9s ease forwards; }
@keyframes burst { to { transform: translate(-50%, -36px); opacity: 0; } }
.slw[data-msg]::after { content: attr(data-msg); position: absolute; bottom: calc(100% + 8px); left: 0; width: 240px; background: var(--text); color: var(--bg); font-size: 12px; padding: 8px 10px; border-radius: 12px; }
body.has-player .slw { bottom: calc(96px + env(safe-area-inset-bottom)); }
body.has-claimbar .slw { bottom: calc(150px + env(safe-area-inset-bottom)); }
body.is-bare .slw { display: none; }
@media (min-width: 760px) {
  .slw { left: 18px; bottom: 18px; }
  body.has-player .slw { bottom: 100px; }
  .dedic { font-size: 13.5px; padding: 8px 16px; }
  .dedic__faces img { width: 34px; height: 34px; }
}
@media (max-width: 380px) { .slw__open small { display: none; } }

/* home hero: dedication photo */
.hero__panel--photo { padding: 0; min-height: 300px; justify-content: flex-end; background: #0b1110; }
.hero__panel--photo img.hero__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.hero__panel--photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--accent-deep-fixed) 96%, black) 0%, color-mix(in srgb, var(--accent-deep-fixed) 70%, transparent) 38%, transparent 70%); }
.hero__caption { position: relative; z-index: 1; padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 6px; text-align: center; align-items: center; }
.hero__caption .hero__ded { font-size: 17px; line-height: 1.9; }
.hero__caption .hero__ded b { color: var(--ring); }
.hero__caption small { font-size: 12.5px; opacity: .88; }
.hero__caption blockquote { font-size: 18px; }

.ded-photo { margin: 0; position: relative; border-radius: 26px; overflow: hidden; box-shadow: var(--hero-shadow); background: #0b1110; }
.ded-photo img { width: 100%; height: auto; display: block; aspect-ratio: 1400 / 932; object-fit: cover; }
.ded-photo figcaption { position: absolute; inset-inline: 0; bottom: 0; padding: 40px 20px 16px; color: #fff; text-align: center; font-weight: 700; line-height: 1.9; font-size: 14.5px;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent-deep-fixed) 95%, black), transparent); }
.ded-photo figcaption b { color: var(--ring); }

/* floating mobile tab bar (like the Mesbah study site) */
@media (max-width: 759px) {
  .bottomnav {
    inset-inline: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 6px; gap: 2px; border-radius: 22px;
    background: var(--card); border: 1px solid var(--line); box-shadow: 0 16px 36px -14px rgba(0, 0, 0, .38);
  }
  .bottomnav a { border-radius: 16px; min-height: 52px; font-size: 10.5px; gap: 3px; }
  .bottomnav a.is-active { background: var(--accent-soft); color: var(--text); }
  .bottomnav a.is-active .ic { color: var(--accent); }
  .bottomnav__add .ic { width: 34px; height: 34px; }
  .slw { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .claimbar { bottom: calc(86px + env(safe-area-inset-bottom)); }
  body.has-claimbar .slw { bottom: calc(160px + env(safe-area-inset-bottom)); }
}
.section__head h2 { display: flex; align-items: center; gap: 8px; }
.section__head h2::before { content: ""; width: 14px; height: 14px; flex-shrink: 0; background: var(--gold); -webkit-mask: url("../img/medallion.svg") center / contain no-repeat; mask: url("../img/medallion.svg") center / contain no-repeat; }
.card { transition: box-shadow .2s, border-color .2s; }
.kcard:hover { box-shadow: 0 18px 40px -24px color-mix(in srgb, var(--accent) 60%, transparent); }
/* keep accent-coloured text readable on every night palette */
:root[data-theme="dark"] .btn--ghost, :root[data-theme="dark"] .eyebrow, :root[data-theme="dark"] a:not([class]),
:root[data-theme="dark"] .section__head a, :root[data-theme="dark"] .chip:not(.chip--gold):not(.chip--glass):not(.chip--danger) { color: var(--accent-deep); }
:root[data-theme="dark"] .btn--ghost { border-color: color-mix(in srgb, var(--accent-deep) 35%, transparent); }
