/* منصة أهل القرآن */
@font-face { font-family: 'Noto Kufi Arabic'; src: url('../fonts/NotoKufi-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Kufi Arabic'; src: url('../fonts/NotoKufi-Bold.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face {
  font-family: 'Amiri Quran';
  src: url('../fonts/AmiriQuran.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'KFGQPC Warsh';
  src: url('../fonts/KFGQPCWarsh.woff2') format('woff2'), url('../fonts/KFGQPCWarsh.ttf') format('truetype');
}
@font-face {
  font-family: 'KFGQPC Hafs';
  src: url('../fonts/KFGQPCHafs.ttf') format('truetype');
  font-display: swap;
}

:root {
  --green: #0d5c4d;
  --green-2: #10705e;
  --gold: #c9a227;
  --bg: #f7f5ef;
  --panel: #ffffff;
  --ink: #1d2b27;
  --muted: #64748b;
  --line: #e2e8f0;
  --danger: #b91c1c;
  --ok: #15803d;
}
html[data-theme="dark"] {
  --bg: #0f1a17;
  --panel: #16241f;
  --ink: #e6efe9;
  --muted: #9db3a8;
  --line: #27403a;
  --green: #1a8a73;
  --green-2: #1f9c83;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0f1a17;
    --panel: #16241f;
    --ink: #e6efe9;
    --muted: #9db3a8;
    --line: #27403a;
    --green: #1a8a73;
    --green-2: #1f9c83;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}
a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--green);
  color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 1.2rem; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; align-items: center; flex-wrap: nowrap; min-width: 0; }
.nav a, .nav summary { color: #d7ece5; padding: 6px 12px; border-radius: 999px; white-space: nowrap; font-size: .98rem; cursor: pointer; list-style: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav a.x { display: none; }
.menu-btn { display: none; }
.nav .more { position: relative; }
.more-panel { position: absolute; top: calc(100% + 8px); inset-inline-start: 0; min-width: 190px; background: var(--green); border: 1px solid rgba(255,255,255,.25); border-radius: 14px; padding: 6px; box-shadow: 0 10px 28px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 2px; z-index: 30; }
.more-panel a { border-radius: 10px; }
.name-btn { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions .btn { padding: 6px 14px; white-space: nowrap; }
.nav summary.on, .nav a.on, .nav summary:hover, .nav a:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; }

.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 60px; }

.hero { text-align: center; padding: 36px 12px; }
.hero h1 { color: var(--green); font-size: 2.2rem; margin-bottom: 8px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.btn {
  display: inline-block; background: var(--green); color: #fff;
  border: none; border-radius: 10px; padding: 8px 18px;
  font-size: 1rem; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--green-2); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--green-2); border: 1px solid var(--line); }
.topbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.btn.big { padding: 12px 28px; font-size: 1.1rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 18px 0; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; color: var(--ink); display: block;
}
a.card:hover { border-color: var(--green-2); text-decoration: none; }
.card h3 { margin: 0 0 6px; color: var(--green); }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; margin: 14px 0;
}
.form label, #quiz-setup label { display: block; margin-bottom: 14px; font-weight: 600; }
input, select {
  display: block; width: 100%; margin-top: 4px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 1rem; font-family: inherit; background: var(--bg); color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--green-2); border-color: transparent; }

.alert { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); border-radius: 10px; padding: 10px 16px; }
html[data-theme="dark"] .alert { background: #2a1414; border-color: #5c2323; }

.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .85rem; }
.hidden { display: none !important; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.tab { padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); }
.tab.on { background: var(--green); color: #fff; border-color: var(--green); }

.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.page-cell {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 0; text-align: center; color: var(--ink); font-size: .9rem;
}
.page-cell:hover { border-color: var(--green-2); background: rgba(13,92,77,.08); text-decoration: none; }

.surah-banner {
  text-align: center; font-weight: 700; color: var(--green);
  font-family: 'KFGQPC Hafs', 'Amiri Quran', serif; font-size: 1.5rem;
  border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; margin: 14px 0 8px;
}

.surah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.surah-cell {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; display: flex; flex-direction: column; color: var(--ink);
}
.surah-cell:hover { border-color: var(--green-2); text-decoration: none; }
.surah-cell .num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; margin-bottom: 6px;
}
.surah-cell .sname { font-weight: 700; }

