/* ==========================================================================
   সহজে কুরআন শিখি — design system
   ========================================================================== */
/* Quran text: King Fahd Complex Uthmanic Hafs font (matches the KFGQPC-encoded Quran data) */
@font-face { font-family: "KFGQPC Hafs"; src: url("../fonts/kfgqpc-hafs.woff2") format("woff2"); font-display: swap; }
/* Lesson Arabic: Scheherazade New (SIL, OFL) — large, clear harakat, Indo-Pak marks */
@font-face { font-family: "Scheherazade New"; font-weight: 400; src: url("../fonts/scheherazade-new-arabic-400-normal.woff2") format("woff2"); font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC; }
@font-face { font-family: "Scheherazade New"; font-weight: 700; src: url("../fonts/scheherazade-new-arabic-700-normal.woff2") format("woff2"); font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC; }
:root {
  --bg: #f6f2e8;
  --bg-2: #efe8d8;
  --surface: #ffffff;
  --surface-2: #fbf8f1;
  --surface-3: #f3eee2;
  --ink: #13211c;
  --ink-2: #2c3a34;
  --muted: #66736d;
  --line: #e6dfcf;
  --line-2: #d9d0bc;
  --brand: #0b5d45;
  --brand-2: #0f7a5b;
  --brand-3: #e3f1ea;
  --brand-ink: #ffffff;
  --gold: #c99a3a;
  --gold-2: #a87c22;
  --gold-soft: #f6ecd3;
  --success: #15803d;
  --success-soft: #dcf3e3;
  --danger: #c2410c;
  --danger-soft: #fde5d8;
  --info: #1d4ed8;
  --info-soft: #e0e9fd;
  --warn: #b45309;
  --warn-soft: #fdf0d5;
  --shadow-sm: 0 1px 2px rgba(19, 33, 28, .06), 0 1px 1px rgba(19, 33, 28, .04);
  --shadow: 0 10px 30px -12px rgba(19, 33, 28, .18), 0 2px 6px rgba(19, 33, 28, .05);
  --shadow-lg: 0 30px 60px -20px rgba(11, 61, 45, .35);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --font: "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Scheherazade New", "Traditional Arabic", serif;
  --font-quran: "KFGQPC Hafs", "Scheherazade New", serif;
  /* Tajweed colours (light theme) */
  --tj-ghunnah: #15803d; --tj-ikhfa: #c2410c; --tj-idgham: #7e22ce; --tj-iqlab: #1d4ed8;
  --tj-qalqala: #0e7490; --tj-madd: #db2777; --tj-madd-long: #b91c1c; --tj-silent: #9aa3af;
  /* Harakat tag colours */
  --sg-a: #dc2626; --sg-i: #2563eb; --sg-u: #16a34a; --sg-tan: #9333ea; --sg-suk: #0e7490; --sg-shad: #ea580c; --sg-madd: #b45309; --sg-long: #b45309;
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23c99a3a' stroke-opacity='.16' stroke-width='1'%3E%3Crect x='22' y='22' width='36' height='36'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3Cpath d='M0 40h22M58 40h22M40 0v22M40 58v22'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="sepia"]) {
    --bg: #0b1411; --bg-2: #0e1a16; --surface: #12201b; --surface-2: #162720; --surface-3: #1b2f27;
    --ink: #eaf1ed; --ink-2: #cad6d0; --muted: #93a49c; --line: #233830; --line-2: #2e463c;
    --brand: #1f9e74; --brand-2: #2bb889; --brand-3: #133a2d; --gold: #e0b65a; --gold-2: #f0c96f; --gold-soft: #2e2716;
    --success: #34d399; --success-soft: #11372a; --danger: #fb923c; --danger-soft: #3a2015; --info: #93b4ff; --info-soft: #172544; --warn: #fbbf24; --warn-soft: #382a10;
    --shadow: 0 10px 30px -12px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.3); --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1411; --bg-2: #0e1a16; --surface: #12201b; --surface-2: #162720; --surface-3: #1b2f27;
  --ink: #eaf1ed; --ink-2: #cad6d0; --muted: #93a49c; --line: #233830; --line-2: #2e463c;
  --brand: #1f9e74; --brand-2: #2bb889; --brand-3: #133a2d; --gold: #e0b65a; --gold-2: #f0c96f; --gold-soft: #2e2716;
  --success: #34d399; --success-soft: #11372a; --danger: #fb923c; --danger-soft: #3a2015; --info: #93b4ff; --info-soft: #172544; --warn: #fbbf24; --warn-soft: #382a10;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.3); --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* "Eye comfort" reading theme: warm paper tones, lower contrast */
