/* ════════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM — "Modern Persian / Emerald Ink"
   Airy, museum-clean. One jewel accent (emerald). Geometric, not floral.
   ════════════════════════════════════════════════════════════════════════ */
@font-face {
  font-family: "Shekasteh";
  src: url("assets/wm_Shekasteh-96.ttf") format("truetype");
  font-weight: 400;
  /* block (not swap): never paint the generic `cursive` fallback then swap —
     the font is preloaded in <head> and cached on refresh, so it paints
     directly in Shekasteh with no flash of fallback. */
  font-display: block;
}
:root {
  /* type scale (rem-based so 200% zoom survives) */
  --fs: 1; /* user text-size multiplier */
  --lh-poem: 1.95; /* couplet line-height (user adjustable) */
  --lh-ar: 2.35; /* vocalised Arabic line-height */

  /* fonts */
  --fa:
    "Estedad", "Vazirmatn", system-ui, -apple-system, sans-serif; /* body + UI  */
  --display: "Morabba", "Vazirmatn", var(--fa); /* big display */
  --ar: "Amiri Quran", "Noto Naskh Arabic", serif; /* Qur'an     */

  /* — LIGHT / paper — */
  --paper: #fcfcfa;
  --paper-2: #f5f5f0;
  --raise: #ffffff;
  --ink: #14181a;
  --ink-2: #3c4346;
  --muted: #717a78;
  --accent: #0e7c66;
  --accent-2: #0b6553;
  --accent-tint: #e5f1ed;
  --poem: #0e6b58;
  --gold: #94732f; /* surah title + couplet ornament */
  --qq: #94732f; /* couplet ink (emerald) + embedded-Qur'an gilt */
  /* couplet copper→gold→teal — also drives the home card hover border */
  --grad: linear-gradient(135deg, #b5532e, #b0832f, #2e7d72, #1e5a57);
  --conic: conic-gradient(
    from 0deg,
    #b5532e,
    #b0832f,
    #2e7d72,
    #57cfc0,
    #2e7d72,
    #b0832f,
    #b5532e
  );
  --card-glow:
    0 16px 38px rgba(70, 50, 20, 0.16), 0 0 26px rgba(46, 125, 114, 0.18);
  --neon: #7a1fd6;
  --neon-glow:
    0 0 1px rgba(138, 43, 226, 0.55), 0 0 10px rgba(168, 85, 247, 0.5),
    0 0 22px rgba(168, 85, 247, 0.32);
  --hair: #eceae3;
  --hair-2: #e3e1d8;
  --shadow-sm: 0 1px 2px rgba(20, 24, 26, 0.04);
  --shadow:
    0 1px 2px rgba(20, 24, 26, 0.05), 0 10px 34px rgba(20, 40, 34, 0.06);
  --shadow-lg:
    0 2px 8px rgba(20, 24, 26, 0.06), 0 24px 60px rgba(20, 40, 34, 0.14);

  /* metrics */
  --maxw: 48rem; /* reading measure */
  --homew: 64rem;
  --r: 14px;
  --r-lg: 22px; /* radii */
  --tap: 46px; /* min tap target */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
[data-theme="sepia"] {
  --paper: #f6efe0;
  --paper-2: #f0e7d3;
  --raise: #fbf6eb;
  --ink: #2a2418;
  --ink-2: #4b4434;
  --muted: #8a7c5f;
  --accent: #0e7c66;
  --accent-2: #0b6553;
  --accent-tint: #e6eedf;
  --poem: #0c6a54;
  --gold: #94732f;
  --qq: #94732f;
  --neon: #7a1fd6;
  --neon-glow:
    0 0 1px rgba(138, 43, 226, 0.55), 0 0 10px rgba(168, 85, 247, 0.5),
    0 0 22px rgba(168, 85, 247, 0.32);
  --hair: #e6dabf;
  --hair-2: #decfad;
}
[data-theme="ink"] {
  --paper: #0e1312;
  --paper-2: #141a19;
  --raise: #161d1b;
  --ink: #e9ecea;
  --ink-2: #c2c9c6;
  --muted: #8b9591;
  --accent: #3fbfa3;
  --accent-2: #57cdb3;
  --accent-tint: #15211d;
  --poem: #6fd0c6;
  --gold: #c9a24a;
  --qq: #e6ce8e; /* couplets glow firouzeh on night */
  --grad: linear-gradient(135deg, #e0894e, #d7a845, #3fb89e, #57cfc0);
  --conic: conic-gradient(
    from 0deg,
    #e0894e,
    #d7a845,
    #3fb89e,
    #7fe0d2,
    #3fb89e,
    #d7a845,
    #e0894e
  );
  --card-glow:
    0 16px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(63, 184, 158, 0.28);
  --neon: #d9a6ff;
  --neon-glow:
    0 0 4px rgba(199, 125, 255, 0.9), 0 0 16px rgba(199, 125, 255, 0.7),
    0 0 34px rgba(168, 85, 247, 0.5);
  --hair: #222c29;
  --hair-2: #2b3633;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 36px rgba(0, 0, 0, 0.4);
  --shadow-lg:
    0 2px 10px rgba(0, 0, 0, 0.5), 0 28px 70px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}
html {
  font-size: calc(16px * var(--fs));
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--fa);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02";
  letter-spacing: 0;
  transition:
    background 0.35s var(--ease),
    color 0.35s var(--ease);
  overflow-x: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
}
::selection {
  background: var(--accent-tint);
  color: var(--accent-2);
}
.fa-num {
  font-variant-numeric: normal;
}
.hidden {
  display: none !important;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* hairline focus ring for a11y */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ════════════════════════════════════════════════════════════════════════
   APP CHROME — sticky top bar + reading-progress + bottom tab bar
   ════════════════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.05) blur(14px);
  -webkit-backdrop-filter: saturate(1.05) blur(14px);
  border-bottom: 1px solid var(--hair);
  transition:
    transform 0.3s var(--ease),
    opacity 0.3s var(--ease);
}
body.immersive .topbar {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.topbar .row {
  max-width: var(--homew);
  margin: 0 auto;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 max(1rem, env(safe-area-inset-right)) 0
    max(1rem, env(safe-area-inset-left));
}
.iconbtn {
  width: var(--tap);
  height: var(--tap);
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  border-radius: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.16s var(--ease);
}
.iconbtn svg {
  width: 21px;
  height: 21px;
  display: block;
}
.iconbtn:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.iconbtn:active {
  transform: scale(0.93);
}
.iconbtn.accent {
  color: var(--accent);
}

.tb-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.tb-brand .mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: var(--gold);
}
/* book name in the gilt hand — fades in once the hero title scrolls away */
.tb-brand .tb-title {
  font-family: "Shekasteh", cursive;
  color: var(--gold);
  font-size: 1.5rem;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(8px);
  transition:
    opacity 0.35s var(--ease),
    transform 0.35s var(--ease);
}
.tb-brand .tb-title.show {
  opacity: 1;
  transform: none;
}
.tb-brand .tt {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
  min-width: 0;
}
.tb-brand .tt b {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.2px;
}
.tb-brand .tt small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-surah {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  cursor: pointer;
}
.tb-surah b {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.08rem;
}
.tb-surah small {
  color: var(--muted);
  font-size: 0.7rem;
}
.spacer {
  flex: 1 1 auto;
}

/* desktop primary nav (hidden on mobile) */
.tb-nav {
  display: flex;
  gap: 0.15rem;
  align-items: center;
}
.tb-nav .navlink {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: var(--tap);
  padding: 0 0.85rem;
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.16s var(--ease);
  border: 0;
  background: transparent;
}
.tb-nav .navlink svg {
  width: 18px;
  height: 18px;
}
.tb-nav .navlink:hover {
  color: var(--ink);
  background: var(--paper-2);
}
.tb-nav .navlink.on {
  color: var(--accent);
}

/* reading progress */
.progress {
  height: 2px;
  background: transparent;
  position: relative;
  overflow: hidden;
}
.progress > i {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.12s linear;
}
#view-home .progress,
body[data-route="home"] .progress {
  opacity: 0;
}

/* bottom tab bar (mobile thumb-zone) */
.tabbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(1.05) blur(16px);
  -webkit-backdrop-filter: saturate(1.05) blur(16px);
  border-top: 1px solid var(--hair);
  padding-bottom: var(--safe-b);
  transition: transform 0.3s var(--ease);
}
body.immersive .tabbar {
  transform: translateY(110%);
}
.tabbar .inner {
  display: flex;
  max-width: 30rem;
  margin: 0 auto;
}
.tabbar button {
  flex: 1;
  min-height: calc(var(--tap) + 10px);
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.66rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s var(--ease);
  padding-top: 6px;
}
.tabbar button svg {
  width: 23px;
  height: 23px;
}
.tabbar button.on {
  color: var(--accent);
}
.tabbar button:active {
  transform: scale(0.92);
}
@media (max-width: 767.98px) {
  .tabbar {
    display: block;
  }
  .tb-nav {
    display: none;
  }
}

