/* ==========================================================================
   سكينة — نظام التصميم
   خطوط: Tajawal للواجهة، Amiri للنصوص الشرعية. اتجاه RTL، محمول أولًا.
   ========================================================================== */
:root {
  --font-ui: 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --font-text: 'Amiri', 'Scheherazade New', 'Traditional Arabic', 'Times New Roman', serif;

  --bg: #f4f6f3;
  --bg-elev: #ffffff;
  --bg-soft: #e9efe9;
  --text: #17201d;
  --text-2: #55655f;
  --text-3: #5f6e66;   /* تباين ≥ 4.5:1 على الأبيض وخلفية الصفحة (AA للنص الصغير) */
  --line: #dde4df;
  --primary: #0f766e;
  --primary-strong: #0b5c56;
  --primary-soft: #d9f0ec;
  --on-primary: #ffffff;
  --gold: #8f5e12;   /* تباين ≥ 4.5:1 على gold-soft للرقاقات الذهبية (حديث اليوم) */
  --gold-soft: #fbf1dc;
  --danger: #b42318;
  --danger-soft: #fde8e6;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --hero: linear-gradient(150deg, #0f766e 0%, #0b5c56 55%, #0a4a46 100%);
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 14px rgba(16, 24, 20, .06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 20, .14);
  --radius: 18px;
  --radius-sm: 12px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1412;
  --bg-elev: #122019;
  --bg-soft: #172a23;
  --text: #e8ece9;
  --text-2: #a7b5ad;
  --text-3: #8a9b91;
  --line: #22362e;
  --primary: #2dd4bf;
  --primary-strong: #5eead4;
  --primary-soft: #0f2f2a;
  --on-primary: #05201c;
  --gold: #e2b04a;
  --gold-soft: #2c2410;
  --danger: #f87171;
  --danger-soft: #3a1515;
  --ok: #4ade80;
  --ok-soft: #10301d;
  --hero: linear-gradient(150deg, #115e59 0%, #0f3d3a 60%, #0b2d2b 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 70px; scroll-padding-bottom: calc(var(--tab-h) + 90px); }
body {
  margin: 0; font-family: var(--font-ui); background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.55; -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.3; }
p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- الإطار العام ---------- */
.app { max-width: 600px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); position: relative; }
@media (min-width: 640px) { .app { box-shadow: 0 0 0 1px var(--line); } }
.app-header { padding: calc(10px + var(--safe-t)) 16px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 38px; height: 38px; border-radius: 12px; background: var(--hero); display: grid; place-items: center; box-shadow: var(--shadow); }
.brand-logo svg { width: 24px; height: 24px; }
.brand h1 { font-size: 1.25rem; letter-spacing: -.2px; }
.brand small { display: block; font-size: 0.6875rem; color: var(--text-3); font-weight: 500; margin-top: -2px; }
.header-actions { display: flex; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-elev); display: grid; place-items: center; color: var(--text-2); transition: background .2s, transform .1s; }
.icon-btn:active { transform: scale(.96); }
.icon-btn svg { width: 20px; height: 20px; }

.view-container { flex: 1; padding: 6px 16px calc(var(--tab-h) + var(--safe-b) + 24px); }
.view { display: none; animation: fade .28s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view, * { animation: none !important; transition: none !important; } }

