/* ============================================================
   Sirat - design system v3
   Warm & cozy: sand, terracotta, espresso, gold.
   Light by default. Dark available via toggle only.
   ============================================================ */

:root {
  --bg: #FBF4E8;
  --bg-2: #F7EAD8;
  --surface: #FFFFFF;
  --surface-2: #F6EDDC;
  --ink: #38261A;
  --ink-strong: #2A1B10;
  --muted: #8A7462;
  --primary: #B25B34;
  --primary-soft: #F7E2D4;
  --deep: #331E10;
  --gold: #C6A14B;
  --gold-deep: #A8843A;
  --gold-soft: #F3E7C9;
  --line: #EBDFC9;
  --danger: #A6403A;
  --ok: #2E7D5B;
  --hero-ink: #2A1B10;
  --hero-muted: #6B5847;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(51, 30, 16, 0.06), 0 14px 34px rgba(51, 30, 16, 0.07);
  --font-ui: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Amiri", "Scheherazade New", serif;
  /* set from Settings. Scales Arabic you READ - verses, the surahs in the
     prayer, the names of Allah. Deliberately not applied to nav, tiles or
     headings, where a 36% jump would wreck the layout for no benefit. */
  --ar-scale: 1;
}

html[data-theme="dark"] {
  --bg: #171009;
  --bg-2: #1D140B;
  --surface: #221810;
  --surface-2: #2B1F15;
  --ink: #F2E8D8;
  --ink-strong: #FAF3E6;
  --muted: #B3A18D;
  --primary: #E08A5C;
  --primary-soft: #3A2718;
  --deep: #120C06;
  --gold: #D8B45E;
  --gold-deep: #C6A14B;
  --gold-soft: #34301F;
  --line: #3A2C1E;
  --hero-ink: #F2E8D8;
  --hero-muted: #C4B096;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* the header is sticky, so anchor jumps must stop short of it or the
   heading of the target section ends up hidden underneath. --header-h is
   measured in app.js; the fallback covers the case where JS has not run. */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h, 56px) + 1rem); }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

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

a { color: var(--primary); }

/* ---------- header / nav ---------- */

.site-header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.6rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink-strong);
  margin-right: auto;
}

.brand svg { width: 32px; height: 32px; flex: none; }

/* Brand sheet: the wordmark is a serif, set plainly. "Do not alter
   typography" - so this rule and .foot-brand are the only places it is set. */
.brand .brand-name {
  font-family: var(--font-ar);
  font-weight: 700;
  font-size: 1.34rem;
  letter-spacing: 0.01em;
}

.site-nav { display: flex; gap: 0.15rem; flex-wrap: wrap; }

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.91rem;
  font-weight: 500;
  padding: 0.4rem 0.72rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover { background: var(--primary-soft); color: var(--primary); }

.site-nav a.active { background: var(--gold); color: #2A2410; font-weight: 600; }

/* header controls: language mode + theme */

.header-controls { display: flex; align-items: center; gap: 0.5rem; }

/* The active segment used to be a square block relying on the track's
   overflow:hidden to round it off, which left visible corners. It rounds
   itself now and the track holds it in with padding. */
.mode-switch {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  background: var(--surface);
}

.mode-switch button {
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.34rem 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.mode-switch button svg { width: 14px; height: 14px; flex: none; }

.mode-switch button.on { background: var(--primary); color: #FFF7EC; }

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 1.4rem 1.1rem 4rem; }

.narrow { max-width: 840px; }

/* ---------- hero (warm + light + alive) ---------- */

.hero, .page-hero {
  position: relative;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--hero-ink);
  overflow: hidden;
}

.hero::before, .page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 420px at 12% -10%, rgba(240, 201, 138, 0.4), transparent 68%),
    radial-gradient(640px 460px at 88% 8%, rgba(232, 168, 124, 0.3), transparent 70%),
    radial-gradient(500px 380px at 50% 110%, rgba(198, 161, 75, 0.22), transparent 72%);
}

.hero::after, .page-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -110px;
  width: 340px;
  height: 460px;
  border: 3px solid var(--gold);
  border-bottom: none;
  border-radius: 170px 170px 0 0;
  opacity: 0.16;
  pointer-events: none;
}

/* floating warm shapes */

.floaters { position: absolute; inset: 0; pointer-events: none; }

.floater {
  position: absolute;
  border-radius: 50%;
  filter: blur(38px);
  opacity: 0.5;
  animation: floatY 9s ease-in-out infinite;
}

.floater.f1 { width: 220px; height: 220px; background: #F0C98A; top: -60px; left: 6%; }
.floater.f2 { width: 180px; height: 180px; background: #E8A87C; bottom: -40px; right: 10%; animation-delay: -3s; animation-duration: 11s; }
.floater.f3 { width: 140px; height: 140px; background: #F3DCA8; top: 30%; right: 28%; animation-delay: -6s; animation-duration: 13s; }

html[data-theme="dark"] .floater { opacity: 0.16; }

.float-arch {
  position: absolute;
  width: 54px;
  height: 74px;
  border: 2.5px solid var(--gold);
  border-bottom: none;
  border-radius: 27px 27px 0 0;
  opacity: 0.24;
  animation: drift 16s ease-in-out infinite;
}

.float-arch.a1 { left: 8%; top: 58%; }
.float-arch.a2 { right: 7%; top: 22%; width: 38px; height: 52px; border-radius: 19px 19px 0 0; animation-delay: -5s; animation-duration: 19s; }
.float-arch.a3 { left: 24%; top: 14%; width: 30px; height: 42px; border-radius: 15px 15px 0 0; animation-delay: -10s; animation-duration: 22s; }

@keyframes floatY {
  0%, 100% { transform: translateY(0) }
  50% { transform: translateY(-26px) }
}

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-2deg) }
  50% { transform: translateY(-18px) rotate(3deg) }
}

.hero-inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 3.6rem 1.1rem 3.2rem;
  text-align: center;
}

.hero .kicker, .page-hero .kicker {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero h1 {
  font-size: clamp(2rem, 4.8vw, 3.2rem);
  line-height: 1.16;
  margin: 0.55rem auto 0.9rem;
  max-width: 760px;
  font-weight: 700;
  color: var(--ink-strong);
}

.hero p.lede {
  color: var(--hero-muted);
  max-width: 640px;
  margin: 0 auto 1.6rem;
  font-size: 1.06rem;
}

.hero .hero-ayah {
  font-family: var(--font-ar);
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  color: var(--ink-strong);
  direction: rtl;
  line-height: 2;
  margin-bottom: 0.3rem;
}

.hero .hero-ayah-tr { color: var(--hero-muted); font-size: 0.95rem; margin-bottom: 1.6rem; }

.btn {
  display: inline-block;
  background: var(--primary);
  color: #FFF7EC;
  font-weight: 600;
  text-decoration: none;
  padding: 0.78rem 1.55rem;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-family: var(--font-ui);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(178, 91, 52, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-2px) scale(1.015); box-shadow: 0 10px 24px rgba(178, 91, 52, 0.34); }

.btn.gold { background: var(--gold); color: #2A2410; box-shadow: 0 6px 18px rgba(198, 161, 75, 0.3); }

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: none;
  margin-left: 0.5rem;
}

/* ---------- page hero (module pages) ---------- */

.page-hero { padding: 2.5rem 1.1rem 2.1rem; text-align: center; }

.page-hero > * { position: relative; }

.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0.4rem 0; color: var(--ink-strong); }

.page-hero p { color: var(--hero-muted); max-width: 640px; margin: 0 auto; font-size: 0.99rem; }

.page-hero .page-progress { max-width: 360px; margin: 1.25rem auto 0; }

/* ---------- reveal-on-scroll ---------- */

.rv {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .floater, .float-arch, .p-art .art-disc { animation: none !important; }
}

/* ---------- section headings ---------- */

.section-head { margin: 2.6rem 0 1.2rem; }

.section-head .kicker {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.section-head h2 { font-size: clamp(1.45rem, 3vw, 1.95rem); line-height: 1.25; margin-top: 0.25rem; color: var(--ink-strong); }

.section-head p.sub { color: var(--muted); margin-top: 0.4rem; max-width: 660px; }

/* ---------- module cards ---------- */

.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

.module-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.2rem 1.1rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

.module-card:hover { transform: translateY(-4px) rotate(-0.3deg); box-shadow: 0 8px 16px rgba(51,30,16,0.09), 0 22px 44px rgba(51,30,16,0.12); }

.module-card .icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  transition: transform 0.25s ease;
}

.module-card:hover .icon { transform: scale(1.12) rotate(-4deg); }

.module-card .icon svg { width: 24px; height: 24px; }

.module-card h3 { font-size: 1.12rem; color: var(--ink-strong); }

.module-card p { color: var(--muted); font-size: 0.92rem; flex: 1; }

.module-card .num {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  font-weight: 700;
  color: var(--gold-deep);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.module-card.soon { opacity: 0.62; pointer-events: none; }

.module-card.soon .badge-soon {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  width: fit-content;
}

/* progress */

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

.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.progress-label { font-size: 0.78rem; color: var(--muted); display: flex; justify-content: space-between; margin-top: 0.35rem; }

/* ---------- stat strip ---------- */

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.4rem; }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat .big { font-size: 1.75rem; font-weight: 700; color: var(--primary); }

.stat .lbl { color: var(--muted); font-size: 0.83rem; }

@media (max-width: 520px) {
  .stat-strip { gap: 0.55rem; }
  .stat { padding: 0.75rem 0.4rem; }
  .stat .big { font-size: 1.3rem; }
  .stat .lbl { font-size: 0.68rem; }
}

/* ---------- content blocks ---------- */

.content-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.5rem;
  margin-bottom: 1.4rem;
}

.content-section h2 { font-size: 1.35rem; margin-bottom: 0.7rem; display: flex; align-items: baseline; gap: 0.55rem; color: var(--ink-strong); }

.content-section h2 .sec-num { color: var(--primary); font-size: 0.95rem; font-weight: 700; }

/* Numbered sections keep their number - it says where you are in a sequence.
   Standalone sections had a bare initial letter instead, which read as a typo.
   These get a glyph of the thing itself. */
.content-section h2 .sec-icon {
  flex: none;
  /* the h2 is a baseline flex row, so on a heading that wraps to two lines a
     centred icon floats between them. Pin it to the first line instead. */
  align-self: flex-start;
  margin-top: -0.15rem;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.content-section h2 .sec-icon svg { width: 17px; height: 17px; display: block; }

.content-section h3 { font-size: 1.05rem; margin: 1.1rem 0 0.4rem; color: var(--ink-strong); }

.content-section p { margin-bottom: 0.8rem; }

.content-section ul, .content-section ol { margin: 0.2rem 0 0.9rem 1.3rem; }

.content-section li { margin-bottom: 0.4rem; }

/* verse / hadith blocks - Quran stays Arabic in every mode */

.ayah {
  background: var(--surface-2);
  border-inline-start: 3px solid var(--gold);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  margin: 1rem 0;
  text-align: center;
}

.ayah .ar { font-family: var(--font-ar); font-size: calc(1.55rem * var(--ar-scale)); line-height: 2.1; direction: rtl; color: var(--ink-strong); }

.ayah .tr { font-style: italic; color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

.ayah .en { margin-top: 0.5rem; font-size: 0.98rem; }

.ayah .src {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--gold-deep);
  background: var(--gold-soft);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

.hadith { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; margin: 1rem 0; background: var(--surface); }

.hadith .txt { font-size: 0.98rem; }

.hadith .src { display: block; margin-top: 0.45rem; font-size: 0.78rem; color: var(--gold-deep); font-weight: 600; }

.note { background: var(--primary-soft); border-radius: 14px; padding: 0.85rem 1.1rem; font-size: 0.92rem; margin: 0.9rem 0; }

.note strong { color: var(--primary); }

.diff-note { border: 1.5px dashed var(--gold-deep); border-radius: 14px; padding: 0.8rem 1rem; font-size: 0.88rem; margin: 0.9rem 0; }

.diff-note strong { color: var(--gold-deep); }

/* prayer position steps - illustrated flip cards */
.figure-switch {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  margin: 0.2rem 0 0.4rem;
}

.figure-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.34rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}

.figure-switch button.on { background: var(--primary); color: #fff; }

.pray-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 1.1rem;
  margin: 1rem 0 1.4rem;
}

.pray-step { margin: 0; perspective: 1600px; }

/* the button is the flipping element; both faces are stacked inside it */
.ps-flip {
  box-sizing: border-box;
  display: block;
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 18px;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.16, 0.2, 1);
}

.ps-flip:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.ps-flip[aria-expanded="true"] { transform: rotateY(180deg); }

.ps-face {
  display: block;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* front defines the card height; back is absolutely positioned over it */
.ps-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  background: var(--surface-2);
}

.ps-front img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #F3DED6;
}