main {
  min-height: 60vh;
}

/* ════════════════════════════════════════════════════════════════════════
   GEOMETRIC ORNAMENT — strictly linework (girih spirit, not floral)
   ════════════════════════════════════════════════════════════════════════ */
.headpiece {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--accent);
  margin: 0 auto;
}
.headpiece .ln {
  height: 1px;
  flex: 1;
  max-width: 8rem;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 55%, transparent)
  );
}
.star8 {
  color: var(--accent);
}
.star8 svg {
  display: block;
}

/* faint tiled motif behind the surah numeral */
.motif {
  position: absolute;
  inset: 0;
  color: var(--accent);
  opacity: 0.05;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════════════════════
   HOME — calm hero + 114-surah grid
   ════════════════════════════════════════════════════════════════════════ */
.wrap {
  max-width: var(--homew);
  margin: 0 auto;
  padding: 0 max(1.1rem, env(safe-area-inset-right)) 0
    max(1.1rem, env(safe-area-inset-left));
}
.hero {
  padding: clamp(2.6rem, 7vw, 5rem) 0 clamp(1.6rem, 4vw, 2.6rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* faint gilt girih ground behind the frontispiece title */
.hero .motif {
  color: var(--gold);
  opacity: 0.08;
  -webkit-mask-image: radial-gradient(
    circle at 50% 40%,
    #000 22%,
    transparent 62%
  );
  mask-image: radial-gradient(
    circle at 50% 40%,
    #000 22%,
    transparent 62%
  );
}
.hero-in {
  position: relative;
  z-index: 1;
}
/* gilt headpiece over the title (echoes the surah opening) */
.hero .headpiece {
  color: var(--gold);
  max-width: 17rem;
  margin: 0 auto 1.3rem;
}
.hero .headpiece .star8 {
  color: var(--gold);
}
.hero .headpiece .ln {
  max-width: none;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 50%, transparent)
  );
}
.hero .headpiece .ln:last-child {
  background: linear-gradient(
    270deg,
    transparent,
    color-mix(in srgb, var(--accent) 50%, transparent)
  );
}
.hero .kicker {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  margin-bottom: 0.7rem;
}
.hero h1 {
  font-family: "Shekasteh", cursive;
  font-weight: 400;
  line-height: 1.45;
  font-size: clamp(3.2rem, 12vw, 6rem);
  margin: 0;
  letter-spacing: 0;
  color: var(--gold);
}
.hero .sub {
  font-family: var(--display);
  font-weight: 400;
  color: var(--accent);
  font-size: clamp(1.1rem, 3.4vw, 1.5rem);
  margin: 0.4rem 0 0;
}
/* gilt diamond divider under the title (same artifact as the surah page) */
.hero .tdiv {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 1.05rem 0 0;
}
.hero .tdiv .ln {
  width: 3rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.hero .tdiv .ln:last-child {
  background: linear-gradient(270deg, transparent, var(--gold));
}
.hero .tdiv .dia {
  width: 9px;
  height: 9px;
  background: var(--gold);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow:
    0 0 0 3px var(--paper),
    0 0 0 4px color-mix(in srgb, var(--gold) 35%, transparent);
}
[data-theme="ink"] .hero .tdiv .dia {
  box-shadow: 0 0 8px color-mix(in srgb, var(--gold) 55%, transparent);
}
.hero .ded {
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 300;
  margin: 1.1rem auto 0;
  max-width: 30rem;
  line-height: 1.9;
}

/* search field */
.search {
  position: relative;
  max-width: 34rem;
  margin: 1.8rem auto 0;
}
.search svg.ic {
  position: absolute;
  inset-inline-start: 1.05rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 54px;
  border: 1px solid var(--hair-2);
  background: var(--raise);
  color: var(--ink);
  border-radius: 16px;
  padding-block: 0;
  padding-inline-start: 3rem;
  padding-inline-end: 2.6rem;
  font-family: var(--fa);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: 0.18s var(--ease);
}
.search input::placeholder {
  color: var(--muted);
}
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint);
}
.search .clr {
  position: absolute;
  inset-inline-end: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: none;
  place-items: center;
}
.search .clr.show {
  display: grid;
}

