/* ============================================================
   نور — موقع إسلامي جامع
   تصميم عربي RTL · بلا أي مكتبات خارجية
   ============================================================ */

/* ---------- المتغيرات ---------- */
:root {
  --bg: #05120e;
  --bg-2: #081a14;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-solid: #0b211a;
  --text: #f4f0e4;
  --muted: #9db0a5;
  --gold: #d9b45b;
  --gold-2: #f2d89a;
  --gold-soft: rgba(217, 180, 91, 0.12);
  --green: #1c6b50;
  --green-2: #37a67d;
  --line: rgba(217, 180, 91, 0.17);
  --line-soft: rgba(255, 255, 255, 0.08);
  --danger: #e08a7a;
  --shadow: 0 34px 80px -48px #000;
  --shadow-sm: 0 14px 36px -26px #000;
  --radius: 22px;
  --radius-sm: 14px;
  --font-ui: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-quran: "Amiri", "Traditional Arabic", serif;
  --quran-size: 30px;
  --header-h: 76px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f7f3e8;
  --bg-2: #efe8d6;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(255, 255, 255, 0.95);
  --surface-solid: #fffdf7;
  --text: #15281f;
  --muted: #5e7067;
  --gold: #96701f;
  --gold-2: #bd8f33;
  --gold-soft: rgba(150, 112, 31, 0.1);
  --green: #175c44;
  --green-2: #1f7d5b;
  --line: rgba(150, 112, 31, 0.24);
  --line-soft: rgba(20, 45, 33, 0.1);
  --danger: #a84a38;
  --shadow: 0 30px 70px -45px rgba(40, 50, 30, 0.5);
  --shadow-sm: 0 12px 30px -22px rgba(40, 50, 30, 0.45);
  color-scheme: light;
}

/* ---------- أساسيات ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
  transition: background-color 0.35s ease, color 0.35s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23d9b45b' stroke-width='1'%3E%3Cpath d='M60 4 76 20 98 20 98 42 114 58 98 74 98 96 76 96 60 112 44 96 22 96 22 74 6 58 22 42 22 20 44 20Z'/%3E%3Ccircle cx='60' cy='58' r='13'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
}

[data-theme="light"] body::before { opacity: 0.07; }

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48% 42% at 82% -5%, rgba(55, 166, 125, 0.2), transparent 70%),
    radial-gradient(42% 40% at 5% 15%, rgba(217, 180, 91, 0.12), transparent 70%),
    radial-gradient(60% 55% at 50% 110%, rgba(28, 107, 80, 0.22), transparent 70%);
}

[data-theme="light"] .bg-orbs {
  background:
    radial-gradient(48% 42% at 82% -5%, rgba(55, 166, 125, 0.14), transparent 70%),
    radial-gradient(42% 40% at 5% 15%, rgba(189, 143, 51, 0.14), transparent 70%),
    radial-gradient(60% 55% at 50% 110%, rgba(28, 107, 80, 0.1), transparent 70%);
}

img, svg { max-width: 100%; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

h1, h2, h3, h4, p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--gold); color: #10231c; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] { display: none !important; }

.container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.muted { color: var(--muted); }
.gold { color: var(--gold); }
.center { text-align: center; }

/* ---------- شريط التمرير ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- الهيدر ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: var(--header-h);
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #14231b;
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 8px 24px -10px var(--gold);
}

.brand-mark .icon { width: 24px; height: 24px; stroke-width: 1.4; }

.brand-mark.static { width: 40px; height: 40px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.brand-text small { font-size: 11px; color: var(--muted); letter-spacing: 0.4px; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
  padding: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  min-width: 0;
  max-width: 100%;
}

.nav-link {
  position: relative;
  padding: 8px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover { color: var(--text); background: var(--surface-2); }

.nav-link.is-active {
  color: #15241c;
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  box-shadow: 0 6px 18px -10px var(--gold);
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.icon-btn:hover { border-color: var(--line); background: var(--surface-2); transform: translateY(-1px); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.sm .icon { width: 17px; height: 17px; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1px;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:active { transform: translateY(1px) scale(0.99); }

.btn-gold {
  color: #14231b;
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  box-shadow: 0 16px 34px -20px var(--gold);
}

.btn-gold:hover { box-shadow: 0 20px 40px -18px var(--gold); transform: translateY(-2px); }

.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.btn-ghost:hover { background: var(--surface-2); border-color: var(--gold); transform: translateY(-2px); }

.btn-sm { padding: 9px 17px; font-size: 13.5px; gap: 7px; }
.btn-sm .icon { width: 17px; height: 17px; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font-size: 13.5px;
  font-weight: 700;
}

.link-btn .icon { width: 17px; height: 17px; transition: transform 0.2s ease; }
.link-btn:hover .icon { transform: translateX(-4px); }

/* ---------- الصفحات ---------- */
main { padding-bottom: 80px; }

