/* =========================================================
   حصن المسلم - التصميم الملكي (النهار بني)
   ملف واحد لكل الصفحات. الألوان في أول الملف.
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Tajawal:wght@400;500;700;800&display=swap");

:root {
  --font-ui: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-text: "Amiri", "Traditional Arabic", serif;
  --font-head: "Amiri", serif;
  --font-title: "Amiri", serif;
  --font-num: "Amiri", serif;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-sm: 12px;
  --hero-radius: 28px;
  --mark-radius: 12px;
  --hero-title-size: 2.7rem;
  --shadow-sm: 0 1px 2px rgba(20,30,40,.05), 0 2px 8px rgba(20,30,40,.04);
  --shadow: 0 2px 4px rgba(20,30,40,.05), 0 10px 28px rgba(20,30,40,.08);
  --shadow-lg: 0 18px 48px rgba(10,20,30,.22);
  --theme-color: #3b2416;
  --bg: #ece0ca;
  --bg-pattern: rgba(92,58,33,.07);
  --surface: #f8efdf;
  --surface-2: #efe2c9;
  --border: #dbc6a1;
  --text: #3a2418;
  --text-soft: #7a604a;
  --primary: #5c3a21;
  --primary-soft: rgba(92,58,33,.15);
  --on-primary: #f6e5bf;
  --accent: #b8862f;
  --accent-strong: #8f641a;
  --accent-soft: #f0deb5;
  --on-accent: #2a1a0c;
  --header-bg: rgba(59,36,22,.95);
  --header-text: #f3e2bb;
  --header-border: rgba(201,152,74,.35);
  --btn-bg: rgba(255,255,255,.08);
  --btn-border: rgba(217,169,90,.35);
  --btn-hover: rgba(255,255,255,.16);
  --hero-bg: linear-gradient(165deg,#3b2416 0%,#6e4427 55%,#3b2416 100%);
  --hero-text: #f7e7c2;
  --hero-sub: #dcc293;
  --hero-accent: #dcab5c;
  --hero-pattern: rgba(220,171,92,.22);
  --hero-glow: radial-gradient(ellipse at 50% 0%, rgba(220,171,92,.28), transparent 62%);
  --mark-bg: linear-gradient(135deg,#6e4427,#3b2416);
  --mark-fg: #e2b867;
  --star-off: #cdb893;
  --paper: linear-gradient(180deg,#fcf5e6,#f4e6c9);
  --paper-border: #d8be8c;
  --paper-text: #3a2418;
  --frame: rgba(160,112,40,.42);
  --ornament-bg: linear-gradient(135deg,#6e4427,#3b2416);
  --ornament-fg: #e2b867;
  --ring: #c4923e;
  --ring-done: #5c3a21;
  --ring-track: #e0cfae;
  --progress: linear-gradient(90deg,#5c3a21,#c4923e);
  --counter-bg: radial-gradient(circle at 35% 28%, #8d5c36, #5c3a21 60%, #3b2416);
  --counter-text: #f7e7c2;
  --counter-inner: rgba(226,184,103,.55);
  --counter-shadow: 0 14px 34px rgba(59,36,22,.38), inset 0 1px 0 rgba(255,255,255,.14);
  --btn-primary: linear-gradient(135deg,#7a4d2c,#4a2d1a);
  --counter-border: 2px solid #c4923e;
}

/* الوضع الليلي */
:root[data-theme="dark"] {
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow: 0 2px 4px rgba(0,0,0,.3), 0 12px 30px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 48px rgba(0,0,0,.55);
  --theme-color: #070f1d;
  --bg: #070f1d;
  --bg-pattern: rgba(212,174,90,.03);
  --surface: #0f1b2e;
  --surface-2: #16243b;
  --border: #22324d;
  --text: #ebe5d5;
  --text-soft: #9aa4b6;
  --primary: #c9a24a;
  --primary-soft: rgba(201,162,74,.18);
  --on-primary: #0b1424;
  --accent: #d4ae5a;
  --accent-strong: #e3c071;
  --accent-soft: rgba(212,174,90,.15);
  --on-accent: #0b1424;
  --header-bg: rgba(7,15,29,.92);
  --header-text: #f3e6c4;
  --header-border: rgba(201,162,74,.22);
  --btn-bg: rgba(255,255,255,.05);
  --btn-border: rgba(201,162,74,.28);
  --btn-hover: rgba(255,255,255,.1);
  --hero-bg: linear-gradient(165deg,#081429 0%,#10284b 55%,#081429 100%);
  --mark-bg: #16243b;
  --mark-fg: #d4ae5a;
  --star-off: #2c3c58;
  --paper: #0f1b2e;
  --paper-border: #25385a;
  --paper-text: #f2e9d0;
  --frame: rgba(212,174,90,.25);
  --ornament-bg: #16243b;
  --ring-track: #1d2c45;
  --ring-done: #e3c071;
  --progress: linear-gradient(90deg,#c9a24a,#e3c071);
  --btn-primary: linear-gradient(135deg,#d4ae5a,#b8913a);
  --counter-shadow: 0 14px 34px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.1);
}
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ================= البنية المشتركة (لا تعدّل الألوان هنا، الألوان في الأعلى) ================= */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  transition: background-color .3s, color .3s;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg-pattern);
  -webkit-mask: var(--pattern) repeat;
  mask: var(--pattern) repeat;
  -webkit-mask-size: 72px 72px;
  mask-size: 72px 72px;
}