/* section label */
.seclabel {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin: 2.6rem 0 1.1rem;
}
.seclabel h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.25rem;
  margin: 0;
}
.seclabel .ct {
  color: var(--muted);
  font-size: 0.82rem;
}
.seclabel .dia {
  width: 9px;
  height: 9px;
  background: var(--gold);
  transform: rotate(45deg);
  border-radius: 2px;
  flex: 0 0 auto;
  align-self: center;
}
.seclabel .ln {
  flex: 1;
  height: 1px;
  background: var(--hair);
  align-self: center;
}

/* surah grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.7rem;
  padding-bottom: clamp(3rem, 10vw, 6rem);
}
@keyframes spinBorder {
  to {
    transform: translate(-50%, -50%) rotate(1turn);
  }
}
.scard {
  position: relative;
  display: block;
  width: 100%;
  text-align: start;
  padding: 2px; /* gilt-border gutter */
  border: none;
  border-radius: var(--r);
  background: var(--hair); /* resting hairline */
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  font-family: var(--fa);
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
}
/* rotating copper→gold→teal ring, revealed on hover */
.scard::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: var(--conic);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.scard:not(.soon):hover {
  background: transparent;
  box-shadow: var(--card-glow);
  transform: translateY(-3px);
}
.scard:not(.soon):hover::before {
  opacity: 1;
  animation: spinBorder 4.5s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .scard:not(.soon):hover::before {
    animation: none;
  }
}
.scard:active {
  transform: translateY(0);
}
.cardin {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-height: 70px;
  padding: 0.9rem 1rem;
  border-radius: calc(var(--r) - 2px);
  background: var(--raise);
}
.scard .n {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--gold);
  flex: 0 0 auto;
  width: 2.5rem;
  text-align: center;
  line-height: 1;
}
.scard:not(.soon):hover .n {
  background-image: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.scard .meta {
  min-width: 0;
  flex: 1;
}
.scard .nm {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}
.scard .nm b {
  font-family: var(--ar);
  font-weight: 500;
  font-size: 1.18rem;
  letter-spacing: 0;
  color: var(--ink);
}
.scard .nm .ar {
  font-family: var(--ar);
  font-size: 0.92rem;
  color: var(--muted);
}
.scard .sub2 {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.3rem;
}
.scard .row2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.28rem;
}
.pill {
  font-size: 0.66rem;
  font-weight: 500;
  padding: 0.12rem 0.5rem;
  border-radius: 20px;
  line-height: 1.5;
  border: 1px solid var(--hair-2);
  color: var(--muted);
  white-space: nowrap;
}
.pill.makki {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--hair-2));
  background: var(--accent-tint);
}
.scard .cts {
  color: var(--muted);
  font-size: 0.72rem;
}
.scard .go {
  position: absolute;
  inset-inline-end: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hair-2);
  transition: 0.16s var(--ease);
}
.scard:hover .go {
  color: var(--accent);
  inset-inline-end: 0.7rem;
}
.scard.soon {
  cursor: default;
  opacity: 0.62;
}
.scard.soon:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  background: var(--hair);
}
.scard.soon:hover::before {
  opacity: 0;
  animation: none;
}
.scard.soon .n {
  color: var(--muted);
}
.scard.soon .go {
  display: none;
}
.scard .soonbadge {
  position: absolute;
  inset-inline-end: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.64rem;
  color: var(--muted);
  border: 1px solid var(--hair-2);
  border-radius: 20px;
  padding: 0.1rem 0.5rem;
}
.scard.soon:not(.soon-show) .soonbadge {
  display: none;
}
.empty {
  grid-column: 1/-1;
  text-align: center;
  color: var(--muted);
  padding: 2.4rem 0;
  font-size: 0.95rem;
}