.page { padding-top: 44px; }

.page.is-active { animation: fadeUp 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.page-head { margin-bottom: 30px; }

.page-head h1 {
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.25;
  margin: 6px 0 10px;
}

.center-head { text-align: center; }
.center-head .page-head > div { margin-inline: auto; max-width: 680px; }

.lead {
  color: var(--muted);
  font-size: 17px;
  max-width: 62ch;
}

.lead.sm { font-size: 15px; line-height: 1.9; }
.center-head .lead { margin-inline: auto; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-top: 2px;
}

.section-note { color: var(--muted); font-size: 13.5px; text-align: left; }

.block { margin-top: 64px; }

/* ---------- الهيرو ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: 30px 0 12px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 1px;
}

.eyebrow .icon { width: 15px; height: 15px; }

.bismillah {
  font-family: var(--font-quran);
  font-size: clamp(21px, 2.6vw, 27px);
  color: var(--gold);
  margin: 22px 0 4px;
  line-height: 1.9;
  opacity: 0.95;
}

.hero h1 {
  font-size: clamp(36px, 5.4vw, 58px);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -1.2px;
  margin: 4px 0 18px;
}

.grad {
  background: linear-gradient(100deg, var(--gold-2) 10%, var(--gold) 55%, var(--green-2) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead { font-size: 16.5px; max-width: 54ch; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.hero-stats li { display: flex; flex-direction: column; line-height: 1.35; }
.hero-stats b { font-size: 21px; font-weight: 800; color: var(--text); }
.hero-stats span { font-size: 12px; color: var(--muted); }

/* بطاقة الصلاة */
.hero-card-wrap { position: relative; }

.hero-card-wrap::before {
  content: "";
  position: absolute;
  inset: 14% 8% 4% 8%;
  background: radial-gradient(closest-side, rgba(55, 166, 125, 0.28), transparent 75%);
  filter: blur(40px);
  z-index: -1;
}

.prayer-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(120% 110% at 100% 0%, rgba(55, 166, 125, 0.2), transparent 58%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

[data-theme="light"] .prayer-card {
  background:
    radial-gradient(120% 110% at 100% 0%, rgba(55, 166, 125, 0.16), transparent 58%),
    linear-gradient(160deg, #fffefa, #f6f1e3);
}

.prayer-card::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  pointer-events: none;
  opacity: 0.7;
}

.prayer-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.pill .icon { width: 15px; height: 15px; }

.city-tag {
  font-size: 12.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-name {
  margin-top: 26px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.next-time {
  font-family: var(--font-quran);
  font-size: clamp(54px, 7vw, 72px);
  line-height: 1.05;
  font-weight: 700;
  background: linear-gradient(120deg, var(--gold-2), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 1px;
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}

.countdown { display: flex; gap: 9px; }

.cd {
  flex: 1;
  min-width: 60px;
  padding: 10px 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--surface);
  text-align: center;
}

.cd b {
  display: block;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.cd span { font-size: 10.5px; color: var(--muted); letter-spacing: 0.3px; }

.mini-progress {
  height: 4px;
  margin: 18px 0;
  border-radius: 99px;
  background: var(--line-soft);
  overflow: hidden;
}

.mini-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-2), var(--gold));
  transition: width 0.8s ease;
}

.hero-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 0 16px;
  border-top: 1px dashed var(--line-soft);
}

.hero-dates span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.hero-dates strong { font-size: 13px; font-weight: 700; line-height: 1.5; }

.prayer-card .link-btn { margin-top: 2px; }

/* ---------- أبواب الخير ---------- */
.doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.door {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-align: start;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.door:hover {
  transform: translateY(-3px);
  border-color: var(--line);
  background: var(--surface-2);
}

.door-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--gold-soft);
  color: var(--gold);
}