:root[data-theme="sepia"] {
  --bg: #efe4cc; --bg-2: #e8dbbd; --surface: #f8efdb; --surface-2: #f3e8cf; --surface-3: #ebdec0;
  --ink: #3b2c17; --ink-2: #4c3b23; --muted: #7a6748; --line: #e0d0ad; --line-2: #d3c09a;
  --brand: #7a4f12; --brand-2: #946119; --brand-3: #f0e0bd; --gold: #a8741f; --gold-2: #8a5d15; --gold-soft: #f1e1b8;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.22em; }
.ar, [lang="ar"] { font-family: var(--font-ar); direction: rtl; }
.ar-inline { font-family: var(--font-ar); font-size: 1.3em; line-height: 1.2; color: var(--brand); padding: 0 .15em; unicode-bidi: isolate; }
.quran-text { font-family: var(--font-ar); direction: rtl; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--surface); --b-ink: var(--ink); --b-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid var(--b-line); background: var(--b-bg); color: var(--b-ink);
  font-weight: 600; font-size: .98rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: var(--b-ink); box-shadow: var(--shadow-sm); border-color: var(--brand); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { --b-bg: var(--brand); --b-ink: var(--brand-ink); --b-line: transparent; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn-primary:hover { --b-bg: var(--brand-2); color: #fff; }
.btn-gold { --b-bg: linear-gradient(135deg, #d9ac4b, #b8862a); --b-ink: #1d1503; --b-line: transparent; background: linear-gradient(135deg, #e2b75a, #b8862a); }
.btn-gold:hover { color: #1d1503; filter: brightness(1.05); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { --b-bg: var(--surface-3); box-shadow: none; border-color: transparent; }
.btn-danger { --b-ink: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn-success { --b-bg: var(--success); --b-ink: #fff; --b-line: transparent; }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: 1.08rem; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-round { border-radius: 999px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.hint { font-size: .82rem; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s;
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.6; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.input-group { position: relative; }
.input-group .icon-left { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-group .input { padding-left: 44px; }
.input-group .toggle-pass { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.input.ar { font-family: var(--font-ar); font-size: 1.25rem; text-align: right; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card-lg { padding: 28px; border-radius: var(--radius-lg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3, .card-head h2 { margin: 0; }
.card-link { display: block; color: inherit; transition: transform .2s, box-shadow .2s, border-color .2s; }
.card-link:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.pill-brand { background: var(--brand-3); color: var(--brand); }
.pill-gold { background: var(--gold-soft); color: var(--gold-2); }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-info { background: var(--info-soft); color: var(--info); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid; margin-bottom: 16px; font-weight: 500; }
.alert .icon { margin-top: 3px; }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }

.progress { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress.gold > span { background: linear-gradient(90deg, #d9ac4b, #b8862a); }
.progress.thin { height: 6px; }

.ring { --p: 0; --size: 120px; --w: 12px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--ring-color, var(--brand)) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring::before { content: ""; position: absolute; inset: var(--w); border-radius: 50%; background: var(--surface); }
.ring > * { position: relative; text-align: center; line-height: 1.1; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { width: 44px; height: 44px; color: var(--line-2); margin-bottom: 8px; }

/* ---------- Logo ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.08rem; }
.brand:hover { color: var(--ink); }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); margin-top: -2px; }
.logo-img { border-radius: 12px; object-fit: cover; }

/* ==========================================================================
   Student app shell
   ========================================================================== */
.app { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .stats { display: flex; gap: 6px; align-items: center; }
.stat-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .88rem; }
.stat-chip .icon { width: 1.1em; height: 1.1em; }
.stat-chip.flame { color: #ea580c; }
.stat-chip.xp { color: var(--gold-2); }
.main { padding: 20px 16px 110px; max-width: 1120px; width: 100%; margin: 0 auto; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: clamp(1.45rem, 3.5vw, 2rem); }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; color: var(--muted); font-size: .72rem; font-weight: 600; }
.bottom-nav a .icon { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.active .icon { stroke-width: 2.2; }
.bottom-nav a.active::before { content: ""; position: absolute; }

.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--ink-2); font-weight: 600; }
.nav-link .icon { width: 22px; height: 22px; color: var(--muted); }
.nav-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px var(--brand); }
.nav-link.active .icon { color: #fff; }
.nav-sep { height: 1px; background: var(--line); margin: 12px 6px; }

@media (min-width: 960px) {
  .app { grid-template-columns: 264px 1fr; }
  .sidebar { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
  .sidebar .brand { padding: 4px 8px 18px; }
  .bottom-nav { display: none; }
  .topbar .brand { display: none; }
  .topbar { padding: 14px 32px; }
  .main { padding: 28px 32px 60px; }
}
.premium-box { margin-top: auto; padding: 18px; border-radius: 18px; color: #fff; background: radial-gradient(120% 120% at 100% 0%, #1b8a66 0%, #0b4d3b 55%, #083a2c 100%); position: relative; overflow: hidden; }
.premium-box::after { content: ""; position: absolute; inset: 0; background: var(--pattern); opacity: .5; pointer-events: none; }
.premium-box > * { position: relative; }
.premium-box h4 { margin: 6px 0 4px; }
.premium-box p { font-size: .86rem; opacity: .85; margin-bottom: 12px; }

.notice-bar { background: var(--gold-soft); color: var(--gold-2); border-bottom: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); padding: 8px 16px; font-weight: 600; text-align: center; font-size: .92rem; }

/* ---------- Dashboard ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.dash-layout { display: grid; gap: 18px; }
@media (min-width: 1040px) { .dash-layout { grid-template-columns: 1.65fr 1fr; align-items: start; } }

.hero-card {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 26px; color: #fff;
  background: radial-gradient(130% 140% at 100% 0%, #1d9a72 0%, #0b5d45 45%, #073b2c 100%); box-shadow: var(--shadow-lg);
}
.hero-card::before { content: ""; position: absolute; inset: 0; background: var(--pattern); opacity: .55; }
.hero-card > * { position: relative; }
.hero-card .eyebrow { color: #f3d58f; font-weight: 600; font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.hero-card h2 { color: #fff; margin: 6px 0 4px; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.hero-card p { color: rgba(255,255,255,.82); }
.hero-card .btn-light { --b-bg: #fff; --b-ink: #0b4d3b; --b-line: transparent; }
.hero-card .hero-ar { position: absolute; left: 18px; bottom: -14px; font-family: var(--font-ar); font-size: 110px; line-height: 1; color: rgba(255,255,255,.08); pointer-events: none; }
.hero-card .progress { background: rgba(255,255,255,.18); }
.hero-card .progress > span { background: linear-gradient(90deg, #f3d58f, #e0b65a); }

.kpi { display: flex; align-items: center; gap: 14px; }
.kpi .kpi-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.kpi .kpi-icon .icon { width: 24px; height: 24px; }
.kpi b { display: block; font-size: 1.35rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .84rem; color: var(--muted); }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-strip .day { text-align: center; font-size: .74rem; color: var(--muted); font-weight: 600; }
.week-strip .dot { width: 100%; aspect-ratio: 1; max-width: 40px; margin: 4px auto 0; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.week-strip .dot.on { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; }
.week-strip .dot.today { outline: 2px solid var(--brand); outline-offset: 2px; }

.course-card { display: grid; gap: 14px; padding: 18px; }
.course-card .course-top { display: flex; gap: 14px; align-items: center; }
.course-tile { width: 64px; height: 64px; border-radius: 18px; flex: none; display: grid; place-items: center; color: #fff; font-family: var(--font-ar); font-size: 1.15rem; line-height: 1; box-shadow: inset 0 -6px 14px rgba(0,0,0,.18); position: relative; overflow: hidden; }
.course-tile::after { content: ""; position: absolute; inset: 0; background: var(--pattern); opacity: .45; }
.course-tile span { position: relative; }
.course-card h3 { margin: 0; font-size: 1.1rem; }
.course-card p { margin: 0; font-size: .9rem; color: var(--muted); }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge-item { text-align: center; padding: 16px 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.badge-item .medal { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; color: #fff; position: relative; box-shadow: inset 0 -5px 10px rgba(0,0,0,.18), 0 8px 16px -8px currentColor; }
.badge-item .medal::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.45); }
.badge-item .medal .icon { width: 28px; height: 28px; color: #fff; }
.badge-item b { display: block; font-size: .92rem; }
.badge-item span { font-size: .78rem; color: var(--muted); }
.badge-item.locked { opacity: .55; filter: grayscale(1); }
.mini-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-badges .medal { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.mini-badges .medal .icon { width: 20px; height: 20px; color: #fff; }

/* ---------- Course path ---------- */
.course-hero { display: grid; gap: 18px; align-items: center; padding: 24px; border-radius: var(--radius-lg); color: #fff; position: relative; overflow: hidden; margin-bottom: 24px; }
.course-hero::before { content: ""; position: absolute; inset: 0; background: var(--pattern); opacity: .5; }
.course-hero > * { position: relative; }
.course-hero h1 { color: #fff; margin: 0 0 4px; }
.course-hero p { color: rgba(255,255,255,.85); margin: 0; }
.course-hero .progress { background: rgba(255,255,255,.2); }
.course-hero .progress > span { background: #fff; }
@media (min-width: 720px) { .course-hero { grid-template-columns: 1fr auto; padding: 32px; } }

.path { position: relative; display: grid; gap: 12px; max-width: 720px; margin: 0 auto; }
.path::before { content: ""; position: absolute; left: 33px; top: 20px; bottom: 20px; width: 3px; border-radius: 3px; background: repeating-linear-gradient(to bottom, var(--line-2) 0 8px, transparent 8px 14px); }
.step { position: relative; display: flex; align-items: center; gap: 16px; padding: 12px 14px 12px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: inherit; transition: transform .2s, box-shadow .2s; }
a.step:hover { color: inherit; transform: translateX(4px); box-shadow: var(--shadow); }
.step .node { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; z-index: 1; background: var(--surface-3); color: var(--muted); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--line-2); }
.step .node .icon { width: 20px; height: 20px; }
.step.done .node { background: var(--success); color: #fff; box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 40%, transparent); }
.step.open .node { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); animation: pulse 2.2s infinite; }
.step.premium .node { background: var(--gold-soft); color: var(--gold-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 50%, transparent); }
.step.locked { opacity: .62; }
.step.open { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: var(--shadow); }
.step h4 { margin: 0; font-size: 1rem; }
.step p { margin: 0; font-size: .85rem; color: var(--muted); }
.step .step-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); } 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--brand) 8%, transparent); } }

/* ==========================================================================
   Lesson player
   ========================================================================== */
.lesson-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.lesson-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.lesson-top .progress { flex: 1; height: 12px; }
.lesson-steps { display: flex; gap: 6px; justify-content: center; padding: 14px 16px 0; flex-wrap: wrap; }
.lesson-steps button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: .85rem; cursor: pointer; }
.lesson-steps button .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: .72rem; }
.lesson-steps button.active { border-color: var(--brand); color: var(--brand); background: var(--brand-3); }
.lesson-steps button.active .n { background: var(--brand); color: #fff; }
.lesson-steps button.done .n { background: var(--success); color: #fff; }
.lesson-body { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 22px 16px 130px; }
.lesson-foot { position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.lesson-foot .inner { max-width: 860px; margin: 0 auto; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.lesson-title { text-align: center; margin-bottom: 18px; }
.lesson-title .pill { margin-bottom: 8px; }
.lesson-title h1 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); margin: 0; }

.prose { font-size: 1.04rem; line-height: 1.85; }
.prose h3 { margin: 1.4em 0 .5em; color: var(--brand); display: flex; align-items: center; gap: 8px; }
.prose h3::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--gold); }
.prose h4 { margin: 1.2em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--gold-2); font-weight: 700; }
.prose .ar-inline { font-size: 1.45em; }
.callout { display: block; padding: 14px 16px 14px 18px; border-radius: 14px; background: var(--brand-3); border-left: 4px solid var(--brand); margin: 0 0 1em; color: var(--ink-2); }
.callout-warn { background: var(--warn-soft); border-left-color: var(--warn); }
.md-table { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: 14px; }
.md-table table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.md-table th, .md-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.md-table th { background: var(--surface-3); font-weight: 700; font-size: .88rem; }
.md-table tr:last-child td { border-bottom: 0; }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.item-grid.wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.item-card { position: relative; display: grid; gap: 4px; justify-items: center; text-align: center; padding: 18px 10px 14px; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; transition: transform .15s, border-color .2s, box-shadow .2s; user-select: none; -webkit-tap-highlight-color: transparent; }
.item-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: var(--shadow); }
.item-card:active { transform: scale(.97); }
.item-card .glyph { font-family: var(--font-ar); font-size: 3.3rem; line-height: 1.6; color: var(--ink); direction: rtl; }
.item-grid.wide .item-card .glyph { font-size: 2rem; }
.item-card .bn { font-weight: 700; color: var(--brand); }
.item-card .note { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.item-card .play-badge { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-3); color: var(--brand); }
.item-card .play-badge .icon { width: 14px; height: 14px; }
.item-card.playing { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.item-card.playing .glyph { color: var(--brand); }
.item-card.seen::after { content: ""; position: absolute; top: 10px; left: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

.flash-wrap { display: grid; gap: 18px; justify-items: center; }
.flashcard { width: min(100%, 420px); aspect-ratio: 4/3.2; perspective: 1200px; cursor: pointer; }
.flashcard .inner { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.flashcard.flipped .inner { transform: rotateY(180deg); }
.flashcard .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 28px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 20px; text-align: center; border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.flashcard .face.back { transform: rotateY(180deg); background: radial-gradient(120% 120% at 100% 0%, #1d9a72, #0b5d45 60%, #073b2c); color: #fff; border: 0; }
.flashcard .glyph { font-family: var(--font-ar); font-size: clamp(3rem, 14vw, 5rem); line-height: 1.4; direction: rtl; }
.flashcard .face.back .bn { font-size: 2rem; font-weight: 700; }
.flashcard .face.back .note { opacity: .85; }
.flashcard .hint { position: absolute; bottom: 14px; left: 0; right: 0; }

.recorder { display: grid; gap: 12px; padding: 16px; border-radius: 20px; border: 1px dashed var(--line-2); background: var(--surface-2); width: min(100%, 520px); }
.recorder .row { justify-content: center; flex-wrap: wrap; }
.rec-btn { width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #dc2626; color: #fff; cursor: pointer; box-shadow: 0 10px 22px -10px #dc2626; transition: transform .15s; }
.rec-btn .icon { width: 28px; height: 28px; }
.rec-btn.recording { animation: recpulse 1.2s infinite; }
@keyframes recpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 50% { box-shadow: 0 0 0 14px rgba(220,38,38,0); } }
.meter { height: 8px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #eab308, #ef4444); transition: width .08s; }

.quiz-card { max-width: 640px; margin: 0 auto; }
.quiz-q { text-align: center; margin-bottom: 20px; }
.quiz-q .big-ar { font-family: var(--font-ar); font-size: clamp(3.2rem, 13vw, 5rem); line-height: 1.6; direction: rtl; color: var(--ink); }
.quiz-q .big-ar.quran { font-family: var(--font-quran); font-size: clamp(1.7rem, 6vw, 2.4rem); line-height: 2.2; }
.quiz-q h3 { font-size: 1.2rem; line-height: 1.6; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opts.cols-2 { grid-template-columns: repeat(2, 1fr); }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font-weight: 600; font-size: 1.02rem; transition: border-color .15s, background .15s, transform .1s; }
.opt:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.opt:active { transform: scale(.99); }
.opt .key { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-3); font-size: .8rem; color: var(--muted); }
.opt .ar-opt { font-family: var(--font-ar); font-size: 2.1rem; line-height: 1.5; direction: rtl; flex: 1; text-align: center; }
.opt .ar-opt.qfont { font-family: var(--font-quran); font-size: 1.8rem; }
.opt .quran-opt { font-family: var(--font-quran); font-size: 1.45rem; line-height: 2.1; direction: rtl; flex: 1; text-align: right; }
.opt.selected { border-color: var(--brand); background: var(--brand-3); }
.opt.correct { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.opt.correct .key { background: var(--success); color: #fff; }
.opt.wrong { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); animation: shake .35s; }
.opt[disabled] { cursor: default; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.feedback { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.feedback.good { color: var(--success); }
.feedback.bad { color: var(--danger); }

.result { text-align: center; max-width: 520px; margin: 0 auto; display: grid; gap: 16px; justify-items: center; }
.result .ring { --size: 168px; --w: 14px; }
.result .ring b { font-size: 2.4rem; display: block; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.result-stats div { padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.result-stats b { display: block; font-size: 1.3rem; }
.result-stats span { font-size: .8rem; color: var(--muted); }
.new-badge { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 16px; background: var(--gold-soft); color: var(--gold-2); width: 100%; text-align: left; font-weight: 600; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; }

/* ---------- Hifz mode ---------- */
.ayah-list { display: grid; gap: 12px; }
.ayah { border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); padding: 16px 18px; transition: border-color .2s, box-shadow .2s, background .3s; }
.ayah.active { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); background: color-mix(in srgb, var(--brand-3) 40%, var(--surface)); }
.ayah .ayah-ar { font-family: var(--font-quran); font-size: var(--q-size, 2rem); line-height: 2.3; direction: rtl; text-align: right; color: var(--ink); word-spacing: .08em; }
.ayah .ayah-tr { color: var(--ink-2); font-size: .98rem; margin-top: 6px; }
.ayah .ayah-tl { color: var(--muted); font-size: .88rem; font-style: italic; margin-top: 4px; }
.ayah .ayah-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ayah-num { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; background: var(--brand-3); color: var(--brand); font-weight: 700; font-size: .85rem; }
.ayah-end { font-family: var(--font-quran); color: var(--gold-2); font-size: 1em; white-space: nowrap; }
.w { display: inline-block; transition: color .25s, filter .25s, background .25s; border-radius: 6px; padding: 0 2px; }
.w.hide { color: transparent; background: var(--surface-3); filter: blur(0); min-width: 2.2em; }
.w.hide.peek { color: var(--muted); background: transparent; }
.hifz-levels { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface-3); gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font-weight: 600; color: var(--muted); cursor: pointer; font-size: .9rem; }
.seg button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* ==========================================================================
   Quran reader
   ========================================================================== */
.surah-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .surah-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .surah-grid { grid-template-columns: repeat(3, 1fr); } }
.surah-row { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: inherit; transition: border-color .2s, transform .15s; }
.surah-row:hover { color: inherit; border-color: var(--brand); transform: translateY(-1px); }
.surah-no { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: .9rem; color: var(--brand); position: relative; }
.surah-no::before { content: ""; position: absolute; inset: 4px; border: 1.5px solid var(--gold); border-radius: 8px; transform: rotate(45deg); }
.surah-no::after { content: ""; position: absolute; inset: 4px; border: 1.5px solid var(--gold); border-radius: 8px; }
.surah-row .ar-name { font-family: var(--font-ar); font-weight: 700; font-size: 1.5rem; color: var(--brand); margin-left: auto; line-height: 1.4; }
.surah-row h4 { margin: 0; font-size: 1rem; }
.surah-row p { margin: 0; font-size: .8rem; color: var(--muted); }

.reader-head { text-align: center; padding: 26px 18px 22px; border-radius: var(--radius-lg); color: #fff; position: relative; overflow: hidden; margin-bottom: 16px; background: radial-gradient(130% 140% at 50% 0%, #1d9a72 0%, #0b5d45 50%, #073b2c 100%); }
.reader-head::before { content: ""; position: absolute; inset: 0; background: var(--pattern); opacity: .55; }
.reader-head > * { position: relative; }
.reader-head .ar-title { font-family: var(--font-ar); font-weight: 700; font-size: 2.6rem; line-height: 1.6; color: #f3d58f; }
.reader-head h1 { color: #fff; font-size: 1.4rem; margin: 0; }
.reader-head p { margin: 4px 0 0; color: rgba(255,255,255,.8); font-size: .92rem; }
.bismillah { text-align: center; font-family: var(--font-quran); font-size: 2.1rem; color: var(--brand); padding: 10px 0 18px; line-height: 2; }
.reader-tools { position: sticky; top: 61px; z-index: 15; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px; margin-bottom: 14px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); }
@media (min-width: 960px) { .reader-tools { top: 73px; } }
.tool-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--muted); }
.tool-toggle.on { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--brand-3); }
.ayah-actions { display: flex; gap: 4px; }
.ayah-actions .btn { color: var(--muted); }
.ayah-actions .btn.on { color: var(--gold-2); }
.ayah-actions .btn.on .icon { fill: currentColor; }

.player { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 35; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 20px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); max-width: 760px; margin: 0 auto; }
.player .btn { --b-bg: transparent; --b-ink: var(--bg); --b-line: transparent; }
.player .btn:hover { --b-bg: rgba(255,255,255,.1); box-shadow: none; }
:root[data-theme="dark"] .player .btn:hover { --b-bg: rgba(0,0,0,.1); }
.player .play-main { --b-bg: var(--gold); --b-ink: #1d1503; width: 48px; height: 48px; border-radius: 50%; }
.player .play-main:hover { --b-bg: var(--gold-2); }
.player .info { min-width: 0; flex: 1; line-height: 1.3; }
.player .info b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .info span { font-size: .78rem; opacity: .7; }
.player select { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 4px 6px; font: inherit; font-size: .8rem; max-width: 120px; }
.player select option { color: #000; }
@media (min-width: 960px) { .player { bottom: 18px; left: 280px; } }
.player-bar { position: absolute; left: 18px; right: 18px; bottom: 4px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; }
.player-bar span { display: block; height: 100%; width: 0; background: var(--gold); }

/* ==========================================================================
   Toast & modal
   ========================================================================== */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 600; animation: toastIn .3s cubic-bezier(.2,.8,.2,1); }
.toast.gold { background: linear-gradient(135deg, #e2b75a, #b8862a); color: #1d1503; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 20, 16, .55); backdrop-filter: blur(4px); z-index: 150; display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; }
.modal { background: var(--surface); border-radius: 22px; padding: 24px; width: min(100%, 460px); box-shadow: var(--shadow-lg); animation: toastIn .25s; }
@keyframes fadeIn { from { opacity: 0; } }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-art { display: none; position: relative; overflow: hidden; color: #fff; padding: 48px; background: radial-gradient(130% 120% at 0% 0%, #1d9a72 0%, #0b5d45 45%, #062f24 100%); }
.auth-art::before { content: ""; position: absolute; inset: 0; background: var(--pattern); opacity: .6; }
.auth-art > * { position: relative; }
.auth-art .big { font-family: var(--font-ar); font-size: clamp(2.4rem, 4vw, 3.4rem); line-height: 1.9; color: #f3d58f; direction: rtl; }
.auth-form { display: grid; place-items: center; padding: 28px 16px; }
.auth-form .box { width: min(100%, 420px); }
.auth-form h1 { font-size: 1.7rem; margin: 22px 0 6px; }
@media (min-width: 960px) { .auth { grid-template-columns: 1.05fr 1fr; } .auth-art { display: flex; flex-direction: column; justify-content: space-between; } }

/* ==========================================================================
   Landing page
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.site-nav { display: none; gap: 4px; }
.site-nav a { padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; }
.site-nav a:hover { background: var(--surface-3); color: var(--ink); }
@media (min-width: 900px) { .site-nav { display: flex; } }

.hero { position: relative; overflow: hidden; padding: 40px 0 56px; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto; height: 120%; background: radial-gradient(60% 50% at 70% 30%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 70%), radial-gradient(50% 50% at 20% 20%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%); pointer-events: none; }
.hero .container { position: relative; display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero { padding: 72px 0 90px; } .hero .container { grid-template-columns: 1.1fr .9fr; } }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .88rem; box-shadow: var(--shadow-sm); }
.hero .eyebrow b { background: var(--brand); color: #fff; padding: 2px 10px; border-radius: 99px; font-size: .78rem; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.5rem); line-height: 1.2; margin: 18px 0 16px; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--brand) 10%, var(--gold-2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.12rem; color: var(--muted); max-width: 560px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 22px; }
.trust { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; font-weight: 500; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust .icon { color: var(--brand); }

.mock { position: relative; justify-self: center; width: min(100%, 420px); }
.mock-phone { position: relative; border-radius: 40px; padding: 12px; background: #0d1714; box-shadow: var(--shadow-lg), inset 0 0 0 2px #24332d; transform: rotate(-2deg); }
.mock-screen { border-radius: 30px; overflow: hidden; background: var(--bg); padding: 18px 14px; display: grid; gap: 12px; }
.mock-float { position: absolute; padding: 10px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; font-size: .88rem; display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); }
.mock-float.a { top: 40px; left: -22px; color: #ea580c; }
.mock-float.b { bottom: 70px; right: -18px; color: var(--gold-2); }
@media (max-width: 520px) { .mock-float.a { left: -4px; } .mock-float.b { right: -4px; } }

.section { padding: 64px 0; }
.section-alt { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-head .kicker { color: var(--gold-2); font-weight: 700; letter-spacing: .02em; font-size: .92rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.feature { padding: 24px; }
.feature .f-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 14px; }
.feature .f-icon .icon { width: 26px; height: 26px; }
.feature h3 { font-size: 1.12rem; }
.feature p { color: var(--muted); margin: 0; font-size: .96rem; }
.journey { display: grid; gap: 14px; counter-reset: j; }
@media (min-width: 900px) { .journey { grid-template-columns: repeat(4, 1fr); } }
.journey .card { position: relative; padding-top: 30px; }
.journey .card::before { counter-increment: j; content: counter(j, bengali); position: absolute; top: -16px; left: 20px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; box-shadow: var(--shadow); }
.price-card { position: relative; max-width: 460px; margin: 0 auto; padding: 32px; border-radius: 28px; background: var(--surface); border: 2px solid var(--gold); box-shadow: var(--shadow-lg); text-align: center; }
.price-card .ribbon { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); padding: 4px 16px; border-radius: 99px; background: linear-gradient(135deg, #e2b75a, #b8862a); color: #1d1503; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.price { font-size: 3.2rem; font-weight: 700; line-height: 1; color: var(--ink); }
.price del { font-size: 1.2rem; color: var(--muted); font-weight: 500; margin-left: 8px; }
.check-list { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 10px; text-align: left; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .icon { color: var(--success); margin-top: 4px; flex: none; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 4px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--brand); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); }
.cta-band { border-radius: 28px; padding: 40px 24px; text-align: center; color: #fff; position: relative; overflow: hidden; background: radial-gradient(130% 140% at 50% 0%, #1d9a72 0%, #0b5d45 50%, #073b2c 100%); }
.cta-band::before { content: ""; position: absolute; inset: 0; background: var(--pattern); opacity: .5; }
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); }
.site-footer { padding: 36px 0 28px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }

/* ---------- Tables (shared) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.table th { font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.wrap { white-space: normal; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex: none; }
.avatar.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 1.5rem; }

.lb-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-row.me { background: var(--brand-3); }
.lb-rank { width: 32px; text-align: center; font-weight: 700; color: var(--muted); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; margin-bottom: 18px; }
.podium .p { text-align: center; padding: 14px 8px; border-radius: 20px 20px 12px 12px; background: var(--surface); border: 1px solid var(--line); }
.podium .p .avatar { margin: 0 auto 8px; }
.podium .p.first { padding-top: 26px; border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--surface)); }
.podium .p b { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pay-method { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 2px solid var(--line); cursor: pointer; background: var(--surface); }
.pay-method:has(input:checked) { border-color: var(--brand); background: var(--brand-3); }
.pay-method input { accent-color: var(--brand); width: 20px; height: 20px; }
.pay-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .8rem; flex: none; }
.copy-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-3); font-weight: 700; font-size: 1.15rem; letter-spacing: .03em; }

@media print { .no-print { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
[data-theme-toggle] .t-sun { display: none; }
@media (max-width: 959px) { .hide-mobile { display: none; } }
.btn-light { --b-bg: #fff; --b-ink: #0b4d3b; --b-line: transparent; }
.btn-light:hover { color: #0b4d3b; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
.is-reader .main { max-width: 900px; }
@media (max-width: 640px) {
  .site-header .brand small { display: none; }
  .site-header .brand { font-size: .98rem; white-space: nowrap; }
  .site-header .btn-ghost:not(.btn-icon) { display: none; }
  .player { gap: 4px; padding: 8px 10px; }
  .player .info b { display: none; }
  .player .play-main { width: 44px; height: 44px; }
  .player select { max-width: 96px; }
  .topbar .brand span { font-size: .95rem; }
}
.w.hide { background: color-mix(in srgb, var(--gold) 18%, var(--surface-3)); border-bottom: 2px dashed color-mix(in srgb, var(--gold) 60%, transparent); cursor: pointer; }
.player .play-main .icon { width: 22px; height: 22px; }
@media (max-width: 640px) {
  .reader-tools { position: static; flex-wrap: nowrap; overflow-x: auto; gap: 6px; }
  .reader-tools > .row { flex-wrap: nowrap; flex: none; }
}
@media (max-width: 440px) {
  .topbar .brand > span { display: none; }
}
.player .play-main { padding: 0; }

.ayah .ayah-pr, .ayah-pr { color: var(--brand); font-weight: 600; font-size: 1.02rem; line-height: 1.7; margin-top: 6px; }

/* Quiz: options locked after answering + "listen again" next to the correct answer */
.opt-wrap { position: relative; }
.opt.locked { cursor: default; }
.opt.locked:active { transform: none; }
.opt-wrap.has-replay .opt { padding-right: 150px; }
.opt-wrap .replay { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border: 0; border-radius: 999px; background: var(--success); color: #fff; font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 14px -8px var(--success); transition: filter .12s; }
.opt-wrap .replay:hover { filter: brightness(1.08); }
.opt-wrap .replay:active { transform: translateY(-50%) scale(.96); }
.opt-wrap .replay .icon { width: 18px; height: 18px; }
.opt-wrap .replay.playing { animation: replayPulse 1s infinite; }
@keyframes replayPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 25%, transparent); } }
@media (max-width: 480px) {
  .opt-wrap .replay { padding: 6px 10px; right: 10px; font-size: .78rem; gap: 4px; }
  .opt-wrap .replay .icon { width: 16px; height: 16px; }
  .opt-wrap.has-replay .opt { padding-right: 122px; }
}

/* ==========================================================================
   Tajweed colours
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="sepia"]) {
    --tj-ghunnah: #4ade80; --tj-ikhfa: #fb923c; --tj-idgham: #c084fc; --tj-iqlab: #60a5fa;
    --tj-qalqala: #22d3ee; --tj-madd: #f472b6; --tj-madd-long: #f87171; --tj-silent: #7d8996;
    --sg-a: #f87171; --sg-i: #60a5fa; --sg-u: #4ade80; --sg-tan: #c084fc; --sg-suk: #22d3ee; --sg-shad: #fb923c; --sg-madd: #fbbf24; --sg-long: #fbbf24;
  }
}
:root[data-theme="dark"] {
  --tj-ghunnah: #4ade80; --tj-ikhfa: #fb923c; --tj-idgham: #c084fc; --tj-iqlab: #60a5fa;
  --tj-qalqala: #22d3ee; --tj-madd: #f472b6; --tj-madd-long: #f87171; --tj-silent: #7d8996;
  --sg-a: #f87171; --sg-i: #60a5fa; --sg-u: #4ade80; --sg-tan: #c084fc; --sg-suk: #22d3ee; --sg-shad: #fb923c; --sg-madd: #fbbf24; --sg-long: #fbbf24;
}
.tj-ghunnah { color: var(--tj-ghunnah); }
.tj-ikhfa { color: var(--tj-ikhfa); }
.tj-idgham { color: var(--tj-idgham); }
.tj-iqlab { color: var(--tj-iqlab); }
.tj-qalqala { color: var(--tj-qalqala); }
.tj-madd { color: var(--tj-madd); }
.tj-madd-long { color: var(--tj-madd-long); }
.tj-silent { color: var(--tj-silent); }
.tj-off .tj { color: inherit; }
.w.hide .tj { color: transparent; }
.w.hide.peek .tj { color: var(--muted); }
.tj-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; margin: 4px 0 14px; }
.tj-legend.compact { gap: 4px 8px; margin: 0; }
.tj-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ink-2); padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.tj-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: currentColor; }
.tj-off .tj-legend { opacity: .45; }
.tj-toggle-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
/* harakat tag on lesson cards */
.sign { display: inline-block; margin-top: 2px; padding: 1px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff; background: var(--sg-color, var(--muted)); }
.item-card.has-sign { border-top: 4px solid var(--sg-color); }
.item-card.has-sign .bn { color: var(--sg-color); }
.sign-a { --sg-color: var(--sg-a); } .sign-i { --sg-color: var(--sg-i); } .sign-u { --sg-color: var(--sg-u); }
.sign-tan { --sg-color: var(--sg-tan); } .sign-suk { --sg-color: var(--sg-suk); } .sign-shad { --sg-color: var(--sg-shad); }
.sign-madd { --sg-color: var(--sg-madd); } .sign-long { --sg-color: var(--sg-long); }
.quiz-q .big-ar.wide { font-size: clamp(2rem, 8vw, 3rem); line-height: 1.9; }

/* Word meanings */
.item-card .meaning { font-size: .82rem; color: var(--ink-2); line-height: 1.4; background: var(--gold-soft); border-radius: 8px; padding: 3px 8px; margin-top: 2px; }
.item-card .meaning b { color: var(--gold-2); }
.flashcard .face.back .meaning { font-size: 1.05rem; font-weight: 600; background: rgba(255,255,255,.14); border-radius: 10px; padding: 4px 12px; }
.wbw-bn { display: none; }
.ayah-ar.wbw-on { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; line-height: 1.9; }
.ayah-ar.wbw-on .wbw-w { display: inline-flex; flex-direction: column; align-items: center; text-align: center; padding: 2px 4px 6px; border-radius: 10px; }
.ayah-ar.wbw-on .wbw-w:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.ayah-ar.wbw-on .wbw-bn { display: block; font-family: var(--font); font-size: .8rem; font-weight: 500; line-height: 1.35; color: var(--ink-2); direction: ltr; max-width: 9.5em; margin-top: -2px;
  border-top: 1.5px dotted color-mix(in srgb, var(--gold) 60%, transparent); padding-top: 3px; }
.ayah-ar.wbw-on .ayah-end { align-self: center; }

/* Word being recited */
.ayah-ar [data-wi] { border-radius: 8px; transition: background-color .12s ease, box-shadow .12s ease; }
.ayah-ar [data-wi].w-active { background: color-mix(in srgb, var(--gold) 34%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 34%, transparent); }
.ayah-ar.wbw-on [data-wi].w-active .wbw-bn { color: var(--ink); font-weight: 700; }
/* Legal pages */
.legal-page { padding: 32px 0 56px; }
.container.narrow { max-width: 820px; }
.legal-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.legal-tabs a { padding: 7px 14px; border-radius: 99px; font-weight: 600; font-size: .9rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.legal-tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.legal-card { padding: 28px clamp(18px, 4vw, 40px); }
.legal-card h1 { margin: 0 0 4px; font-size: clamp(1.5rem, 4vw, 2rem); }
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: .82rem; }
.legal-links a { color: var(--muted); }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; margin: 4px 0 16px; cursor: pointer; }
.agree input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--brand); }
.site-footer .legal-row { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; padding-top: 12px; border-top: 1px solid var(--line); }

/* ==========================================================================
   Word study, word popup, progress, search, course landing pages
   ========================================================================== */
.d-block { display: block; }
.split { display: grid; gap: 16px; }
@media (min-width: 900px) { .split { grid-template-columns: 1.15fr .85fr; align-items: start; } }
.hide-sm { }
@media (max-width: 560px) { .hide-sm { display: none; } }
mark { background: color-mix(in srgb, var(--gold) 35%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }

/* focused lesson page */
.is-study { background: var(--bg); }
.study-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.study-top-title { min-width: 0; line-height: 1.25; }
.study-top-title small { display: block; color: var(--muted); font-size: .75rem; }
.study-top-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.study-main { padding-top: 18px; padding-bottom: 40px; }
.guide-box { padding: 12px 16px; margin-bottom: 14px; }
.guide-box summary { cursor: pointer; font-weight: 700; }
.guide-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 12px 0 0; font-size: .92rem; }
.guide-list dt { font-weight: 700; color: var(--brand); display: flex; align-items: center; gap: 4px; }
.guide-list dt .icon { width: 16px; height: 16px; }
.guide-list dd { margin: 0; color: var(--ink-2); }
@media (max-width: 560px) { .guide-list { grid-template-columns: 1fr; gap: 2px; } .guide-list dd { margin-bottom: 8px; } }
.study-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.wlist { display: grid; gap: 8px; }
.wrow { display: grid; grid-template-columns: 34px auto 1fr auto; gap: 10px 14px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.wno { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: .82rem; font-weight: 700; }
.w-ar { font-family: var(--font-ar); font-size: 2.1rem; line-height: 1.5; min-width: 92px; padding: 2px 10px; border-radius: 12px; border: 0; background: var(--brand-3); color: var(--ink); cursor: pointer; text-align: center; }
.w-ar:hover { background: color-mix(in srgb, var(--brand) 18%, transparent); }
.winfo { min-width: 0; }
.w-pr { font-weight: 700; color: var(--brand); }
.w-root { font-weight: 500; font-size: .78rem; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.w-root [lang="ar"], .w-tags [lang="ar"] { font-family: var(--font-ar); font-size: 1.15em; }
.w-bn { font-weight: 600; color: var(--ink); }
.w-en { font-size: .86rem; color: var(--muted); }
.wend { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.w-count { display: grid; justify-items: center; line-height: 1.05; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; color: var(--ink); }
.w-count b { font-size: 1.05rem; }
.w-count small { font-size: .7rem; color: var(--muted); }
.w-count:hover { border-color: var(--brand); }
.hide-mean [data-mean], .hide-mean .w-bn, .hide-mean .w-en { filter: blur(6px); opacity: .55; user-select: none; transition: filter .2s; }
.hide-mean .wrow { cursor: pointer; }
.hide-mean .wrow.reveal [data-mean] { filter: none; opacity: 1; }
@media (max-width: 640px) {
  .wrow { grid-template-columns: auto 1fr auto; padding: 10px 12px; }
  .wrow .wno { display: none; }
  .w-ar { font-size: 1.8rem; min-width: 70px; }
}
/* verbs */
.is-verbs .wrow { grid-template-columns: 34px 1fr auto; }
.is-verbs .winfo { grid-column: 2 / 3; }
.vforms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vf { display: grid; justify-items: center; gap: 0; padding: 6px 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); text-align: center; font: inherit; }
button.vf { cursor: pointer; }
button.vf:hover { border-color: var(--brand); background: var(--brand-3); }
.vf small { font-size: .68rem; color: var(--muted); font-weight: 600; }
.vf b { font-family: var(--font-quran); font-size: 1.45rem; line-height: 1.9; font-weight: 400; }
.vf .w-pr { font-size: .78rem; }
.vf-m { background: var(--gold-soft); }
.w-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.w-tags .pill { font-size: .74rem; }
.is-verbs .wend { grid-row: 1 / span 2; grid-column: 3; }
@media (max-width: 640px) {
  .is-verbs .wrow { grid-template-columns: 1fr auto; }
  .is-verbs .vforms { grid-column: 1 / -1; }
  .is-verbs .winfo { grid-column: 1 / 2; }
  .is-verbs .wend { grid-row: auto; grid-column: 2; }
}
.quiz-cta { text-align: center; margin-top: 18px; }
.quiz-cta h2 { font-size: 1.25rem; }
.quiz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.exam-intro { text-align: center; }
.exam-intro .exam-badge { font-size: 2.6rem; }
.exam-intro ul { text-align: left; max-width: 520px; margin: 0 auto 16px; }

/* reader additions */
.wbw-pr { display: none; }
.ayah-ar.wbw-on .wbw-pr { display: block; font-family: var(--font); font-size: .78rem; font-weight: 700; color: var(--brand); direction: ltr; line-height: 1.3; margin-top: -4px; }
.ayah-ar .wbw-w { cursor: pointer; }
.ayah-ar:not(.wbw-on) .wbw-w:hover .wbw-ar { text-decoration: underline dotted color-mix(in srgb, var(--brand) 60%, transparent); text-underline-offset: 10px; }
.hide-mean .wbw-bn:not(.shown), .hide-mean .ayah-tr:not(.shown) { filter: blur(6px); opacity: .5; cursor: pointer; user-select: none; }
.mem-btn { gap: 4px; color: var(--muted); }
.mem-btn.on { color: var(--success); background: var(--success-soft); }
.today-chip { display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; padding: 4px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: .86rem; color: var(--ink-2); }
.reading-mode { width: auto; min-height: 36px; padding: 4px 8px; font-size: .86rem; }

/* word profile popup (modal sheet) */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(8, 18, 14, .5); display: flex; align-items: flex-end; justify-content: center; animation: sheetfade .18s ease-out; }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 22px 22px 0 0; padding: 22px 18px 26px; box-shadow: var(--shadow-lg); animation: sheetup .24s cubic-bezier(.2,.8,.2,1); outline: none; }
@keyframes sheetfade { from { background: rgba(8, 18, 14, 0); } }
@keyframes sheetup { from { transform: translateY(40px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .sheet-wrap, .sheet { animation: none; } }
.sheet.wide { max-width: 720px; }
.sheet-x { position: absolute; top: 10px; right: 10px; }
@media (min-width: 720px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 22px; } }
body.sheet-open { overflow: hidden; }
.wi-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding-right: 36px; }
.wi-ar { font-family: var(--font-ar); font-size: 3rem; line-height: 1.5; padding: 0 16px; border-radius: 16px; background: var(--brand-3); }
.wi-meta { display: grid; gap: 6px; }
.wi-pr { font-weight: 700; color: var(--brand); font-size: 1.15rem; }
.wi-mean { margin: 14px 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.wi-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wi-stats div { text-align: center; padding: 10px; border-radius: 14px; background: var(--gold-soft); }
.wi-stats b { display: block; font-size: 1.35rem; color: var(--gold-2); }
.wi-stats span { font-size: .8rem; color: var(--ink-2); }
.wi-h { margin: 18px 0 8px; font-size: 1rem; }
.wi-bars { display: grid; gap: 6px; }
.wi-bar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .9rem; color: var(--ink); text-decoration: none; }
.wi-bar .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi-bar .b { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.wi-bar .b i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
a.wi-bar:hover .t { color: var(--brand); }
.wi-forms { display: flex; flex-wrap: wrap; gap: 6px; }
.wi-form { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.wi-form [lang="ar"] { font-family: var(--font-quran); font-size: 1.3rem; line-height: 1.9; }
.wi-form small { color: var(--muted); }
.wi-ayahs { display: grid; gap: 8px; }
.wi-ayah { display: grid; gap: 4px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.wi-ayah:hover { border-color: var(--brand); }
.wi-ayah .pill { justify-self: start; }
.wi-ayah-ar { font-family: var(--font-quran); font-size: 1.35rem; line-height: 2.1; text-align: right; }
.wi-ayah-ar mark { background: color-mix(in srgb, var(--gold) 40%, transparent); }

/* progress page */
.prog-kpis { grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .prog-kpis { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.prog-today { display: flex; gap: 16px; align-items: center; }
.bars14 { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 150px; }
.b14 { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.b14 i { display: block; width: 100%; max-width: 22px; border-radius: 6px 6px 2px 2px; background: var(--brand); min-height: 3px; }
.b14 small { font-size: .68rem; color: var(--muted); }
.course-prog { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.course-prog:last-child { border-bottom: 0; padding-bottom: 0; }
.sec-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sec-chips .pill { font-size: .76rem; }
.recent-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.recent-row:last-child { border-bottom: 0; }
.surah-prog { display: grid; gap: 4px; max-height: 420px; overflow: auto; }
.sp-row { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.sp-name { display: grid; line-height: 1.3; }
.sp-bars { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; }

/* search */
.search-box { position: relative; display: flex; gap: 8px; align-items: center; }
.search-box .icon-left { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 42px; flex: 1; }
.search-hit { display: grid; gap: 6px; color: var(--ink); text-decoration: none; }
.search-hit:hover { border-color: var(--brand); }
.search-hit .pill { justify-self: start; }
.hit-ar { font-family: var(--font-quran); font-size: 1.5rem; line-height: 2.2; text-align: right; }
.tabs-pill { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tabs-pill a { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .9rem; text-decoration: none; }
.tabs-pill a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; }
.today-card { display: flex; gap: 14px; align-items: center; }

/* public course landing page */
.cl-hero { background: radial-gradient(120% 130% at 100% 0%, color-mix(in srgb, var(--cc) 70%, #fff) 0%, var(--cc) 45%, color-mix(in srgb, var(--cc) 55%, #000) 100%); color: #fff; padding: 28px 0 32px; }
.cl-hero h1 { margin: 8px 0 6px; font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.25; }
.cl-back { color: rgba(255,255,255,.85); display: inline-flex; align-items: center; gap: 2px; }
.cl-back .icon { width: 16px; height: 16px; }
.cl-sub { font-size: 1.08rem; opacity: .92; max-width: 640px; }
.cl-meta { gap: 6px 16px; font-size: .92rem; opacity: .95; }
.cl-meta .muted { color: rgba(255,255,255,.75); }
.cl-free { margin-top: 16px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 18px; padding: 12px 14px; max-width: 640px; }
.cl-free summary { cursor: pointer; font-weight: 700; }
.cl-free-list { display: grid; gap: 6px; margin-top: 10px; }
.cl-free-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; }
.cl-grid { display: grid; gap: 22px; }
@media (min-width: 980px) { .cl-body { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.cl-body { padding-top: 22px; padding-bottom: 90px; }
.cl-side { order: -1; }
@media (min-width: 980px) { .cl-side { order: 0; position: sticky; top: 84px; } .cl-body { margin-top: -120px; } .cl-hero { padding-bottom: 140px; } .cl-hero .cl-main { max-width: calc(100% - 362px); } }
.cl-sec { margin-bottom: 26px; }
.cl-sec > h2, .cl-sec h2 { font-size: 1.3rem; margin: 0 0 12px; }
.cl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 26px; }
.cl-stats div { text-align: center; padding: 14px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.cl-stats b { display: block; font-size: 1.4rem; color: var(--brand); }
.cl-stats span { font-size: .8rem; color: var(--muted); }
@media (max-width: 520px) { .cl-stats { grid-template-columns: repeat(2, 1fr); } }
.feat-group { margin-bottom: 18px; }
.feat-group h3 { font-size: 1.05rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.feat-grid { display: grid; gap: 8px; }
@media (min-width: 700px) { .feat-grid { grid-template-columns: 1fr 1fr; } }
.feat { display: flex; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.feat-ic { font-size: 1.5rem; line-height: 1; flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-3); }
.feat p { margin: 2px 0 0; font-size: .9rem; color: var(--ink-2); }
.steps3 { display: grid; gap: 10px; }
@media (min-width: 700px) { .steps3 { grid-template-columns: repeat(3, 1fr); } }
.step3 { padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.step3 .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 8px; }
.step3 p { margin: 4px 0 0; font-size: .92rem; color: var(--ink-2); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .icon { color: var(--success); flex: none; margin-top: 4px; width: 18px; height: 18px; }
.lead-p { font-size: 1.05rem; color: var(--ink-2); }
.accordion { display: grid; gap: 8px; }
.accordion details { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.accordion summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "▾"; color: var(--muted); transition: transform .2s; }
.accordion details[open] summary::after { transform: rotate(180deg); }
.acc-n { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-3); color: var(--brand); font-weight: 700; flex: none; }
.acc-list { border-top: 1px solid var(--line); max-height: 420px; overflow: auto; }
.acc-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.acc-item:last-child { border-bottom: 0; }
.acc-lock { color: var(--muted); }
.acc-lock .icon { width: 16px; height: 16px; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--ink-2); }
.stars { color: var(--line-2); letter-spacing: 1px; white-space: nowrap; }
.stars .on { color: #f59e0b; }
.rev-summary { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.rev-big { display: grid; justify-items: center; min-width: 120px; }
.rev-big b { font-size: 2.2rem; line-height: 1.1; }
.rev-list { display: grid; gap: 8px; }
.rev p { margin: 6px 0 4px; }
.star-pick { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-pick input { position: absolute; opacity: 0; pointer-events: none; }
.star-pick label { font-size: 1.8rem; color: var(--line-2); cursor: pointer; line-height: 1; }
.star-pick input:checked ~ label, .star-pick label:hover, .star-pick label:hover ~ label { color: #f59e0b; }
.star-pick input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 4px; }
.cl-cta { text-align: center; margin-bottom: 14px; }
.enroll-card .price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.enroll-card .price-row b { font-size: 2rem; color: var(--ink); }
.enroll-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 6px; font-size: .92rem; }
.enroll-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgba(0,0,0,.3); }
@media (min-width: 980px) { .enroll-bar { display: none; } }
.video-wrap { position: relative; padding-top: 56.25%; border-radius: 18px; overflow: hidden; background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* guide */
.g-steps { display: grid; gap: 6px; }
.g-step { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.g-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; flex: none; }
.g-arrow { text-align: center; color: var(--gold-2); font-size: 1.1rem; }
.g-mini { padding-left: 1.2em; margin: 0; display: grid; gap: 6px; }

/* print: word lessons become a clean handout */
@media print {
  .study-top, .no-print, .quiz-cta, .quiz-card, .study-tools, .guide-box, .toasts, .alert, .wend .btn, .bottom-nav, .sidebar { display: none !important; }
  body, .is-study { background: #fff; }
  .wrow { break-inside: avoid; border-color: #ccc; }
  .hide-mean [data-mean] { filter: none !important; opacity: 1 !important; }
}

/* Course page: numbered sections that open as dropdowns */
.sec-drops { display: grid; gap: 12px; }
.sec-drop { border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); overflow: hidden; }
.sec-drop[open] { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.sec-drop > summary { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; list-style: none; }
.sec-drop > summary::-webkit-details-marker { display: none; }
.sec-drop > summary:hover { background: var(--surface-2); }
.sec-no { width: 54px; height: 54px; border-radius: 16px; flex: none; display: grid; place-items: center; align-content: center; line-height: 1; background: var(--brand); color: #fff; }
.sec-no b { font-size: 1.4rem; }
.sec-no small { font-size: .68rem; opacity: .85; }
.sec-txt { display: grid; gap: 3px; min-width: 0; }
.sec-txt > b { font-size: 1.1rem; }
.sec-prog { display: flex; align-items: center; gap: 8px; max-width: 320px; }
.sec-chev { flex: none; color: var(--muted); transition: transform .2s; }
.sec-drop[open] .sec-chev { transform: rotate(180deg); }
.sec-path { padding: 4px 12px 14px; border-top: 1px solid var(--line); }

/* ==========================================================================
   Glass theme — frosted translucent surfaces over a soft animated colour mesh
   ========================================================================== */
:root {
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-soft: rgba(255, 255, 255, .42);
  --glass-line: rgba(255, 255, 255, .75);
  --glass-edge: color-mix(in srgb, var(--brand) 12%, transparent);
  --glass-shadow: 0 12px 40px -18px rgba(11, 61, 45, .35), inset 0 1px 0 rgba(255, 255, 255, .7);
  --glass-blur: 18px;
  --mesh-a: rgba(29, 154, 114, .30); --mesh-b: rgba(224, 182, 90, .30); --mesh-c: rgba(56, 189, 248, .18); --mesh-d: rgba(147, 51, 234, .12);
  --cal-bn: #15803d; --cal-hj: #a87c22;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="sepia"]) {
    --glass: rgba(18, 34, 28, .58); --glass-strong: rgba(18, 34, 28, .82); --glass-soft: rgba(18, 34, 28, .42);
    --glass-line: rgba(255, 255, 255, .08); --glass-shadow: 0 14px 44px -18px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .06);
    --mesh-a: rgba(31, 158, 116, .28); --mesh-b: rgba(224, 182, 90, .16); --mesh-c: rgba(56, 189, 248, .10); --mesh-d: rgba(147, 51, 234, .14);
    --cal-bn: #4ade80; --cal-hj: #f0c96f;
  }
}
:root[data-theme="dark"] {
  --glass: rgba(18, 34, 28, .58); --glass-strong: rgba(18, 34, 28, .82); --glass-soft: rgba(18, 34, 28, .42);
  --glass-line: rgba(255, 255, 255, .08); --glass-shadow: 0 14px 44px -18px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .06);
  --mesh-a: rgba(31, 158, 116, .28); --mesh-b: rgba(224, 182, 90, .16); --mesh-c: rgba(56, 189, 248, .10); --mesh-d: rgba(147, 51, 234, .14);
  --cal-bn: #4ade80; --cal-hj: #f0c96f;
}
:root[data-theme="sepia"] {
  --glass: rgba(250, 241, 221, .62); --glass-strong: rgba(250, 241, 221, .85); --glass-soft: rgba(250, 241, 221, .45);
  --glass-line: rgba(255, 250, 238, .7); --mesh-a: rgba(168, 116, 31, .20); --mesh-b: rgba(212, 160, 80, .25); --mesh-c: rgba(140, 90, 40, .10); --mesh-d: rgba(190, 120, 60, .10);
}

/* the colour mesh behind everything */
html { background: var(--bg); }
body { background: transparent; }
body::before {
  content: ""; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 12% 18%, var(--mesh-a), transparent 70%),
    radial-gradient(34vmax 34vmax at 88% 12%, var(--mesh-b), transparent 70%),
    radial-gradient(40vmax 40vmax at 78% 88%, var(--mesh-c), transparent 70%),
    radial-gradient(30vmax 30vmax at 18% 92%, var(--mesh-d), transparent 70%);
  animation: meshdrift 26s ease-in-out infinite alternate;
}
@keyframes meshdrift { 0% { transform: translate3d(0, 0, 0) rotate(0deg); } 50% { transform: translate3d(3vmax, -2vmax, 0) rotate(6deg); } 100% { transform: translate3d(-2vmax, 3vmax, 0) rotate(-4deg); } }

/* frosted surfaces */
.card, .glass-panel, .sec-drop, .enroll-card, .sheet, .accordion details, .feat, .step3, .cl-stats div, .exam-intro, .rev-summary {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
}
/* list items: translucent but no blur (keeps long pages smooth on phones) */
.step, .wrow, .ayah, .acc-item, .opt, .wi-ayah, .search-hit, .recent-row, .g-step, .tabs-pill a, .stat-chip, .w-count, .vf, .tool-toggle, .pill {
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.step, .wrow, .ayah, .opt, .g-step { background: var(--glass-strong); border-color: var(--glass-line); }
.ayah.active { background: color-mix(in srgb, var(--brand-3) 55%, var(--glass-strong)); }
.site-header, .topbar, .admin-top, .study-top { background: var(--glass); border-bottom: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.bottom-nav, .enroll-bar { background: var(--glass-strong); border-top: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); }
@media (min-width: 1024px) { .sidebar { background: var(--glass); border-right: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%); } }
.input { background: var(--glass-strong); }
.section-alt { background: var(--glass-soft); border-color: var(--glass-line); }
.btn:where(:not(.btn-primary):not(.btn-gold):not(.btn-danger):not(.btn-success):not(.btn-ghost):not(.btn-light)) { --b-bg: var(--glass-strong); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .glass-panel, .sec-drop, .enroll-card, .sheet, .accordion details, .site-header, .topbar, .bottom-nav, .study-top { background: var(--surface); }
}

/* interactive: light that follows the pointer on cards (desktop) */
@media (hover: hover) and (pointer: fine) {
  .card.spot, .glass-panel.spot, .feat.spot, .sec-drop.spot, .step.spot {
    background-image: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .38), transparent 42%);
  }
  :root[data-theme="dark"] .spot { background-image: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .07), transparent 42%) !important; }
  .card-link, .course-card, .feat, .step3, .step:not(.locked) { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
  .card-link:hover, .course-card:hover, .feat:hover, .step3:hover, .step:not(.locked):hover { transform: translateY(-3px); box-shadow: 0 20px 44px -20px rgba(11, 61, 45, .45), inset 0 1px 0 rgba(255,255,255,.6); }
}
/* shine sweep on primary buttons */
.btn-primary, .btn-gold { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::after, .btn-gold::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 48%, transparent 66%); transform: translateX(-120%); transition: transform .7s ease; }
.btn-primary:hover::after, .btn-gold:hover::after { transform: translateX(120%); }
/* tap ripple */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .25; pointer-events: none; animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
/* scroll reveal */
.rv { opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); transition-delay: var(--rd, 0s); }
.rv.in { opacity: 1; transform: none; }
/* soft floating glow for hero headings */
.hero h1 em { background-size: 200% auto; animation: shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: 200% center; } }
@media (prefers-reduced-motion: reduce) {
  body::before, .hero h1 em { animation: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  .btn-primary::after, .btn-gold::after { display: none; }
}

/* ==========================================================================
   Prayer times, forbidden times, calendars
   ========================================================================== */
.salah-strip { padding: 0 0 36px; margin-top: -18px; position: relative; z-index: 2; }
.salah-widget { border-radius: 24px; padding: 18px; }
.salah-widget .empty { padding: 20px; }
.sw-top { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.sw-dates { display: grid; gap: 2px; }
.sw-dates b { font-size: 1.05rem; }
.sw-dates span { font-size: .88rem; color: var(--ink-2); }
.sw-next { text-align: right; display: grid; justify-items: end; line-height: 1.25; }
.sw-next small { color: var(--muted); font-size: .78rem; }
.sw-next b { font-size: 1.7rem; letter-spacing: .02em; background: linear-gradient(120deg, var(--brand), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sw-forb { margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: .9rem; }
.sw-times { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.sw-t { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--glass-line); text-align: center; transition: transform .2s; }
.sw-t span { font-size: .8rem; color: var(--ink-2); white-space: nowrap; }
.sw-t b { font-size: 1.05rem; }
.sw-t.now { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -12px var(--brand); }
.sw-t.now span { color: rgba(255,255,255,.85); }
.sw-t.next:not(.now) { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.sw-foot { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: .86rem; color: var(--ink-2); }
.sw-foot a { margin-left: auto; font-weight: 700; }
.salah-widget.compact .sw-times { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.salah-widget.compact .sw-t { padding: 8px 2px; }
.salah-widget.compact .sw-t span { font-size: .72rem; }
.salah-widget.compact .sw-t b { font-size: .92rem; }
@media (max-width: 560px) {
  .sw-times { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .sw-t { padding: 8px 2px; border-radius: 12px; }
  .sw-t span { font-size: .68rem; }
  .sw-t b { font-size: .86rem; }
  .sw-next b { font-size: 1.35rem; }
  .sw-foot a { margin-left: 0; }
}

.salah-opts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.salah-opts select { width: auto; min-width: 170px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--glass-line); }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; }
.dates3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.dcard { display: grid; gap: 2px; padding: 14px 16px; border-radius: 20px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--glass-shadow); }
.dcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(140deg, rgba(255,255,255,.28), transparent 55%); pointer-events: none; }
.dcard small { opacity: .85; font-weight: 600; }
.dcard b { font-size: 1.25rem; line-height: 1.3; }
.dcard span { font-size: .84rem; opacity: .9; }
.dcard.en { background: linear-gradient(135deg, #2563eb, #1e3a8a); }
.dcard.bnc { background: linear-gradient(135deg, #16a34a, #0b5d45); }
.dcard.hj { background: linear-gradient(135deg, #d4a043, #8a5d15); }
.dcard.hj [lang="ar"] { font-family: var(--font-ar); font-size: 1.05rem; }
@media (max-width: 640px) { .dates3 { grid-template-columns: 1fr; } .dcard { grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; } .dcard small { grid-row: span 2; } }

.salah-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; border-radius: 26px; flex-wrap: wrap; }
.sh-clock { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 700; line-height: 1.1; letter-spacing: .01em; }
.sh-cur { margin-top: 8px; font-size: .95rem; }
.sh-ring { --p: 0; width: 196px; height: 196px; border-radius: 50%; display: grid; place-items: center; margin-left: auto; position: relative;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), color-mix(in srgb, var(--brand) 12%, transparent) 0); transition: background .6s; }
.sh-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.sh-ring > div { position: relative; display: grid; justify-items: center; text-align: center; line-height: 1.25; padding: 0 16px; }
.sh-ring small { font-size: .78rem; color: var(--muted); }
.sh-ring b { font-size: 1.9rem; }
@media (max-width: 560px) { .sh-ring { width: 168px; height: 168px; margin: 0 auto; } .sh-ring b { font-size: 1.6rem; } .salah-hero { justify-content: center; text-align: center; } }
.forb-now { margin-top: 12px; padding: 12px 16px; border-radius: 16px; background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); animation: pulseb 2s ease-in-out infinite; }
@keyframes pulseb { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 12%, transparent); } }
.ptimes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.pt { position: relative; display: grid; justify-items: center; gap: 2px; padding: 16px 8px 14px; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); text-align: center; animation: ptin .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes ptin { from { opacity: 0; transform: translateY(14px); } }
.pt-ic { font-size: 1.6rem; }
.pt-n { font-weight: 700; }
.pt-t { font-size: 1.25rem; }
.pt small { color: var(--muted); font-size: .74rem; }
.pt em { position: absolute; top: -9px; font-style: normal; font-size: .7rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--brand); color: #fff; }
.pt em.nx { background: var(--gold); color: #1d1503; }
.pt.now { background: linear-gradient(150deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; transform: translateY(-4px); }
.pt.now small { color: rgba(255,255,255,.8); }
.pt.next:not(.now) { border-color: var(--gold); }
@media (max-width: 640px) { .ptimes { grid-template-columns: repeat(2, 1fr); } .pt:last-child { grid-column: 1 / -1; } }
.xtimes, .forb-list { display: grid; gap: 8px; }
.xt, .fb { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-line); }
.fb.on { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-title { flex: 1; text-align: center; display: grid; }
.cal-title b { font-size: 1.25rem; }
.cal-title span { font-size: .86rem; color: var(--muted); }
.center-x { justify-content: center; gap: 10px; flex-wrap: wrap; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cw { text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cw.fri, .cd.fri b { color: var(--brand); }
.cd { position: relative; display: grid; justify-items: center; align-content: start; gap: 0; min-height: 64px; padding: 6px 2px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-line); line-height: 1.2; }
.cd.empty { background: transparent; border-color: transparent; }
.cd b { font-size: 1.12rem; }
.cd .cbn { font-size: .68rem; color: var(--cal-bn); font-weight: 600; }
.cd .chj { font-size: .68rem; color: var(--cal-hj); font-weight: 600; }
.cd.today { background: linear-gradient(150deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 10px 22px -12px var(--brand); }
.cd.today b, .cd.today .cbn, .cd.today .chj { color: #fff; }
.cd.ev i { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.cd.ev.national i { background: #dc2626; }
@media (hover: hover) { .cd:not(.empty):hover { transform: translateY(-2px); transition: transform .15s; } }
@media (max-width: 480px) { .cal-grid { gap: 3px; } .cd { min-height: 54px; border-radius: 10px; padding: 4px 1px; } .cd b { font-size: .98rem; } .cd .cbn, .cd .chj { font-size: .6rem; } }
.cal-events { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.cal-events li { padding: 8px 12px; border-radius: 12px; background: var(--glass-strong); border-left: 4px solid var(--gold); font-size: .92rem; }
.cal-events li.national { border-left-color: #dc2626; }
.month-box summary { cursor: pointer; }
.mt-table td, .mt-table th { text-align: center; white-space: nowrap; font-size: .86rem; }
.mt-table tr.today td { background: color-mix(in srgb, var(--brand) 14%, transparent); font-weight: 700; }
.mt-table tr.fri td:first-child { color: var(--brand); font-weight: 700; }
@media print { .salah-hero, .ptimes, .cal-card, .dates3, .salah-opts { break-inside: avoid; } body::before { display: none; } }
.sheet { background: var(--glass-strong); }

/* Audio player: deep green glass bar with light controls (same look in every theme) */
.player {
  background: linear-gradient(135deg, rgba(13, 74, 56, .92), rgba(8, 40, 31, .94));
  color: #f1f7f4; border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 18px 40px -16px rgba(4, 30, 22, .65), inset 0 1px 0 rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
}
.player .btn { --b-bg: rgba(255, 255, 255, .12); --b-ink: #f1f7f4; --b-line: rgba(255, 255, 255, .16); border-radius: 14px; }
.player .btn:hover { --b-bg: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .3); box-shadow: none; }
.player .btn .icon { width: 20px; height: 20px; }
.player .play-main { --b-bg: linear-gradient(145deg, #f3d58f, #d4a043); background: linear-gradient(145deg, #f3d58f, #d4a043); --b-ink: #1d1503; --b-line: transparent; border-radius: 50%; box-shadow: 0 6px 18px -6px rgba(224, 182, 90, .8), inset 0 1px 0 rgba(255, 255, 255, .5); }
.player .play-main:hover { filter: brightness(1.06); box-shadow: 0 8px 22px -6px rgba(224, 182, 90, .95); }
.player .info b { color: #fff; }
.player .info span { color: rgba(241, 247, 244, .75); opacity: 1; }
.player .btn.on { --b-bg: rgba(224, 182, 90, .22); border-color: rgba(224, 182, 90, .55); }
.player select {
  -webkit-appearance: none; appearance: none; max-width: 150px; min-height: 38px; padding: 6px 30px 6px 12px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-weight: 600; font-size: .82rem; cursor: pointer;
  background: rgba(255, 255, 255, .12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f3d58f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.player select:hover, .player select:focus { background-color: rgba(255, 255, 255, .2); border-color: rgba(243, 213, 143, .6); outline: none; }
.player select option { color: #13211c; background: #fff; }
.player-bar { background: rgba(255, 255, 255, .14); }
.player-bar span { background: linear-gradient(90deg, #f3d58f, #e0b65a); box-shadow: 0 0 8px rgba(243, 213, 143, .7); }
@media (max-width: 560px) { .player select { max-width: 112px; padding-right: 26px; } .player .btn-icon.btn-sm { width: 38px; height: 38px; min-height: 38px; } }

/* Voice navigation in the reader */
.voice-btn { --b-bg: linear-gradient(135deg, var(--brand), var(--brand-2)); background: linear-gradient(135deg, var(--brand), var(--brand-2)); --b-ink: #fff; --b-line: transparent; color: #fff; }
.voice-btn:hover { color: #fff; filter: brightness(1.08); }
.vj { text-align: center; display: grid; gap: 10px; justify-items: center; }
.vj-tabs { width: 100%; max-width: 440px; }
.vj-tabs button { flex: 1; }
.vj-hint { max-width: 460px; margin: 0; }
.vj-mic { width: 92px; height: 92px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, #2bb889, #0b5d45); box-shadow: 0 14px 34px -12px rgba(11, 93, 69, .8), inset 0 2px 0 rgba(255,255,255,.25); transition: transform .15s; }
.vj-mic svg { width: 40px; height: 40px; }
.vj-mic:active { transform: scale(.96); }
.vj-mic.on { background: radial-gradient(circle at 30% 25%, #f87171, #dc2626); animation: vjpulse 1.3s ease-in-out infinite; }
@keyframes vjpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); } 50% { box-shadow: 0 0 0 18px rgba(220, 38, 38, 0); } }
.vj-status { font-weight: 700; min-height: 1.6em; }
.vj-status.bad { color: var(--danger); }
.vj-status.good { color: var(--success); }
.vj-heard { min-height: 1.4em; font-size: 1.05rem; color: var(--ink-2); font-family: var(--font), var(--font-ar); }
.vj-or { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; }
.vj-or::before, .vj-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.vj-type { display: flex; gap: 8px; width: 100%; max-width: 380px; }
.vj-type .input { flex: 1; }
.ayah.jumped { animation: jumped 1.6s ease-out; }
@keyframes jumped { 0% { box-shadow: 0 0 0 0 rgba(224, 182, 90, .9); } 40% { box-shadow: 0 0 0 10px rgba(224, 182, 90, .35); } 100% { box-shadow: 0 0 0 0 rgba(224, 182, 90, 0); } }

/* Reader toolbar: toggles on top, then one clean full-width control bar */
.reader-tools { display: grid; gap: 10px; }
.rt-controls { display: grid; grid-template-columns: minmax(150px, 1.2fr) auto minmax(120px, 1fr) auto; gap: 10px; align-items: end; width: 100%; padding-top: 10px; border-top: 1px solid var(--glass-line); }
.rt-field { display: grid; gap: 4px; min-width: 0; }
.rt-label { font-size: .72rem; font-weight: 700; color: var(--muted); padding-left: 4px; letter-spacing: .01em; }
.rt-select { -webkit-appearance: none; appearance: none; width: 100%; height: 42px; padding: 0 34px 0 12px; border-radius: 12px; border: 1px solid var(--glass-line); font: inherit; font-weight: 600; font-size: .9rem; color: var(--ink); cursor: pointer;
  background: var(--glass-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230b5d45' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.rt-select:hover, .rt-select:focus { border-color: color-mix(in srgb, var(--brand) 45%, var(--glass-line)); outline: none; }
.rt-select option { color: #13211c; background: #fff; }
.rt-seg { display: flex; height: 42px; border-radius: 12px; overflow: hidden; border: 1px solid var(--glass-line); background: var(--glass-strong); }
.rt-seg button { flex: 1; min-width: 48px; border: 0; background: none; font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; }
.rt-seg button + button { border-left: 1px solid var(--glass-line); }
.rt-seg button:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.rt-voice { height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 0; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 18px -10px var(--brand); white-space: nowrap; }
.rt-voice .icon { width: 18px; height: 18px; }
.rt-voice:hover { filter: brightness(1.08); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="sepia"]) .rt-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f3d58f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); } }
:root[data-theme="dark"] .rt-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f3d58f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
@media (max-width: 720px) {
  .reader-tools { overflow: visible; }
  .reader-tools > .row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .reader-tools > .row::-webkit-scrollbar { display: none; }
  .rt-controls { grid-template-columns: 1fr auto; }
  .rt-jump { grid-column: 1 / 2; }
  .rt-voice { align-self: end; }
}
@media (max-width: 380px) { .rt-voice span { display: none; } .rt-voice { padding: 0 14px; } }

/* "go back" chip after a jump */
.back-chip { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 36; display: flex; align-items: center; gap: 2px; padding: 4px;
  border-radius: 999px; background: linear-gradient(135deg, rgba(224, 182, 90, .96), rgba(184, 134, 42, .96)); color: #1d1503; box-shadow: 0 14px 30px -12px rgba(120, 80, 10, .7); animation: chipin .3s cubic-bezier(.2,.8,.2,1); }
.back-chip[hidden] { display: none; }
@keyframes chipin { from { opacity: 0; transform: translate(-50%, 12px); } }
.back-chip button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.back-go { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 800; white-space: nowrap; }
.back-go:hover { background: rgba(255, 255, 255, .25); }
.back-x { width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; line-height: 1; }
.back-x:hover { background: rgba(0, 0, 0, .1); }
@media (min-width: 960px) { .back-chip { bottom: 100px; left: calc(50% + 130px); } }
.reader-tools .tool-toggle { white-space: nowrap; flex: none; }
.reader-tools { justify-content: stretch; grid-template-columns: minmax(0, 1fr); }
.reader-tools > .row { justify-content: flex-start; }
@media (min-width: 721px) { .rt-controls { grid-template-columns: minmax(170px, 1.3fr) minmax(120px, .6fr) minmax(150px, 1.1fr) auto; } .rt-seg button { min-width: 56px; } }
.player .info span { white-space: nowrap; }
.rt-select, .rt-seg { border-color: color-mix(in srgb, var(--brand) 22%, var(--line)); } .rt-seg button + button { border-left-color: color-mix(in srgb, var(--brand) 22%, var(--line)); }

/* Prayer widget: countdown always stays in the top-right corner */
.sw-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 12px; flex-wrap: nowrap; }
.sw-dates { min-width: 0; }
.sw-dates b, .sw-dates span { overflow-wrap: anywhere; }
.sw-next { min-width: 0; }
.sw-next b { font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: 0; }
.salah-widget.compact .sw-next b { font-size: 1.35rem; }
.salah-widget.compact .sw-dates b { font-size: .98rem; }
.salah-widget.compact .sw-dates span { font-size: .82rem; }
@media (max-width: 360px) { .sw-next b { font-size: 1.15rem; } }
@media (min-width: 1040px) { .dash-layout { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1280px) { .dash-layout { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); } }

/* Dashboard: full prayer schedule right under the greeting on phones / single-column screens */
.dash-top-salah { margin-bottom: 16px; }
@media (min-width: 1280px) { .dash-top-salah { display: none; } }
@media (max-width: 1279px) { .dash-side-salah { display: none; } }
.sw-more { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.sw-x { display: grid; justify-items: center; gap: 1px; padding: 7px 2px; border-radius: 12px; background: var(--glass-soft); border: 1px dashed var(--glass-line); text-align: center; }
.sw-x span { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.sw-x b { font-size: .9rem; }
.sw-forbid { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 8%, transparent); font-size: .8rem; color: var(--ink-2); }
.sw-forbid > b { color: var(--danger); font-size: .82rem; }
.sw-forbid span.on { color: var(--danger); font-weight: 700; }
.salah-widget.full .sw-foot a { margin-left: auto; }
@media (max-width: 400px) { .sw-more { grid-template-columns: repeat(3, 1fr); } .sw-forbid { font-size: .76rem; } }