/* ════════════════════════════════════════════════════════════════════════
   SURAH PAGE
   ════════════════════════════════════════════════════════════════════════ */
.reader {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 max(1.15rem, env(safe-area-inset-right)) 7rem
    max(1.15rem, env(safe-area-inset-left));
}

/* opening: headpiece + bismillah + title */
.opening {
  text-align: center;
  padding: clamp(1.8rem, 6vw, 3.4rem) 0 0.4rem;
}
.opening .headpiece {
  margin-bottom: 1.5rem;
}
.bism {
  font-family: var(--ar);
  font-size: clamp(1.7rem, 6vw, 2.5rem);
  color: var(--ink);
  line-height: 1.6;
  margin: 0 auto;
  font-weight: 400;
}
.titleblock {
  position: relative;
  margin: 1.8rem auto 0;
  padding: 1.2rem 0 0.2rem;
}
.titleblock .bignum {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(4rem, 18vw, 7rem);
  color: var(--accent-tint);
  line-height: 0.85;
  position: relative;
  z-index: 0;
  letter-spacing: -0.02em;
}
[data-theme="ink"] .titleblock .bignum {
  color: color-mix(in srgb, var(--accent) 18%, transparent);
}
.titleblock h1 {
  font-family: "Shekasteh", cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  line-height: 1.5;
  margin: -0.1em 0 0;
  position: relative;
  z-index: 1;
  letter-spacing: 0;
  color: var(--gold);
}
/* small gilt artifact under the surah title */
.titleblock .tdiv {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.7rem 0 0;
  position: relative;
  z-index: 1;
}
.titleblock .tdiv .ln {
  width: 3rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.titleblock .tdiv .ln:last-child {
  background: linear-gradient(270deg, transparent, var(--gold));
}
.titleblock .tdiv .dia {
  width: 9px;
  height: 9px;
  background: var(--gold);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow:
    0 0 0 3px var(--paper),
    0 0 0 4px color-mix(in srgb, var(--gold) 35%, transparent);
}
[data-theme="ink"] .titleblock .tdiv .dia {
  box-shadow: 0 0 8px color-mix(in srgb, var(--gold) 55%, transparent);
}
.titleblock .ar {
  font-family: var(--ar);
  font-size: 1.25rem;
  color: var(--ink-2);
  margin: 0.35rem 0 0;
}
.titleblock .meaning {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.25rem 0 0;
  font-weight: 300;
}
.titleblock .facts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.facts .fact {
  color: var(--muted);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.facts .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--hair-2);
}