.door-icon .icon { width: 23px; height: 23px; }

.door-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.door-body b { font-size: 15px; font-weight: 800; }
.door-body small { font-size: 12px; color: var(--muted); line-height: 1.6; }

.door-arrow {
  width: 18px;
  height: 18px;
  margin-inline-start: auto;
  color: var(--muted);
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.door:hover .door-arrow { transform: translateX(-4px); opacity: 1; color: var(--gold); }

/* ---------- آية / حديث ---------- */
.daily-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.quote-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    radial-gradient(90% 100% at 100% 0%, rgba(217, 180, 91, 0.09), transparent 65%),
    var(--surface);
  overflow: hidden;
}

.quote-card::after {
  content: "”";
  position: absolute;
  inset-inline-start: 18px;
  bottom: -40px;
  font-family: var(--font-quran);
  font-size: 150px;
  color: var(--gold);
  opacity: 0.1;
  pointer-events: none;
}

.quote-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.verse {
  font-family: var(--font-quran);
  font-size: clamp(23px, 2.8vw, 30px);
  line-height: 2;
  color: var(--text);
}

.hadith-text { font-size: 17px; line-height: 2; font-weight: 500; }

.ref { margin-top: auto; padding-top: 16px; color: var(--gold); font-size: 13px; font-weight: 700; }

/* ---------- اللوحات ---------- */
.panel {
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.field { display: flex; flex-direction: column; gap: 7px; flex: 1 1 220px; min-width: 0; }
.field label { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 0.4px; }

select,
input[type="search"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(0% + 18px) calc(50% + 2px), calc(0% + 13px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-start: 32px;
  cursor: pointer;
}

select:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--gold);
  background-color: var(--surface-2);
}

select option { background: var(--surface-solid); color: var(--text); }

.geo-btn { flex: none; }

.note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.9;
}

.note .icon { width: 17px; height: 17px; margin-top: 4px; color: var(--gold); }

/* ---------- الصلاة ---------- */
.next-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(110% 160% at 100% 0%, rgba(55, 166, 125, 0.26), transparent 60%),
    linear-gradient(140deg, rgba(28, 107, 80, 0.34), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .next-banner {
  background:
    radial-gradient(110% 160% at 100% 0%, rgba(55, 166, 125, 0.2), transparent 60%),
    linear-gradient(140deg, rgba(28, 107, 80, 0.12), #fffdf7);
}

.next-banner-info h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 4px 0 2px;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 800;
}

.next-banner .countdown { flex: none; }
.next-banner .cd { min-width: 68px; background: rgba(0, 0, 0, 0.16); border-color: var(--line); }

[data-theme="light"] .next-banner .cd { background: rgba(255, 255, 255, 0.7); }

.prayer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
}

.prayer-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.prayer-item:hover { border-color: var(--line); transform: translateY(-2px); }

.prayer-item .p-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 6px;
  border-radius: 11px;
  background: var(--gold-soft);
  color: var(--gold);
}

.prayer-item .p-icon .icon { width: 20px; height: 20px; }

.prayer-item .p-name { font-size: 14px; font-weight: 700; }
.prayer-item .p-time {
  font-family: var(--font-quran);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.prayer-item .p-sub { font-size: 11px; color: var(--muted); }

.prayer-item.is-next {
  border-color: var(--gold);
  background: linear-gradient(150deg, var(--gold-soft), var(--surface));
}

.prayer-item.is-next::after {
  content: "التالية";
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--gold);
  color: #15241c;
  font-size: 10px;
  font-weight: 800;
}

.prayer-item.is-past { opacity: 0.55; }
.prayer-item.is-past:hover { opacity: 0.85; }

