:root {
  --bg: #0e0a12;
  --bg2: #15101b;
  --card: #1c1623;
  --card2: #241c2d;
  --line: #2f2638;
  --text: #f4ece3;
  --muted: #a99cad;
  --dim: #6f6475;
  --ember: #ff7a2f;
  --ember2: #ff4d1f;
  --gold: #ffc65c;
  --green: #5fd49a;
  --blue: #6fb6ff;
  --red: #ff5d5d;
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 60% at 50% -10%, #2a1620 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overscroll-behavior: none;
  user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }

/* ---------- الهيدر والتبويبات ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + var(--safe-t)) 18px 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.brand { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 24px; font-weight: 800; background: linear-gradient(90deg, var(--gold), var(--ember)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-date { font-size: 12px; color: var(--muted); }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--card); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.7; }

main { padding: 4px 16px calc(96px + var(--safe-b)); max-width: 560px; margin: 0 auto; }

.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
  display: flex; justify-content: space-around;
  padding: 8px 6px calc(8px + var(--safe-b));
  background: rgba(18, 13, 23, .985);
  border-top: 1px solid var(--line);
}
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--dim); padding: 4px 0; border-radius: 14px; transition: color .2s; }
.tabs .ti { font-size: 20px; filter: grayscale(1) opacity(.55); transition: filter .2s, transform .2s; }
.tabs button.active { color: var(--text); }
.tabs button.active .ti { filter: none; transform: translateY(-2px) scale(1.1); }

/* ---------- عناصر عامة ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; border-radius: 16px; background: var(--card2); font-weight: 700; transition: transform .1s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(135deg, var(--gold), var(--ember)); color: #2a1206; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--card2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: rgba(95, 212, 154, .14); color: var(--green); }
.chip.warn { background: rgba(255, 122, 47, .15); color: var(--ember); }
.chip.bad { background: rgba(255, 93, 93, .13); color: var(--red); }
.chip.info { background: rgba(111, 182, 255, .13); color: var(--blue); }
.bar { height: 8px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold)); border-radius: 99px; transition: width .5s; }
.section-title { font-size: 14px; color: var(--muted); margin: 18px 4px 8px; font-weight: 700; }

/* ---------- البطل: الشعلة ---------- */
.hero { text-align: center; padding: 6px 0 4px; position: relative; }
.flame-wrap { width: 190px; height: 210px; margin: 0 auto; position: relative; }
.flame-wrap svg { width: 100%; height: 100%; overflow: visible; }
.glow { position: absolute; inset: 6% -6% -10%; border-radius: 50%; opacity: .55; animation: breathe 3s ease-in-out infinite; will-change: transform, opacity; -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent 100%); mask-image: radial-gradient(closest-side, #000 25%, transparent 100%); }
.flame-wrap, .hero { contain: layout paint; }
.flame-wrap svg { will-change: transform; }
/* وقت السكرول نوقف كل الحركات المستمرة */
body.scrolling *, body.scrolling *::before, body.scrolling *::after { animation-play-state: paused !important; }
@keyframes breathe { 50% { opacity: .85; transform: scale(1.08); } }
.flicker { transform-origin: 50% 92%; animation: flick 1.6s ease-in-out infinite; }
.flicker.f2 { animation-duration: 1.15s; animation-delay: -.4s; }
.flicker.f3 { animation-duration: .9s; animation-delay: -.2s; }
@keyframes flick { 0%,100% { transform: scale(1, 1) skewX(0); } 25% { transform: scale(.97, 1.04) skewX(1.5deg); } 50% { transform: scale(1.02, .97) skewX(-1deg); } 75% { transform: scale(.98, 1.03) skewX(1deg); } }
.coal-pulse { animation: coal 2.4s ease-in-out infinite; }
@keyframes coal { 50% { opacity: .45; } }
.spark { animation: rise 2.8s linear infinite; opacity: 0; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-120px); opacity: 0; } }
.streak-num { font-size: 56px; font-weight: 900; line-height: 1; margin-top: 2px; letter-spacing: -1px; }
.streak-num small { font-size: 18px; font-weight: 700; color: var(--muted); margin-inline-start: 6px; }
.stage-name { color: var(--gold); font-weight: 700; margin-top: 4px; }
.hero-meta { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.shields { display: inline-flex; gap: 2px; }
.shields .off { opacity: .2; filter: grayscale(1); }
.next-stage { max-width: 260px; margin: 12px auto 0; }

/* ---------- مهام اليوم ---------- */
.task { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); margin-bottom: 10px; width: 100%; text-align: start; }
.task .ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 22px; background: var(--card2); flex: none; }
.task.done .ic { background: rgba(95, 212, 154, .14); }
.task .tx { flex: 1; min-width: 0; }
.task .t1 { font-weight: 700; }
.task .t2 { font-size: 12.5px; color: var(--muted); }
.task.done { border-color: rgba(95, 212, 154, .3); }

