/* Evening Adhkar — eveningadhkar.com */

:root {
  --ar-scale: 1;
  --radius: 22px;
  --wrap: 760px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --arabic: Amiri, "Geeza Pro", "Noto Naskh Arabic", "Traditional Arabic", serif;
}

/* Dusk (default) */
:root,
[data-theme="dusk"] {
  color-scheme: dark;
  --bg: #0d1230;
  --bg-2: #121838;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --line: rgba(232, 220, 255, .1);
  --line-2: rgba(232, 220, 255, .18);
  --text: #efe9dd;
  --text-2: #c7c4d6;
  --muted: #9a9bb8;
  --gold: #e9bd72;
  --gold-2: #f6d7a0;
  --gold-ink: #22180a;
  --rose: #d98a7a;
  --sky-1: #0a0f2a;
  --sky-2: #1b1f4f;
  --sky-3: #3d2b5c;
  --sky-4: #9a5a62;
  --sky-5: #e59a6b;
  --done: #8fcfa9;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -30px rgba(0, 0, 0, .8);
  --header: rgba(13, 18, 48, .72);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f0e4;
  --bg-2: #efe6d4;
  --surface: #fffcf5;
  --surface-2: #f8f1e3;
  --line: rgba(60, 45, 20, .1);
  --line-2: rgba(60, 45, 20, .18);
  --text: #1c2042;
  --text-2: #3b3f5e;
  --muted: #73718a;
  --gold: #9c6a1c;
  --gold-2: #b8802a;
  --gold-ink: #fffaf0;
  --rose: #b0604f;
  --sky-1: #f6f0e4;
  --sky-2: #f3e6d2;
  --sky-3: #f1d6be;
  --sky-4: #eebd9f;
  --sky-5: #e9a77f;
  --done: #2f7d55;
  --shadow: 0 1px 2px rgba(60, 45, 20, .05), 0 18px 40px -28px rgba(60, 45, 20, .35);
  --header: rgba(246, 240, 228, .8);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.12; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap.wide { max-width: 960px; }
.center { text-align: center; }
.fine { font-size: .8rem; color: var(--muted); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--gold); color: var(--gold-ink); text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--header);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.bar {
  max-width: 1120px; margin: 0 auto; height: 64px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.32rem/1 var(--serif); letter-spacing: .005em; white-space: nowrap; }
.brand em { font-style: italic; font-weight: 500; color: var(--gold); }
.brand-mark { width: 28px; height: 28px; fill: var(--gold); }
.brand-mark .brand-star { fill: var(--gold-2); }

.nav { margin-left: auto; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.nav::-webkit-scrollbar { display: none; }
.nav ul { display: flex; gap: 2px; margin: 0; padding: 0 18px 0 0; list-style: none; }
.nav a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-size: .9rem; font-weight: 500; white-space: nowrap; transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }

.progress-count { font: 500 .85rem/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress-count b { color: var(--gold); font-weight: 600; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); cursor: pointer;
  transition: color .2s, border-color .2s, background .2s, transform .2s var(--ease);
}
.icon-btn:hover { color: var(--gold); border-color: var(--line-2); }
.icon-btn:active { transform: scale(.94); }

.progress { height: 2px; background: transparent; }
.progress-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--rose), var(--gold), var(--gold-2)); box-shadow: 0 0 12px var(--gold); transition: width .5s var(--ease); }

@media (max-width: 720px) {
  .bar { height: auto; flex-wrap: wrap; row-gap: 0; padding-top: 10px; }
  .brand { font-size: 1.2rem; margin-right: auto; }
  .nav { order: 3; width: calc(100% + 32px); margin: 6px -16px 0; padding: 0 12px 6px; }
  html { scroll-padding-top: 124px; }
}

/* ---------- Hero ---------- */

.hero, .page-hero { position: relative; isolation: isolate; overflow: hidden; }
.hero { padding: clamp(64px, 12vw, 132px) 0 clamp(80px, 12vw, 128px); }
.page-hero { padding: clamp(48px, 9vw, 96px) 0 clamp(36px, 7vw, 64px); }
.page-hero.tall { min-height: 70vh; display: grid; align-items: center; }

