/* الفكرة: لازوردي المخطوطات مع تذهيب، صفحات هادئة ونص القرآن هو البطل */
:root {
  --bg: #f2f4f3;
  --surface: #ffffff;
  --surface-2: #e9edec;
  --ink: #15233d;
  --muted: #5d6879;
  --line: #dbe0e3;
  --gold: #9c7020;
  --gold-soft: #f3e8cf;
  --lapis: #13233f;
  --lapis-ink: #f1ead6;
  --ok: #2f7d5b;
  --shadow: 0 1px 2px rgba(20,35,61,.06), 0 8px 24px rgba(20,35,61,.06);

  --f-quran: "Amiri Quran", "Traditional Arabic", serif;
  /* خط موحّد لكل الموقع عدا القرآن: Thmanyah Serif Display Black (ملف في assets/fonts) ثم Cairo احتياطيًا */
  --f-text: "Thmanyah Serif Display", "Cairo", "Segoe UI", Tahoma, sans-serif;
  --f-display: "Thmanyah Serif Display", "Cairo", "Segoe UI", Tahoma, sans-serif;
  --f-ui: "Thmanyah Serif Display", "Cairo", "Segoe UI", Tahoma, sans-serif;

  --qsize: 1.75rem;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121b2e; --surface-2: #19243b; --ink: #ebe6d8; --muted: #9ba5b8;
    --line: #243250; --gold: #d9b562; --gold-soft: #2a2717; --lapis: #0f1d36; --lapis-ink: #f1ead6;
    --ok: #5fbf91; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121b2e; --surface-2: #19243b; --ink: #ebe6d8; --muted: #9ba5b8;
  --line: #243250; --gold: #d9b562; --gold-soft: #2a2717; --lapis: #0f1d36; --lapis-ink: #f1ead6;
  --ok: #5fbf91; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-ui); font-size: 18.5px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; justify-content: center; }

.wrap {
  max-width: 1120px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* الشريط العلوي */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-in {
  display: flex; align-items: center; gap: 12px; min-height: 60px;
  max-width: 1120px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--f-display); font-size: 1.35rem; font-weight: 700; }
.brand-star { width: 28px; height: 28px; color: var(--gold); }
.nav { display: flex; gap: 2px; margin-inline-start: auto; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .92rem; color: var(--muted); }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.on { color: var(--gold); font-weight: 600; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  min-width: 38px; height: 38px; display: inline-grid; place-items: center; cursor: pointer; padding: 0 8px;
}
.icon-btn:hover { border-color: var(--gold); }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .nav {
    display: none; position: absolute; inset: 100% 0 auto; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 8px; font-size: 1rem; }
  #themeBtn { margin-inline-start: auto; }
}