/* view tabs (segmented) */
.tabs {
  position: sticky;
  top: 58px;
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.9rem 0 1.1rem;
  margin: 1.6rem 0 0.4rem;
  background: linear-gradient(var(--paper) 72%, transparent);
}
body.immersive .tabs {
  top: 0;
}
.tabs .seg {
  display: inline-flex;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 13px;
  padding: 4px;
  gap: 4px;
}
.tabs .seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--fa);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.5rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.16s var(--ease);
}
.tabs .seg button.on {
  background: var(--raise);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ── poem block ── */
.poemblock {
  margin: 2rem 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-tint);
  color: var(--accent-2);
  border-radius: 20px;
  padding: 0.32rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  margin: 0 auto 1.4rem;
}
.chip svg {
  width: 14px;
  height: 14px;
}
.chipwrap {
  display: flex;
  justify-content: center;
}
.poemnote {
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 300;
  margin: -0.7rem 0 1.4rem;
}

.poem {
  margin: 0 auto;
  max-width: 34rem;
}
.beyt {
  position: relative;
  padding: 0.35rem 0;
  scroll-margin-top: 7rem;
  border-radius: 10px;
  transition: background 0.2s var(--ease);
  -webkit-user-select: none;
  user-select: none;
  caret-color: transparent;
}
.beyt .num {
  position: absolute;
  inset-inline-start: -1.9rem;
  top: 0.5rem;
  font-size: 0.66rem;
  color: var(--muted);
  opacity: 0;
  transition: 0.15s var(--ease);
  font-variant-numeric: normal;
}
body.show-nums .beyt .num {
  opacity: 0.55;
}
.beyt:hover .num {
  opacity: 0.7;
}
.mesra {
  margin: 0;
  font-family: "Shekasteh", cursive;
  font-weight: 400;
  font-size: 1.68rem;
  line-height: calc(var(--lh-poem) + 0.4);
  color: var(--g-color, var(--poem));
  /* reading glow — same colour as the couplet, intensity driven by JS (--glow 0..1) */
  text-shadow: 0 0 calc(var(--glow, 0) * 16px)
    color-mix(
      in srgb,
      var(--g-color, var(--poem)) calc(var(--glow, 0) * 60%),
      transparent
    );
}
.beyt.bk {
  background: var(--accent-tint);
}
.beyt.bk::before {
  content: "";
  position: absolute;
  inset-inline-start: -0.55rem;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}