.ps-cap, .ps-back-in {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1rem 1rem;
  text-align: left;
}

.ps-back-in { height: 100%; overflow-y: auto; gap: 0.34rem; }

.ps-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ps-name { font-weight: 700; font-size: 1.02rem; color: var(--deep); }
.ps-name [lang="ar"] { font-family: var(--font-ar); font-weight: 400; color: var(--primary); margin-left: 0.3rem; }
.ps-do { font-size: 0.9rem; color: var(--ink); }

/* sub-heading on a card back that carries more than one thing to say */
.ps-step {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.ps-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* verse separator inside a run of Arabic - a small gold ring.
   Replaces the bare U+06DD glyph, which fonts render at wildly different sizes. */
.v-sep {
  display: inline-block;
  width: 0.58em;
  height: 0.58em;
  margin: 0 0.45em;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  vertical-align: 0.08em;
  opacity: 0.85;
}

.ps-ar {
  font-family: var(--font-ar);
  font-size: 1.32rem;
  line-height: 2;
  color: var(--deep);
  direction: rtl;
}

.ps-tr { font-size: 0.84rem; font-style: italic; color: var(--primary); }
.ps-en { font-size: 0.86rem; color: var(--ink); }
.ps-src { font-size: 0.74rem; color: var(--muted); }
.ps-why { font-size: 0.83rem; color: var(--muted); font-style: italic; }

.ps-tap {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0.75;
}

@media (prefers-reduced-motion: reduce) {
  .ps-flip { transition: none; }
}

/* done chip */

.done-chip {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.done-chip:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.03); }

.done-chip.is-done { background: var(--primary); border-color: var(--primary); color: #FFF7EC; }

/* ---------- tiles ---------- */

.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.7rem; margin: 0.9rem 0; }

.tile { background: var(--surface-2); border-radius: 14px; padding: 0.85rem 0.9rem; text-align: center; transition: transform 0.15s ease; }

.tile:hover { transform: translateY(-3px); }

.tile .t-ar { font-family: var(--font-ar); font-size: 1.25rem; color: var(--primary); direction: rtl; }

.tile .t-en { font-weight: 600; font-size: 0.92rem; margin-top: 0.15rem; color: var(--ink-strong); }

.tile .t-sub { color: var(--muted); font-size: 0.8rem; }

/* ---------- prophet cards ---------- */

.prophet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }

details.prophet-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s ease;
}

details.prophet-card:hover { transform: translateY(-2px); }

details.prophet-card summary { list-style: none; cursor: pointer; padding: 1.05rem 1.2rem; display: flex; align-items: center; gap: 0.8rem; }

details.prophet-card summary::-webkit-details-marker { display: none; }

.prophet-num {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}

.prophet-name { flex: 1; }

.prophet-name .en { font-weight: 700; font-size: 1.05rem; display: block; color: var(--ink-strong); }

.prophet-name .meta { color: var(--muted); font-size: 0.8rem; }

.prophet-ar { font-family: var(--font-ar); font-size: 1.35rem; color: var(--gold-deep); direction: rtl; }

details.prophet-card .prophet-body { padding: 0 1.2rem 1.2rem; border-top: 1px dashed var(--line); }

details.prophet-card .prophet-body p { margin-top: 0.8rem; font-size: 0.95rem; }

.lesson { background: var(--gold-soft); border-radius: 12px; padding: 0.6rem 0.9rem; font-size: 0.88rem; margin-top: 0.8rem; }

.lesson strong { color: var(--gold-deep); }

.qref { color: var(--muted); font-size: 0.8rem; margin-top: 0.55rem; display: block; }

.story-link {
  display: inline-block;
  margin-top: 0.9rem;
  margin-right: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 2px solid var(--primary-soft);
  transition: border-color 0.15s ease;
}

.story-link:hover { border-color: var(--primary); }

/* ---------- prophet detail page ---------- */

.story-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 1.1rem auto 0;
}

.story-toggle button {
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.story-toggle button.on { background: var(--primary); color: #FFF7EC; }

.p-chapter { margin-bottom: 1.3rem; }

.p-chapter p { font-size: 1rem; }

.p-art { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; margin: 1.5rem auto; }

.p-art .art-disc {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  animation: floatY 7s ease-in-out infinite;
}

.p-art .art-disc svg { width: 46px; height: 46px; }

.p-art figcaption { color: var(--muted); font-size: 0.8rem; font-style: italic; }

.p-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }

.p-nav a { text-decoration: none; font-weight: 600; font-size: 0.92rem; color: var(--primary); }

/* ---------- seerah timeline ---------- */

.timeline { position: relative; margin: 1.2rem 0 0; padding-left: 1.6rem; }

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--gold), var(--primary));
  border-radius: 2px;
}

.tl-item { position: relative; padding: 0 0 1.5rem 0.9rem; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 7px;
  width: 12px;
  height: 12px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--gold);
  border: 2.5px solid var(--bg);
  box-shadow: 0 0 0 2px var(--gold);
}

.tl-item .year {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  margin-bottom: 0.3rem;
}

.tl-item h4 { font-size: 1.02rem; margin-bottom: 0.25rem; color: var(--ink-strong); }

.tl-item p { font-size: 0.93rem; }

/* ---------- quiz (warm terracotta block) ---------- */

