/* Noor ul Mubin — "old paper" styles */

:root {
  /* Parchment (light) */
  --bg: #ecdfc0;
  --surface: #f7eed7;
  --surface-2: #eadcb7;
  --text: #36260f;
  --muted: #76603f;
  --primary: #2c5a43;
  --primary-ink: #fbf4e1;
  --primary-soft: #dfe2c3;
  --accent: #8f5e17;
  --accent-soft: #eedaa9;
  --border: #d3bd91;
  --rule: #c7ad7a;
  --highlight: #f5dc9a;
  --danger: #a3271e;
  --shadow: 0 1px 2px rgba(80, 50, 15, .12), 0 6px 18px rgba(80, 50, 15, .10);
  --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .30 0 0 0 0 .14 0 0 0 .10 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --vignette: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(110, 70, 20, .16) 100%);

  /* Tajweed colours (standard colour-coded Mushaf scheme, slightly deepened for paper) */
  --tj-h: #988c7a; --tj-s: #988c7a; --tj-l: #988c7a;
  --tj-n: #4a72f0; --tj-p: #3a49e8; --tj-o: #1f3fb0; --tj-m: #000ea8;
  --tj-q: #cf0008; --tj-g: #e66d00;
  --tj-f: #8a009c; --tj-c: #c400a8; --tj-i: #1595cc;
  --tj-a: #12866c; --tj-u: #157f00; --tj-w: #4a9c00;
  --tj-d: #8e8678; --tj-b: #8e8678;

  --font-ui: "Lora", Georgia, "Times New Roman", serif;
  --font-quran: "Amiri Quran", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --font-arabic: "Noto Naskh Arabic", "Segoe UI", sans-serif;
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", serif;

  --ar-size: 30px;
  --tr-size: 17px;
  --radius: 10px;
  --tabbar-h: 64px;
  color-scheme: light;
}

/* Lamplight (dark) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #19140e;
    --surface: #231b13;
    --surface-2: #2c2318;
    --text: #ecdfc3;
    --muted: #b29d7b;
    --primary: #a3cfae;
    --primary-ink: #15261b;
    --primary-soft: #2b3a2c;
    --accent: #dcb167;
    --accent-soft: #3d301c;
    --border: #3e3224;
    --rule: #54442f;
    --highlight: #3d311b;
    --danger: #f2b8b5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .9 0 0 0 0 .8 0 0 0 0 .6 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --vignette: radial-gradient(ellipse at 50% 30%, rgba(255, 190, 90, .05), transparent 60%);
    --tj-h: #8d8270; --tj-s: #8d8270; --tj-l: #8d8270;
    --tj-n: #87a3ff; --tj-p: #7f89ff; --tj-o: #7493ff; --tj-m: #9aa1ff;
    --tj-q: #ff6b6b; --tj-g: #ffa04d;
    --tj-f: #d27bff; --tj-c: #ff6fe0; --tj-i: #5fd0ff;
    --tj-a: #42d1ad; --tj-u: #7bd84f; --tj-w: #a4e05a;
    --tj-d: #9a9080; --tj-b: #9a9080;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #19140e;
  --surface: #231b13;
  --surface-2: #2c2318;
  --text: #ecdfc3;
  --muted: #b29d7b;
  --primary: #a3cfae;
  --primary-ink: #15261b;
  --primary-soft: #2b3a2c;
  --accent: #dcb167;
  --accent-soft: #3d301c;
  --border: #3e3224;
  --rule: #54442f;
  --highlight: #3d311b;
  --danger: #f2b8b5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .9 0 0 0 0 .8 0 0 0 0 .6 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --vignette: radial-gradient(ellipse at 50% 30%, rgba(255, 190, 90, .05), transparent 60%);
  --tj-h: #8d8270; --tj-s: #8d8270; --tj-l: #8d8270;
  --tj-n: #87a3ff; --tj-p: #7f89ff; --tj-o: #7493ff; --tj-m: #9aa1ff;
  --tj-q: #ff6b6b; --tj-g: #ffa04d;
  --tj-f: #d27bff; --tj-c: #ff6fe0; --tj-i: #5fd0ff;
  --tj-a: #42d1ad; --tj-u: #7bd84f; --tj-w: #a4e05a;
  --tj-d: #9a9080; --tj-b: #9a9080;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--vignette), var(--paper-noise);
  background-attachment: fixed, scroll;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16.5px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

html[lang="ar"] body { font-family: var(--font-arabic); }
html[lang="ur"] body { font-family: var(--font-urdu); line-height: 2; }
html[lang="ur"] input, html[lang="ur"] select, html[lang="ur"] button { font-family: var(--font-urdu); }
html[lang="ar"] input, html[lang="ar"] select, html[lang="ar"] button { font-family: var(--font-arabic); }
[lang="en"] { font-family: var(--font-ui); line-height: 1.6; }

a { color: var(--primary); }
button, input, select { font: inherit; color: inherit; }
svg { flex-shrink: 0; }

/* Hidden above the page (not off to the side, which made right-to-left pages scroll sideways). */
.skip {
  position: absolute; top: -200px; inset-inline-start: 8px; z-index: 100;
  background: var(--surface); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { top: 8px; }

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

/* ---------- Top bar & navigation ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-inline-end: auto; }
.brand img { border-radius: 8px; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: .3px; }

.topnav { display: none; gap: 4px; }
.topnav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  background-image: var(--paper-noise);
  border-top: 1px solid var(--rule);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500;
  min-width: 0;
}
html[lang="ur"] .tabbar a { font-size: 11px; line-height: 1.6; }
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tabbar a[aria-current="page"] { color: var(--primary); }
.tabbar a[aria-current="page"] svg { background: var(--primary-soft); border-radius: 999px; padding: 2px 14px; width: 52px; }

@media (min-width: 900px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  :root { --tabbar-h: 0px; }
}

/* ---------- Page layout ---------- */

main { outline: none; }
.page {
  max-width: 780px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom));
}