/* neon focus: single-click a couplet to select → complementary purple glow on the text only */
.beyt.sel .mesra {
  color: var(--neon);
  text-shadow: var(--neon-glow);
  transition:
    color 0.25s var(--ease),
    text-shadow 0.25s var(--ease);
}
.beyt.sel .q {
  color: var(--poem);
  text-shadow: none;
}
/* desktop: two hemistichs around a quiet centred gutter (whitespace, no rule) */
@media (min-width: 768px) {
  .beyt {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: baseline;
    column-gap: 2.4rem;
    margin-block: 0.45rem;
  }
  /* wide view: beyt number centred in the gutter between hemistichs */
  .beyt .num {
    inset-inline-start: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.5;
    color: var(--gold);
  }
  .m1 {
    text-align: justify;
    text-align-last: justify;
  }
  .m2 {
    text-align: justify;
    text-align-last: justify;
  }
}
@media (max-width: 767.98px) {
  .beyt {
    text-align: center;
    margin-block: 0.9rem;
  }
  .mesra {
    display: block;
  }
  .m1 {
    margin-bottom: 0.15rem;
  }
  .beyt + .beyt {
    margin-top: 1.15rem;
  }
}
/* embedded Qur'an phrase inside a hemistich — kept in the POEM font so line
   spacing stays uniform; emerald colour + thin underline mark it as a link. */
.q {
  font-family: var(--ar);
  font-size: 0.94em;
  color: var(--g-color, var(--poem));
  cursor: pointer;
  border-radius: 5px;
  padding: 0 0.12em;
  transition: 0.14s var(--ease);
  text-decoration: none;
}
.q:hover {
  background: color-mix(in srgb, var(--poem) 12%, transparent);
}

/* ── ayah card ── */
.ayahcard {
  background: var(--raise);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  margin: 1.5rem auto;
  padding: 0.4rem 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ayah {
  position: relative;
  padding: 1.5rem 1.5rem;
  scroll-margin-top: 7rem;
  transition: background 0.25s var(--ease);
}
.ayah + .ayah {
  border-top: 1px solid var(--hair);
}
.ayah .ix {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.74rem;
  margin-bottom: 0.85rem;
}
.ayah .ix .badge {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--hair));
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  font-variant-numeric: normal;
  flex: 0 0 auto;
}
.ayah .ar {
  font-family: var(--ar);
  font-size: clamp(1.45rem, 5vw, 1.85rem);
  line-height: var(--lh-ar);
  text-align: center;
  color: var(--ink);
  margin: 0;
  font-weight: 400;
}
.ayah .tr {
  color: var(--ink-2);
  font-size: 1rem;
  text-align: center;
  margin: 0.85rem auto 0;
  font-weight: 300;
  line-height: 1.95;
  max-width: 34rem;
}
.ayah .tools {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.1rem;
  opacity: 0;
  transition: 0.18s var(--ease);
}
.ayah:hover .tools,
.ayah:focus-within .tools {
  opacity: 1;
}
@media (hover: none) {
  .ayah .tools {
    opacity: 1;
  }
}
.minibtn {
  border: 1px solid var(--hair-2);
  background: var(--paper);
  color: var(--muted);
  border-radius: 20px;
  font-size: 0.76rem;
  padding: 0.34rem 0.85rem;
  cursor: pointer;
  font-family: var(--fa);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: 0.15s var(--ease);
}
.minibtn svg {
  width: 14px;
  height: 14px;
}
.minibtn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--hair-2));
}
.minibtn.on {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
[data-theme="ink"] .minibtn.on {
  color: #08110e;
}
.ayah.flash {
  background: var(--accent-tint);
}
.ayah.bk .ix .badge {
  background: var(--accent);
  color: #fff;
}
[data-theme="ink"] .ayah.bk .ix .badge {
  color: #08110e;
}

/* track rhythm: alternate poem alignment subtly on desktop */
.poemblock:nth-of-type(even) .chipwrap {
}

/* ── story essay ── */
.story {
  max-width: 40rem;
  margin: 1.4rem auto 0;
  animation: fade 0.3s var(--ease);
}
.story .esstitle {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  text-align: center;
  margin: 0 0 0.4rem;
}
.story .essrule {
  width: 3.5rem;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 2rem;
  border-radius: 2px;
}
.story h2 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--accent);
  font-size: 1.3rem;
  margin: 2.4rem 0 0.7rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--hair);
}
.story h2:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.story p {
  margin: 0.85rem 0;
  text-align: justify;
  font-weight: 300;
  font-size: 1.04rem;
  line-height: 2.05;
  color: var(--ink-2);
  text-wrap: pretty;
}
.story .src {
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--hair);
  margin-top: 2.2rem;
  padding-top: 1.1rem;
}