.quiz {
  background: linear-gradient(135deg, #B25B34, #8F4526);
  color: #FFF3E6;
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  margin: 2rem 0 1rem;
  position: relative;
  overflow: hidden;
}

html[data-theme="dark"] .quiz { background: linear-gradient(135deg, #8F4526, #6E3319); }

.quiz h2 { font-size: 1.3rem; margin-bottom: 0.3rem; }

.quiz .quiz-sub { color: #F3D9C4; font-size: 0.9rem; margin-bottom: 1.1rem; }

.quiz-q { font-weight: 600; font-size: 1.05rem; margin-bottom: 0.9rem; }

.quiz-opts { display: grid; gap: 0.55rem; }

.quiz-opt {
  text-align: left;
  background: rgba(255, 247, 236, 0.1);
  border: 1.5px solid rgba(255, 247, 236, 0.32);
  color: #FFF3E6;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-opt:hover { border-color: var(--gold); transform: translateX(3px); }

.quiz-opt.correct { background: var(--ok); border-color: var(--ok); color: #fff; }

.quiz-opt.wrong { background: #7A2A24; border-color: #7A2A24; color: #fff; animation: shake 0.35s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0) }
  25% { transform: translateX(-5px) }
  75% { transform: translateX(5px) }
}

.quiz-opt:disabled { cursor: default; }

.quiz-foot { margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.9rem; color: #F3D9C4; }

.quiz-score { font-weight: 700; color: var(--gold); font-size: 1.05rem; }

.quiz .btn { font-size: 0.9rem; padding: 0.55rem 1.2rem; background: var(--gold); color: #2A2410; }

/* confetti */

.confetti {
  position: absolute;
  top: -12px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  pointer-events: none;
  animation: confetti-fall 1.6s ease-in forwards;
}

@keyframes confetti-fall {
  to { transform: translateY(340px) rotate(560deg); opacity: 0; }
}

/* ---------- checklist ---------- */

.checklist { display: grid; gap: 0.5rem; margin: 1rem 0; }

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.check-item:hover { border-color: var(--primary); transform: translateX(3px); }

.check-item input { margin-top: 0.28rem; width: 17px; height: 17px; accent-color: var(--primary); flex: none; }

.check-item span { font-size: 0.94rem; }

.check-item.checked span { text-decoration: line-through; color: var(--muted); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: 1.8rem 1.1rem 2.4rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.site-footer .foot-brand { font-family: var(--font-ar); font-weight: 700; color: var(--gold-deep); font-size: 1.1rem; margin-bottom: 0.4rem; }

.site-footer p { max-width: 660px; margin: 0.25rem auto; }

.foot-legal {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.foot-legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.foot-legal a:hover { color: var(--primary); }

/* ---------- misc ---------- */

.pill-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.6rem 0; }

.pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; font-size: 0.8rem; padding: 0.25rem 0.75rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 2.5rem; }
  .brand .brand-name { font-size: 1.08rem; }
  .header-controls { order: 2; margin-left: auto; }
  .site-nav { order: 3; width: 100%; }
}

.center { text-align: center; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* ---------- icon buttons (search, menu) ---------- */

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-strong);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover { transform: scale(1.08); border-color: var(--primary); color: var(--primary); }

.icon-btn svg { width: 17px; height: 17px; }

/* ---------- slide-down menu panel ---------- */

.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(320px, 88vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 44px rgba(51, 30, 16, 0.16);
  z-index: 90;
  padding: 1.2rem 1.3rem 2rem;
  overflow-y: auto;
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.menu-panel.open { transform: none; }

.menu-panel .menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.menu-panel .menu-head strong { font-size: 1.05rem; color: var(--ink-strong); }

.menu-panel nav { display: grid; gap: 0.2rem; }

.menu-panel nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  transition: background 0.12s ease, color 0.12s ease;
}

.menu-panel nav a:hover { background: var(--primary-soft); color: var(--primary); }

.menu-panel nav a .m-ar { margin-left: auto; font-family: var(--font-ar); color: var(--gold-deep); font-size: 1.05rem; }

/* section labels appear both inside the nav index and in the settings
   panel, which has no nav wrapper - so this stays scoped to the panel only */
.menu-panel .menu-section {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.7rem 0.7rem 0.25rem;
  margin-top: 0.15rem;
  border-top: 1px solid var(--line);
}
.menu-panel .menu-section:first-of-type { border-top: none; margin-top: 0; }

.menu-controls { padding: 0.15rem 0.7rem 0.5rem; }

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.45rem 0;
}

.set-row-stack { flex-direction: column; align-items: stretch; gap: 0.6rem; }

.set-row-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-strong);
}

.set-row-text small {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.set-row-stack .mode-switch { width: 100%; }
.set-row-stack .mode-switch button { flex: 1; padding: 0.46rem 0.5rem; }

.set-row select {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
}

.set-note {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

/* .btn-quiet is defined later in the file and would otherwise win on the
   colour, leaving a destructive action looking like every other button */
.btn.set-danger {
  align-self: flex-start;
  color: var(--danger);
  background: transparent;
  border: 1.5px solid var(--danger);
}

.btn.set-danger.is-armed { background: var(--danger); border-color: var(--danger); color: #FFF7EC; }

/* Transliteration is the sound line under the Arabic. Hidden by choice, not
   deleted, so it comes straight back when the setting is turned on again. */
html[data-translit="off"] .pv-tr,
html[data-translit="off"] .nm-tr { display: none; }

/* ---------- prayer floater ----------
   Bottom-right pill with the next prayer. Sits above the tab bar on mobile,
   and yields entirely to the audio bar, which owns the bottom edge when a
   recitation is playing. */
.pt-float {
  position: fixed;
  right: max(0.9rem, env(safe-area-inset-right));
  bottom: calc(0.9rem + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

body.has-audio .pt-float { display: none; }

.ptf-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-strong);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.ptf-pill svg { width: 15px; height: 15px; color: var(--gold-deep); flex: none; }

/* On phones the corner pill floats over content and reads as clutter, so it
   docks instead: a slim strip sitting on the tab bar, part of the chrome.
   Same breakpoint as the tab bar itself. */
@media (pointer: coarse), (max-width: 760px) {
  body.has-tabbar .pt-float {
    left: 0;
    right: 0;
    bottom: calc(70px + env(safe-area-inset-bottom));
    align-items: stretch;
    gap: 0;
  }

  body.has-tabbar .ptf-pill {
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--line);
    box-shadow: none;
    justify-content: center;
    padding: 0.42rem 0.9rem;
    font-size: 0.82rem;
  }

  /* the strip takes real estate, so the page has to end above it */
  body.has-tabbar.has-ptf { padding-bottom: calc(102px + env(safe-area-inset-bottom)); }

  body.has-tabbar .ptf-sheet { margin: 0 0.6rem 0.5rem; }
  body.has-tabbar .ptf-invite { margin: 0 0.6rem 0.5rem; max-width: none; }
}

.ptf-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.7rem 0.85rem 0.6rem;
  min-width: 200px;
}

.ptf-list { list-style: none; margin: 0 0 0.45rem; padding: 0; }

.ptf-list li {
  display: flex;
  justify-content: space-between;
  gap: 1.4rem;
  padding: 0.28rem 0.35rem;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--ink);
}

.ptf-list li strong { font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.ptf-list li.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.ptf-list li.on strong { color: var(--primary); }

.ptf-link {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 0.2rem 0.35rem;
}

.ptf-invite {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 0.45rem 0.5rem 0.45rem 0.95rem;
  max-width: min(320px, calc(100vw - 2rem));
}

.ptf-invite a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.ptf-x {
  flex: none;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ptf-x svg { width: 12px; height: 12px; }

/* ---------- tasbih counter ---------- */

.tsb-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.3rem; }

.tsb-chip {
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tsb-chip.on { background: var(--primary); border-color: var(--primary); color: #FFF7EC; }

.tsb-why { font-size: 0.84rem; color: var(--muted); margin: -0.5rem 0 1.2rem; }
.tsb-why a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ---------- home: the new-muslim doorway ---------- */

.nm-banner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.3rem 0 0.4rem;
  padding: 1rem 1.2rem;
  background: var(--primary-soft);
  border: 1.5px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.nm-banner:hover { transform: translateY(-2px); border-color: var(--primary); }

.nm-banner-icon { flex: none; width: 40px; height: 40px; color: var(--primary); }
.nm-banner-icon svg { width: 100%; height: 100%; }

.nm-banner-text { display: grid; gap: 0.1rem; }
.nm-banner-text strong { color: var(--ink-strong); font-size: 1.02rem; }
.nm-banner-text span { font-size: 0.87rem; color: var(--muted); }

.nm-banner-go { margin-left: auto; flex: none; font-size: 1.3rem; color: var(--primary); }

/* ---------- new-muslim track: art, path, shahada ---------- */

.nm-art { margin: 1.4rem 0 0; }
.nm-art img { width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: var(--shadow); }
.content-section .nm-art { margin: -0.2rem 0 1.1rem; }
.content-section .nm-art img { box-shadow: none; border: 1px solid var(--line); }

.nm-path { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); }

.nm-path-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.nm-path-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--primary));
  transition: width 0.35s ease;
}

.nm-path-stops { list-style: none; margin: 0.7rem 0 0; padding: 0; display: flex; }
.nm-path-stops li { flex: 1; }

.nm-path-stops a {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  text-decoration: none;
  color: var(--ink);
}

.nm-path-stops strong { font-size: 0.86rem; color: var(--ink-strong); }
.nm-path-stops small { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.nm-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  background: var(--surface);
}

.nm-dot.part { border-color: var(--gold); background: var(--gold-soft); }
.nm-dot.done { border-color: var(--ok); background: var(--ok); }

.nm-path-note { margin: 0.8rem 0 0; text-align: center; font-size: 0.86rem; font-weight: 600; color: var(--primary); min-height: 1.2rem; }

.sh-hint { font-size: 0.86rem; color: var(--muted); margin-bottom: 0.7rem; }

.sh-words { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.sh-word {
  font-family: var(--font-ar);
  font-size: calc(1.35rem * var(--ar-scale));
  line-height: 1.6;
  color: var(--ink-strong);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sh-word.seen { border-color: var(--gold); }
.sh-word.on { background: var(--primary); border-color: var(--primary); color: #FFF7EC; }

.sh-meaning {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin: 0.8rem 0 1.1rem;
  padding: 0.7rem 0.9rem;
  background: var(--gold-soft);
  border-radius: 12px;
  min-height: 2.6rem;
}

.sh-m-ar { font-family: var(--font-ar); font-size: 1.25rem; color: var(--gold-deep); }
.sh-m-en { font-size: 0.95rem; font-weight: 600; color: var(--ink-strong); }

/* zakat calculator: currency + live price row */
.zc-live { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.9rem; }
.zc-live .zc-field { display: grid; gap: 0.3rem; }
.zc-live .zc-field > span { font-size: 0.8rem; font-weight: 600; color: var(--muted); }

.tsb-stage { text-align: center; }

.tsb-pad {
  position: relative;
  width: min(240px, 62vw);
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
  margin: 0 auto;
  display: block;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tsb-pad:active { transform: scale(0.97); }

.tsb-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tsb-ring circle { fill: none; stroke-width: 7; }
.tsb-ring-track { stroke: var(--line); }
.tsb-ring-fill { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 0.2s ease; }

.tsb-mid { position: absolute; inset: 0; display: grid; place-content: center; gap: 0.1rem; }
.tsb-count { font-size: 3.2rem; font-weight: 700; line-height: 1; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.tsb-target { font-size: 0.82rem; color: var(--muted); }

.tsb-now { margin: 1.2rem auto 0; max-width: 480px; }
.tsb-ar { font-family: var(--font-ar); font-size: calc(1.7rem * var(--ar-scale)); line-height: 2; direction: rtl; color: var(--ink-strong); }
.tsb-tr { font-size: 0.98rem; font-weight: 600; color: var(--primary); margin-top: 0.2rem; }
.tsb-en { font-size: 0.88rem; color: var(--muted); margin-top: 0.15rem; }
html[data-translit="off"] .tsb-tr { display: none; }

.tsb-actions { display: flex; justify-content: center; gap: 0.6rem; margin-top: 1rem; }

.tsb-done { min-height: 1.4rem; margin-top: 0.7rem; font-weight: 600; color: var(--ok); }

.tsb-day {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--line);
}

.tsb-day div { display: grid; text-align: center; }
.tsb-day strong { font-size: 1.25rem; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.tsb-day span { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

@media (prefers-reduced-motion: reduce) {
  .tsb-pad:active { transform: none; }
  .tsb-ring-fill { transition: none; }
}


.menu-panel .menu-note {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 27, 16, 0.34);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.menu-backdrop.show { opacity: 1; pointer-events: auto; }

/* ---------- search overlay ---------- */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 9vh 1rem 2rem;
  background: rgba(42, 27, 16, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.search-overlay.open { display: flex; }

.search-box {
  width: min(640px, 100%);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(20, 10, 4, 0.35);
  overflow: hidden;
  animation: searchPop 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes searchPop {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.search-input-row svg { width: 19px; height: 19px; color: var(--primary); flex: none; }

.search-input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  color: var(--ink-strong);
}

.search-input-row input::placeholder { color: var(--muted); }

.search-results { max-height: 54vh; overflow-y: auto; padding: 0.5rem; }

.search-hint { color: var(--muted); font-size: 0.85rem; padding: 1rem 1.2rem; }

.search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
}

.search-result:hover, .search-result.sel { background: var(--primary-soft); }

.search-result .sr-type {
  flex: none;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-deep);
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
}

.search-result .sr-main { min-width: 0; }

.search-result .sr-title { font-weight: 600; color: var(--ink-strong); font-size: 0.95rem; }

.search-result .sr-sub {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- prophet tiles (index of stories) ---------- */

.prophet-grid { align-items: start; }

.prophet-tile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.prophet-tile:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 8px 16px rgba(51, 30, 16, 0.09), 0 20px 40px rgba(51, 30, 16, 0.11);
}

.prophet-tile .tile-go {
  flex: none;
  color: var(--primary);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.16s ease;
}

.prophet-tile:hover .tile-go { opacity: 1; transform: none; }

.prophet-tile .tile-go svg { width: 18px; height: 18px; display: block; }

.prophet-tile.is-done .prophet-num { background: var(--primary); color: #FFF7EC; }

/* ---------- glossary ---------- */

.term-filter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  max-width: 440px;
  margin: 0 auto 1.6rem;
}

.term-filter svg { width: 17px; height: 17px; color: var(--primary); flex: none; }

.term-filter input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 0.98rem;
  color: var(--ink-strong);
}

.term-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }

.term-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.1rem;
}

.term-card .term-top { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.2rem; }

.term-card .term-name { font-weight: 700; font-size: 1.12rem; color: var(--ink-strong); }

.term-card .term-arabic { margin-left: auto; font-family: var(--font-ar); font-size: 1.5rem; color: var(--gold-deep); direction: rtl; }

.term-card .term-lit { color: var(--muted); font-size: 0.84rem; font-style: italic; margin-bottom: 0.55rem; }

.term-card .term-means { font-size: 0.94rem; margin-bottom: 0.75rem; }

.term-card .term-use { background: var(--primary-soft); border-radius: 12px; padding: 0.6rem 0.85rem; font-size: 0.87rem; margin-bottom: 0.5rem; }

.term-card .term-use strong { color: var(--primary); }

.term-card .term-not { background: var(--gold-soft); border-radius: 12px; padding: 0.6rem 0.85rem; font-size: 0.87rem; }

.term-card .term-not strong { color: var(--gold-deep); }

.term-card ul { margin: 0.3rem 0 0 1.1rem; }

.term-card li { margin-bottom: 0.25rem; }

/* ---------- Quran reader ---------- */

.q-bismillah {
  font-family: var(--font-ar);
  font-size: 1.7rem;
  text-align: center;
  direction: rtl;
  color: var(--gold-deep);
  margin: 0.4rem 0 1.4rem;
}

.q-verse {
  padding: 1.05rem 0.2rem;
  border-bottom: 1px dashed var(--line);
}

.q-verse:last-child { border-bottom: none; }

.q-verse .q-ar {
  font-family: var(--font-ar);
  font-size: calc(1.65rem * var(--ar-scale));
  line-height: 2.3;
  direction: rtl;
  text-align: right;
  color: var(--ink-strong);
}

.q-verse .q-num {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-deep);
  margin-right: 0.5rem;
  vertical-align: middle;
  padding: 0 0.3rem;
}

.q-verse .q-en {
  margin-top: 0.55rem;
  font-size: 0.98rem;
  color: var(--ink);
}

#verses.ar-only .q-en { display: none; }

#verses.ar-only .q-verse { padding: 0.7rem 0.2rem; }

/* ---------- animated illustration scenes ---------- */

.scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 1.4rem auto;
}

.scene svg { width: min(320px, 80%); height: auto; }

.scene figcaption { color: var(--muted); font-size: 0.8rem; font-style: italic; text-align: center; }

.tawaf-orbit { transform-origin: 110px 92px; animation: tawaf-spin 22s linear infinite; }

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

.sai-runner { animation: sai-run 6s ease-in-out infinite; }

@keyframes sai-run {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(150px); }
}

.arafah-sun { animation: sun-glow 5s ease-in-out infinite; transform-origin: center; }

@keyframes sun-glow {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.pebble { opacity: 0; animation: pebble-throw 2.6s ease-in infinite; }

.pebble.p2 { animation-delay: 0.85s; }
.pebble.p3 { animation-delay: 1.7s; }

@keyframes pebble-throw {
  0% { opacity: 0; transform: translate(0, 0); }
  12% { opacity: 1; }
  55% { opacity: 1; transform: translate(74px, -34px); }
  75% { opacity: 0; transform: translate(96px, -18px); }
  100% { opacity: 0; }
}

.ripple { transform-origin: center; animation: ripple-out 3.2s ease-out infinite; }

.ripple.r2 { animation-delay: 1.1s; }
.ripple.r3 { animation-delay: 2.2s; }

@keyframes ripple-out {
  0% { transform: scale(0.35); opacity: 0.85; }
  100% { transform: scale(1.25); opacity: 0; }
}

.tent-glow { animation: sun-glow 7s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .tawaf-orbit, .sai-runner, .arafah-sun, .pebble, .ripple, .tent-glow { animation: none !important; }
  .pebble { opacity: 1; }
}

/* ---------- Quran mode chooser ---------- */

.q-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: 1.4rem; }

.q-mode {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.3rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.q-mode:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 10px 22px rgba(51,30,16,0.12); }

.q-mode .q-mode-ic { width: 50px; height: 50px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }

.q-mode .q-mode-ic svg { width: 27px; height: 27px; }

.q-mode h3 { font-size: 1.18rem; color: var(--ink-strong); }

.q-mode p { color: var(--muted); font-size: 0.9rem; flex: 1; }

.q-mode .q-mode-go { color: var(--primary); font-weight: 600; font-size: 0.9rem; }

/* saved places / bookmarks on the Quran home */

.saved-list { display: grid; gap: 0.5rem; margin-top: 0.5rem; }

.saved-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.95rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.saved-item:hover { border-color: var(--primary); }

.saved-item .si-ic { color: var(--gold-deep); flex: none; }
.saved-item .si-ic svg { width: 18px; height: 18px; display: block; }
.saved-item .si-main { flex: 1; min-width: 0; }
.saved-item .si-title { font-weight: 600; color: var(--ink-strong); font-size: 0.94rem; }
.saved-item .si-sub { color: var(--muted); font-size: 0.8rem; }
.saved-item .si-del { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0.2rem 0.4rem; border-radius: 8px; }
.saved-item .si-del:hover { color: var(--danger); background: var(--surface-2); }

/* ---------- audio player bar (sticky bottom) ---------- */

.audio-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  z-index: 70;
  width: min(680px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--deep);
  color: #F5EFE2;
  border-radius: 999px;
  padding: 0.55rem 1rem 0.55rem 0.6rem;
  box-shadow: 0 10px 34px rgba(20, 10, 4, 0.35);
}

.audio-bar .ap-play {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: #2A2410;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.audio-bar .ap-play:hover { transform: scale(1.06); }
.audio-bar .ap-play svg { width: 22px; height: 22px; }

.audio-bar .ap-mid { flex: 1; min-width: 0; }

.audio-bar .ap-label { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.8rem; margin-bottom: 0.3rem; }
.audio-bar .ap-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #F5EFE2; }
.audio-bar .ap-time { color: #C9B79A; flex: none; }

.audio-bar .ap-track { height: 6px; background: rgba(245,239,226,0.18); border-radius: 999px; cursor: pointer; overflow: hidden; }
.audio-bar .ap-fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), #E8A87C); border-radius: 999px; }

.audio-bar .ap-reciter { flex: none; font-size: 0.72rem; color: #C9B79A; letter-spacing: 0.04em; }

@media (max-width: 480px) {
  .audio-bar .ap-reciter { display: none; }
}

/* space so the fixed bar never hides the last verses / nav */
body.has-audio { padding-bottom: 84px; }

/* ---------- read-along: word highlight + settings popover ---------- */
.q-verse .q-ar .qw { cursor: pointer; border-radius: 10px; padding: 0.16em 0.14em; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: color 0.12s, background 0.12s; }
.q-verse .q-ar .qw:hover { color: var(--primary); }
.q-verse .q-ar .qw.on { color: #fff; background: var(--primary); box-shadow: 0 3px 12px rgba(178, 91, 52, 0.32); }
html[data-theme="dark"] .q-verse .q-ar .qw.on { color: #1b120a; }

.audio-bar .ap-gear { flex: none; width: 40px; height: 40px; border: none; background: rgba(245,239,226,0.1); color: #EBDCC4; border-radius: 50%; cursor: pointer; display: grid; place-items: center; transition: background 0.14s; }
.audio-bar .ap-gear:hover { background: rgba(245,239,226,0.22); }
.audio-bar .ap-gear svg { width: 20px; height: 20px; }

.ra-pop { position: fixed; z-index: 71; left: 50%; transform: translateX(-50%) translateY(8px); bottom: 74px; width: min(340px, calc(100% - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 0.4rem 1rem; opacity: 0; pointer-events: none; transition: opacity 0.16s, transform 0.16s; }
.ra-pop.open { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.ra-pop-sec { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.ra-pop-sec:last-child { border-bottom: none; }
.ra-pop-lab { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.55rem; display: flex; align-items: center; justify-content: space-between; }
.ra-toggle { flex: none; width: 44px; height: 26px; border-radius: 999px; border: none; background: var(--line); cursor: pointer; position: relative; transition: background 0.16s; }
.ra-toggle.on { background: var(--primary); }
.ra-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left 0.16s; }
.ra-toggle.on .ra-knob { left: 21px; }
.ra-reciters { display: flex; flex-direction: column; gap: 0.4rem; }
.ra-opt { text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 11px; padding: 0.5rem 0.7rem; cursor: pointer; font-family: inherit; transition: border-color 0.14s, background 0.14s; }
.ra-opt:hover { border-color: var(--gold); }
.ra-opt.sel { border-color: var(--primary); background: var(--primary-soft); }
.ra-opt-n { display: block; font-weight: 600; font-size: 0.9rem; color: var(--ink-strong); }
.ra-opt.sel .ra-opt-n { color: var(--primary); }
.ra-opt-d { display: block; font-size: 0.76rem; color: var(--muted); margin-top: 1px; }
.ra-speeds { display: flex; gap: 0.5rem; }
.ra-sp { flex: 1; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0.45rem 0; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 0.85rem; color: var(--ink); transition: border-color 0.14s, background 0.14s; }
.ra-sp.sel { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* ---------- explanation (tafsir) view ---------- */
.story-toggle { flex-wrap: wrap; }
.tafsir-top { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tafsir-src { font-size: 0.82rem; color: var(--muted); }
.tafsir-src strong { color: var(--ink-strong); font-weight: 700; }
.go-deeper { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.go-deeper button { border: none; background: none; font-family: inherit; font-weight: 600; font-size: 0.82rem; color: var(--muted); padding: 0.35rem 0.85rem; border-radius: 999px; cursor: pointer; transition: background 0.14s, color 0.14s; }
.go-deeper button.on { background: var(--primary); color: #fff; }
.tafsir-passage { margin-bottom: 1.9rem; padding-bottom: 1.5rem; border-bottom: 1px dashed var(--line); }
.tafsir-passage:last-child { border-bottom: none; }
.tafsir-range { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); padding: 0.32rem 0.7rem; border-radius: 999px; margin-bottom: 0.95rem; }
.tafsir-h { font-size: 1.05rem; color: var(--ink-strong); margin: 1.15rem 0 0.5rem; }
.tafsir-p { font-size: 1.02rem; line-height: 1.75; color: var(--ink); margin-bottom: 0.85rem; }

/* ---------- The Quran in English: book reading ---------- */
.book-wrap { max-width: 680px; margin: 0 auto; }
.book-surah { margin: 2.4rem 0 2.8rem; }
.book-surah:first-child { margin-top: 0.6rem; }
.book-title { font-size: 1.5rem; text-align: center; color: var(--ink-strong); margin-bottom: 0.25rem; }
.book-sub { text-align: center; color: var(--muted); font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 1.5rem; }
.book-bism { text-align: center; font-style: italic; color: var(--gold-deep); margin: 0 0 1.5rem; font-size: 1.05rem; }
.book-p { font-size: 1.15rem; line-height: 1.95; color: var(--ink); margin-bottom: 1.15rem; }
.book-p .vn { font-size: 0.6em; color: var(--gold-deep); font-weight: 700; vertical-align: super; margin: 0 0.16em 0 0.04em; }
.book-note { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; text-align: center; }
.book-continue { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--radius); padding: 0.85rem 1rem; margin-bottom: 1.2rem; color: var(--ink); }
.book-continue .bc-ic { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--gold); color: #2A2410; display: grid; place-items: center; }
.book-continue .bc-ic svg { width: 18px; height: 18px; }
.book-continue .bc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.book-continue .bc-t { font-weight: 700; color: var(--ink-strong); }
.book-continue .bc-s { font-size: 0.85rem; color: var(--muted); }
.book-continue .bc-go { color: var(--gold-deep); font-size: 1.2rem; flex: none; }
.book-fab { position: fixed; right: 16px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 0.5rem; background: var(--primary); color: #fff; border: none; border-radius: 999px; padding: 0.7rem 1.15rem; font-family: inherit; font-weight: 600; font-size: 0.9rem; box-shadow: 0 8px 24px rgba(178, 91, 52, 0.4); cursor: pointer; transition: transform 0.12s, background 0.15s; }
.book-fab:hover { transform: translateY(-1px); }
.book-fab:active { transform: translateY(1px); }
.book-fab svg { width: 18px; height: 18px; }
.book-fab.saved { background: var(--gold-deep); }
.book-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(10px); background: var(--ink-strong); color: #FAF3E6; padding: 0.6rem 1.05rem; border-radius: 999px; font-size: 0.85rem; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 61; box-shadow: var(--shadow); }
.book-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pin-bar { position: fixed; left: 0; right: 0; z-index: 48; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 0.5rem 1.1rem; display: flex; align-items: baseline; gap: 0.5rem; transform: translateY(-130%); transition: transform 0.22s ease; pointer-events: none; }
.pin-bar.show { transform: translateY(0); }
.pin-bar .pin-s { font-weight: 700; color: var(--ink-strong); font-size: 0.95rem; }
.pin-bar .pin-v { color: var(--muted); font-size: 0.82rem; }

/* ---------- Quran reader: bookmark + juz surah headers + playing highlight ---------- */

.q-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 0.8rem; }

.q-bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.q-bookmark-btn:hover { border-color: var(--gold-deep); color: var(--gold-deep); }
.q-bookmark-btn.saved { background: var(--gold); border-color: var(--gold); color: #2A2410; }
.q-bookmark-btn svg { width: 16px; height: 16px; }

.q-surah-head {
  text-align: center;
  margin: 1.6rem 0 0.4rem;
  padding-top: 1rem;
  border-top: 2px solid var(--gold-soft);
}
.q-surah-head:first-child { border-top: none; padding-top: 0; margin-top: 0.4rem; }
.q-surah-head .qsh-ar { font-family: var(--font-ar); font-size: 1.7rem; color: var(--gold-deep); direction: rtl; }
.q-surah-head .qsh-en { font-weight: 700; color: var(--ink-strong); }

.q-verse.playing { background: var(--gold-soft); border-radius: 12px; margin: 0 -0.4rem; padding-left: 0.6rem; padding-right: 0.6rem; }

.q-verse .q-mark {
  border: none;
  background: transparent;
  color: var(--line);
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 6px;
  vertical-align: middle;
  transition: color 0.15s ease;
}
.q-verse .q-mark:hover { color: var(--gold-deep); }
.q-verse .q-mark.on { color: var(--gold); }
.q-verse .q-mark svg { width: 16px; height: 16px; display: block; }

.q-verse .q-ar-row { display: flex; align-items: flex-start; gap: 0.4rem; justify-content: space-between; }
.q-verse .q-ar-row .q-ar { flex: 1; }

/* ---------- menu controls row ---------- */

.menu-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

/* ---------- badges ---------- */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.8rem;
}

.badge {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 0.9rem;
  text-align: center;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.badge.earned {
  opacity: 1;
  border-color: var(--gold);
  background: linear-gradient(160deg, var(--surface), var(--gold-soft));
  box-shadow: var(--shadow);
}

.badge:hover { transform: translateY(-3px); }

.badge .badge-medal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 0.4rem;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.badge.earned .badge-medal { background: var(--gold); color: #2A2410; }

.badge .badge-medal svg { width: 26px; height: 26px; }

.badge .badge-name { display: block; font-weight: 700; font-size: 0.92rem; color: var(--ink-strong); }

.badge .badge-sub { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 0.15rem; }

/* ---------- verse of the day ---------- */

.vod {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem 1.5rem 1.5rem;
  text-align: center;
  margin-top: 1.4rem;
  overflow: hidden;
}

.vod::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 200px at 85% 0%, rgba(240, 201, 138, 0.28), transparent 70%);
  pointer-events: none;
}

.vod .vod-kicker {
  color: var(--gold-deep);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.vod .vod-ar {
  font-family: var(--font-ar);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  line-height: 2;
  direction: rtl;
  color: var(--ink-strong);
  margin: 0.6rem 0 0.2rem;
}

.vod .vod-tr { font-style: italic; color: var(--muted); font-size: 0.88rem; }

.vod .vod-en { font-size: 1.02rem; margin-top: 0.5rem; }

.vod .vod-src {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--gold-deep);
  background: var(--gold-soft);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

.vod .btn { margin-top: 0.9rem; font-size: 0.88rem; padding: 0.55rem 1.2rem; }

/* ---------- start-here strip (home) ---------- */

.start-strip {
  background: linear-gradient(120deg, var(--primary-soft), var(--gold-soft));
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  margin-top: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.start-strip .ss-text { flex: 1; min-width: 220px; }

.start-strip h3 { color: var(--ink-strong); font-size: 1.08rem; margin-bottom: 0.15rem; }

.start-strip p { color: var(--ink); font-size: 0.9rem; opacity: 0.85; }

.start-strip .btn { font-size: 0.9rem; padding: 0.6rem 1.2rem; }

/* short surahs to recite after Al-Fatihah (salah module) */
.surah-picks { display: grid; gap: 0.7rem; margin: 1rem 0 0.9rem; }

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

.pick[open] { border-color: var(--gold); background: var(--surface-2); }

.pick > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.6rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
}

.pick > summary::-webkit-details-marker { display: none; }
.pick > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.pick-ar { font-family: var(--font-ar); font-size: calc(1.3rem * var(--ar-scale)); color: var(--primary); }
.pick-en { font-weight: 700; color: var(--deep); }
.pick-meta { font-size: 0.78rem; color: var(--muted); margin-inline-start: auto; }

.pick-vs { list-style: none; margin: 0; padding: 0 1rem 1rem; }

.pv {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  position: relative;
}

.pv-n {
  position: absolute;
  inset-inline-start: -0.1rem;
  top: 0.8rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-deep);
  opacity: 0.7;
}

.pv-ar {
  font-family: var(--font-ar);
  font-size: calc(1.5rem * var(--ar-scale));
  line-height: 2.1;
  direction: rtl;
  color: var(--ink-strong);
  text-align: right;
}

/* the sound line - the one a non-reader actually prays from, so it leads */
.pv-tr {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--primary);
  padding-inline-start: 1.1rem;
}

.pv-en { font-size: 0.88rem; color: var(--muted); padding-inline-start: 1.1rem; }

.picks-foot { font-size: 0.78rem; color: var(--muted); }

@media (max-width: 520px) {
  .pick-meta { margin-inline-start: 0; width: 100%; }
  .pv-ar { font-size: calc(1.32rem * var(--ar-scale)); }
}

/* "sunnah" / "required" tag on a sub-heading, and Arabic set inline in a sentence */
.tagline {
  display: inline-block;
  vertical-align: middle;
  margin-inline-start: 0.5rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  background: var(--gold-soft);
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
}

.tagline.req { color: #fff; background: var(--primary); }

.inline-ar { font-family: var(--font-ar); font-size: calc(1.15em * var(--ar-scale)); line-height: 2; }

/* required / sunnah breakdown table */
.fard-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.92rem; }
.fard-table th, .fard-table td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.fard-table th { font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.fard-table td:last-child { white-space: nowrap; font-weight: 600; }
.fard-table .is-req { color: var(--primary); }
.fard-table .is-sun { color: var(--gold-deep); }
.table-scroll { overflow-x: auto; }

/* "watch it once through" - the nine positions played in order */
.prayer-player {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  margin: 1rem 0 1.4rem;
}

.pp-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #F3DED6;
}

.pp-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.pp-img.on { opacity: 1; }

.pp-cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  padding: 0.85rem 1rem 0.2rem;
}

.pp-n {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pp-name { font-weight: 700; color: var(--deep); }
.pp-say { font-size: 0.9rem; font-weight: 600; color: var(--gold-deep); }
.pp-do { width: 100%; font-size: 0.88rem; color: var(--muted); }

.pp-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem 0.9rem;
}

.pp-btn {
  flex: none;
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--deep);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}

.pp-btn svg { width: 20px; height: 20px; }
.pp-play { background: var(--primary); border-color: var(--primary); color: #fff; }
.pp-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.pp-play .i-pause, .playing .pp-play .i-play { display: none; }
.playing .pp-play .i-pause { display: block; }

.pp-dots { display: flex; gap: 0.3rem; margin-inline-start: auto; flex-wrap: wrap; }

.pp-dot {
  width: 9px; height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
}

.pp-dot.on { background: var(--primary); transform: scale(1.25); }

@media (prefers-reduced-motion: reduce) {
  .pp-img { transition: none; }
}

/* a story whose report strength is called out on its page */
.src-flag {
  display: inline-block;
  margin-inline-start: 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-deep);
  background: var(--gold-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  vertical-align: 1px;
}

/* Stories from the Quran - illustrated index cards and story hero */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}

.story-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.story-card:hover, .story-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(51, 30, 16, 0.12);
}

.sc-img { display: block; background: #F3DED6; }

.sc-img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.sc-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem 1rem 1rem;
  position: relative;
}

.sc-num {
  position: absolute;
  top: -14px;
  inset-inline-end: 1rem;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(51, 30, 16, 0.2);
}

.sc-name {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--deep);
  padding-inline-end: 2rem;
}

.sc-ar {
  font-family: var(--font-ar);
  font-weight: 400;
  color: var(--primary);
  margin-inline-start: 0.4rem;
}

.sc-meta { font-size: 0.86rem; color: var(--muted); }

.story-card.is-done { border-color: var(--gold); }
.story-card.is-done .sc-num { background: var(--gold-deep); }

/* the wide scene at the top of a story */
.story-hero {
  margin: 1.4rem 0 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #F3DED6;
}

.story-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* reference material folded away so the walkthrough stays the main thread */
.fold {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  margin: 1.1rem 0;
  overflow: hidden;
}

.fold[open] { background: var(--surface); border-color: var(--gold); }

.fold > summary {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 2.4rem 0.9rem 1.1rem;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.fold > summary::after {
  content: "";
  position: absolute;
  inset-inline-end: 1.1rem;
  top: 1.25rem;
  width: 9px; height: 9px;
  border-inline-end: 2px solid var(--gold-deep);
  border-block-end: 2px solid var(--gold-deep);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

.fold[open] > summary::after { transform: rotate(-135deg); top: 1.5rem; }

.fold-t { font-weight: 700; font-size: 1.05rem; color: var(--deep); }
.fold-s { font-size: 0.86rem; color: var(--muted); }
.fold-in { padding: 0 1.1rem 0.4rem; }
.fold-in > *:first-child { margin-top: 0; }

/* prayer times + qibla */
.pt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pt-place { font-size: 1.25rem; font-weight: 700; color: var(--deep); }
.pt-coords { font-size: 0.78rem; color: var(--muted); }
.pt-hijri { font-size: 0.86rem; font-weight: 600; color: var(--gold-deep); background: var(--gold-soft); padding: 0.25rem 0.7rem; border-radius: 999px; }

.pt-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0 0.4rem; align-items: center; }
.pt-city { display: flex; gap: 0.4rem; flex: 1 1 260px; }

.pt-city input {
  flex: 1;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
}

.pt-city input:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.btn-quiet { background: var(--surface-2); color: var(--deep); border: 1px solid var(--line); }

.pt-status { font-size: 0.9rem; color: var(--muted); margin: 0.6rem 0 0; }
.pt-next { margin: 0.8rem 0 0; font-size: 1rem; color: var(--ink); }
.pt-next strong { color: var(--primary); }

.pt-list { list-style: none; padding: 0; margin: 1rem 0 0; }

.pt-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  align-items: baseline;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border-bottom: 1px solid var(--line);
}

.pt-row.is-next { background: var(--primary-soft); border-bottom-color: transparent; }
.pt-row.is-sunrise { opacity: 0.72; }
.pt-name { grid-column: 1; grid-row: 1; font-weight: 700; color: var(--deep); }
.pt-ar { font-family: var(--font-ar); font-weight: 400; color: var(--primary); margin-inline-start: 0.4rem; }
.pt-sub { grid-column: 1; grid-row: 2; font-size: 0.8rem; color: var(--muted); }
.pt-time { grid-column: 2; grid-row: 1 / span 2; justify-self: end; align-self: center; font-size: 1.15rem; font-weight: 700; color: var(--deep); font-variant-numeric: tabular-nums; }

.pt-settings { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.2rem 0 0.6rem; }
.pt-field { display: flex; flex-direction: column; gap: 0.3rem; flex: 1 1 240px; }
.pt-field > span { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }

.pt-field select {
  font: inherit;
  font-size: 0.92rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  max-width: 100%;
}

.madhab-switch { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; align-self: flex-start; }
.madhab-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.86rem; font-weight: 600; padding: 0.34rem 1rem; border-radius: 999px; cursor: pointer; }
.madhab-switch button.on { background: var(--primary); color: #fff; }

/* the dial */
.qibla-box { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; justify-content: center; margin: 1rem 0; }

.q-dial {
  position: relative;
  flex: none;
  width: 190px; height: 190px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface-2);
  color: var(--primary);
}

.q-mark { position: absolute; font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.q-n { top: 6px; left: 50%; transform: translateX(-50%); color: var(--gold-deep); }
.q-s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.q-e { right: 8px; top: 50%; transform: translateY(-50%); }
.q-w { left: 8px; top: 50%; transform: translateY(-50%); }

.q-needle {
  position: absolute;
  inset: 30px;
  display: block;
  transform-origin: 50% 50%;
  transition: transform 0.6s cubic-bezier(0.4, 0.16, 0.2, 1);
}

.q-needle svg { width: 100%; height: 100%; display: block; }

/* the Kaaba sits on the pointing end of the needle. It rides both rotations,
   so prayer-times.js spins it back to keep it upright at every bearing. */
.q-kaaba {
  position: absolute;
  top: 0;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  transition: transform 0.6s cubic-bezier(0.4, 0.16, 0.2, 1);
}

.q-kaaba svg { width: 100%; height: 100%; display: block; }
.kb-body { fill: var(--deep); }
.kb-band, .kb-door { fill: var(--gold); }

@media (prefers-reduced-motion: reduce) { .q-kaaba { transition: none; } }

/* ---------- facing the qibla ----------
   Only ever shown with the live compass on, because without a magnetometer
   there is no way to know which way the person is actually pointing. */
.q-dial.is-aligned {
  border-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, var(--surface-2));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent);
}

/* the ring, needle and hub carry the green. The Kaaba keeps its own colours
   so it stays readable as a Kaaba rather than a green smudge. */
.q-dial.is-aligned .q-needle { color: var(--ok); }
.q-dial.is-aligned .q-hub { background: var(--ok); }

.q-aligned {
  display: none;
  margin: 0 0 0.6rem;
  font-weight: 700;
  color: var(--ok);
}

.q-aligned.show { display: block; }
.q-hub { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--gold); }

.q-read { flex: 1 1 220px; }
.q-deg { font-size: 2.1rem; font-weight: 700; color: var(--deep); line-height: 1.1; font-variant-numeric: tabular-nums; }
.q-word { color: var(--primary); font-weight: 600; margin-bottom: 0.6rem; }
.q-help { font-size: 0.86rem; color: var(--muted); margin: 0.4rem 0 0; }

@media (prefers-reduced-motion: reduce) { .q-needle { transition: none; } }

/* the dial turns with the device when a magnetometer is present */
.q-dial { transition: transform 0.35s cubic-bezier(0.4, 0.16, 0.2, 1); }
#qLiveBtn { margin: 0.5rem 0 0.2rem; font-size: 0.88rem; padding: 0.45rem 1rem; }
#qLive { font-size: 0.84rem; }
@media (prefers-reduced-motion: reduce) { .q-dial { transition: none; } }

/* the journey is grouped: foundations, how to practise, living it */
.group-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 2.2rem 0 0.9rem;
  font-size: 1.15rem;
  color: var(--deep);
}

.group-head:first-of-type { margin-top: 1.2rem; }

.group-n {
  flex: none;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-deep);
  font-size: 0.76rem;
  font-weight: 700;
}

.group-sub {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--muted);
}

/* tools and reference: deliberately NOT module cards - no number, no progress,
   so nothing looks like a step you have failed to finish */
.tool-card {
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.2rem 1.1rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

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

.tool-card .icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--gold-soft);
  color: var(--gold-deep);
  display: grid;
  place-items: center;
}

.tool-card h3 { margin: 0; font-size: 1.05rem; color: var(--deep); }
.tool-card p { margin: 0; font-size: 0.92rem; color: var(--muted); }

/* Test Yourself quiz page */
.qz-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  margin-top: 1.1rem;
}