/* ---------- القرآن ---------- */
.quran-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.surah-panel { padding: 14px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-2);
}

.search-box .icon { width: 18px; height: 18px; color: var(--muted); }
.search-box input {
  flex: 1;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  font-size: 14px;
}
.search-box input:focus { outline: none; }
.search-box:focus-within { border-color: var(--gold); }

.surah-count { padding: 11px 4px 7px; font-size: 11.5px; color: var(--muted); }

.surah-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: min(620px, calc(100vh - 260px));
  overflow-y: auto;
  padding-inline-end: 4px;
}

.surah-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  text-align: start;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.surah-item:hover { background: var(--surface-2); }

.surah-item.is-active {
  background: var(--gold-soft);
  border-color: var(--line);
}

.surah-num {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.surah-item.is-active .surah-num { background: var(--gold); color: #15241c; border-color: transparent; }

.surah-item .s-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700; }
.surah-item .s-meta { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.reader { min-height: 560px; padding: 28px; }

.reader-body { scroll-margin-top: calc(var(--header-h) + 16px); }

.reader-empty,
.reader-loading,
.reader-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 480px;
  padding: 30px;
  text-align: center;
}

.reader-empty h3,
.reader-error h3 { font-size: 21px; font-weight: 800; }
.reader-empty p,
.reader-error p { max-width: 48ch; color: var(--muted); font-size: 14px; line-height: 2; }

.empty-ornament {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 30px;
  margin-bottom: 6px;
}

.empty-ornament .icon { width: 34px; height: 34px; }

.reader-error .chips { justify-content: center; margin: 6px 0 4px; }

.spinner {
  width: 34px;
  height: 34px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.reader-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.reader-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; margin: 2px 0 3px; }
.reader-head .muted { font-size: 12.5px; }

.reader-tools { display: flex; align-items: center; gap: 10px; }

.font-ctl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
}