/* البطل */
.hero { position: relative; background: var(--lapis); color: var(--lapis-ink); overflow: hidden; }
.hero-pattern {
  position: absolute; inset: 0; opacity: .14;
  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%3Cg fill='none' stroke='%23d9b562' stroke-width='1.2'%3E%3Crect x='22' y='22' width='36' height='36'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3Cpath d='M0 0L22 22M80 0L58 22M0 80L22 58M80 80L58 58'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.hero-in { position: relative; text-align: center; padding-block: 3.5rem 3rem; display: grid; justify-items: center; gap: .6rem; }
.hero-date { margin: 0; font-size: .95rem; color: #d9b562; letter-spacing: .02em; }
.hero-title { margin: 0; font-family: var(--f-quran); font-weight: 400; font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.9; text-wrap: balance; }
.hero-ref { margin: 0; font-size: .85rem; opacity: .7; }
.next-prayer {
  margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 6px 14px;
  border: 1px solid rgba(217,181,98,.4); border-radius: 999px; padding: 8px 22px; background: rgba(255,255,255,.04);
}
.np-label { font-size: .85rem; opacity: .75; }
.np-name { font-family: var(--f-display); font-size: 1.2rem; color: #d9b562; }
.np-count { font-size: 1.2rem; letter-spacing: .05em; direction: ltr; }
.np-city { font-size: .8rem; opacity: .6; }

/* بطاقات */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: .5rem; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--gold); margin: 0; }
.card-ref { font-size: .85rem; color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: .8rem; }
.btn {
  border: 1px solid var(--gold); background: var(--gold); color: var(--surface);
  padding: 7px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; font-size: .92rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn.sm { padding: 5px 12px; font-size: .85rem; }

.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; padding-block: 28px 40px; }
.home-grid .daily:first-child { grid-row: span 4; align-self: start; }
.home-grid { align-items: start; }
.quran-text { font-family: var(--f-quran); font-size: var(--qsize); line-height: 2.2; margin: 0; }
.quran-text.big { font-size: 1.9rem; }
.hadith-text { font-family: var(--f-text); font-size: 1.25rem; line-height: 2; margin: 0; }
.hadith-text.big { font-size: 1.45rem; }
.tafsir-mini summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.tafsir-mini p { font-family: var(--f-text); font-size: 1.1rem; margin: .4rem 0 0; }
.continue { display: grid; gap: 2px; text-decoration: none; border-inline-start: 0; background: var(--gold-soft); border-color: transparent; }
.continue strong { font-family: var(--f-display); font-size: 1.3rem; }
.tiles { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); text-decoration: none; background: var(--surface); }
.tile b { font-family: var(--f-display); font-size: 1.15rem; font-weight: 500; }
.tile span { color: var(--muted); font-size: .88rem; }
.tile:hover { border-color: var(--gold); }
@media (max-width: 760px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-grid .daily:first-child { grid-row: auto; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

/* عناوين الصفحات وأدوات */
.page-h { padding-block: 32px 12px; }
.page-h h2 { font-family: var(--f-display); font-size: 2rem; font-weight: 700; margin: 0; text-wrap: balance; }
.page-h p { margin: .2rem 0 0; }
.sub-h { font-family: var(--f-display); font-weight: 500; font-size: 1.25rem; margin: 28px 0 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 12px; align-items: center; }
.toolbar input, .toolbar select, .reader-bar select {
  flex: 1 1 200px; min-width: 0; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
}
.toolbar .num-in { flex: 0 1 110px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--surface); }
.seg.sm button { padding: 5px 10px; font-size: .85rem; }
.seg.tabs { margin-block: 8px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 8px 16px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 5px 14px; border-radius: 999px; cursor: pointer; font-size: .9rem; }
.chip.on { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }

/* فهرس السور */
.surah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding-bottom: 40px; }
.surah-item {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none;
}
.surah-item:hover { border-color: var(--gold); }
.s-num {
  width: 40px; height: 40px; display: grid; place-items: center; font-size: .9rem; font-weight: 600; color: var(--gold);
  background: no-repeat center / 40px 40px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23b8913f' stroke-width='1.3'%3E%3Crect x='8' y='8' width='24' height='24'/%3E%3Crect x='8' y='8' width='24' height='24' transform='rotate(45 20 20)'/%3E%3C/g%3E%3C/svg%3E");
}
.s-name { font-family: var(--f-quran); font-size: 1.3rem; line-height: 1.4; }
.s-meta { font-size: .78rem; color: var(--muted); display: block; font-family: var(--f-ui); }
.s-count { font-size: .8rem; color: var(--muted); }
.search-results { display: grid; gap: 10px; margin-bottom: 20px; }
.search-results .res { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; display: block; }
.search-results .res b { color: var(--gold); font-size: .85rem; font-weight: 600; }
.search-results .res p { margin: 2px 0 0; font-family: var(--f-text); font-size: 1.15rem; }
mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 2px; }