.qz-mode {
  font: inherit;
  text-align: left;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.qz-mode:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(51, 30, 16, 0.1);
}

.qz-mode-name { font-weight: 700; font-size: 1.05rem; color: var(--deep); }
.qz-mode-sub { font-size: 0.86rem; color: var(--primary); font-weight: 600; }
.qz-mode-best { font-size: 0.78rem; color: var(--muted); }

.qz-opts { display: grid; gap: 0.6rem; margin-top: 1rem; }

.qz-opt {
  font: inherit;
  text-align: left;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.qz-opt:hover:not(:disabled) { border-color: var(--primary); }
.qz-opt:disabled { cursor: default; }

.qz-opt.correct {
  border-color: var(--gold-deep);
  background: rgba(198, 161, 75, 0.16);
  font-weight: 600;
}

.qz-opt.wrong {
  border-color: var(--primary);
  background: rgba(178, 91, 52, 0.12);
  text-decoration: line-through;
}

.qz-why {
  margin-top: 1rem;
  padding: 0.75rem 0.95rem;
  font-size: 0.92rem;
  border-left: 3px solid var(--gold);
  background: var(--surface-2);
  border-radius: 0 12px 12px 0;
}

.qz-src { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }

.qz-score { font-size: 3rem; font-weight: 700; color: var(--primary); line-height: 1.1; }

.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  .qz-mode { transition: none; }
  .qz-mode:hover { transform: none; }
}