.reader-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.reader-head h1 { color: var(--green); font-size: 1.5rem; margin: 0; }

.quran-page {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 22px; margin: 16px 0; text-align: justify;
}
.basmalah { text-align: center; font-family: 'KFGQPC Hafs', 'Amiri Quran', serif; font-size: 1.7rem; color: var(--green); margin: 6px 0 18px; }
.quran-text { font-family: 'KFGQPC Hafs', 'Amiri Quran', serif; font-size: 1.75rem; line-height: 2.3; }
.ayah { cursor: pointer; border-radius: 8px; padding: 0 2px; transition: background .2s; }
.ayah:hover { background: rgba(16,112,94,.08); }
.ayah.marked { background: rgba(201,162,39,.14); }
.ayah-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; margin: 0 4px;
  border: 1px solid var(--gold); border-radius: 50%;
  font-size: .95rem; color: var(--gold); font-family: inherit;
}
.bm { background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--gold); }

.quiz-bar { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.bar { flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
#q-bar-fill { height: 100%; width: 0; background: var(--green-2); transition: width .3s; }
.question { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; text-align: center; }
.q-label { font-weight: 700; color: var(--green); }
#q-options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  text-align: right; font-family: 'Amiri Quran', serif; font-size: 1.35rem; line-height: 2;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; cursor: pointer;
}
.opt:hover { border-color: var(--green-2); }
.opt.picked { border-color: var(--green); background: rgba(16,112,94,.1); }
.opt.right { border-color: var(--ok); background: rgba(21,128,61,.12); }
.opt.wrong { border-color: var(--danger); background: rgba(185,28,28,.1); }

.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; }
.tbl th, .tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: right; }
.tbl th { background: rgba(16,112,94,.08); }

.foot { border-top: 1px solid var(--line); padding: 22px 16px; text-align: center; font-size: .9rem; color: var(--muted); }
.license { text-align: left; direction: ltr; max-width: 640px; margin: 8px auto; }
.license pre { white-space: pre-wrap; font-size: .75rem; background: var(--panel); padding: 12px; border-radius: 10px; border: 1px solid var(--line); }

@media (max-width: 760px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .menu-btn { display: inline-block; order: 2; background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 6px 14px; font-family: inherit; font-size: .95rem; cursor: pointer; }
  .top-actions { display: contents; }
  #theme-toggle { order: 1; margin-inline-start: auto; }
  .nav { order: 3; flex: 1 1 100%; width: 100%; display: none; flex-wrap: wrap; gap: 8px; padding: 8px 0 4px; }
  .topbar.open .nav { display: flex; }
  .nav a { flex: 1 1 calc(50% - 8px); text-align: center; padding: 10px 8px; font-size: 1rem; background: rgba(255,255,255,.08); border-radius: 12px; }
  .nav a.on { background: rgba(255,255,255,.22); }
  .nav a.x { display: block; }
  .nav .more { display: none; }
  .top-actions .btn { display: none; order: 4; flex: 1 1 28%; text-align: center; padding: 9px 8px; border-radius: 12px; }
  .topbar.open .top-actions .btn { display: block; }
  .name-btn { max-width: none; }
  .quran-text { font-size: 1.45rem; }
}