h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 700; }
h1 { font-size: 25px; letter-spacing: .2px; }
h2 { font-size: 18px; }
html[lang="ur"] h1, html[lang="ur"] h2, html[lang="ur"] h3 { line-height: 1.9; }

.section { margin-top: 22px; }
.section > h2 { margin-bottom: 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card {
  background: var(--surface);
  background-image: var(--paper-noise);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small-btn { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tj-swatch {
  width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(var(--tj-q) 0 25%, var(--tj-n) 0 50%, var(--tj-a) 0 75%, var(--tj-g) 0);
}
.btn.chip[aria-pressed="false"] .tj-swatch { filter: grayscale(1); opacity: .6; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.field { display: grid; gap: 6px; margin-top: 14px; }
.field label, .field .label { font-weight: 600; font-size: 14px; }
select, input[type="text"], input[type="number"], input[type="search"] {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border-radius: 8px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 80%, white 20%); color: var(--text);
}
:root[data-theme="dark"] select, :root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="number"], :root[data-theme="dark"] input[type="search"] { background: var(--surface-2); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) select, :root:not([data-theme="light"]) input[type="text"],
  :root:not([data-theme="light"]) input[type="number"], :root:not([data-theme="light"]) input[type="search"] { background: var(--surface-2); }
}
input[type="range"] { width: 100%; accent-color: var(--primary); }
.check { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px); text-align: center; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.state { text-align: center; padding: 40px 16px; color: var(--muted); }
.state .btn { margin-top: 12px; }
.spinner {
  width: 28px; height: 28px; margin: 0 auto 12px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Home ---------- */

/* Leather book cover */
.hero {
  background-color: #4a2f14;
  background-image:
    radial-gradient(circle at 85% 15%, rgba(232, 196, 119, .28), transparent 45%),
    var(--paper-noise),
    linear-gradient(135deg, #5c3b1b, #3e2710 65%, #2f1d0b);
  color: #f3e6c8; border: 1px solid #2a1a0a;
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0), inset 0 0 0 7px rgba(232, 196, 119, .55), var(--shadow);
  padding: 22px;
  position: relative; overflow: hidden;
}
.hero h1 { font-size: 28px; color: #f6e7c4; }
.hero .tagline { opacity: .85; margin-top: 2px; font-style: italic; }
html[lang="ur"] .hero .tagline, html[lang="ar"] .hero .tagline { font-style: normal; }
.hero .dates { margin-top: 14px; display: grid; gap: 2px; }
.hero .hijri { font-weight: 600; color: #ebc77a; }

.next-prayer { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: inherit; }
.next-prayer .name { font-size: 22px; font-weight: 700; }
.next-prayer .time { font-size: 22px; font-weight: 700; color: var(--primary); text-align: end; }
.next-prayer .countdown { color: var(--muted); font-size: 14px; }

.continue { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: inherit; }
.continue .ar { font-family: var(--font-quran); font-size: 26px; color: var(--primary); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface); background-image: var(--paper-noise);
  border: 1px solid var(--border);
  text-decoration: none; color: var(--text); font-weight: 600;
  min-height: 96px;
}
.tile:hover { border-color: var(--accent); }
.tile svg { color: var(--accent); }
.tile.soon { opacity: .6; cursor: default; }
.tile.soon:hover { border-color: var(--border); }
.tile .badge { font-size: 12px; font-weight: 500; color: var(--muted); }

/* ---------- Surah list ---------- */

.search { position: relative; margin-top: 12px; }
.search svg { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-inline-start: 40px; }

.surah-list, .lesson-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.surah-item, .lesson-item {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); background-image: var(--paper-noise);
  border: 1px solid var(--border);
  text-decoration: none; color: var(--text);
}
.lesson-item { margin: 0; }
.surah-item:hover, .lesson-item:hover { border-color: var(--accent); }
.num-badge {
  width: 40px; height: 40px; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 8px; transform: rotate(45deg);
}
.num-badge > span { transform: rotate(-45deg); }
.surah-item .t1, .lesson-item .t1 { display: block; font-weight: 600; }
.surah-item .t2 { display: block; font-size: 13px; color: var(--muted); }
.surah-item .ar { font-family: var(--font-quran); font-size: 22px; color: var(--primary); text-align: end; line-height: 1.4; }

/* ---------- Reader ---------- */

/* Illuminated surah heading */
.surah-head {
  text-align: center; padding: 22px 16px;
  border: 3px double color-mix(in srgb, var(--accent) 70%, transparent);
  background-image: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent-soft) 70%, transparent), transparent 70%), var(--paper-noise);
  position: relative;
}
.surah-head::before, .surah-head::after {
  content: "۞"; position: absolute; top: 8px; color: var(--accent); font-size: 18px; opacity: .8;
  font-family: var(--font-quran);
}
.surah-head::before { left: 12px; }
.surah-head::after { right: 12px; }
.surah-head .ar-name { font-family: var(--font-quran); font-size: 40px; color: var(--primary); line-height: 1.9; margin-bottom: 6px; }
.surah-head .meta { color: var(--muted); font-size: 14px; }
.surah-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.bismillah {
  text-align: center; font-family: var(--font-quran); font-size: calc(var(--ar-size) * 1.05);
  margin: 22px 0 8px; color: var(--text); line-height: 2;
}