/* Islamic Calendar page */
.cal-today {
  position: relative;
  text-align: center;
  padding: 1.6rem 1.2rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 22px 22px 18px 18px;
  background: var(--surface-2);
  overflow: hidden;
}

.cal-today::before {
  content: "";
  position: absolute;
  inset: 10px 10px auto;
  height: 130px;
  border: 1.5px solid rgba(198, 161, 75, 0.35);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  pointer-events: none;
}

.cal-moon { width: 34px; height: 34px; color: var(--gold); margin-bottom: 0.2rem; }
.cal-today-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--gold-deep); }
.cal-today-h { font-size: 1.45rem; font-weight: 700; color: var(--deep); margin: 0.15rem 0; }
.cal-today-ar { font-family: var(--font-ar); font-size: 1.35rem; color: var(--primary); margin: 0.1rem 0 0.3rem; }
.cal-today-g { font-size: 0.9rem; color: var(--muted); }

.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.cal-month-sub { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.cal-wd { text-align: center; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.cal-wd.fri { color: var(--gold-deep); }

.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
}

.cal-day .hd { font-weight: 700; color: var(--deep); line-height: 1; }
.cal-day .gd { font-size: 0.62rem; color: var(--muted); line-height: 1; }
.cal-day.fri { background: rgba(198, 161, 75, 0.08); }
.cal-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.cal-day.today .hd { color: var(--primary); }

.cal-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.75rem 0.2rem;
  border-bottom: 1px solid var(--line);
}