/* ---------- شريط التبويبات ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 600px; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--bg-elev) 88%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 40; }
.tab { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 0.7188rem; font-weight: 700; padding: 6px 2px; position: relative; }
.tab svg { width: 24px; height: 24px; transition: transform .2s; }
.tab.active { color: var(--primary); }
.tab.active svg { transform: translateY(-1px); }
.tab.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary); }

/* ---------- بطاقات ومكوّنات ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-title h2, .card-title h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 20px; height: 20px; color: var(--primary); }
.muted { color: var(--text-2); }
.tiny { font-size: 0.75rem; color: var(--text-3); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; padding: 12px 18px; font-weight: 800; border: 1px solid transparent; transition: transform .1s, background .2s, box-shadow .2s; min-height: 46px; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-outline { background: var(--bg-elev); border-color: var(--line); color: var(--text); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-soft { background: var(--primary-soft); color: var(--primary-strong); }
[data-theme="dark"] .btn-soft { color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; min-height: 36px; font-size: 0.8125rem; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--bg-soft); color: var(--text-2); font-size: 0.7812rem; font-weight: 700; border: 1px solid transparent; }
.chip svg { width: 14px; height: 14px; }
.chip.active { background: var(--primary); color: var(--on-primary); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip-btn { cursor: pointer; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { flex-shrink: 0; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg-soft); border-radius: 14px; padding: 4px; gap: 4px; }
.segmented button { border: 0; background: transparent; border-radius: 11px; padding: 9px 8px; font-weight: 800; color: var(--text-2); }
.segmented button.active { background: var(--bg-elev); color: var(--primary); box-shadow: var(--shadow); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 0.8125rem; font-weight: 700; color: var(--text-2); }
.input, select.input { width: 100%; border: 1px solid var(--line); background: var(--bg-elev); border-radius: 12px; padding: 11px 12px; min-height: 44px; }
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2355655f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 36px; }

.switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--primary); }
.switch input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.switch input:checked + span::after { transform: translateX(-18px); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .label { font-weight: 700; }
.setting-row .desc { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper button { width: 38px; height: 38px; border: 0; background: var(--bg-soft); font-size: 1.125rem; font-weight: 900; }
.stepper output { min-width: 44px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

.toast { pointer-events: none; position: fixed; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); left: 50%; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 700; opacity: 0; transition: .25s; z-index: 60; max-width: 90vw; text-align: center; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.update-banner { position: fixed; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: calc(100% - 24px); max-width: 560px; display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); padding: 10px 12px 10px 16px; border-radius: 14px; font-weight: 700; z-index: 62; box-shadow: var(--shadow-lg); }
.update-banner span:first-child { flex: 1; }
.update-banner .icon-btn { width: 32px; height: 32px; background: transparent; border-color: transparent; color: inherit; }

/* ---------- الورقة السفلية (Sheet) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; opacity: 0; transition: opacity .25s; }
.sheet-backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%); width: 100%; max-width: 600px; max-height: 88vh; background: var(--bg-elev); border-radius: 22px 22px 0 0; z-index: 55; transition: transform .3s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.sheet.show { transform: translate(-50%, 0); }
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-size: 1.0625rem; }
.sheet-body { overflow-y: auto; padding: 14px 18px calc(18px + var(--safe-b)); }

/* ---------- شاشة الصلاة ---------- */
.hero { background: var(--hero); color: #fff; border-radius: 22px; padding: 20px 18px 18px; position: relative; overflow: hidden; box-shadow: 0 14px 34px rgba(11, 92, 86, .3); margin-bottom: 14px; }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .12; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64' fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='M32 4 38 26 60 32 38 38 32 60 26 38 4 32 26 26Z'/%3E%3Cpath d='M32 14 44 32 32 50 20 32Z'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3Cpath d='M0 0 12 12M64 0 52 12M0 64 12 52M64 64 52 52'/%3E%3C/svg%3E"); background-size: 64px 64px; pointer-events: none; }
.hero > * { position: relative; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero-label { font-size: 0.8125rem; opacity: .85; font-weight: 700; }
.hero-prayer { font-size: 2.125rem; font-weight: 900; line-height: 1.1; margin-top: 2px; }
.hero-time { font-size: 1.375rem; font-weight: 800; opacity: .95; font-variant-numeric: tabular-nums; }
.hero-countdown { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.hero-countdown .count { font-size: 2.5rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: 1px; direction: ltr; }
.hero-countdown .lbl { font-size: 0.8125rem; opacity: .85; }
.hero-progress { height: 6px; background: rgba(255,255,255,.22); border-radius: 3px; margin-top: 14px; overflow: hidden; }
.hero-progress i { display: block; height: 100%; background: #fff; border-radius: 3px; transition: width 1s linear; }
.hero-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 0.7812rem; opacity: .9; flex-wrap: wrap; }
.hero .loc-chip { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.hero .loc-chip svg { color: #fff; }

.date-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 4px 12px; font-size: 0.8125rem; color: var(--text-2); }
.date-row b { color: var(--text); font-weight: 800; }

.times { display: flex; flex-direction: column; }
.time-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-radius: 14px; gap: 10px; transition: background .2s; }
.time-row + .time-row { margin-top: 4px; }
.time-row .name { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1rem; }
.time-row .name svg { width: 22px; height: 22px; color: var(--text-3); }
.time-row .time { font-weight: 800; font-size: 1.0625rem; font-variant-numeric: tabular-nums; direction: ltr; }
.time-row.current { background: var(--primary-soft); }
.time-row.current .name, .time-row.current .time { color: var(--primary-strong); }
[data-theme="dark"] .time-row.current .name, [data-theme="dark"] .time-row.current .time { color: var(--primary); }
.time-row.current .name svg { color: var(--primary); }
.time-row .next-badge { font-size: 0.625rem; background: #8a5a12; color: #fff; padding: 2px 8px; border-radius: 999px; font-weight: 800; }
.time-row.sunrise { opacity: .78; }
.time-row.sunrise .name { font-weight: 600; font-size: 0.9375rem; }
.time-row .bell { width: 30px; height: 30px; border: 0; background: transparent; color: var(--text-3); display: grid; place-items: center; border-radius: 8px; }
.time-row .bell.on { color: var(--gold); }
.time-row .bell svg { width: 18px; height: 18px; }

.extras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.extra { background: var(--bg-soft); border-radius: 14px; padding: 12px; text-align: center; }
.extra .v { font-weight: 900; font-size: 1.125rem; font-variant-numeric: tabular-nums; direction: ltr; }
.extra .k { font-size: 0.75rem; color: var(--text-2); font-weight: 700; }

.onboard { text-align: center; padding: 28px 16px; }
.onboard .art { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 28px; background: var(--hero); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.onboard .art svg { width: 56px; height: 56px; }
.onboard h2 { font-size: 1.375rem; margin-bottom: 6px; }
.onboard p { color: var(--text-2); margin-bottom: 18px; }

table.month { width: 100%; border-collapse: collapse; font-size: 0.7188rem; font-variant-numeric: tabular-nums; }
table.month th, table.month td { padding: 7px 2px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.month th { color: var(--text-2); font-weight: 800; position: sticky; top: 0; background: var(--bg-elev); }
table.month tr.today td { background: var(--primary-soft); font-weight: 800; }
table.month td:first-child { text-align: right; font-weight: 700; }
.table-wrap { overflow-x: auto; }

/* ---------- القبلة ---------- */
.qibla-card { padding-bottom: 12px; }
.qibla-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.qibla-head h3 { display: flex; align-items: center; gap: 8px; font-size: 1.0625rem; margin: 0; }
.compass-wrap { position: relative; width: min(82vw, 340px); aspect-ratio: 1; margin: 6px auto 4px; }
.compass-rose { width: 100%; height: 100%; transition: transform .12s linear; will-change: transform; color: var(--text-2); }
.compass-wrap .needle { position: absolute; inset: 0; color: var(--primary); transition: transform .12s linear, color .3s; will-change: transform; }
.compass-wrap .needle svg { width: 100%; height: 100%; display: block; }
.compass-wrap.static .needle { color: var(--text-3); }
.compass-wrap.aligned .needle { color: var(--ok); }
.compass-wrap.aligned .compass-rose { filter: drop-shadow(0 0 22px color-mix(in srgb, var(--ok) 65%, transparent)); }
.compass-wrap.aligned .kaaba-mark circle { stroke: var(--ok); stroke-width: 3; }
.compass-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.compass-center .big-num { position: relative; top: 26%; font-size: 1.875rem; font-weight: 900; font-variant-numeric: tabular-nums; direction: ltr; color: var(--text); background: color-mix(in srgb, var(--bg-elev) 85%, transparent); padding: 2px 10px; border-radius: 12px; line-height: 1.2; }
.compass-wrap.aligned .big-num { color: var(--ok); }
.compass-center .ok-mark svg { width: 30px; height: 30px; stroke-width: 3.2; }
.compass-wrap .level { position: absolute; left: 2%; bottom: 2%; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg-soft); display: grid; place-items: center; }
.compass-wrap .level::before { content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--text-3); opacity: .6; }
.compass-wrap .level i { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); transition: transform .12s linear, background .3s; }
.compass-wrap .level.flat i { background: var(--ok); }
.compass-wrap .start-overlay { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; background: color-mix(in srgb, var(--bg-elev) 55%, transparent); border-radius: 50%; backdrop-filter: blur(2px); text-align: center; padding: 20px; }
.compass-wrap .start-overlay small { font-size: 0.7188rem; color: var(--text-2); max-width: 220px; line-height: 1.6; }
.turn-hint { text-align: center; font-weight: 900; font-size: 1.1875rem; min-height: 30px; margin: 6px 0 2px; color: var(--text); transition: color .3s; }
.turn-hint.big { font-size: 1.25rem; }
.turn-hint.ok, .turn-hint .ok { color: var(--ok); }
.turn-hint.ok::before { content: '✓ '; }
.turn-hint.warn, .turn-hint .warn { color: var(--gold); font-size: 1rem; }
.qibla-foot { text-align: center; margin-top: 8px; }
.calib { display: flex; align-items: center; gap: 10px; background: var(--gold-soft); color: var(--gold); border-radius: 12px; padding: 8px 12px; margin-top: 8px; font-size: 0.8125rem; font-weight: 700; line-height: 1.6; }
.calib.danger { background: var(--danger-soft); color: var(--danger); }
.calib .fig8 { width: 52px; height: 26px; flex: 0 0 auto; }
.calib.uncertain { align-items: flex-start; }
.calib.uncertain > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; font-weight: 600; }
.near-kaaba { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 18px 12px 10px; }
.near-kaaba .nk-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; }
.near-kaaba .nk-icon svg { width: 36px; height: 36px; }
.near-kaaba h4 { margin: 0; font-size: 1.125rem; line-height: 1.5; max-width: 30ch; }
.near-kaaba p { margin: 0; color: var(--text-2); font-size: 0.875rem; line-height: 1.85; max-width: 36ch; }
.calib svg:not(.fig8) { width: 20px; height: 20px; flex: 0 0 auto; }
.sun-mode .sun-dial { width: min(60vw, 240px); margin: 6px auto; }
.sun-mode .sun-dial svg { width: 100%; height: 100%; display: block; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv div { background: var(--bg-soft); border-radius: 12px; padding: 10px 8px; text-align: center; }
.kv .v { font-weight: 900; font-size: 1rem; font-variant-numeric: tabular-nums; direction: ltr; }
.kv .k { font-size: 0.7188rem; color: var(--text-2); font-weight: 700; }
.notice { background: var(--gold-soft); color: var(--gold); border-radius: 12px; padding: 10px 12px; font-size: 0.8125rem; font-weight: 700; display: flex; gap: 8px; align-items: flex-start; }
.notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.info { background: var(--primary-soft); color: var(--primary-strong); }
[data-theme="dark"] .notice.info { color: var(--primary); }
ol.steps { padding-right: 20px; margin: 8px 0 0; color: var(--text-2); font-size: 0.8438rem; }
ol.steps li + li { margin-top: 6px; }

/* ---------- الأذكار ---------- */
.progress-ring { display: flex; align-items: center; gap: 14px; }
.ring { width: 64px; height: 64px; position: relative; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); width: 64px; height: 64px; }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .4s; }
.ring output { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.dhikr { padding: 16px 16px 14px; }
.dhikr.done { opacity: .55; }
.dhikr .text { font-family: var(--font-text); font-size: calc(19px * var(--text-scale, 1)); line-height: 2.05; text-align: justify; text-align-last: right; margin-bottom: 10px; }
.dhikr .ayah { color: var(--primary-strong); }
[data-theme="dark"] .dhikr .ayah { color: var(--primary); }
.dhikr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.count-btn { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--primary); background: var(--bg-elev); color: var(--primary); font-weight: 900; font-size: 1.25rem; font-variant-numeric: tabular-nums; display: grid; place-items: center; flex-shrink: 0; transition: transform .08s, background .2s; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.count-btn:active { transform: scale(.92); background: var(--primary-soft); }
.count-btn.done { background: var(--primary); color: var(--on-primary); }
.count-btn small { font-size: 0.625rem; display: block; font-weight: 700; }
.ref { font-size: 0.75rem; color: var(--text-3); }
.virtue { font-size: 0.8125rem; color: var(--text-2); background: var(--bg-soft); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
details.more { margin-top: 8px; }
details.more summary { cursor: pointer; font-size: 0.7812rem; color: var(--primary); font-weight: 700; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: '▸ '; }
details.more[open] summary::before { content: '▾ '; }

/* ---------- الأحاديث ---------- */
.hadith { padding: 16px; }
.hadith .matn { font-family: var(--font-text); font-size: calc(18.5px * var(--text-scale, 1)); line-height: 2.05; text-align: justify; text-align-last: right; }
.hadith .narr { font-size: 0.8125rem; color: var(--text-2); margin-top: 8px; font-weight: 700; }
.hadith .refline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.hadith .lesson { font-size: 0.875rem; color: var(--text-2); background: var(--bg-soft); border-radius: 10px; padding: 10px 12px; margin-top: 10px; line-height: 1.8; }
.hadith.daily { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); background: linear-gradient(180deg, var(--gold-soft), var(--bg-elev) 60%); }
.hadith-actions { display: flex; gap: 4px; }
.hadith-actions .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
.hadith-actions .icon-btn.fav { color: var(--danger); }
.search { position: relative; margin-bottom: 10px; }
.search input { padding-right: 40px; }
.search svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); }
.empty { text-align: center; color: var(--text-3); padding: 30px 10px; }