.sky { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 42%, var(--sky-3) 72%, var(--sky-4) 92%, var(--sky-5) 112%); }
.page-hero .sky { background: linear-gradient(180deg, var(--bg) 0%, var(--sky-2) 70%, var(--sky-3) 135%); }
.sky::after { /* geometric lattice */
  content: ""; position: absolute; inset: 0; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23e9bd72' stroke-width='1'%3E%3Cpath d='M48 8 59.3 36.7 88 48 59.3 59.3 48 88 36.7 59.3 8 48 36.7 36.7Z'/%3E%3Crect x='28' y='28' width='40' height='40'/%3E%3Crect x='28' y='28' width='40' height='40' transform='rotate(45 48 48)'/%3E%3Cpath d='M0 0 8 8M96 0 88 8M0 96 8 88M96 96 88 88'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 96px 96px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%);
  mask-image: linear-gradient(180deg, #000, transparent 75%);
}
[data-theme="light"] .sky::after { opacity: .1; filter: saturate(.6) brightness(.7); }

.stars { position: absolute; left: 0; top: 0; width: 1.5px; height: 1.5px; border-radius: 50%; box-shadow: var(--stars); animation: twinkle 6s ease-in-out infinite alternate; }
[data-theme="light"] .stars { display: none; }
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }

.moon {
  position: absolute; right: max(6vw, calc(50% - 520px)); top: clamp(40px, 9vw, 96px);
  width: clamp(70px, 11vw, 120px); aspect-ratio: 1; border-radius: 50%;
  box-shadow: inset clamp(-26px, -3.6vw, -16px) clamp(-10px, -1.4vw, -6px) 0 0 var(--gold-2);
  filter: drop-shadow(0 0 28px rgba(246, 215, 160, .45));
  transform: rotate(-12deg);
}
[data-theme="light"] .moon { box-shadow: none; right: 50%; transform: translateX(50%); width: clamp(220px, 34vw, 380px); top: auto; bottom: clamp(-190px, -17vw, -110px); background: radial-gradient(circle, rgba(255, 236, 200, .95) 0 30%, rgba(246, 190, 140, .45) 46%, transparent 70%); filter: none; }

.horizon { position: absolute; left: -10%; right: -10%; bottom: 0; height: 46%;
  background: radial-gradient(60% 100% at 50% 100%, rgba(229, 154, 107, .38), transparent 70%); }
.page-hero .horizon { height: 70%; background: radial-gradient(50% 100% at 50% 100%, rgba(229, 154, 107, .16), transparent 70%); }
.hero::after, .page-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 160px; z-index: -1; background: linear-gradient(rgba(0,0,0,0), var(--bg) 92%); }

.hero-inner { text-align: center; }
.eyebrow { font: 400 clamp(1.5rem, 4vw, 2rem)/1.6 var(--arabic); color: var(--gold); margin-bottom: 6px; }
.page-hero .eyebrow { text-align: left; }
.page-hero.tall .eyebrow { text-align: center; }
.eyebrow:not([lang]) { font: 600 .8rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.9rem, 9vw, 5.4rem); font-weight: 500; letter-spacing: -.025em; }
.page-hero h1 { font-size: clamp(2.2rem, 6.5vw, 3.6rem); font-weight: 500; }
.lede { margin: 18px auto 0; max-width: 34em; color: var(--text-2); font-size: clamp(1.02rem, 2.4vw, 1.15rem); line-height: 1.6; }
.page-hero .lede { margin-left: 0; }
.page-hero.tall .lede { margin-left: auto; }

.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.facts li { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-size: .86rem; color: var(--text-2);
  background: color-mix(in srgb, var(--bg) 35%, transparent); border: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.facts .i { color: var(--gold); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: 600 .95rem/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .2s var(--ease), box-shadow .2s, background .2s, border-color .2s;
}
.btn.primary { color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 10px 30px -12px var(--gold); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -12px var(--gold); }
.btn.ghost { color: var(--text); background: var(--surface); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--gold); }
.btn.wide { width: 100%; }
.btn[hidden] { display: none; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--gold); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- Dhikr cards ---------- */

.list { display: grid; gap: 22px; padding-top: 8px; padding-bottom: 24px; counter-reset: dhikr; }