:root {
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.2'%3E%3Cpath d='M40 8 49 31 72 40 49 49 40 72 31 49 8 40 31 31Z'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3Crect x='22' y='22' width='36' height='36'/%3E%3Ccircle cx='40' cy='40' r='6'/%3E%3Cpath d='M0 0 8 8M80 0 72 8M0 80 8 72M80 80 72 72'/%3E%3C/g%3E%3C/svg%3E");
  --fs: 1;
}

button { font: inherit; color: inherit; }
.icon { width: 22px; height: 22px; display: block; }

/* ===== الشريط العلوي ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--header-bg);
  color: var(--header-text);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--header-border);
  transition: background .25s, border-color .25s;
}
.header h1 {
  flex: 1;
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .25s;
}
.header--index {
  position: fixed;
  inset: 0 0 auto 0;
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--hero-text);
}
.header--index h1 { opacity: 0; }
.header--index.scrolled {
  background: var(--header-bg);
  border-color: var(--header-border);
  color: var(--header-text);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.header--index.scrolled h1 { opacity: 1; }

.icon-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .15s;
}
.icon-btn:hover { background: var(--btn-hover); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .icon { width: 20px; height: 20px; }

/* ===== الإعدادات ===== */
.settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 16px;
  width: 260px;
  padding: 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 14px;
}
.settings-panel.show { display: flex; animation: pop .18s ease-out; }
.settings-panel { max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .95rem; }
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.seg button { border: none; background: transparent; min-width: 36px; height: 32px; padding: 0 8px; border-radius: 8px; cursor: pointer; font-weight: 700; }
.seg button:hover { background: var(--accent-soft); }
.switch { position: relative; width: 46px; height: 26px; border: none; border-radius: 99px; background: var(--ring-track); cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: right .2s; }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { right: 23px; }

/* ===== واجهة الفهرس ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: calc(76px + env(safe-area-inset-top)) 20px 64px;
  text-align: center;
  border-radius: 0 0 var(--hero-radius) var(--hero-radius);
}
.hero-pattern {
  position: absolute;
  inset: 0;
  background-color: var(--hero-pattern);
  -webkit-mask: var(--pattern) repeat;
  mask: var(--pattern) repeat;
  -webkit-mask-size: 64px 64px;
  mask-size: 64px 64px;
  -webkit-mask-position: center;
  mask-position: center;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }
.hero .ornament { width: 64px; height: 64px; color: var(--hero-accent); margin: 0 auto 10px; display: block; }
.hero-title {
  font-family: var(--font-title);
  font-size: var(--hero-title-size, 2.6rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--hero-text);
}
.hero-sub { margin-top: 10px; font-size: 1rem; color: var(--hero-sub); letter-spacing: .02em; }

/* ===== البطاقات السريعة ===== */
.quick {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: -38px auto 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.quick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 14px 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  text-align: center;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.3;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.quick-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.quick-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.quick-card.now { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.quick-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 10px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ===== البحث ===== */
.toolbar { max-width: 720px; margin: 0 auto; padding: 20px 16px 4px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box > .icon { position: absolute; right: 16px; color: var(--text-soft); pointer-events: none; }
.search-box input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 46px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input::placeholder { color: var(--text-soft); }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear { position: absolute; left: 9px; width: 34px; height: 34px; border: none; border-radius: 10px; background: var(--surface-2); cursor: pointer; display: none; place-items: center; }
.search-clear.show { display: grid; }
.search-clear .icon { width: 18px; height: 18px; }

.filters { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.chip {
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
}
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.result-count { margin-inline-start: auto; color: var(--text-soft); font-size: .85rem; }

.section-title {
  max-width: 720px;
  margin: 14px auto 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-soft);
}
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to left, var(--border), transparent); }

/* ===== قائمة الأبواب ===== */
.menu { max-width: 720px; margin: 0 auto; padding: 12px 16px 48px; display: grid; gap: 10px; }
.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  font-size: calc(1.02rem * var(--fs));
  font-weight: 700;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.card:active { transform: scale(.99); }
.card-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--mark-radius, 12px);
  background: var(--mark-bg);
  color: var(--mark-fg);
}
.card-mark .icon { width: 22px; height: 22px; }
.card-title { flex: 1; line-height: 1.5; }
.card-title mark { background: var(--accent-soft); color: inherit; border-radius: 4px; padding: 0 2px; }
.star { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; color: var(--star-off); cursor: pointer; transition: color .2s; }
.star:hover, .star.active { color: var(--accent); }
.star.active .icon { fill: currentColor; }
.star.bump { animation: bump .35s ease-out; }
.card.hidden { display: none; }
.empty { display: none; text-align: center; padding: 40px 16px; color: var(--text-soft); }
.empty.show { display: block; }