.cal-event:last-child { border-bottom: 0; }
.cal-event-main { display: flex; flex-direction: column; gap: 0.12rem; }
.cal-event-main strong { color: var(--deep); }
.cal-event-main span { font-size: 0.82rem; color: var(--muted); }
.cal-event-when { text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; gap: 0.12rem; }
.cal-event-when span { font-weight: 600; color: var(--primary); font-size: 0.9rem; }
.cal-event-when em { font-style: normal; font-size: 0.78rem; color: var(--muted); }

.cal-months {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
  margin-top: 1.1rem;
}

.cal-month-tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.6rem;
}

.cal-month-tile.sacred { background: rgba(198, 161, 75, 0.07); }
.cal-month-tile.now { border-color: var(--primary); }
.cm-num { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.cm-names { display: flex; align-items: baseline; gap: 0.5rem; }
.cm-names strong { color: var(--deep); }
.cm-names [lang="ar"] { font-family: var(--font-ar); color: var(--primary); }
.cm-note { flex-basis: 100%; font-size: 0.8rem; color: var(--muted); }
.cm-tag {
  position: absolute;
  top: 0.65rem; right: 0.75rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.cm-tag.now { color: var(--primary); }

/* grouped nav: desktop dropdowns */
.nav-dd { position: relative; display: inline-block; }

.nav-dd > button {
  font: inherit;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.nav-dd > button:hover { background: var(--primary-soft); color: var(--primary); }
.nav-dd > button.here { background: var(--gold); color: #2A2410; font-weight: 600; }
.dd-caret { width: 13px; height: 13px; transition: transform 0.18s ease; }
.nav-dd.open .dd-caret { transform: rotate(180deg); }

.nav-dd-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(51, 30, 16, 0.14);
  padding: 0.45rem;
  display: none;
  z-index: 60;
}

.nav-dd.open .nav-dd-panel { display: block; }

.nav-dd-panel a {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: 9px;
  font-size: 0.9rem;
  color: var(--ink);
}

.nav-dd-panel a:hover { background: var(--primary-soft); color: var(--primary); }
.nav-dd-panel a.active { background: var(--gold); color: #2A2410; font-weight: 600; }

/* mobile tab bar - the app feel */
.tab-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: none;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 0.3rem 0.4rem calc(0.3rem + env(safe-area-inset-bottom));
}

/* ---------- safe areas ----------
   The pages set viewport-fit=cover so the layout reaches the physical edges
   of the screen. That is what makes env(safe-area-inset-*) resolve at all,
   and it also means the notch, the home indicator and the rounded corners
   can now sit on top of content. Every full-width container has to hold its
   own margin back. max() keeps the existing padding wherever the inset is
   zero, which is every device without a cutout. */
.header-inner,
.wrap,
.site-footer,
.hero-inner,
.page-hero {
  padding-left: max(1.1rem, env(safe-area-inset-left));
  padding-right: max(1.1rem, env(safe-area-inset-right));
}

.tab-bar {
  padding-left: max(0.4rem, env(safe-area-inset-left));
  padding-right: max(0.4rem, env(safe-area-inset-right));
}

.tab-item {
  flex: 1;
  position: relative;
  text-align: center;
}

.tab-item > button {
  font: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
  padding: 0;
}

.tab-item svg { width: 22px; height: 22px; display: block; margin: 0.15rem auto 0; color: var(--muted); }
.tab-item span { display: block; font-size: 0.62rem; font-weight: 600; color: var(--muted); padding-bottom: 0.15rem; }
.tab-item.now svg, .tab-item.now span, .tab-item.open svg, .tab-item.open span { color: var(--primary); }

.tab-sheet {
  position: fixed;
  left: 0.6rem; right: 0.6rem;
  bottom: calc(64px + env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 -10px 34px rgba(51, 30, 16, 0.16);
  padding: 0.6rem;
  display: none;
  text-align: left;
  max-height: 60vh;
  overflow-y: auto;
}

.tab-item.open .tab-sheet { display: block; }

.tab-sheet-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding: 0.3rem 0.7rem 0.4rem;
}

.tab-sheet a {
  display: block;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--ink);
}

.tab-sheet a:hover { background: var(--primary-soft); color: var(--primary); }

/* audio player pages keep their own bottom bar */
body.has-audio .tab-bar { display: none !important; }
body.has-audio.has-tabbar { padding-bottom: 0; }

@media (max-width: 700px) {
  .site-nav { display: none !important; }
  .tab-bar { display: flex; }
  body.has-tabbar { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
}

.nav-dd-panel a, .tab-sheet a { text-decoration: none; }

/* Zakat Calculator */
.zc-basis { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 0.9rem; }

.zc-basis-btn {
  font: inherit;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.zc-basis-btn strong { color: var(--deep); }
.zc-basis-btn span { font-size: 0.8rem; color: var(--muted); }
.zc-basis-btn.on { border-color: var(--primary); background: rgba(178, 91, 52, 0.06); }
.zc-basis-btn.on strong { color: var(--primary); }

.zc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 0.6rem; }

.zc-field { display: flex; flex-direction: column; gap: 0.3rem; }
.zc-field span { font-size: 0.82rem; color: var(--muted); }

.zc-field input {
  font: inherit;
  font-size: 1.05rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--deep);
  width: 100%;
}

.zc-field input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }

.zc-hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.6rem; }
.zc-hint a { color: var(--primary); }

.zc-nisab {
  margin-top: 0.9rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 12px 12px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.zc-nisab.ready { border-left-color: var(--gold); color: var(--ink); }
.zc-nisab span { color: var(--muted); font-size: 0.82rem; }

.zc-result {
  text-align: center;
  padding: 1.5rem 1.2rem;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.zc-result-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.zc-result strong { font-size: 2.6rem; line-height: 1.1; color: var(--deep); }
.zc-result.due strong { color: var(--primary); }
.zc-result > span:last-child { font-size: 0.86rem; color: var(--muted); max-width: 46ch; margin: 0 auto; }

@media (max-width: 640px) {
  .zc-basis, .zc-grid { grid-template-columns: 1fr; }
}

/* nav item icons */
.nav-dd-panel a, .tab-sheet a { display: flex; align-items: center; gap: 0.6rem; }
.nav-dd-panel a svg, .tab-sheet a svg { width: 19px; height: 19px; flex: 0 0 auto; }
.tab-sheet a svg { width: 21px; height: 21px; }

/* 99 Names */
.nm-tools { display: flex; align-items: center; gap: 0.8rem; margin-top: 1rem; }

.nm-tools input {
  flex: 1;
  font: inherit;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--deep);
}

.nm-tools input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.nm-count { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }

.nm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0;
}

.nm-card {
  position: relative;
  text-align: center;
  padding: 1.1rem 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.nm-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(51, 30, 16, 0.09); }
.nm-num { position: absolute; top: 0.5rem; left: 0.7rem; font-size: 0.66rem; font-weight: 700; color: var(--muted); }
.nm-ar { font-family: var(--font-ar); font-size: calc(1.75rem * var(--ar-scale)); line-height: 1.4; color: var(--primary); }
.nm-tr { font-weight: 700; font-size: 0.92rem; color: var(--deep); }
.nm-en { font-size: 0.78rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .nm-card { transition: none; }
  .nm-card:hover { transform: none; }
}

/* phone polish: hero CTA spacing, decor behind content, sheet alignment */
.hero-inner .btn { margin: 0.4rem 0.25rem 0; }

.hero .float-arch, .hero .float-orb,
.hero::before, .hero::after,
.page-hero::before, .page-hero::after { z-index: 0; pointer-events: none; }
.hero-inner { position: relative; z-index: 2; }
.page-hero > * { position: relative; z-index: 2; }

/* the tab BAR icon/label rules must not leak into the slide-up sheets */
.tab-sheet a svg { margin: 0; width: 21px; height: 21px; }
.tab-sheet a span {
  display: inline;
  font-size: 0.95rem;
  font-weight: 500;
  color: inherit;
  padding: 0;
}

/* quick-jump chips on the times page */
.pt-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }

.pt-chips a {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.38rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  text-decoration: none;
}