/* ---------- بطاقة الجمرة ---------- */
.ember-card { background: linear-gradient(160deg, #3a1a14, #1c1218); border-color: #5a2a1c; }
.ember-card .countdown { font-size: 22px; font-weight: 800; color: var(--ember); }
.qada-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.out-card { background: linear-gradient(160deg, #1d1a26, #15121b); }

.quote { text-align: center; padding: 20px 18px; }
.quote .qt { font-family: "Noto Naskh Arabic", "Amiri", serif; font-size: 19px; line-height: 1.9; }
.quote .qs { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

.ptimes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.ptimes div { background: var(--card2); border-radius: 14px; padding: 8px 2px; font-size: 12px; color: var(--muted); }
.ptimes b { display: block; color: var(--text); font-size: 14px; }
.ptimes .now { outline: 1.5px solid var(--ember); color: var(--ember); }

/* ---------- الأذكار ---------- */
.seg { display: flex; background: var(--card); border-radius: 16px; padding: 4px; margin-bottom: 12px; border: 1px solid var(--line); }
.seg button { flex: 1; padding: 10px; border-radius: 12px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--card2); color: var(--text); }
.banner { padding: 12px 14px; border-radius: 16px; margin-bottom: 12px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.banner.open { background: rgba(95, 212, 154, .1); color: var(--green); }
.banner.closed { background: rgba(255, 93, 93, .09); color: #ff9a9a; }
.banner.upcoming { background: rgba(111, 182, 255, .1); color: var(--blue); }
.banner.qada { background: rgba(255, 122, 47, .13); color: var(--ember); }
.zk { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; transition: opacity .35s, transform .35s, max-height .45s; }
.zk-body { padding: 18px 16px 12px; cursor: pointer; }
.zk-text { font-family: "Noto Naskh Arabic", "Amiri", serif; font-size: 20px; line-height: 2.05; }
.zk-fadl { margin-top: 12px; font-size: 14px; color: var(--muted); }
.zk-fadl b { color: var(--gold); font-weight: 700; }
.zk-src { font-size: 12.5px; color: var(--dim); margin-top: 6px; }
.zk-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--bg2); border-top: 1px solid var(--line); }
.counter { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 18px; position: relative; }
.counter svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.counter circle { fill: none; stroke-width: 4; }
.zk-actions { display: flex; gap: 4px; }
.zk-actions button { padding: 8px 10px; border-radius: 12px; font-size: 13px; color: var(--muted); }
.zk.done { opacity: .45; }
.zk.done .zk-text { font-size: 15px; max-height: 3.6em; overflow: hidden; }
.zk.done .zk-fadl, .zk.done .zk-src { display: none; }
.zk.pop { animation: pop .35s; }
@keyframes pop { 40% { transform: scale(.985); } }
.fab { position: fixed; bottom: calc(86px + var(--safe-b)); left: 18px; width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, var(--gold), var(--ember)); color: #2a1206; font-size: 30px; font-weight: 700; z-index: 4; box-shadow: 0 8px 24px rgba(255, 122, 47, .35); }

/* ---------- القرآن والقيام ---------- */
.big-stat { text-align: center; padding: 22px 16px; }
.big-stat .n { font-size: 64px; font-weight: 900; line-height: 1; }
.big-stat .l { color: var(--muted); margin-top: 6px; }
.ring { width: 170px; height: 170px; margin: 0 auto; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring .in { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .in b { font-size: 40px; line-height: 1; display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0; }
.stepper .btn { width: 64px; height: 64px; border-radius: 22px; font-size: 22px; padding: 0; }
.moon { font-size: 64px; text-align: center; filter: drop-shadow(0 0 22px rgba(255, 220, 150, .35)); }

/* ---------- السجل ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal .wd { font-size: 11px; color: var(--dim); }
.cal .d { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 13px; background: var(--card2); color: var(--dim); position: relative; }
.cal .d.full { background: linear-gradient(135deg, var(--gold), var(--ember)); color: #2a1206; font-weight: 800; }
.cal .d.min { background: rgba(255, 122, 47, .3); color: var(--text); }
.cal .d.shield { background: rgba(111, 182, 255, .2); color: var(--blue); }
.cal .d.rekindled { background: rgba(255, 122, 47, .15); color: var(--ember); box-shadow: inset 0 0 0 2px var(--ember); }
.cal .d.ember { background: #3a1a14; color: var(--ember); }
.cal .d.missed { background: rgba(255, 255, 255, .03); color: #4d4452; }
.cal .d.today { box-shadow: inset 0 0 0 2px var(--text); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-inline-end: 4px; }
.stat { background: var(--card2); border-radius: 16px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 12px; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { background: var(--card2); border-radius: 16px; padding: 12px 6px; text-align: center; font-size: 12px; }
.badge .bi { font-size: 30px; display: block; }
.badge.off { opacity: .32; filter: grayscale(1); }

/* ---------- الشيت والإعدادات ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 50; }
.sheet-back.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 88vh; overflow-y: auto; background: var(--bg2); border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); max-width: 600px; margin: 0 auto; user-select: text; }
.sheet.on { transform: none; }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 14px; font-size: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; outline: none; }
.field textarea { min-height: 110px; resize: vertical; font-family: "Noto Naskh Arabic", serif; font-size: 17px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ember); }
.switch { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.switch input { width: 46px; height: 26px; appearance: none; background: var(--line); border-radius: 99px; position: relative; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: right .2s; }
.switch input:checked { background: var(--ember); }
.switch input:checked::after { right: 23px; }
.explain p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.explain b { color: var(--text); }

/* ---------- إشعارات داخلية واحتفال ---------- */
.toast { position: fixed; top: calc(14px + var(--safe-t)); left: 50%; transform: translate(-50%, -150%); background: var(--card2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 16px; z-index: 60; transition: transform .35s; max-width: 90vw; text-align: center; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.toast.on { transform: translate(-50%, 0); }
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 59; overflow: hidden; }
.burst i { position: absolute; width: 8px; height: 8px; border-radius: 50%; animation: fly 1.3s ease-out forwards; }
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
.celebrate { text-align: center; padding: 10px 0 6px; }
.celebrate .big { font-size: 72px; }
.celebrate h2 { margin: 6px 0; }

.fade-in { animation: fin .3s ease; }
@keyframes fin { from { opacity: 0; transform: translateY(6px); } }

/* ---------- المواقيت ---------- */
button.ptimes { padding: 0; background: none; text-align: center; }
.pt-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pt-name { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.pt-ctrl { display: flex; align-items: center; gap: 8px; }
.pt-ctrl .btn { width: 38px; height: 38px; padding: 0; border-radius: 12px; font-size: 20px; }
.pt-time { min-width: 74px; text-align: center; font-size: 16px; }
.pt-bell { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; background: var(--card); opacity: .5; }
.pt-bell.on { opacity: 1; background: rgba(255, 122, 47, .15); }
.time-in { flex: 1; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 11px; outline: none; color-scheme: dark; }
input[type="time"], input[type="datetime-local"] { color-scheme: dark; }

/* ---------- دفتري ---------- */
.search { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; outline: none; }
.search:focus { border-color: var(--ember); }
.note { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin-bottom: 12px; user-select: text; }
.note.pinned { border-color: rgba(255, 198, 92, .45); }
.note-text { margin-top: 10px; font-size: 16.5px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.note-actions { display: flex; justify-content: flex-end; gap: 2px; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 4px; }
.note-actions button { padding: 8px 10px; border-radius: 12px; font-size: 13px; color: var(--muted); }
.link-title { font-weight: 700; font-size: 16px; }
.note.watched { opacity: .6; }
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 12px; text-decoration: none; white-space: nowrap; }
.ltr { direction: ltr; text-align: left; }
.type-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.type-pick .chip { padding: 7px 12px; font-size: 13px; }
.chip.sel { background: linear-gradient(135deg, var(--gold), var(--ember)); color: #2a1206; font-weight: 700; }
.empty { text-align: center; padding: 50px 20px; }
.tabs button { font-size: 10.5px; }

/* ---------- إخفاء الذكر المكتمل ---------- */
.zk { scroll-margin-top: 78px; }
.zk.leaving { animation: leave .32s ease forwards; pointer-events: none; }
@keyframes leave { to { opacity: 0; transform: translateX(-60px) scale(.96); } }

/* ---------- النغمات وذكّرني ---------- */
.tone-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tone-row select, .sheet select[data-tonesel] { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; outline: none; }
.tone-row .btn { padding: 10px 14px; }
.seg button { font-size: 13.5px; padding: 10px 4px; }

/* ---------- الرجوع والإغلاق ---------- */
.top { gap: 10px; }
.top .brand { flex: 1; }
.back-btn svg { stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.back-btn[hidden] { display: none; }
.sheet { position: fixed; }
.sheet-x { position: absolute; top: 10px; left: 14px; width: 36px; height: 36px; border-radius: 12px; background: var(--card); color: var(--muted); font-size: 16px; z-index: 2; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.stepper .btn.wide { width: auto; padding: 0 20px; white-space: nowrap; gap: 6px; }
.popup-rem h2 { font-size: 24px; }
.popup-rem .big { animation: ring 1s ease-in-out 3; display: inline-block; }
@keyframes ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }
.switch span { line-height: 1.5; }

/* ---------- رسومات المراحل ---------- */
.flicker { transform-box: fill-box; transform-origin: 50% 92%; }
.art { width: 100%; height: 100%; overflow: visible; display: block; }
.art-breathe { animation: artBreathe 3.2s ease-in-out infinite; }
@keyframes artBreathe { 50% { opacity: .65; } }
.aura { transform-box: fill-box; transform-origin: center; animation: aura 3.6s ease-out infinite; opacity: 0; }
.aura.a2 { animation-delay: 1.2s; } .aura.a3 { animation-delay: 2.4s; }
@keyframes aura { 0% { opacity: 0; transform: scale(.7); } 30% { opacity: .55; } 100% { opacity: 0; transform: scale(1.12); } }
.twinkle { transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .2; transform: scale(.5); } }

/* ---------- الجذوة وحبالها ---------- */
.hub { text-align: center; padding: 0 0 4px; }
.hub-stage { position: relative; width: 100%; max-width: 360px; aspect-ratio: 340 / 270; margin: 0 auto; }
.hub-ropes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rope { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.rope-twist { fill: none; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 5 6; }
.rope.lit { stroke: #c9762c; filter: drop-shadow(0 0 4px rgba(255, 140, 50, .55)); }
.rope-twist.lit { stroke: #ffd38a; animation: ropeFlow 1.2s linear infinite; }
.rope.alive { stroke: #6b4a2e; }
.rope-twist.alive { stroke: #9b7550; opacity: .6; }
.rope.ember { stroke: #ff7a2f; stroke-dasharray: 3 7; animation: emberPulse 1.4s ease-in-out infinite; }
.rope-twist.ember { display: none; }
.rope.cut { stroke: #3d3445; stroke-width: 3.5; }
.fuel { fill: #ffe9a8; filter: drop-shadow(0 0 4px #ffb347); }
@keyframes ropeFlow { to { stroke-dashoffset: -22; } }
@keyframes emberPulse { 50% { opacity: .35; } }
.hub-core { position: absolute; left: 50%; top: 29.6%; width: 52%; aspect-ratio: 1; transform: translate(-50%, -50%); padding: 0; background: none; }
.rope-node { position: absolute; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; z-index: 2; transition: transform .15s; }
.rope-node:active { transform: translate(-50%, -50%) scale(.92); }
.rn-ic { font-size: 20px; }
.rn-n { font-size: 12px; font-weight: 800; margin-top: 3px; }
.rn-l { position: absolute; top: 100%; margin-top: 4px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.rope-node.lit { border-color: #ffb347; background: radial-gradient(circle at 50% 35%, #4a2a18, var(--card)); box-shadow: 0 0 14px rgba(255, 150, 60, .45); }
.rope-node.lit .rn-n { color: var(--gold); }
.rope-node.alive { border-color: #6b4a2e; }
.rope-node.ember { border-color: var(--ember); border-style: dashed; animation: emberPulse 1.4s ease-in-out infinite; }
.rope-node.cut { opacity: .55; filter: grayscale(.8); }
.hub .streak-num { margin-top: 18px; }
.hub-hint { margin: 10px 0 0; }
.rope-chip { font-size: 11px; font-weight: 700; color: var(--gold); margin-inline-start: 4px; }
.rope-chip.ember { color: var(--ember); }
.task > button.ic, .task > button.tx { background: none; padding: 0; text-align: start; }
.task > button.ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 22px; background: var(--card2); flex: none; }
.task > button.tx { flex: 1; min-width: 0; }
.add-habit { margin: 2px 0 6px; border-style: dashed; color: var(--muted); }
.icon-pick { font-size: 20px; padding: 6px 10px !important; }

/* ---------- مراحل الجذوة ---------- */
.stages-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stage-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 8px 6px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stage-card .stage-art { width: 100%; aspect-ratio: 1; }
.stage-card.current { border-color: var(--ember); box-shadow: 0 0 18px rgba(255, 122, 47, .25); }
.stage-card.reached { border-color: rgba(95, 212, 154, .35); }
.stage-card.locked .stage-art { filter: blur(6px) grayscale(1) brightness(.45); }
.stage-card.locked b { color: var(--dim); letter-spacing: 3px; }
.stage-card .chip { font-size: 10.5px; padding: 2px 8px; }
.stage-reveal { width: 190px; height: 190px; margin: 0 auto; animation: reveal .9s cubic-bezier(.2, .8, .2, 1); }
@keyframes reveal { from { opacity: 0; transform: scale(.4); filter: blur(10px); } }

/* ---------- شريط آخر 14 يوم ---------- */
.strip { display: flex; gap: 5px; justify-content: space-between; }
.strip .dot { flex: 1; aspect-ratio: 1; max-width: 20px; border-radius: 6px; background: rgba(255, 255, 255, .05); }
.strip .dot.done { background: linear-gradient(135deg, var(--gold), var(--ember)); }
.strip .dot.rekindled { background: rgba(255, 122, 47, .2); box-shadow: inset 0 0 0 2px var(--ember); }
.strip .dot.ember { background: #3a1a14; box-shadow: inset 0 0 0 1px var(--ember); }
.strip .dot.missed { background: rgba(255, 255, 255, .04); }
.strip .dot.today { box-shadow: inset 0 0 0 2px var(--muted); }

/* ---------- ترتيب الأذكار ---------- */
.sort-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 122, 47, .1); color: var(--ember); margin-bottom: 10px; font-size: 14px; }
#sort-list { display: flex; flex-direction: column; gap: 8px; }
.srt { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; transition: box-shadow .15s; }
.srt.drag { position: relative; z-index: 5; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); border-color: var(--ember); transition: none; }
.srt .handle { font-size: 22px; color: var(--muted); padding: 4px 8px; cursor: grab; touch-action: none; user-select: none; }
.srt-tx { flex: 1; min-width: 0; font-family: "Noto Naskh Arabic", serif; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srt > button { width: 34px; height: 34px; border-radius: 10px; background: var(--card2); color: var(--muted); font-size: 12px; }
.srt > button:disabled { opacity: .25; }

/* ---------- المناسبات ---------- */
.seg4 button { font-size: 12.5px; padding: 10px 2px; }
.ev-row { display: flex; align-items: center; gap: 14px; }
.ev-count { min-width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(160deg, #3a2414, #1c1623); border: 1px solid #5a3a1c; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.ev-count b { font-size: 24px; color: var(--gold); }
.ev-count span { font-size: 11px; color: var(--muted); }
.ev-count.today { background: linear-gradient(135deg, var(--gold), var(--ember)); }
.ev-tx { flex: 1; min-width: 0; }
.next-ev { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; background: linear-gradient(160deg, #241a2e, #1a1420); }
.next-ev .ne-ic { font-size: 30px; }
.next-ev .ne-tx { display: flex; flex-direction: column; gap: 2px; }

/* ---------- عبادة في غير يومها ---------- */
.rope.rest { stroke: #4a3a52; stroke-dasharray: 2 6; }
.rope-twist.rest { display: none; }
.rope-node.rest { border-color: #4a3a52; opacity: .7; }
.task.rest { opacity: .6; }
.wd-pick .chip { padding: 6px 10px; }

/* ---------- الصوت ---------- */
.voice-bar { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 12px 14px; border-radius: 18px; background: var(--card); border: 1px dashed var(--line); margin-bottom: 12px; }
.voice-bar.on { border: 1px solid var(--ember); background: linear-gradient(160deg, #2e1a14, #1c1623); }
.vb-tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.vb-tx .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vb-tx .vb-heard { direction: rtl; font-family: "Amiri", serif; font-size: 14px; color: #e8d9c4; }
.az-all { margin-bottom: 12px; background: linear-gradient(135deg, rgba(95, 212, 154, .16), rgba(95, 212, 154, .06)); border: 1px solid rgba(95, 212, 154, .45); color: #9be3b8; font-weight: 700; }
.az-all .small { font-weight: 400; }
.zk.voicing { border-color: var(--ember); box-shadow: 0 0 0 1px rgba(255, 122, 47, .35); }
.aw { border-radius: 5px; transition: color .2s, background .2s; }
.aw.ok { color: #9be3b8; }
.aw.cur { box-shadow: inset 0 -2px 0 var(--ember); }
.mic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: var(--card2); flex: none; position: relative; }
.mic.on { background: linear-gradient(135deg, var(--gold), var(--ember)); }
.mic.on span { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--ember); animation: micPulse 1.4s ease-out infinite; }
@keyframes micPulse { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }

/* ---------- المصحف ---------- */
@font-face { font-family: "Amiri"; src: url("../fonts/Amiri-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Amiri Quran"; src: url("../fonts/AmiriQuran-Regular.ttf") format("truetype"); font-display: block; }
/* مصحف المدينة */
.ms-wmenu { position: fixed; z-index: 45; display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: #241c2d; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: fin .2s ease; }
.ms-wmenu button { padding: 9px 12px; border-radius: 12px; background: var(--card); font-size: 14px; white-space: nowrap; }
.ms-wmenu button:first-child { background: rgba(95, 212, 154, .18); color: #9be3b8; font-weight: 700; }
.ms-opts { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ms-opts .seg { flex: 1; min-width: 220px; margin: 0; }
.ms-opts .chip { white-space: nowrap; }
.ms-body.paper { background: #f6efdc; padding: 10px 8px 30px; }
.ms-text.madani { font-family: "Amiri Quran", "Amiri", serif; color: #1d1712; line-height: 2.05; text-align: initial; direction: rtl; padding: 6px 4px; border: 2px solid #c9a24a; border-radius: 10px; box-shadow: inset 0 0 0 4px #f6efdc, inset 0 0 0 5px #c9a24a; background: #fffaf0; }
.madani .ml { display: flex; justify-content: space-between; white-space: nowrap; min-height: 2.05em; padding: 0 .35em; }
.madani.opening .ml { justify-content: center; gap: .25em; }
.madani.measure .ml { display: inline-flex; width: max-content; justify-content: flex-start; gap: .22em; }
.madani .mh { justify-content: center; align-items: center; flex-direction: column; line-height: 1.3; margin: .15em 0; border: 1.5px solid #c9a24a; border-radius: 10px; background: linear-gradient(90deg, #efe0b6, #fff6dd, #efe0b6); color: #6b4a12; }
.madani .mh span { font-size: .95em; } .madani .mh small { font-family: "Noto Sans Arabic", sans-serif; font-size: .45em; color: #8a6a3a; }
.madani .mb { justify-content: center; color: #1d1712; }
.madani .ae { color: #9a6b12; padding: 0 .08em; }
.madani .w { padding: 0; border-radius: 4px; }
.madani .w.cur { box-shadow: inset 0 -3px 0 #ff7a2f; background: rgba(255, 122, 47, .12); }
.madani .w.ok, .madani .w.ok j { color: #138a4a; }
.madani .w.prov, .madani .w.prov j { color: #4fae78; }
.madani .w.skip, .madani .w.skip j { color: #d21f1f; background: rgba(255, 60, 60, .14); }
.madani .w.hint, .madani .w.hint j { color: #b07a00; background: rgba(255, 198, 92, .3); }
.madani.hide-mode .w, .madani.hide-mode .w j { color: transparent; background: rgba(0, 0, 0, .07); }
.madani.hide-mode .w.ok, .madani.hide-mode .w.ok j { color: #138a4a; background: none; }
.madani.hide-mode .w.prov, .madani.hide-mode .w.prov j { color: #4fae78; background: none; }
.madani.hide-mode .w.skip, .madani.hide-mode .w.skip j { color: #d21f1f; }
.madani.hide-mode .w.hint, .madani.hide-mode .w.hint j { color: #b07a00; }
.madani.hide-mode .w.cur { background: rgba(255, 122, 47, .25); }
.ms-body.paper .ms-credit { color: #8a7a60; }
/* ألوان التجويد (نفس ألوان المصاحف المجوّدة) */
.madani.tajweed j.ham_wasl, .madani.tajweed j.laam_shamsiyah, .madani.tajweed j.slnt { color: #9a9a9a; }
.madani.tajweed j.madda_normal { color: #537fff; }
.madani.tajweed j.madda_permissible { color: #4050ff; }
.madani.tajweed j.madda_necessary { color: #000ebc; }
.madani.tajweed j.madda_obligatory { color: #2144c1; }
.madani.tajweed j.qalaqah { color: #dd0008; }
.madani.tajweed j.ikhafa { color: #9400a8; }
.madani.tajweed j.ikhafa_shafawi { color: #d500b7; }
.madani.tajweed j.idgham_ghunnah { color: #169777; }
.madani.tajweed j.idgham_wo_ghunnah { color: #169200; }
.madani.tajweed j.idgham_shafawi { color: #58b800; }
.madani.tajweed j.idgham_mutajanisayn, .madani.tajweed j.idgham_mutaqaribayn { color: #a1a1a1; }
.madani.tajweed j.iqlab { color: #26bffd; }
.madani.tajweed j.ghunnah { color: #ff7e1e; }
body.ms-open { overflow: hidden; }
.mushaf { position: fixed; inset: 0; z-index: 30; background: #120e15; display: flex; flex-direction: column; }
.ms-top { display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) 12px 8px; border-bottom: 1px solid var(--line); }
.ms-title { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: start; line-height: 1.3; }
.ms-title b { font-family: "Amiri", serif; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-mode { margin: 0; padding: 3px; }
.ms-mode button { padding: 7px 10px; font-size: 12.5px; }
.ms-body { flex: 1; overflow-y: auto; padding: 14px 18px 30px; }
.ms-text { font-family: "Amiri", "Noto Naskh Arabic", serif; font-size: 24px; line-height: 2.25; text-align: justify; color: #f3e9d8; user-select: none; }
.ms-surah { margin: 14px 0 6px; padding: 8px; text-align: center; border-radius: 14px; background: linear-gradient(90deg, transparent, rgba(255, 198, 92, .14), transparent); border-top: 1px solid rgba(255, 198, 92, .3); border-bottom: 1px solid rgba(255, 198, 92, .3); line-height: 1.5; }
.ms-surah span { display: block; font-size: 22px; color: var(--gold); }
.ms-surah small { font-family: "Noto Sans Arabic", sans-serif; font-size: 12px; color: var(--muted); }
.ms-basmala { text-align: center; font-size: 22px; color: var(--gold); margin-bottom: 4px; }
.ayah-no { color: var(--gold); font-size: 20px; }
.w { border-radius: 6px; padding: 0 1px; transition: background .2s, color .2s; cursor: pointer; }
.w.cur { box-shadow: inset 0 -3px 0 var(--ember); }
.w.ok { color: #9be3b8; }
.w.skip { color: #ff8a8a; background: rgba(255, 93, 93, .12); }
.w.hint { color: var(--gold); background: rgba(255, 198, 92, .15); }
.hide-mode .w { color: transparent; background: rgba(255, 255, 255, .06); text-shadow: none; }
.hide-mode .w.ok { color: #9be3b8; background: none; }
.hide-mode .w.skip { color: #ff8a8a; background: rgba(255, 93, 93, .12); }
.hide-mode .w.hint { color: var(--gold); background: rgba(255, 198, 92, .15); }
.hide-mode .w.cur { background: rgba(255, 122, 47, .22); }
.ms-credit { text-align: center; font-size: 11px; color: var(--dim); margin-top: 20px; }
.ms-bottom { border-top: 1px solid var(--line); padding: 8px 12px calc(10px + var(--safe-b)); background: rgba(18, 13, 23, .96); }
.ms-status { text-align: center; min-height: 20px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ms-ctrl .btn { padding: 10px 12px; font-size: 13px; }
.ms-nav { width: 44px; font-size: 22px !important; padding: 6px 0 !important; }
.mic.big { width: 64px; height: 64px; font-size: 26px; }
.ms-index { position: absolute; inset: 0; background: #120e15; display: flex; flex-direction: column; z-index: 2; }
.ms-index-head { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t)) 14px 10px; border-bottom: 1px solid var(--line); }
.ms-index-head b { flex: 1; font-size: 18px; }
.ms-index-head input { width: 110px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.ms-index-list { overflow-y: auto; padding: 8px 12px 30px; }
.ms-idx { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 6px; border-bottom: 1px solid var(--line); text-align: start; }
.ms-idx b { font-family: "Amiri", serif; font-size: 18px; flex: 1; }
.ms-idx-n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--card2); color: var(--gold); font-size: 13px; }
.mushaf-entry { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.mushaf-entry .btn { flex-direction: column; padding: 16px 10px; gap: 4px; }
.mushaf-entry .btn small { font-weight: 400; font-size: 11.5px; opacity: .8; }

/* ---------- المسبحة ---------- */
.tb-phrases { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.tb-phrases .chip { white-space: nowrap; padding: 7px 12px; font-family: "Amiri", serif; font-size: 14px; }
.tb-scene { position: relative; display: block; width: 100%; padding: 0; border-radius: 24px; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #241a33, #0f0b16); border: 1px solid var(--line); }
.tb-svg { display: block; width: 100%; height: auto; }
.tb-svg circle[stroke], .tb-counter circle { fill: none; stroke-width: 5; }
.tb-svg path[stroke] { fill: none; }
.tb-fx { position: absolute; inset: 0; pointer-events: none; }
.tb-p { position: absolute; width: 14px; height: 14px; margin: -7px; border-radius: 50%; animation: tbFly 1.1s ease-out forwards; }
.tb-p.burden { background: radial-gradient(circle at 35% 30%, #4a4352, #0c0a0f); }
.tb-p.sea { background: #fff; animation-name: tbPop; }
.tb-p.scale { background: #ffe9a8; box-shadow: 0 0 12px #ffd36a; animation-name: tbDrop; }
@keyframes tbFly { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(30px, -140px) scale(.2); opacity: 0; filter: blur(2px); } }
@keyframes tbPop { 0% { transform: scale(1); opacity: .9; } 100% { transform: translateY(-30px) scale(2.2); opacity: 0; } }
@keyframes tbDrop { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(-95px, 80px) scale(.4); opacity: 0; } }
.wave { animation: waveSway 4s ease-in-out infinite; }
.wave.w2 { animation-duration: 5.5s; animation-direction: reverse; }
@keyframes waveSway { 50% { transform: translateX(-12px); } }
.beam { transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.tb-counter { position: absolute; top: 12px; left: 12px; width: 68px; height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.tb-counter svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.tb-counter b { font-size: 20px; color: var(--gold); }
.tb-counter span { font-size: 10px; color: var(--muted); }
.tb-phrase { font-family: "Amiri", serif; font-size: 24px; text-align: center; color: var(--gold); margin: 12px 0; line-height: 1.8; }
.tb-modes { margin-bottom: 10px; }
.tb-phrase.pace .pw { display: inline-block; }
.tb-phrase.pace.run .pw { color: var(--dim); }
.tb-phrase.pace.run .pw { animation: pwLit .22s ease forwards; animation-delay: calc(var(--dur) * var(--i) / var(--n) * .88); }
@keyframes pwLit { 0% { color: var(--dim); transform: scale(1); } 60% { transform: scale(1.12); } 100% { color: var(--gold); transform: scale(1); text-shadow: 0 0 12px rgba(255, 198, 92, .55); } }
.tb-pace { height: 7px; border-radius: 9px; background: var(--line); overflow: hidden; margin: -4px 24px 14px; }
.tb-pace i { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--ember), var(--gold)); }
.tb-pace.run i { animation: paceFill var(--dur) linear forwards; }
@keyframes paceFill { from { width: 0; } to { width: 100%; } }
.tb-auto { gap: 10px; margin-bottom: 10px; }
.tb-auto .btn { flex: 1; }
.tb-auto select, .row label select { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 9px; }
.tb-scenes, .tb-targets { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 6px; margin: 8px 0 2px; scrollbar-width: none; align-items: center; }
.tb-scenes .chip, .tb-targets .chip { white-space: nowrap; padding: 7px 11px; font-size: 13px; }
.tb-targets input { width: 84px; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 7px 9px; color: var(--text); font-size: 14px; }
.tb-targets input.sel { border-color: var(--gold); color: var(--gold); }
.tb-speed { display: flex; align-items: center; gap: 6px; }
.tb-speed input { width: 70px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; color: var(--text); font-size: 15px; text-align: center; }
.tb-form { margin-bottom: 10px; padding: 12px; }
.tb-snd { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 14px; background: rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; font-size: 18px; }
/* كل نقطة في المشهد = تسبيحة */
.tb-svg .it { transform-box: fill-box; transform-origin: center; transition: opacity .55s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.tb-svg.instant .it, .tb-svg.instant * { transition: none !important; }
.tb-svg .ball.gone { opacity: 0; transform: translateY(-70px) scale(.2); }
.tb-svg .foam.gone { opacity: 0; transform: scale(2.2); }
.tb-svg .gem.off { opacity: 0; transform: translateY(-60px) scale(.3); }
.tb-svg .coin.off { opacity: 0; transform: translateY(-120px) rotate(160deg); }
.tb-svg .date.off { opacity: 0; transform: scale(0); }
.tb-svg .star.off { opacity: 0; transform: scale(0) rotate(-90deg); }
.tb-svg .star:not(.off) { filter: drop-shadow(0 0 2px #ffe9a8); }
.tb-svg .bead { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.tb-svg .bead.on { filter: drop-shadow(0 0 3px #ffc65c); }
.tb-svg .bead.cur { animation: beadPulse 1.3s ease-in-out infinite; }
@keyframes beadPulse { 50% { transform: scale(1.35); } }
.tb-svg #sc-glow, .tb-svg #sc-light, .tb-svg #sc-fill, .tb-svg #sc-moon { transition: all .6s ease; }
.tb-svg #sc-beam, .tb-svg #sc-pl, .tb-svg #sc-pr, .tb-svg #sc-bend { transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.tb-ripple { position: absolute; width: 16px; height: 16px; margin: -8px; border-radius: 50%; border: 2px solid #ffd36a; animation: tbRipple .75s ease-out forwards; pointer-events: none; }
@keyframes tbRipple { from { transform: scale(.4); opacity: .9; } to { transform: scale(4.5); opacity: 0; } }
.tb-p.beads, .tb-p.palm, .tb-p.treasure, .tb-p.sky { background: radial-gradient(circle, #fff6d0, #ffc65c 60%, transparent 70%); animation-name: tbPop; }
.tb-p.palm { background: radial-gradient(circle, #e8ffd8, #6fd08a 60%, transparent 70%); }

/* ---------- مكتبتي ---------- */
.tabs button { font-size: 9.5px; }
.tabs .ti { font-size: 18px; }
.lib-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 12px; }
.lib-head h2 { margin: 0; font-size: 22px; }
.mushaf-card { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #2a1f12, #1c1623); border-color: #5a4320; }
.mc-ic { font-size: 34px; }
.mc-tx { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mc-tx b { font-family: "Amiri", serif; font-size: 19px; color: var(--gold); }
.mc-btns { display: flex; flex-direction: column; gap: 6px; }
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; align-items: start; }
.book { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 0; width: 100%; min-width: 0; align-self: start; vertical-align: top; }
.cover { width: 100%; aspect-ratio: 2 / 3; flex: none; border-radius: 6px 12px 12px 6px; overflow: hidden; box-shadow: -3px 0 0 rgba(0, 0, 0, .35) inset, 0 6px 16px rgba(0, 0, 0, .45); background: var(--card2); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gen-cover { width: 100%; height: 100%; padding: 10px 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; text-align: center; background: linear-gradient(160deg, hsl(var(--h) 45% 32%), hsl(var(--h) 50% 16%)); border: 1px solid hsl(var(--h) 40% 45% / .5); }
.gen-cover b { font-family: "Amiri", serif; font-size: 15px; line-height: 1.5; color: #fff4dc; }
.gen-cover span { font-size: 10.5px; color: #e8d6b8; opacity: .85; }
.bk-title { font-size: 13px; font-weight: 700; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-meta { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book .bar { height: 4px; }
.reader .ms-title b { font-family: inherit; font-size: 15px; }
.reader .ms-top .icon-btn { flex: none; }
.rd-zoom { display: flex; gap: 6px; flex: none; }
.rd-zoom .icon-btn { font-size: 22px; font-weight: 700; width: 40px; height: 40px; }
.rd-body { touch-action: pan-x pan-y; overflow: auto; }
.rd-page { transform-origin: 50% 0; }
.rd-page .textLayer { user-select: text; -webkit-user-select: text; }
.rd-ctrl-note { flex-wrap: wrap; }
.rd-body { padding: 8px; background: #1a1620; }
.rd-page { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 4px 20px rgba(0, 0, 0, .5); }
.rd-page canvas { display: block; }
.rd-text { font-family: "Amiri", "Noto Naskh Arabic", serif; line-height: 2; color: #f3e9d8; padding: 8px 6px 30px; user-select: text; white-space: normal; }
.textLayer ::selection { background: rgba(255, 160, 60, .45); }
.reader .ms-ctrl .btn.ghost { padding: 9px 8px; font-size: 12.5px; }
.rd-page .textLayer span, .rd-page .textLayer br { color: transparent !important; }
.rd-page .textLayer { --total-scale-factor: var(--scale-factor); --min-font-size: 1; --text-scale-factor: 1; --min-font-size-inv: 1; }
.w.prov { color: #c8efd8; }
.hide-mode .w.prov { color: #c8efd8; background: none; }