/* ===== صفحة الباب ===== */
.chapter { max-width: 600px; margin: 0 auto; padding: 18px 16px calc(32px + env(safe-area-inset-bottom)); }
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--text-soft); font-size: .88rem; font-weight: 700; }
#overall { color: var(--accent-strong); }
.progress-bar { height: 6px; border-radius: 99px; background: var(--ring-track); overflow: hidden; margin-bottom: 30px; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--progress); border-radius: 99px; transition: width .4s ease; }

.dhikr-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px 24px 22px;
}
.dhikr-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--frame);
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none;
}
.dhikr-ornament {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ornament-bg);
  color: var(--ornament-fg);
  border: 3px solid var(--bg);
  box-shadow: var(--shadow-sm);
}
.dhikr-ornament .icon { width: 24px; height: 24px; }
.dhikr-text {
  position: relative;
  font-family: var(--font-text);
  font-size: calc(1.55rem * var(--fs));
  line-height: 2.15;
  text-align: center;
  color: var(--paper-text);
  white-space: pre-line;
}
.dhikr-source {
  position: relative;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--frame);
  font-size: calc(.86rem * var(--fs));
  line-height: 1.8;
  color: var(--text-soft);
  text-align: center;
}
.dhikr-source b { color: var(--accent-strong); font-weight: 700; }
.dhikr-source:empty { display: none; }
.fade-in { animation: fadeIn .35s ease-out; }

/* ===== العداد ===== */
.counter-wrap { display: flex; flex-direction: column; align-items: center; margin: 28px 0 20px; }
.counter {
  position: relative;
  width: 184px;
  height: 184px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  outline: none;
}
.counter svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.counter .track { fill: none; stroke: var(--ring-track); stroke-width: 7; }
.counter .bar { fill: none; stroke: var(--ring); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .3s ease, stroke .3s; }
.counter.done .bar { stroke: var(--ring-done); }
.counter-face {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: var(--counter-bg);
  color: var(--counter-text);
  border: var(--counter-border, 0);
  box-shadow: var(--counter-shadow);
  transition: transform .12s ease;
}
.counter-face::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid var(--counter-inner);
  pointer-events: none;
}
.counter:active .counter-face, .counter.tap .counter-face { transform: scale(.95); }
.counter:focus-visible .counter-face { box-shadow: 0 0 0 4px var(--accent-soft), var(--counter-shadow); }
.counter-num { font-family: var(--font-num); font-size: 3rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.counter-of { font-size: .85rem; opacity: .8; margin-top: 8px; }
.counter-hint { margin-top: 14px; color: var(--text-soft); font-size: .85rem; }

/* ===== الأزرار ===== */
.controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; }
.btn {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: .98rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .2s, transform .15s, opacity .2s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.primary { background: var(--btn-primary); border-color: transparent; color: var(--on-primary); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.square { width: 52px; padding: 0; }

/* ===== الختام ===== */
.finish {
  display: none;
  position: relative;
  text-align: center;
  padding: 44px 22px 30px;
  background: var(--paper);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.finish.show { display: block; animation: fadeIn .4s ease-out; }
.finish-badge { width: 88px; height: 88px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--counter-bg); color: var(--counter-text); box-shadow: var(--counter-shadow); }
.finish-badge .icon { width: 40px; height: 40px; }
.finish h2 { font-family: var(--font-title); font-size: 2rem; color: var(--paper-text); }
.finish p { color: var(--text-soft); margin: 6px 0 24px; }
.finish .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes bump { 50% { transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 380px) {
  .quick { gap: 8px; }
  .quick-card { font-size: .78rem; min-height: 88px; }
  .counter { width: 160px; height: 160px; }
  .counter-num { font-size: 2.5rem; }
  .controls .label { display: none; }
}

/* أزرار الشريط فوق الواجهة الملوّنة */
.header--index:not(.scrolled) .icon-btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); color: var(--hero-text); }

/* ===== شريط التذكير ===== */
.due-banner {
  display: none;
  max-width: 688px;
  margin: 16px auto 0;
  margin-inline: max(16px, calc((100% - 688px) / 2));
  padding: 12px 16px;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius);
  background: var(--btn-primary);
  color: var(--on-primary);
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: fadeIn .4s ease-out;
}
.due-banner.show { display: flex; }