/* القارئ */
.reader-bar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 61px); z-index: 15; background: var(--bg); border-bottom: 1px solid var(--line); }
.reader-bar-in { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-block: 8px; }
.reader-bar select { flex: 0 1 220px; padding: 6px 10px; }
.font-ctl { display: flex; gap: 4px; }
.reader { max-width: 860px; padding-block: 24px 60px; }
.surah-head {
  text-align: center; border: 1px solid var(--gold); border-radius: 12px; padding: 14px; margin-bottom: 18px;
  background: linear-gradient(var(--gold-soft), var(--gold-soft)) padding-box; position: relative;
}
.surah-head::before, .surah-head::after { content: ""; position: absolute; inset: 4px; border: 1px solid var(--gold); border-radius: 9px; opacity: .45; pointer-events: none; }
.surah-head h2 { margin: 0; font-family: var(--f-quran); font-weight: 400; font-size: 2.2rem; line-height: 1.6; }
.surah-head p { margin: 0; font-size: .85rem; color: var(--muted); }
.basmala { text-align: center; font-family: var(--f-quran); font-size: calc(var(--qsize) * 1.05); margin: 6px 0 14px; }
.mushaf { font-family: var(--f-quran); font-size: var(--qsize); line-height: 2.5; text-align: justify; text-align-last: center; }
.mushaf .ay { cursor: pointer; border-radius: 6px; transition: background .15s; }
.mushaf .ay:hover { background: var(--surface-2); }
.ay.playing, .ay-row.playing { background: var(--gold-soft) !important; }
.ay.marked { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .5em; }
.anum { color: var(--gold); font-size: .85em; white-space: nowrap; padding-inline: 2px; }
.ay-list { display: grid; gap: 12px; }
.ay-row { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ay-row .quran-text { text-align: right; }
.ay-row .tafsir { margin: .5rem 0 0; padding-top: .5rem; border-top: 1px dashed var(--line); }
.ay-row .row-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tafsir { font-family: var(--f-text); font-size: 1.12rem; line-height: 1.95; color: var(--ink); opacity: .9; }
.surah-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; }

/* الأحاديث */
.hadith-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding-bottom: 40px; }
.h-card { display: flex; flex-direction: column; gap: 10px; }
.h-card .hadith-text::before { content: "قال رسول الله ﷺ: "; color: var(--gold); font-size: .85em; }
.h-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; font-size: .85rem; color: var(--muted); }
.tag { background: var(--surface-2); border-radius: 999px; padding: 2px 10px; font-size: .78rem; }
.book-hadith .hadith-text { font-size: 1.3rem; }
.book-hadith .grades { margin-top: .6rem; font-size: .85rem; color: var(--muted); }

/* الأذكار */
.adhkar-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.adhkar-progress div { height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.adhkar-list { display: grid; gap: 12px; margin-bottom: 18px; }
.dhikr {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; text-align: right;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; width: 100%;
}
.dhikr:hover { border-color: var(--gold); }
.dhikr .hadith-text { font-size: 1.25rem; }
.dhikr .note { display: block; font-size: .8rem; color: var(--gold); font-family: var(--f-ui); margin-bottom: 2px; }
.d-count { min-width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--gold); color: var(--gold); font-weight: 600; font-size: 1.1rem; }
.dhikr.done { opacity: .5; border-style: dashed; }
.dhikr.done .d-count { background: var(--ok); border-color: var(--ok); color: var(--surface); }
#adhkarReset { margin-bottom: 40px; }

/* الصلاة */
.prayer-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; padding-bottom: 40px; align-items: start; }
.prayer-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pt { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: grid; gap: 2px; }
.pt span { color: var(--muted); font-size: .9rem; }
.pt b { font-size: 1.6rem; font-weight: 500; }
.pt.next { border-color: var(--gold); background: var(--gold-soft); }
.pt.next span::after { content: " · القادمة"; color: var(--gold); }
.qibla { text-align: center; display: grid; justify-items: center; gap: 4px; }
.compass { width: min(220px, 100%); aspect-ratio: 1; max-width: 100%; }
.compass svg { width: 100%; height: 100%; }
.c-ring { fill: var(--surface-2); stroke: var(--line); stroke-width: 2; }
.c-ring2 { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 2 6; }
.c-dir { fill: var(--muted); font-size: 15px; text-anchor: middle; font-family: var(--f-ui); }
.c-needle { fill: var(--gold); }
.c-hub { fill: var(--ink); }
#qiblaNeedle { transform-origin: 100px 100px; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.qibla-deg { font-size: 1.8rem; font-weight: 600; margin: 0; direction: ltr; }
@media (max-width: 760px) {
  .prayer-layout { grid-template-columns: 1fr; }
  .prayer-times { grid-template-columns: repeat(2, 1fr); }
}