.dhikr {
  position: relative;
  padding: clamp(22px, 4.5vw, 36px) clamp(18px, 4.5vw, 38px) clamp(18px, 3.5vw, 26px);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color .4s, opacity .4s, transform .4s var(--ease);
}
.dhikr.current { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.dhikr.complete { opacity: .62; }
.dhikr.complete:hover, .dhikr.complete:focus-within { opacity: 1; }
.dhikr.pulse { animation: pulse .9s var(--ease); }
@keyframes pulse { 0% { box-shadow: var(--shadow), 0 0 0 0 color-mix(in srgb, var(--gold) 55%, transparent); } 100% { box-shadow: var(--shadow), 0 0 0 18px transparent; } }

.dhikr-head { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(18px, 3.5vw, 26px); }
.medallion { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; color: var(--gold); font: 600 1.05rem/1 var(--serif); font-variant-numeric: lining-nums; }
.medallion svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: color-mix(in srgb, var(--gold) 9%, transparent); stroke: currentColor; stroke-width: 1.1; }
.medallion > span { position: relative; }
.dhikr.complete .medallion { color: var(--done); }

.dhikr-titles { min-width: 0; flex: 1; }
.dhikr-title { font-size: clamp(1.25rem, 3.4vw, 1.5rem); font-weight: 600; }
.dhikr-title a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s var(--ease); }
.dhikr-title a:hover { background-size: 100% 1px; }
.dhikr-sub { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.dhikr.standalone .dhikr-head { justify-content: space-between; }

.repeat { flex: none; margin-left: auto; padding: 6px 12px; border-radius: 999px; font: 600 .85rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); background: color-mix(in srgb, var(--gold) 8%, transparent); }

.arabic {
  font-family: var(--arabic);
  font-size: calc(clamp(1.55rem, 4.6vw, 2.05rem) * var(--ar-scale));
  line-height: 2.15;
  text-align: right;
  color: var(--text);
  word-spacing: .04em;
  font-feature-settings: "calt", "liga";
}
.saw { font-family: var(--arabic); font-size: 1.15em; line-height: 1; font-weight: 400; }
.arabic.quran .preamble { display: block; color: var(--text-2); font-size: .82em; margin-bottom: .3em; }
.arabic.quran .ayah-no { color: var(--gold); font-size: .92em; white-space: nowrap; }

.translit { margin-top: 18px; color: var(--gold-2); font: italic 500 clamp(1.08rem, 2.6vw, 1.2rem)/1.55 var(--serif); }
[data-theme="light"] .translit { color: #7d5520; }
.translation { margin-top: 14px; color: var(--text-2); font-size: clamp(.98rem, 2.3vw, 1.05rem); }
.hide-translit .translit, .hide-translation .translation { display: none; }

.virtue { margin-top: 18px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 6%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 16%, transparent); }
.virtue summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; list-style: none; font: 600 .8rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.virtue summary::-webkit-details-marker { display: none; }
.virtue summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); transition: transform .25s; }
.virtue[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.virtue p { padding: 0 14px 14px 36px; color: var(--text-2); font-size: .95rem; }
.weak-note { margin-top: 12px; font-size: .85rem; color: var(--rose); }

.dhikr-foot { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.source { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); min-width: 0; }
.dhikr-foot .icon-btn { margin-left: auto; width: 36px; height: 36px; }
.grade { display: inline-block; padding: 3px 9px; border-radius: 6px; font: 600 .7rem/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); }
.grade-quran { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.grade-sahih { color: var(--done); border-color: color-mix(in srgb, var(--done) 30%, transparent); }
.grade-daif { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 40%, transparent); }

.counter {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 58px; margin-top: 18px; padding: 0 22px;
  border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface);
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: border-color .25s, transform .12s var(--ease);
}
.counter:hover { border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.counter:active { transform: scale(.985); }
.counter-fill { position: absolute; inset: 0; z-index: -1; transform-origin: left; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 14%, transparent), color-mix(in srgb, var(--gold) 26%, transparent)); transition: transform .35s var(--ease); }
.counter-label { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text-2); }
.counter-label .i { color: var(--gold); width: 1.3em; height: 1.3em; }
.counter-num { font: 500 1.05rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--muted); }
.counter-num b { font: 600 1.6rem/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--text); margin-right: 2px; }
.counter.bump .counter-num b { animation: bump .3s var(--ease); }
@keyframes bump { 40% { transform: scale(1.25); color: var(--gold); } }
.dhikr.complete .counter { border-color: color-mix(in srgb, var(--done) 40%, transparent); }
.dhikr.complete .counter-fill { background: color-mix(in srgb, var(--done) 16%, transparent); }
.dhikr.complete .counter-label, .dhikr.complete .counter-label .i, .dhikr.complete .counter-num b { color: var(--done); }