.footnote {
  max-width: var(--maxw);
  margin: 2.5rem auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  border-top: 1px solid var(--hair);
  padding-top: 1.3rem;
  font-weight: 300;
  line-height: 1.9;
}

/* loading skeleton + spinner + error */
.skel {
  background: linear-gradient(
    90deg,
    var(--paper-2) 25%,
    var(--hair) 37%,
    var(--paper-2) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}
.skel-bism {
  height: 2.2rem;
  width: min(22rem, 70%);
  margin: 1rem auto 0;
}
.skel-line {
  height: 1.05rem;
  margin: 1.1rem auto;
  width: min(38rem, 92%);
}
.skel-line.short {
  width: min(24rem, 60%);
}
.loadrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 2.4rem 0 1.4rem;
  font-weight: 300;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--hair-2);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.errbox {
  text-align: center;
  padding: clamp(2rem, 8vw, 4rem) 0;
  max-width: 34rem;
  margin: 0 auto;
}
.errbox .headpiece {
  margin-bottom: 1.6rem;
  opacity: 0.7;
}
.errbox h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 0.7rem;
}
.errbox p {
  color: var(--muted);
  font-weight: 300;
  line-height: 2;
  font-size: 0.96rem;
}
.errbox code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.82em;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 0.06em 0.4em;
  direction: ltr;
  display: inline-block;
}
.errbtns {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.6rem;
}
.errbtns .minibtn {
  font-size: 0.9rem;
  padding: 0.5rem 1.1rem;
}

/* ════════════════════════════════════════════════════════════════════════
   SHEETS — settings (bottom sheet on mobile / popover on desktop), bookmarks, switcher
   ════════════════════════════════════════════════════════════════════════ */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 13, 0.42);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
  backdrop-filter: blur(2px);
}
.scrim.on {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  z-index: 90;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transition:
    transform 0.32s var(--ease),
    opacity 0.25s var(--ease);
}
/* mobile: bottom sheet */
@media (max-width: 767.98px) {
  .sheet {
    inset-inline: 0;
    bottom: 0;
    border-radius: 24px 24px 0 0;
    border-top: 1px solid var(--hair);
    transform: translateY(110%);
    max-height: 88vh;
    overflow: auto;
    padding-bottom: calc(1.2rem + var(--safe-b));
  }
  .sheet.on {
    transform: translateY(0);
  }
  .sheet .grab {
    width: 42px;
    height: 4px;
    border-radius: 4px;
    background: var(--hair-2);
    margin: 0.7rem auto 0.2rem;
  }
}
/* desktop: popover anchored top-end */
@media (min-width: 768px) {
  .sheet {
    top: 70px;
    inset-inline-end: max(1.1rem, env(safe-area-inset-right));
    width: 380px;
    max-height: 82vh;
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--hair);
    transform: translateY(-8px) scale(0.98);
    opacity: 0;
    pointer-events: none;
  }
  .sheet.on {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .sheet .grab {
    display: none;
  }
}
.sheet .pad {
  padding: 0.4rem 1.3rem 1.3rem;
}
.sheet h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.25rem;
  margin: 0.4rem 0 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet h3 .x {
  border: 0;
  background: var(--paper-2);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.setrow {
  margin: 1.5rem 0;
}
.setrow .lab {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
  letter-spacing: 0.04em;
}
.choices {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.choices button {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  border: 1px solid var(--hair-2);
  background: var(--raise);
  color: var(--ink);
  border-radius: 11px;
  padding: 0.5rem 0.4rem;
  cursor: pointer;
  font-family: var(--fa);
  font-size: 0.86rem;
  transition: 0.15s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.choices button:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--hair-2));
}
.choices button.on {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 600;
}
.choices .sw {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--hair-2);
  flex: 0 0 auto;
}
.swatch-paper {
  background: #fcfcfa;
}
.swatch-sepia {
  background: #f0e7d3;
}
.swatch-ink {
  background: #0e1312;
}
.swatch-auto {
  background: linear-gradient(135deg, #fcfcfa 0 50%, #0e1312 50%);
}
.stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stepper button {
  width: var(--tap);
  height: var(--tap);
  border: 1px solid var(--hair-2);
  background: var(--raise);
  color: var(--ink);
  border-radius: 11px;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  transition: 0.15s var(--ease);
}
.stepper button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.stepper .val {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--hair);
  font-size: 0.95rem;
}
.toggle:last-child {
  border-bottom: 0;
}
.switch {
  width: 46px;
  height: 27px;
  border-radius: 20px;
  border: 1px solid var(--hair-2);
  background: var(--paper-2);
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
  transition: 0.18s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--muted);
  transition: 0.2s var(--ease);
}
.switch.on {
  background: var(--accent);
  border-color: var(--accent);
}
.switch.on::after {
  inset-inline-start: calc(100% - 23px);
  background: #fff;
}