.font-ctl button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.font-ctl button:hover { background: var(--gold); color: #15241c; }
.font-ctl span { padding-inline: 7px; font-size: 11.5px; color: var(--muted); font-weight: 700; }

.bismillah-line {
  margin: 26px 0 8px;
  text-align: center;
  font-family: var(--font-quran);
  font-size: clamp(26px, 3.2vw, 34px);
  color: var(--gold);
  line-height: 1.9;
}

.ayahs { padding-top: 8px; }

.ayah {
  padding: 16px 4px;
  border-bottom: 1px dashed var(--line-soft);
  font-family: var(--font-quran);
  font-size: var(--quran-size);
  line-height: 2.15;
  text-align: justify;
  text-align-last: center;
  transition: background-color 0.2s ease;
  border-radius: 8px;
}

.ayah:hover { background: var(--gold-soft); }

.ayah-num {
  display: inline-grid;
  place-items: center;
  min-width: 29px;
  height: 29px;
  margin: 0 7px;
  padding: 0 4px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.audio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.audio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 700;
}

.audio-label .icon { width: 18px; height: 18px; }

.audio-bar audio { flex: 1 1 260px; height: 38px; min-width: 0; }

/* ---------- الأذكار ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 8px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.chip:hover { color: var(--text); border-color: var(--line); }

.chip.is-active {
  color: #15241c;
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  border-color: transparent;
}

.azkar-progress-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}

.azkar-progress {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}

.azkar-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-2), var(--gold));
  transition: width 0.4s ease;
}

.azkar-progress-wrap p { font-size: 12px; white-space: nowrap; }

.azkar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.azkar-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease, opacity 0.3s ease;
}

.azkar-card:hover { border-color: var(--line); transform: translateY(-2px); }

.azkar-card.is-done {
  border-color: rgba(55, 166, 125, 0.5);
  background: linear-gradient(150deg, rgba(55, 166, 125, 0.1), var(--surface));
}

.azkar-card .z-text {
  font-family: var(--font-quran);
  font-size: clamp(20px, 2.2vw, 23px);
  line-height: 2.05;
  color: var(--text);
}

.azkar-card .z-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.z-note { font-size: 11.5px; color: var(--muted); }

.z-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.z-count:hover { background: var(--gold); color: #15241c; }
.z-count:active { transform: scale(0.94); }
.z-count:disabled { cursor: default; opacity: 1; }
.z-count:disabled:hover { background: rgba(55, 166, 125, 0.16); color: var(--green-2); }

.z-count .icon { width: 15px; height: 15px; }

.azkar-card.is-done .z-count {
  background: rgba(55, 166, 125, 0.16);
  border-color: rgba(55, 166, 125, 0.45);
  color: var(--green-2);
}

.azkar-grid + .center { margin-top: 26px; }

/* ---------- المسبحة ---------- */
.tasbih-panel {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px 26px 26px;
  text-align: center;
}

.dhikr-chips { justify-content: center; }

.tasbih-ring {
  position: relative;
  width: min(330px, 78vw);
  margin: 26px auto 4px;
  aspect-ratio: 1;
}

.tasbih-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.ring-track { fill: none; stroke: var(--line-soft); stroke-width: 10; }
.ring-inner { fill: var(--surface); stroke: var(--line); stroke-width: 1; }

.ring-progress {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 766.5;
  stroke-dashoffset: 766.5;
  transition: stroke-dashoffset 0.25s ease;
  filter: drop-shadow(0 0 6px rgba(217, 180, 91, 0.35));
}

.tasbih-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.tasbih-center strong {
  font-family: var(--font-quran);
  font-size: clamp(58px, 9vw, 76px);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(140deg, var(--gold-2), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.tasbih-center span { margin-top: 6px; font-size: 12.5px; color: var(--muted); font-weight: 700; }

.tasbih-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 112px;
  height: 112px;
  margin-top: 6px;
  border: 0;
  border-radius: 50%;
  color: #14231b;
  background: linear-gradient(150deg, var(--gold-2), var(--gold));
  box-shadow: 0 18px 40px -18px var(--gold), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.14s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.tasbih-btn .icon { width: 25px; height: 25px; }
.tasbih-btn span { font-size: 13.5px; font-weight: 800; }

.tasbih-btn:hover { box-shadow: 0 24px 48px -18px var(--gold), inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.tasbih-btn:active { transform: scale(0.95); }

.tasbih-btn.pulse { animation: pulse 0.35s ease; }

@keyframes pulse {
  0% { transform: scale(1); }
  45% { transform: scale(0.94); box-shadow: 0 0 0 14px rgba(217, 180, 91, 0.12); }
  100% { transform: scale(1); }
}

.tasbih-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

.tasbih-stats { margin-top: 20px; font-size: 12.5px; color: var(--muted); }
.tasbih-stats b { color: var(--text); font-weight: 800; }
.tasbih-stats .dot { margin: 0 8px; color: var(--line); }

/* ---------- الأسماء ---------- */
.names-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.names-toolbar .search-box { flex: 1 1 300px; max-width: 440px; }
.names-count { font-size: 12.5px; color: var(--muted); }

.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}

.name-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: start;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  overflow: hidden;
}

.name-card:hover { border-color: var(--gold); transform: translateY(-3px); background: var(--surface-2); }

.name-card .n-num {
  font-size: 10.5px;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.name-card .n-name {
  font-family: var(--font-quran);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.name-card .n-meaning { font-size: 12px; line-height: 1.8; color: var(--muted); }

.name-card.is-today {
  border-color: var(--gold);
  background: linear-gradient(150deg, var(--gold-soft), var(--surface));
}

.name-card.is-today::after {
  content: "اسم اليوم";
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--gold);
  color: #15241c;
  font-size: 9px;
  font-weight: 800;
}

.empty-state { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- القبلة ---------- */
.qibla-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
}

.compass-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.compass {
  position: relative;
  width: min(400px, 82vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(55, 166, 125, 0.12), transparent 62%),
    var(--surface);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.35), var(--shadow);
}

.compass svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 50%;
  transform-box: border-box;
  transition: transform 0.4s ease;
}

.compass-outer { fill: none; stroke: var(--line); stroke-width: 2; }
.compass-inner { fill: none; stroke: var(--line-soft); stroke-width: 1; }

.compass-labels text {
  fill: var(--muted);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
}

.compass-tick { stroke: var(--line-soft); stroke-width: 1; }
.compass-tick.major { stroke: var(--gold); stroke-width: 2; }

.compass-needle {
  transition: transform 1s cubic-bezier(0.22, 0.8, 0.24, 1);
  transform-origin: 200px 200px;
  transform-box: view-box;
}

.needle-body { fill: var(--gold); filter: drop-shadow(0 0 10px rgba(217, 180, 91, 0.5)); }
.needle-tail { fill: var(--line); opacity: 0.7; }
.needle-hub { fill: var(--gold-2); stroke: var(--bg); stroke-width: 3; }

.compass-north {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gold);
  opacity: 0.8;
}