/* ===== إحصائياتي ===== */
.stats {
  max-width: 688px;
  margin: 16px auto 0;
  margin-inline: max(16px, calc((100% - 688px) / 2));
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 4px; gap: 2px; text-align: center; }
.stat + .stat { border-inline-start: 1px solid var(--border); }
.stat b { font-family: var(--font-num); font-size: 1.5rem; line-height: 1.1; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.stat span { font-size: .75rem; color: var(--text-soft); font-weight: 700; }
.stat-btn { border: none; background: var(--accent-soft); color: var(--accent-strong); cursor: pointer; padding: 10px 14px; font: inherit; }
.stat-btn span { color: inherit; }

/* ===== أذكاري المفضلة ===== */
.favs.empty-favs { display: none; }
.fav-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px 4px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.fav-list::-webkit-scrollbar { display: none; }
.fav-item {
  flex: 0 0 auto;
  max-width: 220px;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: var(--shadow-sm);
}
.fav-star { color: var(--accent); }
.fav-star .icon { width: 18px; height: 18px; fill: currentColor; }
.fav-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== أزرار النسخ والمشاركة وحجم الخط ===== */
.dhikr-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--frame);
}
.act {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.act:hover { background: var(--accent-soft); }
.act:active { transform: scale(.95); }
.act .icon { width: 17px; height: 17px; }
.act.fs { min-width: 40px; justify-content: center; padding: 0 8px; }
.act-sep { flex: 1; }

/* ===== رسالة قصيرة ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  width: max-content;
  max-width: min(360px, calc(100% - 32px));
  padding: 10px 18px;
  border-radius: 16px;
  text-align: center;
  line-height: 1.6;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  font-size: .9rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== نافذة التذكير ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .45);
}
.modal.show { display: flex; animation: fadeIn .2s ease-out; }
.modal-box {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 600px) { .modal { align-items: center; } }
.modal-head { display: flex; align-items: center; gap: 10px; color: var(--accent-strong); }
.modal-head h3 { font-family: var(--font-head); font-size: 1.2rem; color: var(--text); }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.field input {
  height: 44px;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.modal-note { font-size: .85rem; color: var(--text-soft); line-height: 1.7; }
.modal .btn { width: 100%; }
.btn.small { height: 42px; font-size: .9rem; width: 100%; }
.btn.small .icon { width: 18px; height: 18px; }

/* =================== الإصدار الخامس =================== */

/* ===== شاشة الافتتاح ===== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: var(--hero-bg);
  color: var(--hero-text);
  transition: opacity .6s ease, visibility .6s;
}
.splash::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--hero-pattern);
  -webkit-mask: var(--pattern) repeat center / 64px 64px;
  mask: var(--pattern) repeat center / 64px 64px;
}
.splash.out { opacity: 0; visibility: hidden; }
html.no-splash .splash { display: none; }
.splash-inner { position: relative; text-align: center; }
.splash .ornament { width: 96px; height: 96px; color: var(--hero-accent); margin: 0 auto 14px; display: block; animation: splashSpin 1.6s ease-out both; }
.splash-title { font-family: var(--font-title); font-size: 3rem; font-weight: 700; animation: splashUp .9s .25s ease-out both; }
.splash-line { width: 0; height: 2px; margin: 10px auto; background: linear-gradient(90deg, transparent, var(--hero-accent), transparent); animation: splashLine .9s .55s ease-out forwards; }
.splash-sub { color: var(--hero-sub); animation: splashUp .8s .7s ease-out both; }
@keyframes splashSpin { from { opacity: 0; transform: rotate(-90deg) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes splashUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes splashLine { to { width: 160px; } }

/* ===== البطاقات السريعة (6) ===== */
.quick.quick-6 { grid-template-columns: repeat(3, 1fr); }
.quick.quick-6 .quick-card { min-height: 88px; }

/* ===== لوحات: ذكر اليوم والورد ===== */
.panel {
  max-width: 688px;
  margin: 16px auto 0;
  margin-inline: max(16px, calc((100% - 688px) / 2));
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.panel[hidden] { display: none; }
.panel-head { display: flex; align-items: center; gap: 10px; }
.panel-head h3 { flex: 1; font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: var(--text); }
.panel-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--mark-bg); color: var(--mark-fg); flex-shrink: 0; }
.panel-icon .icon { width: 19px; height: 19px; }
.panel-meta { color: var(--text-soft); font-size: .82rem; font-weight: 700; }
.icon-btn.small { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); border-color: var(--border); color: var(--text); }
.daily-text {
  margin-top: 14px;
  font-family: var(--font-text);
  font-size: calc(1.3rem * var(--fs));
  line-height: 2;
  text-align: center;
  color: var(--paper-text);
}
.daily-source { margin-top: 8px; font-size: calc(.8rem * var(--fs)); color: var(--text-soft); text-align: center; line-height: 1.7; }
.daily-source b { color: var(--accent-strong); }
.panel-foot { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--frame); }
.link-btn { color: var(--accent-strong); font-weight: 700; font-size: .88rem; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.panel-foot .act { padding: 0 10px; }

.wird-bar { height: 6px; margin: 12px 0 4px; border-radius: 99px; background: var(--ring-track); overflow: hidden; }
.wird-bar span { display: block; height: 100%; width: 0; background: var(--progress); border-radius: 99px; transition: width .4s; }
.wird-list { display: grid; gap: 8px; margin-top: 10px; }
.wird-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  transition: background .2s;
}
.wird-check {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--on-primary);
}
.wird-check .icon { width: 16px; height: 16px; }
.wird-item.done .wird-check { background: var(--primary); border-color: var(--primary); }
.wird-item.done .wird-name { opacity: .6; text-decoration: line-through; text-decoration-color: var(--accent); }
.wird.complete .panel-meta { color: var(--accent-strong); }
.wird-empty { width: 100%; padding: 14px; border: 1.5px dashed var(--accent); border-radius: 14px; background: transparent; color: var(--accent-strong); font-weight: 700; cursor: pointer; }