/* The ayahs sit on one long "page" */
#ayahs {
  background: var(--surface);
  background-image: var(--paper-noise);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow), inset 0 0 40px color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 4px 20px;
}
@media (max-width: 520px) { #ayahs { padding: 2px 14px; } }

.ayah {
  padding: 16px 0;
  background: linear-gradient(to right, transparent, var(--rule) 15%, var(--rule) 85%, transparent) bottom / 100% 1px no-repeat;
  scroll-margin-top: 80px; transition: background-color .4s;
}
.ayah:last-child { background-image: none; }
.ayah.playing, .ayah.flash { background-color: var(--highlight); background-image: none; border-radius: 8px; padding-inline: 12px; margin-inline: -12px; }
.ayah-bar { display: flex; align-items: center; gap: 4px; }
.ayah-bar .num-badge { width: 30px; height: 30px; font-size: 12px; border-radius: 7px; margin-inline-end: auto; }
.ayah .ar {
  font-family: var(--font-quran); font-size: var(--ar-size); line-height: 2.1;
  text-align: right; direction: rtl; margin: 10px 0 6px; word-spacing: 2px;
}
.ayah .end-mark, .ex-full .end-mark { color: var(--accent); font-size: .9em; white-space: nowrap; }
.ayah .tr { font-size: var(--tr-size); line-height: 1.75; color: var(--text); margin: 0; }
.ayah .tr[dir="rtl"] { text-align: right; }
.ayah .tr.ur { font-family: var(--font-urdu); line-height: 2.3; }

/* Tajweed colours */
.tj-h { color: var(--tj-h); } .tj-s { color: var(--tj-s); } .tj-l { color: var(--tj-l); }
.tj-n { color: var(--tj-n); } .tj-p { color: var(--tj-p); } .tj-o { color: var(--tj-o); } .tj-m { color: var(--tj-m); }
.tj-q { color: var(--tj-q); } .tj-g { color: var(--tj-g); }
.tj-f { color: var(--tj-f); } .tj-c { color: var(--tj-c); } .tj-i { color: var(--tj-i); }
.tj-a { color: var(--tj-a); } .tj-u { color: var(--tj-u); } .tj-w { color: var(--tj-w); }
.tj-d { color: var(--tj-d); } .tj-b { color: var(--tj-b); }

.tj-key { margin-top: 14px; text-align: start; }
.tj-key summary { color: var(--accent); }
.tj-legend {
  list-style: none; padding: 0; margin: 10px 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px;
  font-size: 14px;
}
.tj-legend li { display: flex; align-items: center; gap: 8px; }
.tj-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px var(--surface); }