.compass-hint { font-size: 12px; color: var(--muted); text-align: center; max-width: 40ch; }

.qibla-info { text-align: center; }

.qibla-deg {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  margin: 8px 0 0;
  font-family: var(--font-quran);
  color: var(--gold);
  line-height: 1;
}

.qibla-deg b { font-size: clamp(62px, 9vw, 86px); font-weight: 700; font-variant-numeric: tabular-nums; }
.qibla-deg span { font-size: 28px; margin-top: 8px; }

.qibla-city { font-size: 15px; font-weight: 700; margin-bottom: 18px; }

.qibla-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 22px;
  padding: 14px 0;
  border-block: 1px solid var(--line-soft);
}

.qibla-meta div { display: flex; flex-direction: column; gap: 2px; }
.qibla-meta dt { font-size: 10.5px; color: var(--muted); }
.qibla-meta dd { margin: 0; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.qibla-info .btn { width: 100%; }

.qibla-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 330px;
  margin-inline: auto;
}

.qibla-actions .btn { flex: 1 1 200px; }

.hint {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding: 12px;
  border: 1px dashed var(--line-soft);
  border-radius: 12px;
  text-align: start;
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--muted);
}

.hint .icon { width: 16px; height: 16px; flex: none; margin-top: 4px; color: var(--gold); }

/* ---------- الفوتر ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
  padding: 44px 0 34px;
}

[data-theme="light"] .site-footer { background: linear-gradient(180deg, transparent, rgba(28, 107, 80, 0.05)); }

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 26px;
}

.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand strong { font-size: 19px; font-weight: 800; display: block; line-height: 1.3; }
.footer-brand p { font-size: 11.5px; color: var(--muted); }

.footer-note { max-width: 52ch; font-size: 11.5px; color: var(--muted); line-height: 1.9; }

.footer-copy { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------- التوست ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 120;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- استجابة ---------- */
@media (max-width: 1080px) {
  .nav-link { padding: 8px 11px; font-size: 12.5px; }
  .brand-text small { display: none; }
}

@media (max-width: 960px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 10px 0 8px;
    min-height: 0;
  }
  .nav {
    order: 3;
    width: 100%;
    margin-inline-start: 0;
    padding: 4px;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
    border-radius: 14px;
    flex: 1 0 100%;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-link { padding: 7px 13px; }
  .header-actions { margin-inline-start: auto; }

  .hero { grid-template-columns: 1fr; padding-top: 14px; }
  .hero-card-wrap { max-width: 560px; width: 100%; margin-inline: auto; }
  .hero h1 { letter-spacing: -0.8px; }
  .hero-stats { margin-top: 26px; }

  .daily-grid { grid-template-columns: 1fr; }
  .quran-layout { grid-template-columns: 1fr; }
  .surah-list { max-height: 300px; }
  .reader { min-height: 420px; padding: 20px; }
  .reader-body { scroll-margin-top: 124px; }
  .reader-empty, .reader-loading, .reader-error { min-height: 320px; }

  .qibla-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .footer-brand { flex-direction: column; text-align: center; }
  .footer-copy { white-space: normal; }
}