/* ===== الأقسام ===== */
.jumps { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 2px; scrollbar-width: none; }
.jumps::-webkit-scrollbar { display: none; }
.jumps.hidden { display: none; }
.jump {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}
.jump:hover { color: var(--accent-strong); border-color: var(--accent); }
.group { scroll-margin-top: 76px; }
.group + .group { margin-top: 10px; }
.group.hidden { display: none; }
.group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 2px 10px;
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}
.group-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); }
.group-icon .icon { width: 17px; height: 17px; }
.group-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to left, var(--border), transparent); order: 3; }
.group-count { order: 4; min-width: 26px; padding: 0 8px; height: 22px; display: grid; place-items: center; border-radius: 99px; background: var(--surface-2); color: var(--text-soft); font-size: .75rem; }
.group-cards { display: grid; gap: 10px; }
@media (min-width: 720px) { .group-cards { grid-template-columns: 1fr 1fr; } }

/* ===== نافذة اختيار الورد ===== */
.modal-box.tall { max-height: 86vh; }
.pick-list { overflow-y: auto; margin: 0 -6px; padding: 0 6px; display: grid; gap: 4px; }
.pick-group { margin: 10px 0 4px; font-size: .8rem; font-weight: 800; color: var(--accent-strong); }
.pick { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: .92rem; }
.pick input { width: 20px; height: 20px; accent-color: var(--primary); flex-shrink: 0; }

/* ===== الإعدادات: نسخة احتياطية + حجم الخط ===== */
.backup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.backup-row .btn { font-size: .82rem; padding: 0 8px; }
.seg .fs-pct { min-width: 52px; font-size: .8rem; }
.seg button:disabled, .act:disabled { opacity: .35; cursor: not-allowed; }