/* ---------- الإعدادات ---------- */
.about p { font-size: 0.8125rem; color: var(--text-2); margin-bottom: 8px; line-height: 1.8; }
.about code { font-family: ui-monospace, monospace; font-size: 0.75rem; background: var(--bg-soft); padding: 1px 6px; border-radius: 6px; direction: ltr; display: inline-block; }
.city-list { display: flex; flex-direction: column; }
.city-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line); background: none; border-inline: 0; border-top: 0; width: 100%; text-align: right; }
.city-item .c { font-size: 0.75rem; color: var(--text-3); }
.city-item:hover { background: var(--bg-soft); }
.spinner { width: 18px; height: 18px; border: 3px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.text-scale-ctl { display: inline-flex; gap: 4px; }
.text-scale-ctl button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-elev); font-weight: 900; }

/* ---------- المصحف ---------- */
/* خط Amiri Quran (SIL OFL) مضمّن محليًا حتى يُعرض الرسم العثماني وعلامات الوقف صحيحة دون الاعتماد على الشبكة */
@font-face { font-family: 'Amiri Quran'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/AmiriQuran.woff2') format('woff2'); }

.surah-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: right; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 6px; }
.surah-row:hover { background: var(--bg-soft); }
.surah-row .num { width: 36px; height: 36px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-strong); display: grid; place-items: center; font-weight: 900; font-size: 0.8125rem; flex-shrink: 0; }
[data-theme="dark"] .surah-row .num { color: var(--primary); }
.surah-row .nm { font-weight: 800; font-size: 0.9375rem; }
.surah-row .info { font-size: 0.75rem; color: var(--text-3); }
.surah-row .pg { margin-right: auto; font-size: 0.75rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.resume-card { background: var(--hero); color: #fff; border-radius: 18px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; box-shadow: 0 10px 26px rgba(11,92,86,.28); }
.resume-card b { font-size: 1.0625rem; display: block; }
.resume-card small { opacity: .85; font-size: 0.7812rem; }
.resume-card .btn { background: #fff; color: var(--primary-strong); }

/* وضع مراجعة الحفظ */
@keyframes reveal { from { background: var(--gold-soft); } to { background: transparent; } }
.hifz-panel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.hifz-word { font-family: 'Amiri Quran', 'Amiri', serif; font-size: calc(34px * var(--quran-scale, 1)); text-align: center; min-height: 64px; display: grid; place-items: center; color: var(--primary-strong); }
[data-theme="dark"] .hifz-word { color: var(--primary); }
.hifz-word small { font-family: var(--font-ui); font-size: 0.75rem; color: var(--text-3); }
.hifz-heard { font-size: 0.8125rem; color: var(--text-3); text-align: center; min-height: 20px; direction: rtl; }
.hifz-ctl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.mic-btn { position: relative; }
.mic-btn.listening { background: var(--danger); color: #fff; box-shadow: 0 0 0 6px var(--danger-soft); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px var(--danger-soft); } 50% { box-shadow: 0 0 0 10px transparent; } }
.hifz-progress { height: 6px; background: var(--bg-soft); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.hifz-progress i { display: block; height: 100%; background: var(--primary); transition: width .3s; }

/* شريط التلاوة */
.audio-bar { position: fixed; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); left: 50%; transform: translateX(-50%); width: calc(100% - 24px); max-width: 576px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 10px 12px; z-index: 45; }
.audio-bar .row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.audio-bar .who { font-size: 0.7812rem; font-weight: 800; }
.audio-bar .where { font-size: 0.75rem; color: var(--text-3); }
.audio-bar .ctl { display: flex; align-items: center; gap: 4px; }
.audio-bar .ctl .icon-btn { width: 38px; height: 38px; }
.audio-bar .ctl .play { background: var(--primary); color: var(--on-primary); border-color: transparent; width: 44px; height: 44px; }
.audio-bar .bar { height: 4px; background: var(--bg-soft); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.audio-bar .bar i { display: block; height: 100%; background: var(--primary); width: 0; }
.audio-bar .opts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.audio-bar .opts .chip { padding: 4px 10px; font-size: 0.75rem; }
.has-audio .view-container { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 140px); }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.more-tile { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 14px; text-align: center; box-shadow: var(--shadow); font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.more-tile svg { width: 28px; height: 28px; color: var(--primary); }
.more-tile small { font-weight: 600; color: var(--text-3); font-size: 0.75rem; }

/* ==========================================================================
   صفحة مصحف المدينة (عارض بدقة الطباعة — js/ui/mushaf-page.js)
   ========================================================================== */
.mp {
  --gold-1: #a98a3a; --gold-2: #cfb46f; --gold-3: #e9dcb2; --frame: #2f5a3a; --marker: #8f7430; --rub: #b8336a;
  --mp-hl: rgba(15, 118, 110, .16); --mp-sel: rgba(183, 121, 31, .22); --mp-hide: rgba(60, 50, 20, .13); --mp-hide-line: rgba(60, 50, 20, .25);
  --mp-size: 20px;
  position: relative; display: flex; flex-direction: column; background: var(--paper-bg, var(--paper)); color: var(--ink);
  border-radius: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 12px 30px rgba(0, 0, 0, .22);
  padding: calc(var(--mp-size) * .45) calc(var(--mp-size) * .55) calc(var(--mp-size) * .35);
  direction: rtl; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.mp.night { color-scheme: dark; }
.mp-head, .mp-foot { font-family: 'Amiri Quran', 'Amiri', 'Scheherazade New', serif; color: var(--ink); opacity: .85; line-height: 1.4; }
.mp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: calc(var(--mp-size) * .62); padding: 0 calc(var(--mp-size) * .15); }
.mp-foot { text-align: center; font-size: calc(var(--mp-size) * .68); margin-top: calc(var(--mp-size) * .15); letter-spacing: .05em; }
.mp-body { position: relative; display: grid; grid-template-rows: repeat(15, minmax(0, 1fr)); grid-template-columns: minmax(0, 1fr); aspect-ratio: 1 / 1.108; width: 100%; min-height: 0; line-height: 1; direction: rtl; visibility: hidden; }
.mp.ready .mp-body { visibility: visible; animation: mp-in .25s ease; }
@keyframes mp-in { from { opacity: 0 } to { opacity: 1 } }
/* النص المؤقت ريثما يصل خط الصفحة يظهر فورًا بلا تلاشٍ؛ وصفحة المصحف تحلّ محلّه بتلاشٍ قصير */
.mp.interim .mp-body { animation: none; }
.mp.swap .mp-body { animation: mp-in .3s ease; }
.mp.loading .mp-body::after, .mp.font-error .mp-body::after { content: ''; position: absolute; inset: 0; visibility: visible; background: repeating-linear-gradient(180deg, transparent 0 calc(100% / 15 * .3), color-mix(in srgb, var(--ink) 6%, transparent) calc(100% / 15 * .3) calc(100% / 15 * .7), transparent calc(100% / 15 * .7) calc(100% / 15)); border-radius: 4px; animation: mp-pulse 1.4s ease-in-out infinite; }
.mp.font-error .mp-body::after { animation: none; }
@keyframes mp-pulse { 0%, 100% { opacity: .5 } 50% { opacity: 1 } }
.mp .ml { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; white-space: nowrap; }
.mp .mlw { display: inline-block; white-space: pre; }
.mp .mw, .mp .me { display: inline-block; line-height: 1; vertical-align: baseline; white-space: pre; border-radius: .16em; transition: color .25s, background-color .25s; }
.mp .me { color: var(--marker); }
.mp .rub { color: var(--rub); }
.mp .sajda { color: var(--marker); }
.mp .mw.hl, .mp .me.hl { background: var(--mp-hl); box-shadow: 0 0 0 .08em var(--mp-hl); }
.mp .mw.sel, .mp .me.sel { background: var(--mp-sel); box-shadow: 0 0 0 .08em var(--mp-sel); }
/* ملء الشاشة: الصفحة تملأ الشريحة والأسطر تتوزع على الارتفاع */
.mp.mp-full { width: 100%; height: 100%; border-radius: 0; box-shadow: none; padding: calc(var(--safe-t) + 8px) max(3.5%, env(safe-area-inset-right, 0px)) calc(var(--safe-b) + 6px) max(3.5%, env(safe-area-inset-left, 0px)); }
.mp.mp-full .mp-head { font-size: calc(var(--mp-size) * .66); padding: 0 1%; flex: 0 0 auto; }
.mp.mp-full .mp-mid { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: calc(var(--mp-size) * .3) 0; }
.mp.mp-full .mp-body { aspect-ratio: auto; height: 100%; }
.mp.mp-full .mp-foot { flex: 0 0 auto; font-size: calc(var(--mp-size) * .8); margin-top: 0; }
.mp.mp-full.loading .mp-body::after, .mp.mp-full.font-error .mp-body::after { inset: 4% 2%; }
/* ترويسة السورة: إطار مذهّب بزخرفة على الجانبين واسم السورة بخط أسماء السور */
.mp .mh { padding: 0 calc(var(--mp-size) * .1); }
.mp .sframe { position: relative; width: 100%; height: 88%; max-height: calc(var(--mp-size) * 1.45); display: flex; align-items: center; justify-content: center; border: 1px solid var(--gold-1); border-radius: 4px; box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px var(--gold-2); background: var(--paper); overflow: hidden; }
.mp .sframe::before, .mp .sframe::after { content: ''; position: absolute; top: 4px; bottom: 4px; width: 32%; opacity: .9; background-repeat: repeat-x; background-size: auto 100%; background-position: center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20'><g fill='none' stroke='%23b8993f' stroke-width='1'><path d='M0 10c6-8 14-8 20 0s14 8 20 0'/><path d='M0 10c6 8 14 8 20 0s14-8 20 0'/><circle cx='10' cy='10' r='2.2' fill='%23cfb46f' stroke='none'/><circle cx='30' cy='10' r='2.2' fill='%23cfb46f' stroke='none'/><path d='M20 4l2 6-2 6-2-6z' fill='%23b8993f' stroke='none'/></g></svg>"); }
.mp .sframe::before { right: 4px; -webkit-mask-image: linear-gradient(to left, #000 70%, transparent); mask-image: linear-gradient(to left, #000 70%, transparent); }
.mp .sframe::after { left: 4px; -webkit-mask-image: linear-gradient(to right, #000 70%, transparent); mask-image: linear-gradient(to right, #000 70%, transparent); }
.mp .sname { position: relative; z-index: 1; font-family: 'surahnames', serif; font-size: calc(var(--mp-size) * .86); line-height: 1; color: var(--ink); padding: 0 .6em; background: var(--paper); direction: ltr; letter-spacing: 0; }
/* البسملة: رسم SVG */
.mp .mb svg { height: 78%; max-height: calc(var(--mp-size) * 1.5); width: auto; max-width: 62%; color: var(--ink); display: block; }
/* الصفحتان الأوليان: 8 أسطر في وسط الصفحة داخل إطار مزخرف */
.mp .mframe { position: absolute; top: 17.5%; bottom: 21.5%; left: 1.5%; right: 1.5%; pointer-events: none; border: 2px solid var(--gold-1); border-radius: 10px; box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--gold-2), 0 0 0 4px var(--paper), 0 0 0 5px var(--gold-2); }
.mp .mframe::before { content: ''; position: absolute; inset: 6px; border-radius: 6px; border: 1px solid var(--gold-3); }
.mp .mframe::after { content: ''; position: absolute; inset: -14px; border-radius: 14px; border: 1px solid var(--gold-3); opacity: .8; }
/* البديل النصي (بلا خطوط الصفحات): نص متدفق بخط Amiri Quran بالبنية نفسها */
.mp .mp-body.text { display: block; aspect-ratio: auto; height: auto; min-height: 0; font-family: var(--quran-font, 'Amiri Quran'), 'Amiri', serif; font-size: calc(var(--mp-size) * .95); line-height: 2.05; text-align: justify; text-align-last: center; padding: .2em .1em; overflow: hidden; }
.mp.mp-full .mp-body.text { font-size: calc(var(--mp-size) * 1.02); line-height: 2.15; height: 100%; overflow-y: auto; touch-action: pan-x pan-y; padding: .2em .4em; }
.mp.mp-full:has(.mp-body.text) .mp-mid { align-items: stretch; }
.mp .mp-body.text .ml { display: flex; height: calc(var(--mp-size) * 1.6); margin: .2em 0; }
.mp .mp-body.text .sname.plain { font-family: 'Amiri Quran', 'Amiri', serif; font-size: calc(var(--mp-size) * .9); direction: rtl; }
.mp .mp-body.text .mb svg { height: calc(var(--mp-size) * 1.3); }
.mp .mp-body.text .mw.mark { color: var(--gold-1); font-size: .75em; }
.mp .mp-body.text .me { color: var(--marker); font-size: .95em; }
/* وضع التسميع (إخفاء الكلمات) */
.mp.hifz .mw[data-k]:not(.revealed) { color: transparent; background: var(--mp-hide); box-shadow: inset 0 -.08em 0 var(--mp-hide-line); }
.mp.hifz .mw[data-k]:not(.revealed) .rub { color: transparent; }
.mp.hifz .mw.current { background: var(--primary-soft); box-shadow: inset 0 -.12em 0 var(--primary); animation: mp-pulse 1.2s ease-in-out infinite; }
.mp.hifz .mw.revealed { color: var(--ink); background: transparent; box-shadow: none; animation: reveal .35s ease; }
.mp.hifz.only-current .mw.revealed:not(.last) { color: transparent; background: var(--ok-soft); box-shadow: inset 0 -.08em 0 var(--ok); }

/* ==========================================================================
   قارئ المصحف بملء الشاشة (js/ui/mushaf-reader.js)
   ========================================================================== */
.mreader { --paper: #f6f1e2; --paper-2: #efe7d1; --ink: #1d1a14; --chrome: rgba(24, 36, 22, .94); --chrome-2: rgba(38, 58, 36, .9); --chrome-ink: #f1ead6; --chrome-gold: #cdb371; position: fixed; inset: 0; z-index: 44; background: var(--reader-bg, var(--paper-2)); transition: background .35s; color: var(--chrome-ink); direction: rtl; overflow: hidden; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.mreader.night { --chrome: rgba(12, 16, 12, .94); --chrome-2: rgba(26, 32, 25, .92); --chrome-gold: #a8914f; }
.mreader[hidden] { display: none; }
/* منصة الصفحات: الشاشة كلها */
.mr-stage { position: absolute; inset: 0; }
.mr-track { width: 100%; height: 100%; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
.mr-track::-webkit-scrollbar { display: none; }
.mr-slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; position: relative; }
.mr-ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Amiri Quran', 'Amiri', serif; font-size: 1.625rem; color: #b3a683; }
.mreader.night .mr-ph { color: #6d6650; }
body.has-audio .mreader .mr-track { height: calc(100% - 150px); }
/* الطبقتان العلوية والسفلية (تظهران بنقرة) */
.mr-top, .mr-bottom { position: absolute; left: 0; right: 0; z-index: 2; background: var(--chrome); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .25s; }
.mr-top { top: 0; padding-top: var(--safe-t); transform: translateY(-100%); opacity: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.mr-bottom { bottom: 0; padding-bottom: var(--safe-b); transform: translateY(100%); opacity: 0; border-top: 1px solid rgba(255,255,255,.08); }
.mreader.chrome .mr-top, .mreader.chrome .mr-bottom { transform: none; opacity: 1; }
/* لوحة علوية (مراجعة الحفظ) تبقى ظاهرة ولو أُخفيت الأدوات */
.mreader.has-panel .mr-top { transform: none; opacity: 1; }
.mreader.has-panel:not(.chrome) .mr-topbar, .mreader.has-panel .mr-strip-wrap { display: none; }
.mr-topbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 0; }
.mr-group { display: flex; gap: 4px; }
.mr-btn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--chrome-ink); display: grid; place-items: center; cursor: pointer; }
.mr-btn svg { width: 24px; height: 24px; }
.mr-btn:active { background: rgba(255,255,255,.08); }
.mr-btn.active { color: var(--chrome-gold); background: rgba(255,255,255,.08); }
/* شريط أسماء السور */
.mr-strip-wrap { position: relative; height: 80px; }
.mr-surahs { --sn-w: clamp(120px, 34vw, 170px); display: flex; align-items: center; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 calc(50% - var(--sn-w) / 2); gap: 0; }
.mr-surahs::-webkit-scrollbar { display: none; }
.mr-sname { flex: 0 0 var(--sn-w); width: var(--sn-w); height: 68px; scroll-snap-align: center; border: 0; background: transparent; color: var(--chrome-ink); display: grid; place-items: center; cursor: pointer; opacity: .55; transition: opacity .25s; padding: 0; }
.mr-sname.cur { opacity: 1; }
.mr-sname .glyph { font-family: 'surahnames', serif; font-size: 1.625rem; line-height: 1; direction: ltr; display: none; white-space: nowrap; transition: font-size .25s; }
.mr-sname.cur .glyph { font-size: 2.125rem; }
.mr-sname .plain { font-family: 'Amiri Quran', 'Amiri', serif; font-size: 1.1875rem; white-space: nowrap; }
.mr-sname.cur .plain { font-size: 1.5rem; }
.mreader.snames .mr-sname .glyph { display: block; }
.mreader.snames .mr-sname .plain { display: none; }
.mr-octagon { position: absolute; left: 50%; top: 50%; width: min(240px, 62vw); height: 70px; transform: translate(-50%, -50%); pointer-events: none; color: var(--chrome-gold); opacity: .9; }
.mr-octagon svg { width: 100%; height: 100%; display: block; }
.mr-panel { padding: 0 12px; }
.mr-panel:empty { display: none; }
.mr-panel .hifz-panel { margin: 6px 0 8px; padding: 8px 12px; }
.mr-panel .hifz-word { min-height: 44px; font-size: 1.75rem; }
.mr-panel .hifz-ctl { margin-top: 6px; gap: 6px; }
.mr-panel .hifz-ctl .btn { padding: 8px 10px; font-size: 0.8438rem; min-height: 40px; }
.mr-panel .hifz-progress { margin-top: 6px; }
.mr-panel .hifz-heard { min-height: 16px; font-size: 0.75rem; }
/* الأسفل */
.mr-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px 4px; }
.mr-round { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--chrome-2); color: var(--chrome-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.mr-round svg { width: 24px; height: 24px; }
.mr-round.active { color: var(--chrome-gold); }
.mr-juz { font-family: 'Amiri Quran', 'Amiri', serif; font-size: 1.5625rem; text-align: center; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-stars-wrap { position: relative; height: 62px; }
.mr-stars { position: relative; z-index: 1; display: flex; align-items: center; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 calc(50% - 26px); gap: 8px; }
.mr-stars::-webkit-scrollbar { display: none; }
.mr-star { position: relative; flex: 0 0 52px; width: 52px; height: 52px; scroll-snap-align: center; border: 0; background: transparent; padding: 0; cursor: pointer; display: grid; place-items: center; }
.mr-star i { position: absolute; width: 30px; height: 30px; background: var(--chrome-ink); clip-path: polygon(var(--mr-star)); opacity: .85; transition: width .2s, height .2s, background .2s; }
.mr-star b { position: relative; font-family: 'Amiri Quran', 'Amiri', serif; font-size: 1.0625rem; color: #1f2d1c; display: none; line-height: 1; }
.mr-star.cur i { width: 46px; height: 46px; background: var(--chrome-gold); }
.mr-star.cur::before { content: ''; position: absolute; width: 38px; height: 38px; background: var(--chrome-ink); clip-path: polygon(var(--mr-star)); }
.mr-star.cur b { display: block; }
.mr-star-sel { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; transform: translate(-50%, -50%); pointer-events: none; z-index: 0; }
.mr-star-sel::before { content: ''; position: absolute; inset: 0; background: var(--chrome-gold); clip-path: polygon(var(--mr-star)); opacity: .35; }
/* تلميح أول مرة */
.mr-hint { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 18px); transform: translateX(-50%); z-index: 3; background: rgba(24, 36, 22, .92); color: var(--chrome-ink); font-size: 0.7812rem; font-weight: 700; padding: 10px 14px; border-radius: 14px; max-width: 88vw; text-align: center; line-height: 1.6; box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: fade .4s ease; }
/* مشغّل التلاوة فوق القارئ */
body.mreader-open .audio-bar { bottom: calc(8px + var(--safe-b)); z-index: 46; }
body.mreader-open .tabbar { visibility: hidden; }
body.mreader-open { overflow: hidden; overscroll-behavior: none; } /* لا يتحرك المستند (وقائمة السور) خلف القارئ عند السحب أو الارتداد */
/* وضع الخريطة في شاشة القبلة: يابسة بإسقاط مستطيل وقوس الدائرة العظمى إلى الكعبة */
.map-mode .qmap { width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: #cfe3ee; border: 1px solid var(--line); margin-top: 6px; }
[data-theme="dark"] .map-mode .qmap { background: #0f2230; }
.map-mode .qmap svg { width: 100%; height: 100%; display: block; }
.map-mode .qmap .land { fill: #e8e1c8; stroke: #b9ad86; stroke-width: .25; }
[data-theme="dark"] .map-mode .qmap .land { fill: #2a3326; stroke: #465340; }
.map-mode .qmap .grat { stroke: rgba(0,0,0,.08); stroke-width: .2; fill: none; }
[data-theme="dark"] .map-mode .qmap .grat { stroke: rgba(255,255,255,.08); }
.map-mode .qmap .arc { fill: none; stroke: var(--primary); stroke-width: 1.1; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.map-mode .qmap .arc-halo { fill: none; stroke: #fff; stroke-width: 3; stroke-opacity: .7; vector-effect: non-scaling-stroke; }
.map-mode .qmap .rhumb { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.map-mode .legend { display: flex; gap: 14px; justify-content: center; font-size: 0.75rem; color: var(--text-2); margin-top: 8px; flex-wrap: wrap; }
.map-mode .legend i { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--primary); vertical-align: middle; margin-left: 4px; }
.map-mode .legend i.rh { border-top: 2px dashed var(--gold); }
.map-mode .map-toggle { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
/* شريط خيارات الآية (يظهر بنقرة على الآية) */
.mr-ayahbar { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 12px); transform: translateX(-50%); width: min(560px, calc(100% - 20px)); z-index: 3; background: var(--bg-elev); color: var(--text); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); direction: rtl; animation: mp-in .2s ease; }
.mr-ayahbar[hidden] { display: none; }
.ayahbar { padding: 8px 10px 10px; }
.ayahbar .ab-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 6px; }
.ayahbar .ab-head b { font-size: 0.875rem; }
.ayahbar .ab-head .icon-btn { width: 30px; height: 30px; border-radius: 9px; }
.ayahbar .ab-actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.ayahbar .ab-actions button { border: 0; background: transparent; border-radius: 12px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.6875rem; font-weight: 800; color: var(--text-2); cursor: pointer; }
.ayahbar .ab-actions button svg { width: 22px; height: 22px; color: var(--primary); }
.ayahbar .ab-actions button:active { background: var(--bg-soft); }
.ayahbar .ab-actions button.on { color: var(--gold); } .ayahbar .ab-actions button.on svg { color: var(--gold); }
/* التفسير */
.tafsir-src { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.tafsir-src::-webkit-scrollbar { display: none; }
.tafsir-src .chip { flex-shrink: 0; }
.tafsir-ayah { font-family: 'Amiri Quran', 'Amiri', serif; font-size: 1.25rem; line-height: 2.1; text-align: justify; text-align-last: right; background: var(--gold-soft); border-radius: 14px; padding: 10px 14px; color: var(--text); }
.tafsir-body { font-family: var(--font-text); font-size: calc(17px * var(--text-scale, 1)); line-height: 2; color: var(--text); text-align: justify; text-align-last: right; min-height: 80px; }
.tafsir-body p { margin: 0 0 10px; }
.tafsir-body b { color: var(--primary-strong); font-weight: 700; }
[data-theme="dark"] .tafsir-body b { color: var(--primary); }
.tafsir-body i { color: var(--gold); font-style: normal; }
.tafsir-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tafsir-foot { font-size: 0.7188rem; color: var(--text-3); }
/* الاستماع */
.listen-reciters { max-height: 34vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; padding: 2px 8px; }
.listen-reciters .surah-row { padding: 9px 4px; }
.listen-reciters .surah-row.on .num { background: var(--primary); color: var(--on-primary); }
.diag { font-family: ui-monospace, monospace; font-size: 0.6562rem; line-height: 1.6; white-space: pre-wrap; word-break: break-all; background: var(--bg-soft); border-radius: 10px; padding: 8px 10px; direction: ltr; text-align: left; margin-top: 6px; color: var(--text-2); }
/* وضع النص المتدفق داخل القارئ */
.mreader.text-mode .mp.mp-full .mp-body.text { font-size: calc(var(--mp-size) * 1.02 * var(--quran-scale, 1)); line-height: 2.15; overflow-y: auto; height: 100%; padding: .2em .4em; }
.mreader.text-mode .mp.mp-full .mp-mid { align-items: stretch; }

/* ---------- تظليل الكلمة أثناء التلاوة، العلامات الملوّنة، خطة الختمة، التنزيلات ---------- */
.mp .mw.wl { background: color-mix(in srgb, var(--gold-1) 38%, transparent); border-radius: .18em; box-shadow: 0 0 0 .08em color-mix(in srgb, var(--gold-1) 38%, transparent); transition: background .12s; }
.mp.night .mw.wl { background: color-mix(in srgb, var(--gold-1) 45%, transparent); }
.bm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; background: var(--gold); }
.bm-dot.green { background: var(--ok); } .bm-dot.red { background: var(--danger); } .bm-dot.blue { background: #2563eb; }
.bm-colors { display: flex; gap: 8px; }
.bm-colors button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.bm-colors button.on { border-color: var(--text); }
.bm-note { font-size: .8125rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.khatmah-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.khatmah-card .kh-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.khatmah-card .kh-head b { font-size: 1rem; }
.khatmah-card .kh-bar { height: 8px; background: var(--bg-soft); border-radius: 4px; overflow: hidden; margin: 10px 0 8px; }
.khatmah-card .kh-bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.khatmah-card .kh-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8125rem; color: var(--text-2); }
.khatmah-card .kh-meta b { color: var(--text); }
.dl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.dl-row:last-child { border-bottom: 0; }
.dl-row .nm { font-weight: 700; } .dl-row .info { font-size: .75rem; color: var(--text-3); }
.dl-row .prog { font-variant-numeric: tabular-nums; font-size: .8125rem; color: var(--primary); min-width: 44px; text-align: center; }

/* ---------- المرحلة 3: حصن المسلم، المسبحة، بطاقات المشاركة ---------- */
.more-tile.sm { padding: 12px 10px; gap: 4px; }
.more-tile.sm svg { width: 22px; height: 22px; }
.dhikr-actions { display: flex; gap: 4px; margin-top: 6px; }
.dhikr-actions .icon-btn { width: 32px; height: 32px; border-radius: 10px; }
.dhikr-actions .icon-btn svg { width: 17px; height: 17px; }
.audio-btn.playing { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.hisn-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hisn-title { font-size: 1.05rem; margin: 0; line-height: 1.4; }
.hisn-sec { padding: 6px 8px 2px; }
.hisn-sec-title { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 0.8125rem; color: var(--primary-strong); padding: 6px 8px 8px; }
.hisn-sec-title svg { width: 14px; height: 14px; color: var(--danger); }
.hisn-row { padding: 10px 6px; }
.hisn-row .num { font-size: 0.75rem; }
.hisn-row .nm { line-height: 1.5; }
.hisn-snippet { font-family: var(--font-text); font-weight: 500; font-size: 0.9375rem; }
.hisn-fav { margin-right: auto; color: var(--danger); display: inline-flex; }
.hisn-fav svg { width: 16px; height: 16px; }
.hisn-nav .btn { overflow: hidden; }
.hisn-nav .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.fav { color: var(--danger); }
.tasbih-card { text-align: center; padding: 20px 16px 16px; }
.tasbih-phrase { font-family: var(--font-text); font-size: calc(1.4rem * var(--text-scale, 1)); line-height: 1.9; color: var(--primary-strong); margin-bottom: 14px; }
.tasbih-btn { --pct: 0; position: relative; width: min(64vw, 260px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; border: 0; display: grid; place-content: center; gap: 2px; color: var(--primary-strong); background: radial-gradient(circle at 50% 45%, var(--bg-elev) 0 66%, transparent 67%), conic-gradient(var(--primary) calc(var(--pct) * 360deg), var(--primary-soft) 0); box-shadow: var(--shadow); transition: transform .08s; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.tasbih-btn:active { transform: scale(.96); }
.tasbih-btn.reached { color: var(--on-primary); background: var(--primary); }
.tasbih-count { font-size: 4rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.tasbih-btn small { font-size: 0.8125rem; color: var(--text-3); font-weight: 700; }
.tasbih-btn.reached small { color: var(--on-primary); }
.tasbih-rounds { margin-top: 12px; font-weight: 700; color: var(--text-2); }
.tasbih-stats { margin-top: 10px; }
.chip-text { font-family: var(--font-text); font-size: 0.9375rem; font-weight: 600; }
.share-preview { display: block; width: 100%; max-height: 52vh; object-fit: contain; border-radius: 12px; background: var(--bg-soft); min-height: 120px; }
.hadith.nawawi .narr { font-size: 0.8125rem; line-height: 1.8; }

/* ---------- تهيئة أول تشغيل ---------- */
.onboard-screen { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); animation: ob-in .28s ease; }
.onboard-screen.leaving { animation: ob-out .25s ease forwards; }
@keyframes ob-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ob-out { to { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .onboard-screen, .onboard-screen.leaving { animation: none; } }
body.onboarding { overflow: hidden; }
.ob-inner { max-width: 480px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; gap: 16px; }
.ob-dots { display: flex; justify-content: center; gap: 8px; padding: 4px 0; }
.ob-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: width .2s, background .2s; }
.ob-dots i.on { width: 24px; border-radius: 4px; background: var(--primary); }
.ob-dots i.done { background: var(--primary-soft); }
.ob-step { display: flex; flex-direction: column; gap: 14px; text-align: center; flex: 1; justify-content: center; }
.ob-step h1 { font-size: 2.2rem; margin: 0; color: var(--primary-strong); }
.ob-step h2 { font-size: 1.5rem; margin: 0; }
.ob-logo { width: 84px; height: 84px; margin: 0 auto; border-radius: 26px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; box-shadow: var(--shadow); }
.ob-logo svg { width: 42px; height: 42px; }
.ob-lead { color: var(--text-2); line-height: 1.9; font-size: 0.9375rem; margin: 0; }
.ob-list { list-style: none; padding: 0; margin: 0; text-align: right; display: flex; flex-direction: column; gap: 10px; }
.ob-list li { display: flex; align-items: center; gap: 10px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-weight: 700; font-size: 0.9rem; }
.ob-list li > span { display: inline-flex; width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-strong); align-items: center; justify-content: center; flex-shrink: 0; }
.ob-list li svg { width: 18px; height: 18px; }
.btn-lg { min-height: 52px; font-size: 1.05rem; border-radius: 14px; }
.ob-step .card { margin-bottom: 0; }
.ob-step .field { text-align: right; }

/* روابط داخل النص: تمييز لا يعتمد على اللون وحده (إتاحة) */
p a, .tiny a, .refline a, li a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- المرحلة 5 للمصحف: زر الرجوع الدائم، التعتيم، شبكة السمات، تبويبات الانتقال ---------- */
.mr-exit { position: absolute; top: calc(var(--safe-t) + 6px); left: 50%; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px 0 9px; border: 0; border-radius: 999px; background: var(--chrome); color: var(--chrome-ink); font-weight: 800; font-size: .8125rem; box-shadow: 0 2px 8px rgba(0,0,0,.22); opacity: .92; transition: opacity .35s, transform .2s; cursor: pointer; }
.mr-exit svg { width: 16px; height: 16px; }
.mr-exit.faded { opacity: .38; }
.mr-exit:active { transform: translateX(-50%) scale(.96); opacity: 1; }
.mreader:has(.mr-stage.pulling) .mr-exit { opacity: 0; }
.veil-panel b { color: var(--chrome-ink); }
.mreader.chrome .mr-exit, .mreader.has-panel .mr-exit, .mreader.hifz .mr-exit { opacity: 0; pointer-events: none; }
.mr-dim { position: absolute; inset: 0; z-index: 1; background: #000; opacity: 0; pointer-events: none; transition: opacity .3s; }
.theme-groups { display: flex; flex-direction: column; gap: 10px; }
.theme-group-title { font-size: .78rem; font-weight: 800; color: var(--text-3); margin: 2px 0 6px; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-swatch { display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: 0; padding: 4px 2px; border-radius: 12px; color: var(--text-2); font-size: .72rem; font-weight: 700; cursor: pointer; }
.theme-swatch .sw { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-family: 'Amiri Quran', 'Amiri', serif; font-size: 1.35rem; line-height: 1; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); transition: transform .12s, border-color .2s; }
.theme-swatch.active .sw { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), inset 0 0 0 2px rgba(255,255,255,.35); transform: scale(1.06); }
.theme-swatch.active { color: var(--primary-strong); }
.theme-swatch:active .sw { transform: scale(.95); }
.range { width: 100%; accent-color: var(--primary); }
.goto-tabs { margin-bottom: 8px; }
.goto-list { max-height: 48vh; overflow-y: auto; margin: 0 -6px; }
.goto-page { display: flex; align-items: center; gap: 10px; }
.goto-page input[type=number] { width: 88px; }
.mreader.text-mode .mp.mp-full .mp-body.text { line-height: var(--quran-lh, 2.15); }

/* ---------- المصحف 6: التجويد الملوّن، إخفاء الآيات، التصفح الرأسي، التمرير التلقائي، التحدّيات وخريطة الحرارة ---------- */
.mreader { --tj-madd6: #b3001b; --tj-madd45: #d32f2f; --tj-madd246: #e65100; --tj-madd2: #c98a00; --tj-ghunnah: #2e7d32; --tj-qalqala: #1565c0; --tj-silent: #8a8a8a; --tj-idgham: #5c6bc0; --tj-other: #6a1b9a; }
.mreader.night { --tj-madd6: #ff5c6c; --tj-madd45: #ff7b7b; --tj-madd246: #ffa14d; --tj-madd2: #ffc94d; --tj-ghunnah: #66d97a; --tj-qalqala: #64b5f6; --tj-silent: #8d8d8d; --tj-idgham: #9fa8ff; --tj-other: #ce93d8; }
.tj-m { color: var(--tj-madd6); } .tj-o { color: var(--tj-madd45); } .tj-p { color: var(--tj-madd246); } .tj-n { color: var(--tj-madd2); }
.tj-g, .tj-f, .tj-c, .tj-i, .tj-a, .tj-w { color: var(--tj-ghunnah); } .tj-q { color: var(--tj-qalqala); }
.tj-h, .tj-s, .tj-l { color: var(--tj-silent); } .tj-u { color: var(--tj-idgham); } .tj-d, .tj-b { color: var(--tj-other); }
.mp.hifz .mw[data-k]:not(.revealed) .tj { color: transparent; }
.tj-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: .8125rem; }
.tj-legend span { display: flex; align-items: center; gap: 8px; }
.tj-legend i { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.mr-round.mr-auto, .mr-round.mr-veil { display: none; }
.mreader.text-mode .mr-round.mr-auto, .mreader.vertical .mr-round.mr-auto, .mreader.veil-ok .mr-round.mr-veil { display: grid; }
.mreader.autoscroll .mr-round.mr-auto { color: var(--chrome-gold); }
.mreader.vertical .mr-track { flex-direction: column; overflow-x: hidden; overflow-y: auto; scroll-snap-type: y proximity; touch-action: pan-y; overscroll-behavior-y: contain; }
.mreader.vertical .mr-slide { scroll-snap-align: start; }
.mreader.vertical .mr-slide + .mr-slide { border-top: 1px solid rgba(0,0,0,.08); }
.mr-stage { will-change: transform; transition: transform .2s ease; }
.mr-stage.pulling { transition: none; }
.mr-pull { position: absolute; top: calc(var(--safe-t) + 52px); left: 50%; transform: translateX(-50%); z-index: 3; background: var(--chrome); color: var(--chrome-ink); border-radius: 999px; padding: 6px 14px; font-size: .8rem; font-weight: 800; opacity: 0; transition: opacity .15s; pointer-events: none; }
.mr-pull.on { opacity: 1; }
/* صفحة نص تتّسع للشاشة: لا تمرير داخليًا ولا تمرير رأسي يتسرّب إلى الشاشة خلف القارئ (iOS)؛ السحب الرأسي يبقى لإيماءة الإغلاق */
.mreader .mp.mp-full:not(.overflow) .mp-body.text { overflow-y: hidden; touch-action: pan-x; }
.heatmap { display: grid; grid-template-rows: repeat(7, 10px); grid-auto-flow: column; grid-auto-columns: 10px; gap: 3px; direction: rtl; overflow-x: auto; padding: 4px 0; }
.heatmap i { width: 10px; height: 10px; border-radius: 2px; background: var(--bg-soft); }
.heatmap i.l1 { background: color-mix(in srgb, var(--primary) 30%, var(--bg-soft)); } .heatmap i.l2 { background: color-mix(in srgb, var(--primary) 55%, var(--bg-soft)); } .heatmap i.l3 { background: color-mix(in srgb, var(--primary) 80%, var(--bg-soft)); } .heatmap i.l4 { background: var(--primary); }
.heatmap-foot { display: flex; justify-content: space-between; font-size: .7rem; color: var(--text-3); margin-top: 4px; }
.challenge-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.challenge-card .bar { height: 8px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; margin: 8px 0 6px; }
.challenge-card .bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.challenge-card .bar i.late { background: var(--danger); }
.challenge-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.challenge-row:last-child { border-bottom: 0; }
.challenge-row .nm { font-weight: 800; } .challenge-row .info { font-size: .75rem; color: var(--text-3); }

/* خط حفص من مجمع الملك فهد لوضع النص (يُجلب عند اختياره فقط؛ 88 ك.ب) */
@font-face { font-family: 'KFGQPC Hafs'; font-style: normal; font-weight: 400; font-display: swap; src: url('https://cdn.jsdelivr.net/gh/quran/quran.com-frontend-next@master/public/fonts/quran/hafs/uthmanic_hafs/UthmanicHafs1Ver18.woff2') format('woff2'); }