/* مشغل التلاوة */
.audio-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 10px 0 16px; padding: 10px; background: var(--card, #fff); border: 1px solid rgba(13,92,77,.15); border-radius: 12px; }
.audio-bar select { padding: 4px 6px; border-radius: 8px; border: 1px solid rgba(13,92,77,.3); background: inherit; color: inherit; }
.audio-bar .au-note { width: 100%; text-align: center; font-size: .8rem; color: var(--muted); }
.audio-bar .au-sel { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.ayah.playing { background: rgba(16,112,94,.16); }
.au-ayah { background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--green); padding: 0 2px; }
.au-ayah:hover { transform: scale(1.15); }

/* مراجعة الأخطاء في نتيجة الاختبار */
.review-item { text-align: right; border: 1px solid rgba(13,92,77,.18); border-radius: 12px; padding: 12px; margin: 10px 0; }
.review-item .rv-q { margin: 0 0 8px; }
.review-item .rv-loc { font-size: .85rem; color: var(--muted); }
.review-item .rv-yours { color: #b3261e; margin: 6px 0 2px; }
.review-item .rv-correct { color: #1b7a3d; margin: 6px 0 2px; }
.review-item .rv-tag { font-size: .8rem; font-weight: bold; }

/* الرواية: خط مجمع الملك فهد المطابق لكل رواية، ورقم الآية مضمّن في النص */
.riw-warsh .quran-text, .riw-warsh .basmalah { font-family: 'KFGQPC Warsh', 'Amiri Quran', serif; }
.quran-page .ayah-num { display: none; }
.quran-page .quran-text { font-size: 2rem; line-height: 2.6; }

/* عرض صفحة المصحف بخط QCF (رسم المصحف الورقي) */
.has-qcf > .ayah, .has-qcf > .surah-banner, .has-qcf > .basmalah { display: none; }
.has-qcf .qcf-wrap .surah-banner, .has-qcf .qcf-wrap .basmalah { display: block; }
.qcf-wrap { color: #1b1b1b; max-width: 640px; margin: 0 auto; background: #fffdf5; padding: 10px 14px; border: 1px solid #e6dcb8; border-radius: 6px; }
.qcf-line { color: #1b1b1b; display: flex; justify-content: space-between; white-space: nowrap; font-size: min(5.6vw, 34px); line-height: 1.95; direction: rtl; }
.qcf-line.short { justify-content: center; gap: .35em; }
.qcf-wrap .qv { cursor: pointer; border-radius: 6px; }
.qcf-wrap .qv.playing { background: rgba(16,112,94,.2); }
.qcf-wrap .basmalah { font-family: 'KFGQPC Hafs', serif; font-size: min(5vw,30px); text-align: center; margin: 0; }

/* ===== الختمات ===== */
.btn.gold { background: linear-gradient(135deg,#d9b441,#b8901c); color: #2a2208; border: 0; font-weight: 700; }
.btn.big { padding: 12px 26px; font-size: 1.05rem; margin-top: 10px; }
.khero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 26px 26px; margin-bottom: 18px; border-radius: 18px; color: #fff;
  background: radial-gradient(circle at 12% 20%, rgba(201,162,39,.35), transparent 40%), linear-gradient(135deg,#0d5c4d,#0b3f36); }
.khero h1 { margin: 0 0 4px; font-size: 1.9rem; }
.khero p { margin: 0; opacity: .9; }
.ksec { margin: 26px 0 12px; font-size: 1.25rem; }
.ksec::after { content: ''; display: block; width: 46px; height: 3px; background: var(--gold); border-radius: 3px; margin-top: 4px; }
.kjoin { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px dashed var(--gold); border-radius: 12px; padding: 10px 14px; }
.kjoin input { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); width: 160px; text-transform: uppercase; letter-spacing: 2px; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.kcard { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; color: var(--ink); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.kcard:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.12); text-decoration: none; }
.kcard::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg,var(--green-2),var(--gold)); }
.kc-solo.kcard::before { background: linear-gradient(90deg,#c9a227,#e6cf7a); }
.kc-top { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.kbadge { font-size: .74rem; padding: 2px 9px; border-radius: 99px; background: rgba(16,112,94,.12); color: var(--green-2); font-weight: 600; }
.kbadge.priv { background: rgba(201,162,39,.18); color: #8a6d12; }
.kbadge.ok { background: rgba(21,128,61,.15); color: var(--ok); }
.kc-body { display: flex; gap: 14px; align-items: center; }
.kc-body h3 { margin: 0; font-size: 1.1rem; }
.kded { margin: 2px 0; color: var(--gold); font-size: .92rem; }
.kring { position: relative; flex: none; }
.kring svg { width: 100%; height: 100%; }
.kr-bg { fill: none; stroke: var(--line); stroke-width: 9; }
.kr-fg { fill: none; stroke: var(--gold); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.kring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.15em; }
.kring small { font-size: .6em; opacity: .7; }
.khead { display: flex; gap: 20px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 16px; position: relative; overflow: hidden; }
.khead::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg,var(--green-2),var(--gold)); }
.khead h1 { margin: 0; font-size: 1.6rem; }
.khead-main { flex: 1; min-width: 0; }
.kbar { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.kbar i { display: block; height: 100%; background: linear-gradient(90deg,var(--green-2),var(--gold)); }
.kquick { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; flex-wrap: wrap; }
.kparts { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.kpart { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; position: relative; }
.kp-num { width: 40px; height: 40px; margin: 0 auto 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--line); color: var(--ink); }
.kp-title { font-weight: 600; }
.kp-who { color: var(--muted); min-height: 1.6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpart.free .kp-num { background: rgba(16,112,94,.12); color: var(--green-2); }
.kpart.reserved .kp-num { background: rgba(201,162,39,.25); color: #8a6d12; }
.kpart.done { background: linear-gradient(180deg, rgba(21,128,61,.1), transparent); border-color: rgba(21,128,61,.4); }
.kpart.done .kp-num { background: var(--ok); color: #fff; }
.kpart.mine { box-shadow: 0 0 0 2px var(--gold) inset; }
.kp-actions { display: flex; gap: 4px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.kp-read { font-size: 1.1rem; }
.kp-btn { border: 0; border-radius: 8px; padding: 4px 10px; font: inherit; font-size: .82rem; cursor: pointer; background: var(--green-2); color: #fff; }
.kp-btn.ok { background: var(--ok); }
.kp-btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.kdone { background: linear-gradient(135deg, rgba(201,162,39,.18), rgba(16,112,94,.12)); margin-bottom: 16px; }
.kdone-ico { font-size: 2.2rem; }
.kshare { margin-top: 18px; }
.kcopy { display: flex; gap: 8px; }
.kcopy input { flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); min-width: 0; }
.kcode { letter-spacing: 3px; background: var(--bg); padding: 2px 10px; border-radius: 8px; }
.kdanger { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 8px; flex-wrap: wrap; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.kform { max-width: 560px; margin: 0 auto; }
.kform label { display: block; margin: 10px 0; font-weight: 600; }
.kform input[type=text], .kform input:not([type=radio]) { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; margin-top: 4px; }
.kchoices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.kchoice { display: flex !important; gap: 8px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; margin: 0 !important; }
.kchoice:has(input:checked) { border-color: var(--gold); background: rgba(201,162,39,.1); }
.kchoice input { width: auto !important; margin-top: 6px !important; }
.kchoice small { display: block; font-weight: 400; color: var(--muted); }
@media (max-width: 560px) { .kchoices { grid-template-columns: 1fr; } .khead { flex-direction: column; text-align: center; } .kc-top { justify-content: center; } }

.kring b { direction: ltr; font-size: 1.25em; }
.kring b small { font-size: .55em; }
.reader-head.bottom { margin-top: 18px; }

/* ===== الأذكار والصلاة على النبي ===== */
.ad-pins { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.ad-pin { text-align: center; padding-top: 20px; }
.ad-pin h3 { margin: 6px 0 4px; font-size: 1.05rem; }
.ad-ico { font-size: 2rem; }
.ad-check { color: var(--ok); font-size: .85rem; }
.ad-search { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font: inherit; margin-bottom: 10px; }
.ad-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ad-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.ad-row:hover { border-color: var(--gold); text-decoration: none; }
.ad-row.is-done { border-color: var(--ok); }
.ad-row.is-done::after { content: '✅'; }
.ad-list, .sl-list { display: grid; gap: 12px; }
.ad-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; cursor: pointer; transition: opacity .2s; }
.ad-card.finished { opacity: .55; border-color: var(--ok); }
.ad-text { font-family: 'Amiri Quran', 'Amiri', serif; font-size: 1.35rem; line-height: 2.2; margin: 0 0 8px; }
.ad-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ad-rep { color: var(--muted); font-size: .85rem; }
.ad-btn { min-width: 64px; height: 44px; border: 0; border-radius: 22px; background: linear-gradient(135deg,#d9b441,#b8901c); color: #2a2208; font: inherit; font-weight: 700; font-size: 1.1rem; padding: 0 16px; cursor: pointer; }
.finished .ad-btn { background: var(--ok); color: #fff; }
.sl-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.sl-card .ad-btn { font-size: .9rem; height: 36px; }
.sl-main { text-align: center; }
.sl-formula { font-family: 'Amiri Quran', serif; font-size: 1.5rem; line-height: 2.2; margin-bottom: 14px; }
.sl-tap { width: 190px; height: 190px; border-radius: 50%; border: 6px solid var(--gold); background: radial-gradient(circle at 35% 30%, #1f9c83, #0d5c4d); color: #fff; font: inherit; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.3); -webkit-tap-highlight-color: transparent; user-select: none; }
.sl-tap:active { transform: scale(.96); }
.sl-tap span { font-size: 3.2rem; font-weight: 700; line-height: 1.1; }
.sl-row { display: flex; gap: 12px; justify-content: center; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.sl-row select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.sl-stats { display: flex; justify-content: center; gap: 28px; }
.sl-stats b { display: block; font-size: 1.6rem; color: var(--gold); }
.sl-stats small { color: var(--muted); }
.hidden { display: none !important; }

/* ===== خطط الحفظ ===== */
.mp-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.mp-presets select, .mp-range select, .mp-range input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
.mp-range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.mp-range input { width: 80px; }
.mp-today { margin: 16px 0; border: 2px solid var(--gold); }
.mp-today h2 { margin: 0 0 10px; }
.mp-task { padding: 10px 0; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
.mp-task:first-of-type { border-top: 0; }
.mp-tag { display: inline-block; width: fit-content; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.mp-tag.new { background: rgba(21,128,61,.18); color: var(--ok); }
.mp-tag.rev { background: rgba(201,162,39,.2); color: #8a6d12; }
.mp-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.mp-day { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; position: relative; }
.mp-day b { display: block; }
.mp-day small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.3; min-height: 2.6em; }
.mp-day.done { border-color: var(--ok); background: rgba(21,128,61,.1); }
.mp-day.today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.mp-day.missed { border-color: var(--danger); }
.mp-day.future { opacity: .6; }
.mp-mini { border: 0; background: transparent; color: var(--ink); font-size: 1.1rem; cursor: pointer; }

/* منع التمرير الأفقي */
html, body { max-width: 100%; overflow-x: hidden; }
.topbar, .wrap, main { max-width: 100%; box-sizing: border-box; }
.topbar > * { min-width: 0; }
img, svg, table, pre { max-width: 100%; }

/* ===== الملف الشخصي ===== */
.pf-hero { display: flex; gap: 16px; align-items: center; padding: 22px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #0d5c4d, #1f9c83); box-shadow: 0 8px 24px rgba(13,92,77,.25); margin-bottom: 16px; }
.pf-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--gold); color: #2a2208; font-size: 2rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; border: 3px solid rgba(255,255,255,.6); }
.pf-id h1 { margin: 0 0 4px; font-size: 1.5rem; color: #fff; }
.pf-id p { margin: 0; opacity: .85; font-size: .9rem; word-break: break-all; }
.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 8px; }
.pf-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 10px; text-align: center; }
.pf-stat i { font-style: normal; font-size: 1.5rem; display: block; }
.pf-stat b { display: block; font-size: 1.6rem; color: var(--green); }
.pf-stat span { font-size: .8rem; color: var(--muted); }
.pf-periods { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pf-period { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 14px; padding: 14px; text-align: center; }
.pf-period small { display: block; color: var(--muted); }
.pf-period b { font-size: 2rem; color: var(--green); margin-inline-end: 6px; }
.pf-period em { display: block; font-style: normal; color: #8a6d12; font-size: .85rem; margin-top: 4px; }
.pf-quiz { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pf-q { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.pf-q-top { display: flex; justify-content: space-between; }
.pf-marks { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-mark { background: var(--panel); border: 1px solid var(--gold); border-radius: 99px; padding: 6px 14px; color: var(--ink); }

/* ===== التجويد ===== */
.tj-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.tj-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; font-size: .8rem; }
.tj-legend.hidden { display: none; }
.tj-leg { display: inline-flex; align-items: center; gap: 4px; }
.tj-leg i, .tj-card-h i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.tj-sheet { position: fixed; inset-inline: 0; bottom: 0; max-height: 60vh; overflow: auto; background: var(--panel); border-top: 3px solid var(--gold); border-radius: 18px 18px 0 0; padding: 12px 14px 18px; box-shadow: 0 -8px 30px rgba(0,0,0,.3); z-index: 60; }
.tj-sheet.hidden { display: none; }
.tj-sh-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tj-x { border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.tj-card { border: 1px solid var(--line); border-right: 5px solid var(--gold); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: var(--bg); }
.tj-card p { margin: 4px 0; }
.tj-card-h { display: flex; gap: 8px; align-items: center; }
.tj-words { font-family: 'KFGQPC Hafs', serif; font-size: 1.3rem; }
.tj-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.tj-ex { margin-top: 8px; padding: 8px; background: var(--panel); border-radius: 10px; }
.tj-ex .quran-text { font-size: 1.5rem; }
.tj-dim { opacity: .55; }
.tj-hit { font-weight: 700; }
.tj { border-radius: 3px; }
.ayah.tj-open { background: rgba(201,162,39,.18); }
.tj-hamzat_wasl { color: #8a8f98; }
.tj-lam_shamsiyyah { color: #8a8f98; }
.tj-silent { color: #9aa0a8; }
.tj-madd_2 { color: #d97706; }
.tj-madd_246 { color: #dc2626; }
.tj-madd_muttasil { color: #b91c1c; }
.tj-madd_munfasil { color: #ea580c; }
.tj-madd_6 { color: #7f1d1d; }
.tj-qalqalah { color: #2563eb; }
.tj-ghunnah { color: #db2777; }
.tj-ikhfa { color: #0891b2; }
.tj-ikhfa_shafawi { color: #0e7490; }
.tj-iqlab { color: #7c3aed; }
.tj-idghaam_ghunnah { color: #16a34a; }
.tj-idghaam_no_ghunnah { color: #15803d; }
.tj-idghaam_shafawi { color: #65a30d; }
.tj-idghaam_mutajanisayn { color: #059669; }
.tj-idghaam_mutaqaribayn { color: #0d9488; }

/* ===== الغرف المباشرة ===== */
.rm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-bottom: 10px; }
.rm-tile { position: relative; background: #0f2d27; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; border: 3px solid transparent; }
.rm-tile video { width: 100%; height: 100%; object-fit: cover; background: radial-gradient(circle, #1f9c83, #0d5c4d); }
.rm-tile.hand { border-color: var(--gold); }
.rm-tile.hand::after { content: '✋'; position: absolute; top: 6px; left: 8px; font-size: 1.4rem; }
.rm-name { position: absolute; bottom: 6px; right: 8px; background: rgba(0,0,0,.55); color: #fff; padding: 2px 8px; border-radius: 8px; font-size: .8rem; }
.rm-ctl { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.rm-chat { max-width: 640px; margin: 10px auto; }
.rm-msgs { max-height: 180px; overflow: auto; margin-bottom: 8px; }
.rm-m { padding: 3px 0; } .rm-m.mine { color: var(--green); }
.rm-send { display: flex; gap: 6px; } .rm-send input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }

/* ===== المساعد ===== */
.ai-box { max-width: 720px; margin: 0 auto; }
.ai-msgs { max-height: 55vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ai-m { padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; line-height: 1.8; max-width: 92%; }
.ai-m.bot { background: var(--bg); border: 1px solid var(--line); align-self: flex-start; }
.ai-m.me { background: var(--green); color: #fff; align-self: flex-end; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ai-chips button { border: 1px solid var(--gold); background: transparent; color: var(--ink); border-radius: 99px; padding: 4px 12px; cursor: pointer; font: inherit; font-size: .85rem; }

/* ===== المجتمع ===== */
.cm-new textarea, .cm-post input[type=text] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; box-sizing: border-box; margin-bottom: 8px; }
.cm-post { margin: 12px 0; }
.cm-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.pf-avatar.sm { width: 40px; height: 40px; font-size: 1.1rem; border-width: 2px; }
.cm-body { line-height: 1.9; word-break: break-word; }
.cm-act { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.inl { display: inline; }
.cm-c { background: var(--bg); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.cm-x { border: 0; background: none; color: var(--danger); cursor: pointer; font-size: .8rem; padding: 0; }
.cm-post .rm-send input { margin-bottom: 0; }

/* ===== الدورات ===== */
.cr-lessons { display: grid; gap: 8px; }
.cr-l { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.cr-l.done { border-color: var(--ok); background: rgba(21,128,61,.08); }
.cr-n { width: 30px; height: 30px; border-radius: 50%; background: var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.cr-l.done .cr-n { background: var(--ok); color: #fff; }
.cr-video { position: relative; padding-top: 56.25%; margin: 10px 0; border-radius: 14px; overflow: hidden; background: #000; }
.cr-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cr-body { line-height: 2; margin: 10px 0; }
.cr-ed summary { cursor: pointer; font-weight: 700; }
.kform textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; box-sizing: border-box; margin-top: 4px; }

.legal h2{margin-top:18px;font-size:1.1rem}.legal ul{padding-inline-start:20px;line-height:1.9}.legal p{line-height:1.9}

.rm-tile{position:relative}.rm-mod{position:absolute;top:6px;inset-inline-start:6px;background:rgba(0,0,0,.55);color:#fff;border:0;border-radius:8px;padding:4px 7px;cursor:pointer}.rm-mod+.rm-mod{inset-inline-start:42px}
.rm-st { position: absolute; top: 6px; right: 8px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 8px; font-size: .75rem; }

.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 20px; }
.bd { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; opacity: .6; display: flex; flex-direction: column; gap: 4px; }
.bd.on { opacity: 1; border-color: var(--gold); }
.bd i { font-style: normal; font-size: 1.8rem; }
.bd small { color: var(--muted, #666); font-size: .8rem; }
.bd em { font-style: normal; color: var(--green-2); font-size: .8rem; }
.bd-fill { height: 100%; background: var(--green-2); }
.yl-total { text-align: center; margin: 6px 0 12px; }
.yl-total b { font-size: 2.6rem; color: var(--green); display: block; }
.yl-bar { height: 14px; margin: 8px 0; }
.yl-lb { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.yl-lb li { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.yl-lb li b { flex: 1; }
.yl-lb li em { font-style: normal; color: var(--green-2); }

.ad-audio { width: 100%; margin: 8px 0; }
.ad-sc { width: 100%; height: 120px; border: 0; margin: 8px 0; border-radius: 10px; }

/* الصفحة الرئيسية */
.lp-hero { position: relative; overflow: hidden; margin: -24px -16px 0; padding: 64px 20px 56px; text-align: center; color: #fff; background: radial-gradient(1200px 500px at 50% -10%, #17806a 0%, #0d5c4d 45%, #08382f 100%); }
.lp-pattern { position: absolute; inset: 0; opacity: .13; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M40 4l9 21 21-9-9 21 21 9-21 9 9 21-21-9-9 21-9-21-21 9 9-21-21-9 21-9-9-21 21 9z' fill='none' stroke='%23e6c75a' stroke-width='1.4'/%3E%3C/svg%3E"); background-size: 80px 80px; }
.lp-hero-in { position: relative; max-width: 760px; margin: 0 auto; }
.lp-chip { display: inline-block; padding: 5px 16px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(230,199,90,.5); color: #f2dd8e; font-size: .92rem; }
.lp-hero h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); margin: 14px 0 6px; line-height: 1.2; background: linear-gradient(180deg, #fff 30%, #f0d57a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-sub { font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: #d7ece5; max-width: 620px; margin: 0 auto 22px; }
.lp-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn.gold { background: linear-gradient(180deg, #e3c24f, #c9a227); color: #3a2e05; font-weight: 700; box-shadow: 0 8px 22px rgba(0,0,0,.28); }
.btn.gold:hover { background: linear-gradient(180deg, #ecd06a, #d4ad2e); }
.btn.lp-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); }
.btn.lp-ghost:hover { background: rgba(255,255,255,.12); }
.lp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 34px auto 0; max-width: 620px; }
.lp-stats div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 12px 6px; }
.lp-stats b { display: block; font-size: 1.5rem; color: #f2dd8e; }
.lp-stats span { font-size: .88rem; color: #cfe6de; }
.lp-mine { margin-top: 22px; }
.lp-sec { margin: 44px 0; }
.lp-h { text-align: center; color: var(--green); font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 6px; }
.lp-lead { text-align: center; color: var(--muted); margin: 0 0 24px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.lp-card { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 20px 18px 16px; color: var(--ink); transition: transform .18s, box-shadow .18s, border-color .18s; overflow: hidden; }
.lp-card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--gold), var(--green-2)); }
.lp-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(13,92,77,.16); border-color: var(--green-2); text-decoration: none; }
.lp-ico { width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.7rem; border-radius: 16px; background: linear-gradient(135deg, rgba(16,112,94,.14), rgba(201,162,39,.2)); }
.lp-card em { position: absolute; top: 16px; inset-inline-end: 16px; font-style: normal; font-size: .75rem; color: #8a6d12; background: rgba(201,162,39,.18); padding: 2px 10px; border-radius: 99px; }
.lp-card h3 { margin: 10px 0 2px; color: var(--green); font-size: 1.15rem; }
.lp-card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.7; flex: 1; }
.lp-go { margin-top: 10px; color: var(--green-2); font-weight: 700; font-size: .92rem; }
.lp-st { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.lp-st div { text-align: center; padding: 18px 14px; border-radius: 18px; background: var(--panel); border: 1px dashed var(--gold); }
.lp-st i { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--green); color: #f2dd8e; font-style: normal; font-weight: 700; font-size: 1.2rem; }
.lp-st h3 { margin: 8px 0 4px; color: var(--green); }
.lp-st p { margin: 0; color: var(--muted); }
.lp-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lp-trust div { background: rgba(16,112,94,.08); border-radius: 16px; padding: 16px; }
.lp-trust b { display: block; color: var(--green); margin-bottom: 4px; }
.lp-trust span { color: var(--muted); font-size: .94rem; }
.lp-final { text-align: center; color: #fff; border-radius: 24px; padding: 40px 20px; margin: 10px 0 20px; background: linear-gradient(135deg, #0d5c4d, #08382f); border: 1px solid rgba(230,199,90,.45); }
.lp-final h2 { margin: 0 0 6px; color: #f2dd8e; }
.lp-final p { color: #d7ece5; margin: 0 0 16px; }
@media (max-width: 760px) {
  .lp-hero { padding: 44px 16px 36px; }
  .lp-stats { grid-template-columns: repeat(2, 1fr); }
  .lp-st, .lp-trust { grid-template-columns: 1fr; }
  .lp-grid { grid-template-columns: 1fr; }
}

.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 10px 24px; flex-wrap: wrap; max-width: 1200px; margin: 10px auto 0; padding-top: 12px; border-top: 1px solid var(--line); text-align: right; }
.foot-copy { color: var(--muted); }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: .92rem; }
@media (max-width: 760px) { .foot-row { flex-direction: column; text-align: center; } .foot-links { justify-content: center; } }

.tf-link { text-decoration: none; font-size: 1rem; padding: 0 2px; }
.tf-text { line-height: 2; font-size: 1.05rem; color: var(--ink, inherit); }
.tf-ayah .quran-text { margin: 0 0 8px; }