/* السبحة */
.tasbeeh { display: grid; justify-items: center; gap: 10px; padding-bottom: 50px; }
.bead {
  position: relative; width: min(300px, 80vw); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, var(--surface), var(--surface-2)); box-shadow: var(--shadow);
  display: grid; place-content: center; gap: 4px; margin-block: 16px; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .08s;
}
.bead:active { transform: scale(.97); }
.bead svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.bead-track { fill: none; stroke: var(--line); stroke-width: 8; }
.bead-prog { fill: none; stroke: var(--gold); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 628.3; stroke-dashoffset: 628.3; transition: stroke-dashoffset .2s; }
.bead-phrase { font-family: var(--f-text); font-size: 1.35rem; position: relative; }
.bead-count { font-family: var(--f-display); font-size: 4rem; line-height: 1; color: var(--gold); position: relative; }
.bead-target { font-size: .9rem; color: var(--muted); position: relative; }
.bead.pulse { animation: pulse .6s; }
@keyframes pulse { 50% { box-shadow: 0 0 0 18px color-mix(in srgb, var(--gold) 25%, transparent); } }
.t-foot { display: flex; gap: 16px; align-items: center; }

/* الأسماء */
.names-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding-bottom: 40px; }
.name {
  position: relative; text-align: center; padding: 20px 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.name b { font-family: var(--f-quran); font-weight: 400; font-size: 1.6rem; line-height: 1.6; display: block; color: var(--ink); }
.name small { position: absolute; top: 6px; inset-inline-start: 10px; font-size: .72rem; color: var(--gold); }
.name:hover { border-color: var(--gold); }

/* اقتباسات */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.quote { display: flex; flex-direction: column; gap: 10px; }
.quote p { margin: 0; font-family: var(--f-text); font-size: 1.3rem; line-height: 1.9; }
.quote.verse p { font-family: var(--f-quran); font-size: 1.5rem; }
.quote footer { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .88rem; margin-top: auto; }
#v-quotes .wrap { padding-bottom: 40px; }

/* لوحة الآية */
.sheet-back { position: fixed; inset: 0; background: rgba(5,10,20,.45); z-index: 40; }
.sheet {
  position: fixed; z-index: 41; inset: auto 0 0; max-height: 80vh; overflow: auto;
  background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25);
  padding: 18px max(20px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  max-width: 760px; margin-inline: auto;
}
.sheet-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-family: var(--f-display); }
.sheet .quran-text { margin-bottom: 12px; }

/* المشغل */
.player { position: fixed; z-index: 35; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); }
.player-in { display: flex; gap: 10px; align-items: center; background: var(--ink); color: var(--surface); border-radius: 999px; padding: 6px 8px 6px 8px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.player .icon-btn { background: transparent; border-color: transparent; color: var(--surface); }
.p-label { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toast {
  position: fixed; z-index: 50; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%);
  background: var(--gold); color: var(--surface); padding: 8px 18px; border-radius: 999px; font-size: .92rem; box-shadow: var(--shadow);
}

.foot { border-top: 1px solid var(--line); padding-block: 22px; color: var(--muted); font-size: .82rem; }
.foot p { margin: 0; }

/* قائمة المزيد */
.more { position: relative; }
.more-btn { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-size: .92rem; color: var(--muted); cursor: pointer; }
.more-btn:hover, .more-btn.on { color: var(--ink); background: var(--surface-2); }
.more-btn.on { color: var(--gold); font-weight: 600; background: transparent; }
.more-panel {
  display: none; position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 200px; z-index: 25;
  flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--shadow);
}
.more.open .more-panel { display: flex; }
@media (max-width: 900px) {
  .more-btn { display: none; }
  .more-panel { display: flex; position: static; border: 0; box-shadow: none; padding: 0; min-width: 0; background: transparent; }
}