/* ===== وضع القراءة بملء الشاشة ===== */
.focus-tap { display: none; }
body.focus-mode .header,
body.focus-mode .progress-head,
body.focus-mode .controls,
body.focus-mode .counter-hint,
body.focus-mode .dhikr-actions,
body.focus-mode .phrases,
body.focus-mode .targets,
body.focus-mode .sebha-stats { display: none !important; }
body.focus-mode .chapter { max-width: 760px; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding-top: calc(76px + env(safe-area-inset-top)); }
body.focus-mode #reader { display: flex; flex-direction: column; }
body.focus-mode .progress-bar { position: fixed; top: env(safe-area-inset-top); inset-inline: 0; margin: 0; border-radius: 0; height: 4px; z-index: 95; }
body.focus-mode .dhikr-card { box-shadow: none; }
body.focus-mode .dhikr-text { font-size: calc(1.85rem * var(--fs)); }
body.focus-mode .counter { width: 132px; height: 132px; }
body.focus-mode .counter-num { font-size: 2.3rem; }
body.focus-mode .focus-tap { display: block; position: fixed; inset: 0; z-index: 90; pointer-events: none; }
body.focus-mode { cursor: pointer; -webkit-user-select: none; user-select: none; }
body.focus-mode .counter-wrap { margin: 22px 0 70px; }
.focus-exit {
  pointer-events: auto;
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 14px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.focus-hint {
  position: fixed;
  bottom: calc(18px + env(safe-area-inset-bottom));
  inset-inline: 0;
  width: max-content;
  margin: 0 auto;
  padding: 6px 16px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
  color: var(--text-soft);
  font-size: .82rem;
  pointer-events: none;
}

/* ===== المسبحة ===== */
.phrases { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; }
.phrases::-webkit-scrollbar { display: none; }
.phrase {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  white-space: nowrap;
}
.phrase.on { background: var(--btn-primary); color: var(--on-primary); border-color: transparent; }
.sebha-card { padding-top: 34px; margin-top: 18px; }
.sebha-card .dhikr-text { font-size: calc(1.9rem * var(--fs)); line-height: 1.9; }
.counter.big { width: 220px; height: 220px; }
.counter.big .counter-num { font-size: 3.6rem; }
.sebha-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.sebha-stats > div { display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.sebha-stats b { font-family: var(--font-num); font-size: 1.5rem; color: var(--accent-strong); line-height: 1.2; }
.sebha-stats span { font-size: .78rem; color: var(--text-soft); font-weight: 700; }
.targets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.targets-label { font-weight: 700; color: var(--text-soft); font-size: .9rem; }
.custom-target input {
  width: 110px;
  height: 34px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .88rem;
  text-align: center;
}
.custom-target input.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.controls.two { grid-template-columns: 1fr 1fr; }
body.focus-mode .sebha .counter.big { width: 240px; height: 240px; }

/* ===== بطاقات الأبواب بلون بني في الوضع النهاري ===== */
:root:not([data-theme="dark"]) .card {
  background: linear-gradient(135deg, #7d4e2c 0%, #5c3a21 100%);
  border-color: rgba(220, 171, 92, .38);
  color: #f7e7c2;
  box-shadow: 0 2px 4px rgba(59,36,22,.18), 0 8px 20px rgba(59,36,22,.16);
}
:root:not([data-theme="dark"]) .card:hover { border-color: #dcab5c; }
:root:not([data-theme="dark"]) .card-mark { background: rgba(0,0,0,.22); color: #e2b867; box-shadow: inset 0 0 0 1px rgba(226,184,103,.35); }
:root:not([data-theme="dark"]) .card .star { color: rgba(247,231,194,.4); }
:root:not([data-theme="dark"]) .card .star:hover, :root:not([data-theme="dark"]) .card .star.active { color: #e8bf6c; }
:root:not([data-theme="dark"]) .card-title mark { background: rgba(226,184,103,.35); }
:root:not([data-theme="dark"]) .quick-card {
  background: linear-gradient(180deg, #ecd9b4 0%, #e0c79a 100%);
  border-color: #cfb07a;
  color: #3a2418;
}
:root:not([data-theme="dark"]) .quick-icon { background: #5c3a21; color: #e8bf6c; }
:root:not([data-theme="dark"]) .quick-card.now { border-color: #8f641a; }
:root:not([data-theme="dark"]) .stats { background: linear-gradient(135deg, #7d4e2c 0%, #5c3a21 100%); border-color: rgba(220,171,92,.38); }
:root:not([data-theme="dark"]) .stat + .stat { border-color: rgba(247,231,194,.18); }
:root:not([data-theme="dark"]) .stat b { color: #f0c977; }
:root:not([data-theme="dark"]) .stat span { color: #ead6ad; }
:root:not([data-theme="dark"]) .stat-btn { background: rgba(0,0,0,.2); color: #f0c977; }
:root:not([data-theme="dark"]) .fav-item { background: linear-gradient(180deg, #ecd9b4, #e0c79a); border-color: #b8862f; color: #3a2418; }
:root:not([data-theme="dark"]) .act { background: #efe0c2; border-color: #d4bb8e; }
:root:not([data-theme="dark"]) .panel { background: linear-gradient(180deg, #f3e5c8 0%, #ead6ae 100%); border-color: #d2b582; }
:root:not([data-theme="dark"]) .wird-item { background: rgba(255,250,238,.55); border-color: #d6bd8f; }
:root:not([data-theme="dark"]) .icon-btn.small { background: rgba(255,250,238,.6); border-color: #cfb07a; }
:root:not([data-theme="dark"]) .jump { background: #f0e1c4; border-color: #d4bb8e; color: #6a4a30; }
:root:not([data-theme="dark"]) .group-count { background: #e8d5b0; }
:root:not([data-theme="dark"]) .phrase:not(.on) { background: #efe0c2; border-color: #d4bb8e; }
:root:not([data-theme="dark"]) .sebha-stats > div { background: linear-gradient(135deg, #7d4e2c 0%, #5c3a21 100%); border-color: rgba(220,171,92,.38); }
:root:not([data-theme="dark"]) .sebha-stats b { color: #f0c977; }
:root:not([data-theme="dark"]) .sebha-stats span { color: #ead6ad; }
:root:not([data-theme="dark"]) .custom-target input { background: #f3e6cc; border-color: #d4bb8e; }
:root:not([data-theme="dark"]) .modal-box { background: #f6ecd8; }
:root:not([data-theme="dark"]) .pick { background: #ecdcbc; }
:root:not([data-theme="dark"]) .search-box input,
:root:not([data-theme="dark"]) .chip:not([aria-pressed="true"]) { background: #f3e6cc; border-color: #d4bb8e; }

/* ===== صفحة مقدمة الكتاب وفضل الذكر (v9) ===== */
.about .book-card { background: var(--hero-bg); color: var(--hero-text); border-radius: var(--radius-lg); padding: 26px 20px 18px; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--header-border); margin-bottom: 26px; }
.about .book-title { font-family: var(--font-title); font-size: 2.1rem; font-weight: 700; color: var(--hero-accent); line-height: 1.4; }
.about .book-sub { font-family: var(--font-head); font-size: 1.1rem; color: var(--hero-sub); margin-bottom: 14px; }
.about .book-rows { display: grid; gap: 8px; text-align: right; border-top: 1px solid var(--header-border); padding-top: 14px; }
.about .book-row { display: flex; gap: 10px; font-size: calc(.95rem * var(--fs)); line-height: 1.7; }
.about .book-row span { color: var(--hero-sub); min-width: 58px; flex-shrink: 0; }
.about .book-row b { font-weight: 700; }
.about-section { margin-bottom: 26px; }
.about-head { font-family: var(--font-head); font-size: 1.6rem; color: var(--accent-strong); text-align: center; margin: 6px 0 14px; }
.about-head::after { content: ""; display: block; width: 70px; height: 2px; margin: 6px auto 0; background: var(--accent); border-radius: 2px; }
.about-basmala { font-family: var(--font-text); font-size: calc(1.4rem * var(--fs)); text-align: center; color: var(--text); margin-bottom: 12px; }
.about-sub { font-family: var(--font-head); font-size: 1.25rem; color: var(--accent-strong); margin: 4px 4px 10px; }
.about-item { position: relative; background: var(--paper); border: 1px solid var(--paper-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px 14px; margin-bottom: 14px; }
.about-text { font-family: var(--font-text); font-size: calc(1.3rem * var(--fs)); line-height: 2.1; color: var(--paper-text); text-align: justify; }
.about-src { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--frame); font-size: calc(.86rem * var(--fs)); line-height: 1.8; color: var(--text-soft); }
.about-sign { text-align: left; margin: 6px 8px 0; line-height: 1.9; }
.about-sign b { display: block; color: var(--accent-strong); font-family: var(--font-head); font-size: 1.15rem; }
.about-sign span { color: var(--text-soft); font-size: .92rem; }
.about-home { display: flex; justify-content: center; margin: 10px auto 0; max-width: 260px; text-decoration: none; }


/* =================== الإصدار العاشر: التواصل والمشاركة والتحديث =================== */
.report-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 8px auto 0; padding: 6px 14px; min-height: 34px;
  background: transparent; border: 1px dashed var(--frame); border-radius: 999px;
  color: var(--text-soft); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
}
.report-btn .icon { width: 15px; height: 15px; }
.report-btn:hover { color: var(--accent-strong); border-color: var(--accent); }
body.focus-mode .report-btn { display: none !important; }

.sadaqa-note { text-align: center; font-size: .82rem; color: var(--accent-strong); font-weight: 700; margin-top: -2px; }
.sadaqa-box { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--frame); display: grid; justify-items: center; gap: 10px; }
.sadaqa-box p { margin: 0 !important; color: var(--accent-strong) !important; font-weight: 700; }

.app-share { margin-top: 4px; margin-bottom: calc(28px + env(safe-area-inset-bottom)); }
.share-text { margin-top: 12px; font-family: var(--font-text); font-size: calc(1.15rem * var(--fs)); line-height: 2; color: var(--text); }
.share-src { font-size: calc(.82rem * var(--fs)); color: var(--text-soft); margin-top: 2px; }
.share-url { margin-top: 10px; text-align: center; font-size: .85rem; color: var(--accent-strong); word-break: break-all; }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.share-btns .btn { height: 48px; font-size: .92rem; }

.contact .contact-hero { background: var(--hero-bg); color: var(--hero-text); border-radius: var(--radius-lg); padding: 26px 20px 20px; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--header-border); margin-bottom: 18px; }
.contact .contact-title { font-family: var(--font-title); font-size: 2rem; font-weight: 700; color: var(--hero-accent); line-height: 1.4; }
.contact .contact-sub { color: var(--hero-sub); font-size: calc(.98rem * var(--fs)); line-height: 1.8; margin-top: 6px; }
.contact-list { display: grid; gap: 10px; }
.contact-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none; transition: transform .15s, background .2s; }
.contact-item:active { transform: scale(.98); }
.contact-item:hover { background: var(--surface-2); }
.contact-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--mark-bg); color: var(--mark-fg); flex-shrink: 0; }
.contact-ic .icon { width: 22px; height: 22px; }
.contact-item.wa .contact-ic { background: linear-gradient(135deg,#2f9e5b,#1d7a43); color: #fff; }
.contact-body { display: grid; gap: 2px; }
.contact-body b { font-family: var(--font-head); font-size: 1.1rem; }
.contact-body bdi { color: var(--text-soft); font-size: .95rem; font-weight: 700; letter-spacing: .3px; }
.contact-tip { margin: 16px 4px 6px; font-size: calc(.88rem * var(--fs)); line-height: 1.8; color: var(--text-soft); text-align: center; }
.contact .app-share { margin-inline: 0; }

.update-bar {
  position: fixed; z-index: 200; inset-inline: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px;
  background: var(--header-bg); color: var(--header-text);
  border: 1px solid var(--header-border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); backdrop-filter: blur(8px);
  transform: translateY(160%); transition: transform .35s ease-out;
}
.update-bar.show { transform: translateY(0); }
.update-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--mark-bg); color: var(--mark-fg); flex-shrink: 0; }
.update-icon .icon { width: 18px; height: 18px; }
.update-text { flex: 1; font-weight: 700; font-size: .92rem; }
.update-btn { height: 38px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.update-btn:disabled { opacity: .7; }
.update-x { width: 32px; height: 32px; display: grid; place-items: center; background: transparent; border: 0; color: var(--header-text); opacity: .75; cursor: pointer; }
.update-x .icon { width: 16px; height: 16px; }


/* =================== الإصدار الحادي عشر: التذكير والخط الكبير وحفظ الموضع =================== */
.fs-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 10px; margin-top: -6px; }
.fs-presets button { border: none; background: transparent; height: 32px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 700; font-size: .85rem; color: var(--text); }
.fs-presets button.on { background: var(--primary); color: var(--on-primary); }

/* نافذة التذكير */
.rem-box { gap: 12px; overflow-y: auto; }
.rem-row { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.rem-row span { flex: 1; }
.rem-row input { height: 44px; padding: 0 10px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.rem-sec { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--frame); border-radius: var(--radius); }
.rem-sec > b { color: var(--accent-strong); font-size: .95rem; }
.rem-sec .modal-note { margin: 0; }
.btn.off { opacity: .4; pointer-events: none; }
.btn.ghost { box-shadow: none; background: transparent; font-weight: 600; font-size: .82rem; height: 36px; }

/* حفظ الموضع */
.resume-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px 10px 8px 12px; background: var(--accent-soft); border: 1px solid var(--frame); border-radius: var(--radius-sm); font-size: .88rem; font-weight: 700; color: var(--text); transition: opacity .5s; }
.resume-bar.fade { opacity: 0; }
.resume-text { flex: 1; }
.resume-btn { display: flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.resume-btn .icon { width: 14px; height: 14px; }
body.focus-mode .resume-bar { display: none; }
.recent-item:has(.recent-pos) { max-width: 300px; }
.recent-pos { margin-inline-start: auto; font-size: .72rem; font-weight: 700; color: var(--accent-strong); background: var(--accent-soft); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }

/* وضع القراءة المريح لكبار السن */
:root.comfort { font-size: 112%; }
:root.comfort .settings-panel { width: min(320px, calc(100vw - 32px)); }
:root.comfort body { line-height: 1.75; }
:root.comfort .dhikr-text { line-height: 2.35; font-weight: 700; letter-spacing: .2px; }
:root.comfort .dhikr-source,
:root.comfort .daily-source,
:root.comfort .about-src { color: var(--text); opacity: .85; }
:root.comfort .dhikr-card { padding-inline: 14px; }
:root.comfort .card-title { font-weight: 800; }
:root.comfort .btn { height: 58px; font-size: 1.05rem; }
:root.comfort .act { min-height: 42px; }
:root.comfort .counter:not(.big) { width: 210px; height: 210px; }
:root.comfort .counter-num { font-size: 3.2rem; }
:root.comfort .counter-hint { font-size: .95rem; color: var(--text); }
:root.comfort .report-btn { font-size: .9rem; min-height: 40px; }
:root.comfort .bg-pattern, :root.comfort body::before { opacity: .35; }


/* =================== الإصدار الثاني عشر: المشاركة والصورة وأبوابي =================== */
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 12px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font: inherit; font-weight: 700; font-size: .9rem; text-decoration: none; cursor: pointer; text-align: center; }
.share-opt .icon { width: 28px; height: 28px; color: var(--accent-strong); }
.share-opt.wa .icon { color: #1f9d55; }
.share-opt:active { transform: scale(.97); }
.img-box { gap: 12px; }
.img-wrap { position: relative; display: grid; place-items: center; min-height: 200px; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }
.img-wrap img { display: block; max-width: 100%; max-height: 52vh; object-fit: contain; }
.img-wait { display: none; color: var(--text-soft); font-weight: 700; }
#imgDialog.busy .img-wait { display: block; }
#imgDialog.busy img { display: none; }
#imgDialog.busy #imgShare, #imgDialog.busy #imgSave { opacity: .5; pointer-events: none; }
.section-title small { font-family: var(--font-ui); font-size: .72rem; font-weight: 700; color: var(--text-soft); }
.recent-clear { order: 3; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); font-family: var(--font-ui); line-height: 1.6; font-size: .78rem; font-weight: 700; border-radius: 99px; padding: 3px 14px; cursor: pointer; }
.recent .section-title::after { order: 2; }