/* Completed panel */
.done { padding: 8px 20px 24px; }
.done-inner { max-width: 720px; margin: 0 auto; text-align: center; padding: 44px 24px; border-radius: var(--radius);
  background: radial-gradient(80% 120% at 50% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%), var(--surface);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); animation: rise .8s var(--ease); }
.done-mark { width: 64px; height: 64px; margin: 0 auto 14px; fill: none; stroke: var(--gold); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.done h2 { font-size: 2rem; }
.done-ar { font: 400 1.8rem/1.9 var(--arabic); color: var(--gold); margin-top: 6px; }
.done p:not(.done-ar) { color: var(--text-2); margin: 6px 0 22px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Prose & sections ---------- */

.prose { padding-top: 32px; padding-bottom: 32px; }
.prose h2 { font-size: clamp(1.7rem, 4.5vw, 2.15rem); margin: 44px 0 14px; }
.prose h2:first-child { margin-top: 12px; }
.prose p, .prose li { color: var(--text-2); font-size: 1.04rem; }
.prose p + p { margin-top: 14px; }
.prose ul { padding-left: 1.2em; margin: 0; }
.prose li { margin: 8px 0; padding-left: 4px; }
.prose li::marker { color: var(--gold); }
.prose .grades { list-style: none; padding: 0; }
.prose .grades .grade { margin-right: 8px; }
.prose a:not(.btn):not(.pager-link) { color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.about-block { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 48px; }
.summary { padding: 18px 20px; border-left: 2px solid var(--gold); background: var(--surface); border-radius: 0 12px 12px 0; }
.words { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 1rem; }
.words th { padding: 0 10px 10px 0; text-align: left; font: 600 .75rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.words td { padding: 12px 10px 12px 0; vertical-align: middle; color: var(--text-2); border-bottom: 1px solid var(--line); }
.words td.ar { font-family: var(--arabic); font-size: 1.35rem; line-height: 1.7; color: var(--text); white-space: nowrap; text-align: right; padding-right: 18px; }
.words td.tl { font-style: italic; color: var(--gold-2); }
[data-theme="light"] .words td.tl { color: #7d5520; }
@media (max-width: 520px) { .words th:nth-child(2), .words td.tl { display: none; } }
.dua-quote { margin: 20px 0 0; padding: 22px 22px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.dua-quote figcaption { margin-top: 12px; color: var(--muted); font-size: .88rem; }
.prose .faq:last-of-type + .pager { margin-top: 36px; }

.faq { border-bottom: 1px solid var(--line); }
.faq:first-of-type { border-top: 1px solid var(--line); margin-top: 22px; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 2px; cursor: pointer; list-style: none; font: 600 1.18rem/1.35 var(--serif); color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 300 1.5rem/1 var(--sans); color: var(--gold); transition: transform .25s var(--ease); }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { padding: 0 2px 20px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; margin-top: 26px; font-weight: 500; }

.more { padding-top: 24px; padding-bottom: 64px; }
.more h2 { font-size: 1.6rem; margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.tile { display: flex; align-items: center; gap: 14px; height: 100%; padding: 16px 18px; border-radius: 16px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s var(--ease); }
.tile:hover { border-color: color-mix(in srgb, var(--gold) 45%, transparent); transform: translateY(-2px); }
.tile > .i { width: 26px; height: 26px; color: var(--gold); }
.tile b { display: block; font: 600 1.15rem/1.2 var(--serif); }
.tile small { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0; }
.pager-link { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; padding: 14px 16px; border-radius: 14px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.pager-link:hover { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.pager-link small { grid-column: 2; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pager-link span { grid-column: 2; font: 600 1.05rem/1.25 var(--serif); }
.pager-link .i { grid-row: 1 / 3; grid-column: 1; color: var(--gold); }
.pager-link.next { grid-template-columns: 1fr auto; text-align: right; }
.pager-link.next small, .pager-link.next span { grid-column: 1; }
.pager-link.next .i { grid-column: 2; }
@media (max-width: 520px) { .pager { grid-template-columns: 1fr; } }

/* PDF page */
.pdf-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 48px); align-items: start; max-width: 960px; padding-top: 8px; padding-bottom: 16px; }
.pdf-sheet { display: block; border-radius: 6px; overflow: hidden; background: #fff; transform: rotate(-1.2deg); transition: transform .4s var(--ease);
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -28px rgba(0, 0, 0, .7), 18px 18px 0 -6px color-mix(in srgb, var(--gold) 12%, transparent); }
.pdf-sheet:hover { transform: rotate(0) translateY(-3px); }
.pdf-sheet img { width: 100%; height: auto; }
.pdf-side { display: grid; gap: 12px; position: sticky; top: 96px; }
.pdf-side .btn.primary { min-height: 56px; font-size: 1.02rem; }
.pdf-facts { text-align: center; font-size: .85rem; color: var(--muted); margin: -2px 0 6px; font-variant-numeric: tabular-nums; }
.pdf-points { list-style: none; margin: 14px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.pdf-points li { display: flex; gap: 12px; color: var(--text-2); font-size: .95rem; line-height: 1.5; }
.pdf-points .i { color: var(--gold); margin-top: 2px; }
.prose ol.contents { list-style: none; counter-reset: c; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 28px; }
.prose ol.contents li { counter-increment: c; margin: 0; padding: 0; }
.prose ol.contents a { display: flex; align-items: baseline; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.prose ol.contents a::before { content: counter(c); min-width: 1.4em; font: 600 1rem/1 var(--serif); font-variant-numeric: lining-nums; color: var(--gold); }
.prose ol.contents a span { flex: 1; }
.prose ol.contents a small { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.prose ol.contents a:hover span { color: var(--gold); }
@media (max-width: 720px) {
  .pdf-layout { grid-template-columns: 1fr; }
  .pdf-sheet { max-width: 340px; margin: 0 auto; }
  .pdf-side { position: static; }
}

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 44px 0 calc(32px + env(safe-area-inset-bottom)); background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin-bottom: 26px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font: 600 1.3rem/1 var(--serif); margin-bottom: 14px; }
.footer-brand .brand-mark { width: 24px; height: 24px; }
.footer-ayah { color: var(--muted); font-size: .9rem; }
.footer-ayah span { font: 400 1.35rem/2 var(--arabic); color: var(--text-2); }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a { color: var(--text-2); text-decoration: none; font-size: .92rem; }
.footer-links a:hover { color: var(--gold); }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Settings dialog ---------- */

.settings {
  width: min(440px, calc(100% - 24px)); max-height: calc(100% - 24px);
  padding: 0; border: 1px solid var(--line-2); border-radius: 24px;
  background: var(--bg-2); color: var(--text);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7);
}
.settings::backdrop { background: rgba(5, 8, 25, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.settings[open] { animation: rise .35s var(--ease); }
.settings-inner { display: grid; gap: 16px; padding: 22px; }
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.settings h2 { font-size: 1.6rem; }
.settings legend, .settings .row > label { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; padding: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; padding: 0; border: 0; }
.seg legend { grid-column: 1 / -1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: .9rem; font-weight: 500; cursor: pointer; transition: border-color .2s, color .2s; }
.seg input:checked + span { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.seg input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.row { display: grid; }
.size { display: flex; align-items: center; gap: 12px; }
.size-a { font-family: var(--arabic); color: var(--muted); line-height: 1; }
.size-a.small { font-size: 1rem; } .size-a.large { font-size: 1.7rem; }
input[type="range"] { flex: 1; accent-color: var(--gold); height: 28px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; cursor: pointer; font-size: .96rem; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); transition: background .2s, border-color .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .2s; }
.switch input:checked + i { background: color-mix(in srgb, var(--gold) 30%, transparent); border-color: var(--gold); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--gold-2); }
.switch input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.settings .fine { text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 500; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); transition: opacity .25s, transform .25s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .site-header, .site-footer, .counter, .hero-cta, .share, .more, .settings, .toast, .sky { display: none !important; }
  body { background: #fff; color: #000; }
  .dhikr { break-inside: avoid; box-shadow: none; border-color: #ccc; opacity: 1 !important; }
}