.pt-chips a:hover { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- touch targets ----------
   Everything tappable was 28-35px tall, under the 44px both Apple and Google
   ask for. On a phone that is the difference between hitting a control and
   hitting the thing next to it. Desktop keeps its tighter sizing. */
@media (pointer: coarse), (max-width: 760px) {
  .icon-btn { width: 44px; height: 44px; }

  .mode-switch button { min-height: 40px; }

  .btn, .done-chip, .pt-city input, .pt-city .btn, .pt-field select {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .figure-switch button,
  .madhab-switch button,
  .mode-switch button,
  .theme-switch button,
  .story-toggle button,
  .quran-view button { min-height: 40px; padding-inline: 1.1rem; }

  .figure-switch, .madhab-switch, .mode-switch, .theme-switch { padding: 0.3rem; }

  .quiz-opt { min-height: 48px; }

  .fold > summary, .pick > summary { min-height: 52px; }

  /* the flip cards are the main way people move through wudu and salah */
  .ps-flip { min-height: 44px; }

  .pp-dot, .q-dial { touch-action: manipulation; }

  /* stop iOS zooming the page when a field is focused */
  input, select, textarea { font-size: 16px; }
}

/* ---------- animated scenes, second set ----------
   Same idea as the Hajj scenes, but drawn with currentColor and CSS variables
   so they survive dark mode, and every animation stops for anyone who has
   asked their device to reduce motion. */
.scene svg text { font-family: Outfit, sans-serif; }

.sc-ink   { stroke: var(--deep); }
.sc-gold  { stroke: var(--gold); }
.sc-clay  { stroke: var(--primary); }
.f-gold   { fill: var(--gold); }
.f-clay   { fill: var(--primary); }
.f-ink    { fill: var(--deep); }
.f-muted  { fill: var(--muted); }

/* a light that swells - revelation, Laylatul Qadr */
.glow-pulse { animation: glowPulse 3.4s ease-in-out infinite; transform-origin: center; }
@keyframes glowPulse { 0%,100% { opacity: 0.25; transform: scale(0.9); } 50% { opacity: 0.85; transform: scale(1.12); } }

/* something travelling along a path - the Hijrah, the fasting day */
.travel { animation: travel 9s ease-in-out infinite; }
@keyframes travel { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } }

.sun-arc { animation: sunArc 8s ease-in-out infinite; }
@keyframes sunArc {
  0%   { transform: translate(0, 34px); opacity: 0; }
  12%  { opacity: 1; }
  50%  { transform: translate(84px, -16px); opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translate(168px, 34px); opacity: 0; }
}

/* scales tipping and settling - zakat, the weight of character */
.tip-l { animation: tipL 5s ease-in-out infinite; transform-origin: 110px 40px; }
@keyframes tipL { 0%,100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }

/* coins or drops falling one after another */
.fall { animation: fallDown 2.6s ease-in infinite; opacity: 0; }
.fall.d2 { animation-delay: 0.65s; }
.fall.d3 { animation-delay: 1.3s; }
.fall.d4 { animation-delay: 1.95s; }
@keyframes fallDown {
  0%   { transform: translateY(-16px); opacity: 0; }
  20%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { transform: translateY(46px); opacity: 0; }
}

/* something growing from nothing - sadaqah multiplying */
.grow { animation: growUp 5s ease-out infinite; transform-origin: bottom center; }
@keyframes growUp { 0% { transform: scaleY(0.15); opacity: 0.2; } 60%,100% { transform: scaleY(1); opacity: 1; } }

/* a steady heartbeat - character, the heart */
.beat { animation: beat 2.4s ease-in-out infinite; transform-origin: center; }
@keyframes beat { 0%,100% { transform: scale(1); } 14% { transform: scale(1.1); } 28% { transform: scale(1); } 42% { transform: scale(1.07); } }

/* words leaving the mouth and spreading - the tongue */
.ripple-w { animation: rippleW 3.2s ease-out infinite; opacity: 0; transform-origin: 46px 62px; }
.ripple-w.w2 { animation-delay: 1.05s; }
.ripple-w.w3 { animation-delay: 2.1s; }
@keyframes rippleW { 0% { transform: scale(0.3); opacity: 0.9; } 100% { transform: scale(1.8); opacity: 0; } }

/* a flame dying down - anger cooled */
.flicker { animation: flicker 2.8s ease-in-out infinite; transform-origin: bottom center; }
@keyframes flicker { 0%,100% { transform: scaleY(1) scaleX(1); opacity: 0.95; } 45% { transform: scaleY(0.55) scaleX(0.88); opacity: 0.5; } }

/* two halves drawing together - marriage */
.join-l { animation: joinL 5.5s ease-in-out infinite; }
.join-r { animation: joinR 5.5s ease-in-out infinite; }
@keyframes joinL { 0%,100% { transform: translateX(-13px); } 50% { transform: translateX(0); } }
@keyframes joinR { 0%,100% { transform: translateX(13px); } 50% { transform: translateX(0); } }

/* a slow orbit for stars and small marks */
.twinkle { animation: twinkle 3s ease-in-out infinite; }
.twinkle.t2 { animation-delay: 0.9s; }
.twinkle.t3 { animation-delay: 1.8s; }
@keyframes twinkle { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .glow-pulse, .travel, .sun-arc, .tip-l, .fall, .grow, .beat,
  .ripple-w, .flicker, .join-l, .join-r, .twinkle { animation: none; }
  .fall, .ripple-w { opacity: 1; }
}

/* one wide scene per era of the Seerah */
.era-shot {
  margin: 1rem 0 1.2rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #F3DED6;
}

.era-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.era-shot figcaption {
  padding: 0.6rem 0.9rem 0.7rem;
  font-size: 0.84rem;
  font-style: italic;
  color: var(--muted);
  background: var(--surface-2);
}

/* ---- English translation read-aloud (quran-book-tts.js) ---- */
.tts-bar { border-radius: 22px; }
.tts-row { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.15rem; flex-wrap: nowrap; }
.tts-step {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(245, 239, 226, 0.35); background: transparent;
  color: #F5EFE2; font-size: 1rem; line-height: 1; cursor: pointer;
}
.tts-step:hover { background: rgba(245, 239, 226, 0.14); }
.tts-sel {
  min-width: 0; max-width: 46%; flex: 1 1 auto;
  background: rgba(245, 239, 226, 0.12); color: #F5EFE2;
  border: 1px solid rgba(245, 239, 226, 0.3); border-radius: 999px;
  padding: 0.25rem 0.6rem; font-size: 0.78rem; font-family: inherit;
}
.tts-sel.tts-rate { flex: 0 0 auto; max-width: none; }
.tts-sel option { color: #2A1B10; background: #FBF4E8; }
.book-p.tts-now {
  background: var(--gold-soft);
  box-shadow: 0 0 0 9px var(--gold-soft);
  border-radius: 8px;
}
@media (max-width: 520px) {
  .tts-sel.tts-voice { max-width: 38vw; }
}
body.has-tts { padding-bottom: 116px; }
body.has-tts .book-fab { bottom: 104px; }
body.has-tts .book-toast { bottom: 158px; }

/* ---- Today page (today.html) ---- */
.td-hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
.td-hero p { margin-top: 0.35rem; }
.td-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.6rem 0 1rem; }
.td-head h2 { margin: 0; font-size: 1.25rem; color: var(--ink-strong); }
.td-cust { position: relative; }
.tdc-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 55;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 0.6rem 0.8rem; min-width: 220px;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.tdc-pop[hidden] { display: none; }
.tdc-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--ink); cursor: pointer; }
.tdc-row input { accent-color: var(--primary); width: 16px; height: 16px; }
.td-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(305px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.td-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 1.15rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: 0.55rem;
  min-width: 0;
}
.td-card .td-title { margin: 0; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.td-card h3 { margin: 0.1rem 0 0.2rem; font-size: 1.2rem; color: var(--ink-strong); }
.td-card .btn { align-self: flex-start; margin-top: 0.35rem; }
.td-kick { margin: 0; font-size: 0.8rem; font-weight: 600; color: var(--primary); letter-spacing: 0.04em; }
.td-sub { margin: 0.15rem 0 0; font-size: 0.88rem; color: var(--muted); }
.td-more { font-size: 0.85rem; color: var(--primary); text-decoration: none; margin-top: 0.5rem; display: inline-block; }
.td-more:hover { text-decoration: underline; }
.td-empty p { margin: 0 0 0.6rem; font-size: 0.92rem; color: var(--muted); }
.td-next { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.td-next-name { font-size: 1.35rem; font-weight: 700; color: var(--ink-strong); }
.td-next-in { font-size: 0.95rem; color: var(--primary); font-weight: 600; white-space: nowrap; }
.td-times { list-style: none; margin: 0.3rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.28rem; }
.td-times li { display: flex; justify-content: space-between; font-size: 0.92rem; color: var(--ink); padding: 0.28rem 0.55rem; border-radius: 9px; }
.td-times li.on { background: var(--gold-soft); font-weight: 600; color: var(--ink-strong); }
.td-times li strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.td-foot { display: flex; justify-content: space-between; gap: 0.6rem; margin: 0.55rem 0 0; font-size: 0.82rem; color: var(--muted); }
.td-foot a { color: var(--primary); text-decoration: none; }
.td-stats { display: flex; gap: 0.6rem; }
.td-stat { flex: 1; text-align: center; background: var(--surface-2); border-radius: 12px; padding: 0.6rem 0.3rem; }
.td-stat strong { display: block; font-size: 1.25rem; color: var(--ink-strong); }
.td-stat span { font-size: 0.74rem; color: var(--muted); }
.td-q { margin: 0; font-weight: 600; color: var(--ink-strong); font-size: 0.98rem; }
.td-opts { display: flex; flex-direction: column; gap: 0.4rem; }
.td-opt {
  text-align: left; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 0.55rem 0.75rem; font-family: inherit; font-size: 0.9rem;
  color: var(--ink); cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.td-opt:hover { border-color: var(--primary); }
.td-opt.correct { border-color: #4C8A57; background: rgba(96, 158, 107, 0.14); font-weight: 600; }
.td-opt.wrong { border-color: #B0553C; background: rgba(178, 91, 52, 0.12); }
.td-why p { margin: 0.2rem 0 0.2rem; font-size: 0.88rem; color: var(--ink); }
.td-dates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.td-dates li { display: flex; justify-content: space-between; gap: 0.7rem; align-items: baseline; }
.td-dates strong { display: block; font-size: 0.95rem; color: var(--ink-strong); }
.td-dates span { font-size: 0.8rem; color: var(--muted); }
.td-dates em { font-style: normal; font-size: 0.82rem; color: var(--primary); font-weight: 600; white-space: nowrap; }
.td-card-tools .td-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.td-tool {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  background: var(--surface-2); border-radius: 13px; padding: 0.7rem 0.4rem;
  text-decoration: none; color: var(--ink); font-size: 0.78rem; text-align: center;
  transition: transform 0.12s, background 0.12s;
}
.td-tool:hover { transform: translateY(-2px); background: var(--gold-soft); }
.td-tool svg { width: 26px; height: 26px; }
.td-skel { display: flex; flex-direction: column; gap: 0.5rem; }
.td-skel span { height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: td-shimmer 1.3s infinite linear; }
.td-skel span:first-child { height: 28px; width: 60%; }
@keyframes td-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .td-skel span { animation: none; } }

/* ---- grouped search results ---- */
.sr-head { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0.55rem 0.9rem 0.15rem; }

/* ---- Duas & Dhikr (duas.html) ---- */
.dua-toolbar { display: flex; gap: 0.6rem; margin: 1.4rem 0 0.9rem; align-items: stretch; }
.dua-search { flex: 1; display: flex; align-items: center; gap: 0.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.55rem 1rem; }
.dua-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.dua-search input { border: none; background: none; outline: none; width: 100%; font-family: inherit; font-size: 0.95rem; color: var(--ink); }
.dua-saved-toggle { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.55rem 1rem; font-family: inherit; font-size: 0.9rem; color: var(--ink); cursor: pointer; }
.dua-saved-toggle svg { width: 16px; height: 16px; }
.dua-saved-toggle.on { background: var(--gold-soft); border-color: var(--gold); color: var(--ink-strong); font-weight: 600; }
.dua-cats { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 1rem; scrollbar-width: thin; }
.dua-cats button { flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.85rem; font-family: inherit; font-size: 0.85rem; color: var(--ink); cursor: pointer; }
.dua-cats button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.dua-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.dua-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.15rem 1.25rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.dua-card h2 { margin: 0; font-size: 1.12rem; color: var(--ink-strong); }
.dua-top { display: flex; align-items: center; gap: 0.5rem; }
.dua-cat { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 0.22rem 0.6rem; }
.dua-count { font-size: 0.78rem; font-weight: 700; color: var(--gold-deep); background: var(--gold-soft); border-radius: 999px; padding: 0.22rem 0.55rem; }
.dua-save { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; padding: 0.3rem; border-radius: 8px; }
.dua-save svg { width: 20px; height: 20px; display: block; }
.dua-save.on { color: var(--gold-deep); }
.dua-save:hover { color: var(--primary); }
.dua-ar { font-family: var(--font-ar); font-size: calc(1.45rem * var(--ar-scale)); line-height: 2.05; color: var(--ink-strong); margin: 0.2rem 0; }
.dua-tr { font-size: 0.9rem; font-style: italic; color: var(--muted); margin: 0; }
html[data-translit="off"] .dua-tr { display: none; }
.dua-en { font-size: 0.95rem; color: var(--ink); margin: 0; }
.dua-note { font-size: 0.86rem; color: var(--muted); margin: 0; background: var(--surface-2); border-radius: 11px; padding: 0.55rem 0.75rem; }
.dua-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; margin-top: 0.2rem; flex-wrap: wrap; }

/* ---- Salah practice mode (practice.html) ---- */
.pr-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; margin: 1.3rem 0; }
.pr-pick button { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0.95rem 0.6rem; font-family: inherit; cursor: pointer; text-align: center; color: var(--ink-strong); transition: transform 0.12s, border-color 0.12s; }
.pr-pick button:hover { transform: translateY(-2px); border-color: var(--primary); }
.pr-pick strong { display: block; font-size: 1.05rem; }
.pr-pick span { font-size: 0.8rem; color: var(--muted); }
.pr-stage { max-width: 660px; margin: 0 auto; }
.pr-head { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; margin-bottom: 0.8rem; }
.pr-rakat { font-size: 0.85rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 0.3rem 0.8rem; }
.pr-quit { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.pr-quit:hover { color: var(--primary); }
.pr-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.3rem 1.4rem 1.5rem; text-align: center; }
.pr-card img { width: min(300px, 70vw); height: auto; border-radius: 16px; margin: 0.4rem auto; display: block; }
.pr-card h2 { margin: 0.2rem 0 0.1rem; font-size: 1.3rem; color: var(--ink-strong); }
.pr-say { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0.8rem 0 0.2rem; }
.pr-ar { font-family: var(--font-ar); font-size: calc(1.4rem * var(--ar-scale)); line-height: 2; color: var(--ink-strong); margin: 0.2rem 0; direction: rtl; }
.pr-tr { font-size: 0.9rem; font-style: italic; color: var(--muted); margin: 0.2rem 0; }
html[data-translit="off"] .pr-tr { display: none; }
.pr-en { font-size: 0.93rem; color: var(--ink); margin: 0.2rem 0; }
.pr-hint { font-size: 0.85rem; color: var(--muted); background: var(--surface-2); border-radius: 11px; padding: 0.55rem 0.8rem; margin-top: 0.7rem; text-align: left; }
.pr-nav { display: flex; gap: 0.6rem; justify-content: center; margin-top: 1.1rem; }
.pr-progress { height: 5px; background: var(--surface-2); border-radius: 99px; margin: 1rem 0 0; overflow: hidden; }
.pr-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--primary)); border-radius: 99px; transition: width 0.25s; }
.pr-fig-switch { margin: 0.4rem auto 0; }

/* ---- Quran verse notes (quran-notes.js) ---- */
.q-note-btn { flex: none; background: none; border: none; color: var(--muted); cursor: pointer; padding: 0.3rem; border-radius: 8px; opacity: 0.55; }
.q-note-btn svg { width: 17px; height: 17px; display: block; }
.q-note-btn:hover { opacity: 1; color: var(--primary); }
.q-note-btn.has { opacity: 1; color: var(--gold-deep); }
.q-note-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 0.75rem 0.9rem; margin: 0.5rem 0 0.8rem; }
.q-note-label { font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 700; color: var(--gold-deep); margin-bottom: 0.45rem; }
.q-note-label span { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.q-note-box textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.7rem; font-family: inherit; font-size: 0.92rem; color: var(--ink); background: var(--surface); resize: vertical; }
.q-note-actions { display: flex; gap: 0.5rem; margin-top: 0.55rem; }
.q-note-actions .btn { padding: 0.4rem 1rem; font-size: 0.85rem; }