/* ---------- Learn Tajweed ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tj-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted);
  padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border);
}
.tj-chip .tj-dot { width: 10px; height: 10px; box-shadow: none; }
.lesson h1 { margin: 2px 0 10px; }
.lesson-body p { margin: 0 0 10px; }
.lesson-body ul { margin: 0 0 10px; padding-inline-start: 22px; }
.lesson-body li { margin-bottom: 6px; }
.lesson[lang="ur"] .lesson-body { line-height: 2.2; }
.ar-inline { font-family: var(--font-quran); font-size: 1.25em; color: var(--accent); white-space: nowrap; }
.ex-list { display: grid; gap: 12px; }
.ex-group { margin: 0; }
.ex-head { display: flex; align-items: center; gap: 10px; }
.ex { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.ex:last-child { border-bottom: 0; padding-bottom: 0; }
.ex-word { font-family: var(--font-quran); font-size: 40px; line-height: 1.9; text-align: center; }
.ex-full { font-family: var(--font-quran); font-size: 22px; line-height: 2; text-align: right; color: var(--muted); }
.ex-full span[class^="tj-"] { font-weight: 700; }
.ex-meta { justify-content: space-between; margin-top: 4px; font-size: 14px; }

/* ---------- Prayer ---------- */

.times { list-style: none; padding: 0; margin: 0; }
.times li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; border-bottom: 1px solid var(--rule); font-size: 17px;
}
.times li:last-child { border-bottom: 0; }
.times li .tm { font-weight: 600; font-variant-numeric: tabular-nums; }
.times li.next { background: var(--primary-soft); border-radius: 8px; padding-inline: 12px; color: var(--primary); font-weight: 700; border-bottom-color: transparent; }
.times li.passed { color: var(--muted); }
.times li.sun { font-size: 15px; color: var(--muted); }
details { margin-top: 14px; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.coords { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.loc-name { font-weight: 700; font-size: 18px; }

/* ---------- Qibla ---------- */

.qibla-wrap { display: grid; justify-items: center; gap: 14px; text-align: center; }
.dial { width: min(78vw, 320px); height: auto; }
.dial .rose { transition: transform .15s linear; transform-origin: 160px 160px; }
.dial.aligned .ring { stroke: var(--primary); stroke-width: 6; }
.bearing { font-size: 30px; font-weight: 700; color: var(--primary); }
.aligned-msg { color: var(--primary); font-weight: 700; min-height: 1.5em; }

/* ---------- Bookmarks ---------- */

.bm { display: flex; align-items: center; gap: 12px; }
.bm a { flex: 1; text-decoration: none; color: var(--text); min-width: 0; }
.bm .t2 { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Settings / About ---------- */

.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.preview-ar { font-family: var(--font-quran); direction: rtl; text-align: right; font-size: var(--ar-size); line-height: 2; margin-top: 8px; }
.about p { margin: 0 0 10px; }
.about ul { padding-inline-start: 20px; margin: 0 0 10px; }

[dir="rtl"] .flip { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