@media (max-width: 620px) {
  .container { width: calc(100% - 28px); }
  .page { padding-top: 30px; }
  .block { margin-top: 46px; }
  .hero { gap: 26px; }
  .hero .lead { font-size: 15px; }
  .prayer-card { padding: 22px 18px; }
  .prayer-card::before { inset: 8px; }
  .next-time { font-size: 56px; }
  .cd b { font-size: 20px; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .section-note { text-align: start; }

  .doors { grid-template-columns: 1fr; }
  .quote-card { padding: 20px; }

  .controls { flex-direction: column; align-items: stretch; }
  .field { flex: 1 1 auto; }
  .geo-btn { width: 100%; }

  .next-banner { padding: 20px; }
  .next-banner .countdown { width: 100%; }

  .prayer-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .prayer-item { padding: 14px; }

  .azkar-grid { grid-template-columns: 1fr; }
  .azkar-card { padding: 18px; }
  .azkar-progress-wrap { flex-direction: column; align-items: stretch; gap: 8px; }

  .tasbih-panel { padding: 22px 16px; }
  .tasbih-ring { width: min(280px, 80vw); }

  .names-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .name-card { padding: 14px; }
  .name-card .n-name { font-size: 23px; }

  .qibla-meta { grid-template-columns: 1fr; gap: 10px; }
  .qibla-meta div { flex-direction: row; justify-content: space-between; }
  .qibla-meta dd { font-variant-numeric: tabular-nums; }

  .reader-head { flex-direction: column; align-items: stretch; }
  .reader-tools { justify-content: space-between; }
  .reader .font-ctl span { display: none; }
  .audio-bar { padding: 12px; }
  .audio-bar audio { width: 100%; flex-basis: 100%; }
}

@media (max-width: 380px) {
  .nav-link { font-size: 11.5px; padding: 6px 10px; }
  .hero-cta .btn { width: 100%; }
  .names-grid { grid-template-columns: 1fr; }
}

/* ---------- تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   المصحف: الفهرس والأجزاء والأحزاب والصفحات + التفسير
   ============================================================ */

.lang-btn {
  min-width: 44px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.lang-btn:hover { background: var(--gold-soft); }

.idx-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-2);
}

.idx-tab {
  flex: 1;
  padding: 7px 3px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.idx-tab:hover { color: var(--text); }

.idx-tab.is-active {
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  color: #15241c;
}

.idx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  max-height: min(560px, calc(100vh - 320px));
  overflow-y: auto;
  padding-inline-end: 4px;
}

.idx-grid[hidden] { display: none; }

.idx-cell {
  padding: 8px 0;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.idx-cell:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}

.tool-btn {
  min-width: 42px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.tool-btn.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.surah-item .s-en {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
}

.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 6px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
}

.page-nav[hidden] { display: none; }

.page-nav span {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.pager-btn {
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.pager-btn:disabled { opacity: 0.35; cursor: default; }
.pager-btn:not(:disabled):hover { background: var(--gold-soft); }

.surah-block { margin-bottom: 4px; }

.surah-divider {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 0 6px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
}

.surah-divider span {
  font-family: var(--font-quran);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
}

.surah-divider small { font-size: 11.5px; color: var(--muted); }

.ayah-block { border-bottom: 1px dashed var(--line-soft); }
.ayah-block:last-child { border-bottom: 0; }

.ayah-block .ayah { border-bottom: 0; cursor: pointer; }
.ayah-block .ayah:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ayah-block .ayah[aria-expanded="true"] { background: var(--gold-soft); }

.ayah-en {
  margin: -4px 8px 14px;
  padding-inline-start: 10px;
  border-inline-start: 2px solid var(--line);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.8;
  text-align: left;
}

.tafsir {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.tafsir[hidden] { display: none; }

.tafsir-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--gold-soft);
}

.tafsir-title {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold);
}

.tafsir-close {
  width: 26px;
  height: 26px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.tafsir-close:hover { color: var(--danger); border-color: var(--danger); }

.tafsir-body { max-height: 430px; overflow-y: auto; padding: 2px 16px 12px; }

.tafsir-sec { padding: 12px 0; border-bottom: 1px dashed var(--line-soft); }
.tafsir-sec:last-child { border-bottom: 0; }

.tafsir-src {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
  font-family: var(--font-ui);
}

.tafsir-src b { font-size: 12.5px; color: var(--gold); }
.tafsir-src span { font-size: 10.5px; color: var(--muted); }

.tafsir-text {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 2;
  color: var(--text);
  white-space: pre-line;
}

.tafsir-sec[data-lang="ar"] .tafsir-text {
  font-family: var(--font-quran);
  font-size: 18px;
  line-height: 2.05;
}

.tafsir-sec[data-lang="en"] .tafsir-text { font-size: 14px; line-height: 1.85; }

.tafsir-loading,
.tafsir-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 10px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
}