/* ---- Memorize (memorize.html) ---- */
.mz-modes { display: flex; gap: 0.4rem; margin: 1.2rem 0 1rem; }
.mz-modes button { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.5rem 0.6rem; font-family: inherit; font-size: 0.9rem; color: var(--ink); cursor: pointer; }
.mz-modes button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.mz-verse { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.15rem; margin-bottom: 0.8rem; }
.mz-verse.done { border-color: var(--gold); }
.mz-ar-wrap { position: relative; cursor: pointer; }
.mz-ar { font-family: var(--font-ar); font-size: calc(1.6rem * var(--ar-scale)); line-height: 2.15; color: var(--ink-strong); margin: 0; direction: rtl; transition: filter 0.15s, opacity 0.15s; }
.mz-veil { display: none; }
.mz-blur:not(.revealed) .mz-ar { filter: blur(7px); }
.mz-hide:not(.revealed) .mz-ar { opacity: 0; }
.mz-hide:not(.revealed) .mz-veil, .mz-blur:not(.revealed) .mz-veil { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.mz-blur:not(.revealed) .mz-veil { color: transparent; }
.mz-row { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.6rem; flex-wrap: wrap; }
.mz-n { font-size: 0.8rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 0.2rem 0.6rem; }
.mz-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 0.5rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-family: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.mz-btn svg { width: 15px; height: 15px; }
.mz-btn:hover { border-color: var(--primary); color: var(--primary); }
.mz-btn.playing { background: var(--primary); border-color: var(--primary); color: #fff; }
.mz-mem { margin-left: auto; display: inline-flex; align-items: center; gap: 0.35rem; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.8rem; font-family: inherit; font-size: 0.82rem; color: var(--muted); cursor: pointer; }
.mz-mem svg { width: 15px; height: 15px; }
.mz-mem.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-deep); font-weight: 700; }

/* ---- Learning paths (paths.html) ---- */
.pth-current { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 16px; padding: 1rem 1.2rem; margin-top: 1.4rem; }
.pth-current strong { display: block; color: var(--ink-strong); }
.pth-cur-main { display: flex; flex-direction: column; gap: 0.5rem; }
.pth-cur-mins { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pth-min-label { font-size: 0.82rem; color: var(--muted); }
.pth-cur-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pth-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.8rem; }
.pth-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; font-family: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 0.3rem; transition: transform 0.12s, border-color 0.12s; }
.pth-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.pth-card.on { border-color: var(--primary); background: var(--primary-soft); }
.pth-card strong { font-size: 1.05rem; color: var(--ink-strong); }
.pth-card span { font-size: 0.87rem; color: var(--muted); }
.pth-card em { font-style: normal; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--primary); }
.pth-go { margin-top: 0.25rem; font-size: 0.86rem; font-weight: 700; color: var(--primary); }
.pth-go::after { content: " \2192"; }
.pth-mins { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }
.pth-mins button { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.8rem; font-family: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink-strong); cursor: pointer; }
.pth-mins button.on, .pth-mins button:hover { border-color: var(--primary); background: var(--primary-soft); }

/* today plan card */
.td-plan { list-style: none; margin: 0.2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.td-plan a { display: flex; align-items: baseline; justify-content: space-between; gap: 0.7rem; text-decoration: none; color: inherit; }
.td-plan .tp-main strong { display: block; font-size: 0.97rem; color: var(--ink-strong); }
.td-plan .tp-main span { font-size: 0.8rem; color: var(--muted); }
.td-plan em { font-style: normal; font-size: 0.8rem; color: var(--primary); font-weight: 700; white-space: nowrap; }
.td-plan a:hover .tp-main strong { color: var(--primary); }
.td-plan .progress { margin-top: 0.3rem; }

/* ---- Flashcards & review (review.html) ---- */
.rv-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem 1.4rem 1.7rem; margin-top: 1rem; text-align: center; cursor: pointer; min-height: 220px; display: flex; flex-direction: column; justify-content: center; gap: 0.6rem; }
.rv-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.rv-topic { font-size: 0.74rem; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.rv-front p { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--ink-strong); }
.rv-ar { font-family: var(--font-ar); font-size: calc(1.7rem * var(--ar-scale)); margin: 0 0 0.3rem; color: var(--ink-strong); }
.rv-answer { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.rv-why { margin: 0.3rem 0 0.4rem; font-size: 0.92rem; color: var(--ink); }
.rv-flip-hint { font-size: 0.8rem; color: var(--muted); }
.rv-actions { display: flex; gap: 0.7rem; margin-top: 1rem; }
.rv-actions[hidden] { display: none; }
.rv-actions .btn { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; padding: 0.7rem 0.5rem; }
.rv-actions .btn span { font-size: 0.72rem; font-weight: 500; opacity: 0.85; }

/* ---- Hajj companion (hajj-companion.html) ---- */
.hc-list { display: flex; flex-direction: column; gap: 0.55rem; }
.hc-list label { display: flex; align-items: flex-start; gap: 0.65rem; background: var(--surface-2); border-radius: 12px; padding: 0.65rem 0.85rem; font-size: 0.94rem; color: var(--ink); cursor: pointer; }
.hc-list input { accent-color: var(--primary); width: 18px; height: 18px; flex: none; margin-top: 0.1rem; }
.hc-list input:checked + * { }
.hc-list label:has(input:checked) { opacity: 0.72; text-decoration: line-through; text-decoration-color: var(--gold); text-decoration-thickness: 1px; }
.hc-list a { color: var(--primary); }
.hc-progress { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.8rem; }
.hc-progress .progress { flex: 1; margin: 0; }
.hc-pct { font-size: 0.85rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.hc-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.8rem; }
.hc-notes label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; color: var(--ink-strong); }
.hc-notes textarea { border: 1px solid var(--line); border-radius: 11px; padding: 0.55rem 0.7rem; font-family: inherit; font-size: 0.92rem; font-weight: 400; color: var(--ink); background: var(--surface); resize: vertical; }
.hc-days details { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 0.6rem; background: var(--surface); overflow: hidden; }
.hc-days summary { display: flex; justify-content: space-between; align-items: baseline; gap: 0.7rem; padding: 0.8rem 1rem; cursor: pointer; list-style: none; }
.hc-days summary::-webkit-details-marker { display: none; }
.hc-days summary strong { color: var(--ink-strong); font-size: 0.97rem; }
.hc-days summary span { font-size: 0.8rem; color: var(--primary); font-weight: 600; white-space: nowrap; }
.hc-days details[open] summary { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.hc-days details p { margin: 0; padding: 0.8rem 1rem 0.95rem; font-size: 0.92rem; color: var(--ink); }

/* prophet index tile thumbnails */
.prophet-grid:has(.tile-thumb) { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.prophet-tile .tile-thumb {
  flex: 0 0 auto;
  position: relative;
  width: 88px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.prophet-tile .tile-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prophet-tile .tile-thumb .prophet-num {
  position: absolute;
  left: 5px;
  bottom: 5px;
  width: 24px;
  height: 24px;
  font-size: 0.72rem;
  background: rgba(251, 244, 232, 0.92);
  box-shadow: 0 1px 4px rgba(51, 30, 16, 0.25);
}

.prophet-tile.is-done .tile-thumb .prophet-num {
  background: var(--primary);
  color: #FFF7EC;
}

.prophet-tile .prophet-name .meta {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .prophet-tile .tile-thumb { width: 72px; height: 50px; }
}

/* platform watermark suppressed at owner's request */
/* keyboard skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 3000;
  background: var(--primary);
  color: #FFF7EC;
  padding: 0.6rem 1rem;
  border-radius: 0 0 12px 0;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus { left: 0; }

/* fasting + night rows on the floater sheet and Today card */
.ptf-list li.ptf-extra { color: var(--muted); font-size: 0.82rem; }

.ptf-list li.ptf-extra:first-of-type { border-top: 1px dashed var(--line); margin-top: 0.35rem; padding-top: 0.45rem; }

.td-fast {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.td-fast strong { color: var(--ink-strong); font-variant-numeric: tabular-nums; }

/* ============ Phase 1: landing goal chips, directory, update toast ============ */

.goal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 2.4rem;
}

.goal-chip {
  display: inline-block;
  padding: 0.6rem 1.05rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-strong);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.goal-chip:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }

.goal-chip-quiet { color: var(--muted); font-weight: 500; border-style: dashed; }

.feature-paths .module-card h3 { margin-top: 0.2rem; }

.dir-details { margin: 0 0 2.6rem; }

.dir-details > summary {
  list-style: none;
  cursor: pointer;
  display: block;
  padding: 1.1rem 1.3rem;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.dir-details > summary::-webkit-details-marker { display: none; }

.dir-details > summary > span {
  display: block;
  font-weight: 700;
  color: var(--ink-strong);
  font-size: 1.05rem;
}

.dir-details > summary > span::after {
  content: " \25BE";
  color: var(--primary);
}

.dir-details[open] > summary > span::after { content: " \25B4"; }

.dir-details > summary > em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

.dir-details > summary:hover { border-color: var(--primary); }

.dir-details[open] > summary { margin-bottom: 1.6rem; }

/* service-worker update pill */
.sw-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.6rem 0.55rem 1rem;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(40, 24, 10, 0.18);
  font-size: 0.9rem;
  color: var(--ink-strong);
}

.sw-toast .btn { padding: 0.4rem 0.95rem; font-size: 0.85rem; }

/* screen-reader-only text (search live region and labels) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============ Settings panel: collapsible groups + dual menu icon ============ */

/* collapsible settings groups - the panel opens as five short headings */
.menu-acc { border-top: 1px solid var(--line); }

.menu-acc:first-of-type { border-top: none; }

.menu-acc > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.85rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
}

.menu-acc > summary::-webkit-details-marker { display: none; }

.menu-acc > summary:hover { color: var(--primary); background: var(--primary-soft); }

.menu-acc > summary svg {
  width: 14px;
  height: 14px;
  flex: none;
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.menu-acc[open] > summary { color: var(--ink-strong); }

.menu-acc[open] > summary svg { transform: rotate(180deg); }

.menu-acc > .menu-controls:last-child { padding-bottom: 0.8rem; }

/* menu button: burger on desktop, gear on phones */
.menu-btn .mb-gear { display: none; }

.menu-btn .mb-burger {
  display: block;
  width: 17px;
  height: 12px;
  position: relative;
}

.menu-btn .mb-burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.18s ease;
}

.menu-btn .mb-burger span:nth-child(1) { top: 0; }
.menu-btn .mb-burger span:nth-child(2) { top: 5px; }
.menu-btn .mb-burger span:nth-child(3) { top: 10px; }

.menu-btn.is-open .mb-burger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-btn.is-open .mb-burger span:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
.menu-btn.is-open .mb-burger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 700px) {
  .menu-btn .mb-burger { display: none; }
  .menu-btn .mb-gear { display: block; width: 17px; height: 17px; }
}

/* a touch more glide on the panel itself */
.menu-panel {
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0.22, 1);
}

.menu-backdrop {
  background: rgba(42, 27, 16, 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .menu-panel, .menu-btn .mb-burger span, .menu-acc > summary svg { transition: none; }
}

/* ---------- Ask Sirat: grounded question box ---------- */
.ask-shell {
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card, var(--bg-2));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ask-log {
  padding: 1.1rem;
  max-height: 60vh;
  min-height: 40vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ask-msg { max-width: 88%; border-radius: 16px; padding: 0.8rem 1rem; font-size: 0.95rem; line-height: 1.55; }
.ask-user { align-self: flex-end; background: var(--gold-soft); color: var(--ink-strong); border-bottom-right-radius: 6px; }
.ask-user p { margin: 0; }
.ask-bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.ask-a { margin: 0; font-weight: 500; color: var(--ink-strong); }
.ask-list { margin: 0.6rem 0 0; padding-left: 1.3rem; }
.ask-list li { margin: 0.2rem 0; }
.ask-note { margin: 0.6rem 0 0; font-size: 0.86rem; color: var(--ink); opacity: 0.82; }
.ask-src { margin: 0.6rem 0 0; font-size: 0.78rem; opacity: 0.7; }
.ask-link {
  display: inline-block; margin-top: 0.55rem; font-size: 0.86rem; font-weight: 600;
  color: var(--gold-deep); text-decoration: none;
}
.ask-link:hover, .ask-link:focus-visible { text-decoration: underline; }
.ask-chips, .ask-related { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.ask-related { margin-top: 0.7rem; align-items: center; }
.ask-related-label { font-size: 0.78rem; opacity: 0.7; }
.ask-chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 0.4rem 0.85rem; font: inherit; font-size: 0.84rem;
  cursor: pointer; text-align: left;
}
.ask-chip:hover, .ask-chip:focus-visible { border-color: var(--gold); background: var(--gold-soft); }
.ask-form {
  display: flex; gap: 0.5rem; padding: 0.8rem;
  border-top: 1px solid var(--line); background: var(--bg);
}
.ask-form input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2); color: var(--ink); font: inherit; font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
}
.ask-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.ask-form button {
  border: none; border-radius: 12px; background: var(--gold); color: #2A2410;
  width: 46px; min-width: 46px; cursor: pointer; display: grid; place-items: center;
}
.ask-form button svg { width: 20px; height: 20px; }
.ask-form button:hover { background: var(--gold-deep); color: #FFF8EA; }
@media (max-width: 700px) {
  .ask-log { max-height: none; min-height: 45vh; }
  .ask-msg { max-width: 94%; }
}