/* bookmarks list */
.bklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.bkitem {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--raise);
  cursor: pointer;
  text-align: start;
  font-family: var(--fa);
  color: inherit;
  transition: 0.15s var(--ease);
}
.bkitem:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--hair));
}
.bkitem .k {
  font-size: 0.7rem;
  color: var(--accent);
  border: 1px solid var(--accent-tint);
  background: var(--accent-tint);
  border-radius: 8px;
  padding: 0.15rem 0.5rem;
  flex: 0 0 auto;
}
.bkitem .tx {
  font-size: 0.9rem;
  color: var(--ink-2);
  font-weight: 300;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.bkitem .del {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.bkitem .del:hover {
  color: var(--accent);
}
.bkempty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
  font-size: 0.92rem;
  font-weight: 300;
}

/* ════════════════════════════════════════════════════════════════════════
   AUDIO MINI-PLAYER — docked above tab bar
   ════════════════════════════════════════════════════════════════════════ */
.miniplayer {
  position: fixed;
  inset-inline: 0;
  z-index: 55;
  bottom: calc(var(--safe-b) + 0px);
  transform: translateY(140%);
  transition: transform 0.3s var(--ease);
  pointer-events: none;
}
@media (max-width: 767.98px) {
  .miniplayer {
    bottom: calc(var(--safe-b) + 66px);
  }
}
.miniplayer.on {
  transform: translateY(0);
  pointer-events: auto;
}
body.immersive .miniplayer.on {
  transform: translateY(0);
}
.miniplayer .mp {
  max-width: 30rem;
  margin: 0 auto 0.6rem;
  background: var(--raise);
  border: 1px solid var(--hair);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  margin-inline: max(1rem, env(safe-area-inset-right));
}
@media (min-width: 768px) {
  .miniplayer .mp {
    margin-inline: auto;
  }
}
.mp .pp {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
[data-theme="ink"] .mp .pp {
  color: #08110e;
}
.mp .pp svg {
  width: 18px;
  height: 18px;
}
.mp .info {
  flex: 1;
  min-width: 0;
}
.mp .info b {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
}
.mp .info small {
  color: var(--muted);
  font-size: 0.72rem;
}
.mp .nx {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--hair-2);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.mp .nx:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.mp .cls {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.mp .bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  transform: transl(-50%, 20px);
  bottom: calc(var(--safe-b) + 90px);
  z-index: 95;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.84rem;
  padding: 0.6rem 1.1rem;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s var(--ease);
  transform: translateX(-50%) translateY(16px);
}
.toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* floating prev/next-section buttons — shown only while the surah top
   is scrolled out of view (see setupSectionNav) */
.sectionnav {
  position: fixed;
  z-index: 58;
  inset-inline-end: 0.95rem;
  bottom: calc(var(--safe-b) + 84px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(14px) scale(0.92);
  pointer-events: none;
  transition: 0.25s var(--ease);
}
.sectionnav.on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.secbtn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--hair);
  background: color-mix(in srgb, var(--raise) 90%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  color: var(--accent);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: 0.18s var(--ease);
}
.secbtn:hover {
  color: var(--accent-2);
  border-color: var(--accent);
}
.secbtn svg {
  width: 22px;
  height: 22px;
}
/* lift clear of the audio mini-player when it's docked */
body:has(.miniplayer.on) .sectionnav {
  bottom: calc(var(--safe-b) + 156px);
}

/* fade util */
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
#view-home,
#view-surah {
  animation: fade 0.32s var(--ease);
}

/* ════════════════════════════════════════════════════════════════════════
   MOTION — gated by reduced-motion
   ════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
    