/* بطاقات صغيرة وأشرطة تقدم */
.mini-card { display: grid; gap: 4px; text-decoration: none; }
.mini-card strong { font-family: var(--f-display); font-size: 1.25rem; font-weight: 500; }
.mini-card:hover { border-color: var(--gold); }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--gold); border-radius: 3px; transition: width .4s; }
.bar.big { height: 10px; border-radius: 5px; margin-block: 12px; }
.field { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
.field input { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1rem; min-width: 0; }
.toolbar .num-in.wide { flex: 1 1 200px; }

/* قراءة بالصفحة */
.mushaf-page { font-family: var(--f-quran); font-size: var(--qsize); line-height: 2.5; text-align: justify; text-align-last: center; }
.mushaf-page .page-surah { margin-block: 14px 6px; }
.mushaf-page .page-surah h2 { font-size: 1.7rem; }

/* الختمة */
.khatma-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; padding-bottom: 40px; align-items: start; }
.k-title { font-family: var(--f-display); font-weight: 500; font-size: 1.6rem; margin: .2rem 0 0; text-wrap: balance; }
.k-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.k-stats div { background: var(--surface-2); border-radius: 10px; padding: 10px 4px; display: grid; }
.k-stats b { font-family: var(--f-display); font-size: 1.5rem; color: var(--gold); font-weight: 500; }
.k-stats span { font-size: .8rem; color: var(--muted); }
.k-new { display: grid; gap: 12px; }
.k-new .seg { justify-self: start; }
@media (max-width: 760px) { .khatma-layout { grid-template-columns: 1fr; } }

/* المناسبات */
.occ-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.occ { display: grid; gap: 2px; }
.occ strong { font-family: var(--f-display); font-weight: 500; font-size: 1.2rem; }
.occ .occ-days { font-family: var(--f-display); font-size: 2.2rem; color: var(--gold); line-height: 1.2; }
.occ.soon { border-color: var(--gold); background: var(--gold-soft); }
.hcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding-bottom: 40px; max-width: 640px; }
.hcal .dow { text-align: center; font-size: .78rem; color: var(--muted); }
.hcal .day { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 6px 4px; text-align: center; display: grid; min-width: 0; }
.hcal .day b { font-size: 1.1rem; font-weight: 600; }
.hcal .day span { font-size: .7rem; color: var(--muted); }
.hcal .day.today { border-color: var(--gold); background: var(--gold-soft); }
.hcal .day.white b { color: var(--gold); }

/* الزكاة */
.zakat-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.z-form { display: grid; gap: 14px; }
.z-result { display: grid; gap: 10px; position: sticky; top: 90px; }
.z-row { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.z-row b { font-variant-numeric: tabular-nums; }
.z-big { font-family: var(--f-display); font-size: 2.2rem; color: var(--gold); line-height: 1.3; }
.z-state { padding: 6px 12px; border-radius: 999px; font-size: .88rem; justify-self: start; background: var(--surface-2); }
.z-state.due { background: var(--ok); color: var(--surface); }
.z-note { padding-block: 12px 40px; }
@media (max-width: 760px) { .zakat-layout { grid-template-columns: 1fr; } .z-result { position: static; } }

/* المسابقة */
.quiz { max-width: 760px; padding-bottom: 40px; }
.quiz-card { display: grid; gap: 14px; }
.q-top { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.q-text { font-family: var(--f-display); font-weight: 500; font-size: 1.5rem; margin: 0; text-wrap: balance; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-opt { text-align: right; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.05rem; }
.q-opt:hover:not(:disabled) { border-color: var(--gold); }
.q-opt.right { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.q-opt.wrong { border-color: #c0573f; color: #c0573f; text-decoration: line-through; }
.q-opt:disabled { cursor: default; }
.q-score { font-family: var(--f-display); font-size: 3rem; color: var(--gold); margin: 0; }
@media (max-width: 560px) { .q-opts { grid-template-columns: 1fr; } }

.view { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