.tafsir-error p { max-width: 42ch; line-height: 1.8; margin: 0; }

.spinner.sm { width: 22px; height: 22px; border-width: 2px; }

/* الوضع الإنجليزي لصفحة القرآن */
#page-quran[dir="ltr"] .ayah,
#page-quran[dir="ltr"] .bismillah-line,
#page-quran[dir="ltr"] .surah-divider span,
#page-quran[dir="ltr"] .tafsir-sec[data-lang="ar"] { direction: rtl; }

#page-quran[dir="ltr"] .ayah { text-align: justify; }
#page-quran[dir="ltr"] .reader-meta,
#page-quran[dir="ltr"] .reader-head { text-align: start; }

@media (max-width: 960px) {
  .idx-grid { max-height: 320px; }
  .reader .lang-btn { font-size: 11px; }
}

/* ============================================================
   القبلة: القراءة الحيّة، الانحراف المغناطيسي، وضع الكاميرا (AR)
   ============================================================ */

.compass-hint.is-aligned {
  color: var(--green-2);
  font-weight: 800;
}

.qibla-live {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin-top: 4px;
}

.qibla-live[hidden] { display: none; }

.ql-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
}

.ql-item span { font-size: 10.5px; color: var(--muted); }
.ql-item b { font-size: 16px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.ql-item b.is-good { color: var(--green-2); }

.qibla-refs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin: 0 0 18px;
  font-size: 11.5px;
  color: var(--muted);
}

.qibla-refs b { color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- وضع الكاميرا ---------- */
body.ar-open { overflow: hidden; }

.ar-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  overflow: hidden;
}

.ar-overlay[hidden] { display: none; }

.ar-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.ar-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 26%),
    linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0) 30%);
}

.ar-crosshair {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1px;
  height: 46vh;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
}

.ar-arrow {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 118px;
  height: 148px;
  transform-origin: 50% 50%;
  transition: transform 0.12s linear;
  pointer-events: none;
  will-change: transform;
}

.ar-arrow svg {
  width: 100%;
  height: 100%;
  fill: var(--gold);
  filter: drop-shadow(0 0 14px rgba(217, 180, 91, 0.55));
  transition: fill 0.2s ease;
}

.ar-arrow.is-aligned svg {
  fill: var(--green-2);
  filter: drop-shadow(0 0 18px rgba(55, 166, 125, 0.7));
}

.ar-hud {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
}

.ar-hud b {
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
  font-variant-numeric: tabular-nums;
}

.ar-hud span {
  max-width: 30ch;
  font-size: 13.5px;
  font-weight: 700;
  color: #f4f0e4;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.ar-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 2;
}

.ar-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 62px);
  padding: 0 22px;
  margin: 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.7;
  color: rgba(244, 240, 228, 0.78);
  pointer-events: none;
}

@media (max-width: 620px) {
  .qibla-live { gap: 6px; }
  .ql-item b { font-size: 14px; }
  .ar-arrow { width: 96px; height: 122px; }
  .ar-hud b { font-size: 34px; }
}

/* ============================================================
   روابط الأقسام (SEO): تحويل الأزرار إلى روابط حقيقية
   ============================================================ */

a.nav-link { display: inline-flex; align-items: center; }
a.door { display: flex; }
a.btn,
a.link-btn { text-decoration: none; }
.door:focus-visible,
.nav-link:focus-visible,
.footer-links a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.footer-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 700;
  transition: color 0.18s ease;
}

.footer-links a:hover { color: var(--gold); }

@media (max-width: 620px) {
  .footer-links { gap: 6px 14px; font-size: 12px; }
}
