/* =========================================================
   Umrah — site styles
   ========================================================= */

/* ---------- Fonts (self-hosted, work offline) ---------- */
@font-face { font-family: "Manrope"; src: url(../fonts/manrope-latin-wght-normal.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(../fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(../fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(../fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Amiri"; src: url(../fonts/amiri-arabic-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Amiri"; src: url(../fonts/amiri-arabic-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Amiri Quran"; src: url(../fonts/amiri-quran-arabic-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF; }

/* ---------- Tokens ---------- */
:root {
  --bg: #0B0F19;
  --bg-2: #0E1320;
  --surface: #121A2E;
  --surface-2: #1A2440;
  --text: #F4EFE6;
  --muted: #A7ADBB;
  --faint: #6F7688;
  --gold: #C9A55C;
  --gold-soft: #E6CF9A;
  --gold-deep: #9A7733;
  --line: rgba(201, 165, 92, .26);
  --line-2: rgba(244, 239, 230, .08);
  --green: #2F8F6A;
  --callout: #1B2336;
  --card: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  --glass: rgba(11, 15, 25, .62);
  --shadow: 0 30px 80px -30px rgba(0,0,0,.65);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.36, .64, 1);
  --ar-size: 1.9rem;
  --gutter: 16px;
  --col: min(760px, calc(100% - 2 * var(--gutter)));
  --wide: min(1240px, calc(100% - 2 * var(--gutter)));
  --dock-h: 0px;
  --paper: url(../img/texture-paper.webp);
  --kiswah: url(../img/texture-kiswah.webp);
  --goldtex: url(../img/texture-gold.webp);
  color-scheme: dark;
}
:root[data-theme="day"] {
  --bg: #F6F2EA;
  --bg-2: #EFE9DE;
  --surface: #FFFFFF;
  --surface-2: #EFEAE0;
  --text: #14182A;
  --muted: #555B6C;
  --faint: #8A8F9C;
  --gold: #9A7733;
  --gold-soft: #7C5E22;
  --gold-deep: #6E531E;
  --line: rgba(154, 119, 51, .30);
  --line-2: rgba(20, 24, 42, .09);
  --callout: #ECE8E0;
  --card: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  --glass: rgba(246, 242, 234, .74);
  --shadow: 0 30px 70px -34px rgba(60, 45, 20, .35);
  color-scheme: light;
}
:root[data-ar="s"] { --ar-size: 1.55rem; }
:root[data-ar="l"] { --ar-size: 2.45rem; }
@media (min-width: 900px) {
  :root { --ar-size: 2.3rem; --gutter: 32px; }
  :root[data-ar="s"] { --ar-size: 1.85rem; }
  :root[data-ar="l"] { --ar-size: 2.9rem; }
}
@media (max-width: 899px) { :root { --dock-h: 76px; } }
@media (max-width: 1099px) { html { scroll-padding-top: 132px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
html.rm { scroll-behavior: auto; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font-family: "Manrope", "Amiri", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16.5px; line-height: 1.6; font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom));
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[lang="ar"] { font-family: "Amiri", serif; }
h1, h2, h3, p { margin: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--gold); color: #0B0F19; padding: 10px 14px; border-radius: 10px; font-weight: 700; text-decoration: none; transition: top .2s; }
.skip:focus { top: 12px; }
.noscript { padding: 24px; text-align: center; }
.ic { width: 22px; height: 22px; flex: none; }
.lbl { font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.foil {
  background-image: linear-gradient(105deg, transparent 38%, rgba(255,247,222,.85) 50%, transparent 62%), var(--goldtex);
  background-size: 250% 100%, 420px auto;
  background-position: 130% 0, center;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
:root[data-theme="day"] .foil { filter: saturate(1.1) brightness(.78) contrast(1.15); }

/* ---------- Ambient layers ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(4) infinite;
}
:root[data-theme="day"] .grain { opacity: .04; }
@keyframes grain { 0% { transform: translate(0,0) } 25% { transform: translate(-3%, 2%) } 50% { transform: translate(2%, -3%) } 75% { transform: translate(-2%, -1%) } 100% { transform: translate(0,0) } }
.spot { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(201,165,92,.07), transparent 70%); }
.fine .spot { opacity: 1; }
:root[data-theme="day"] .spot { display: none; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120; pointer-events: none; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 12px rgba(201,165,92,.6); }

/* ---------- Preloader (first visit only) ---------- */
.preloader { display: none; }
.first-visit .preloader {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 300; background: #0B0F19;
  animation: pre-out .6s var(--ease) 1.25s forwards;
}
.pre-star { width: 84px; height: 84px; overflow: visible; }
.pre-star path { fill: rgba(201,165,92,0); stroke: #C9A55C; stroke-width: .6; stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linejoin: round;
  animation: pre-draw .95s var(--ease-io) .1s forwards, pre-fill .5s ease .85s forwards; }
@keyframes pre-draw { to { stroke-dashoffset: 0; } }
@keyframes pre-fill { to { fill: rgba(201,165,92,.18); } }
@keyframes pre-out { 0% { opacity: 1; } 100% { opacity: 0; visibility: hidden; transform: scale(1.04); } }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  transition: background-color .4s var(--ease), backdrop-filter .4s, border-color .4s, transform .5s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); border-bottom-color: var(--line-2); }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.hero-on .brand, .hero-on .tool-btn { color: #F4EFE6; }
.brand .ic { width: 22px; height: 22px; color: var(--gold); }
.brand-ar { font-size: 1.35rem; line-height: 1; color: var(--gold-soft); transform: translateY(1px); }
.brand-en { font-family: "Cormorant", serif; font-weight: 600; font-size: 1.25rem; letter-spacing: .04em; }
.topnav { display: none; }
.top-tools { display: flex; gap: 6px; }
.tool-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.03);
  transition: background-color .25s, border-color .25s, transform .25s var(--spring);
}
.tool-btn:hover { border-color: var(--line); background: rgba(201,165,92,.08); }
.tool-btn:active { transform: scale(.94); }
.tool-btn .ic { width: 20px; height: 20px; }
.aa { font-family: "Cormorant", serif; font-weight: 600; font-size: 1.15rem; line-height: 1; }
.ic-sun { display: none; }
:root[data-theme="day"] .ic-sun { display: block; }
:root[data-theme="day"] .ic-moon { display: none; }
@media (min-width: 900px) {
  .topnav {
    display: flex; gap: 2px; padding: 5px; border-radius: 999px;
    background: var(--glass); border: 1px solid var(--line-2);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  }
  .topbar.scrolled .topnav { background: transparent; border-color: transparent; }
  .nav-btn { padding: 8px 16px; border-radius: 999px; font-size: .86rem; font-weight: 600; letter-spacing: .01em; color: var(--muted); transition: color .25s, background-color .25s; }
  .hero-on .nav-btn { color: rgba(244,239,230,.82); }
  .nav-btn:hover { color: var(--text); background: rgba(201,165,92,.1); }
  .hero-on .nav-btn:hover { color: #fff; }
}

/* Settings popover */
.settings {
  position: fixed; z-index: 260; top: calc(62px + env(safe-area-inset-top)); right: var(--gutter);
  width: 260px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); display: grid; gap: 12px;
  animation: pop .3s var(--spring);
}
.settings[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .9rem; font-weight: 600; }
.switch { width: 44px; height: 26px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); position: relative; transition: background-color .25s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .3s var(--spring), background-color .25s; }
.switch[aria-checked="true"] { background: rgba(201,165,92,.25); border-color: var(--line); }
.switch[aria-checked="true"] span { transform: translateX(18px); background: var(--gold); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { width: 34px; height: 30px; font-weight: 700; font-size: .8rem; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--gold); color: #0B0F19; }

/* ---------- Hero ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; isolation: isolate; color: #F4EFE6; background: #0B0F19; }
.hero-media { position: absolute; inset: 0; }
.hero-bg { position: absolute; inset: -6% 0 -2%; will-change: transform; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg img { animation: kenburns 26s ease-in-out infinite alternate; transform-origin: 50% 60%; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.09); } }
.hero-arch { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; will-change: transform; pointer-events: none; filter: brightness(.9); }
.dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-shade { position: absolute; inset: 0; background:
  radial-gradient(120% 70% at 50% 100%, rgba(11,15,25,.92) 12%, rgba(11,15,25,0) 62%),
  linear-gradient(180deg, rgba(11,15,25,.55) 0%, rgba(11,15,25,0) 22%, rgba(11,15,25,0) 55%, rgba(11,15,25,.95) 100%); }
.hero-copy { position: absolute; left: 0; right: 0; bottom: max(8vh, 84px); text-align: center; padding: 0 var(--gutter); z-index: 2; }
.hero-title { display: grid; justify-items: center; gap: 2px; font-weight: 400; }
.hero-ar { font-family: "Amiri", serif; font-weight: 700; font-size: clamp(4.4rem, 20vw, 8.6rem); line-height: 1.12; padding: 0 .08em; filter: drop-shadow(0 10px 40px rgba(0,0,0,.55)); }
.hero-ar.foil { animation: shine 7s var(--ease-io) 2.2s infinite; }
@keyframes shine { 0%, 55% { background-position: 130% 0, center; } 100% { background-position: -30% 0, center; } }
.hero-en { font-family: "Cormorant", serif; font-weight: 500; font-size: clamp(2rem, 7vw, 3.4rem); letter-spacing: .14em; text-transform: uppercase; margin-top: -.25em; padding-left: .14em; }
.hero-line { margin-top: 14px; font-size: clamp(.78rem, 2.6vw, .92rem); font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: rgba(244,239,230,.78); }
.js .hero-ar, .js .hero-en, .js .hero-line { opacity: 0; transform: translateY(18px); filter: blur(8px); animation: rise 1.3s var(--ease) forwards; }
.js .hero-ar { animation: rise 1.4s var(--ease) calc(var(--intro, .15s)) forwards, shine 7s var(--ease-io) 3s infinite; }
.js .hero-en { animation-delay: calc(var(--intro, .15s) + .25s); }
.js .hero-line { animation-delay: calc(var(--intro, .15s) + .45s); }
.first-visit { --intro: 1.35s; }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
.scroll-cue { position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); width: 1px; height: 54px; transform: translateX(-50%); z-index: 2; overflow: hidden; }
.scroll-cue span { position: absolute; inset: 0; background: linear-gradient(180deg, transparent, var(--gold-soft)); animation: cue 2.2s var(--ease-io) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }
@media (max-width: 720px) {
  .hero-arch { display: none; }
  .hero-copy { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .hero-en { font-size: 1.85rem; }
  .hero-line { font-size: .7rem; letter-spacing: .13em; margin-top: 8px; }
  .scroll-cue { display: none; }
  .hero-shade { background: radial-gradient(130% 55% at 50% 100%, rgba(11,15,25,.95) 25%, rgba(11,15,25,0) 70%), linear-gradient(180deg, rgba(11,15,25,.55) 0%, rgba(11,15,25,0) 18%, rgba(11,15,25,0) 60%, rgba(11,15,25,.96) 100%); }
}

/* ---------- Section titles & reveals ---------- */
.section-title { font-family: "Cormorant", serif; font-weight: 600; font-size: clamp(2.5rem, 8vw, 4.4rem); line-height: 1; letter-spacing: -.01em; }
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Roadmap ---------- */
.roadmap { position: relative; width: var(--wide); margin: 0 auto; padding: clamp(72px, 12vw, 140px) 0 clamp(40px, 8vw, 90px); }
.rm-top { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: clamp(28px, 5vw, 52px); }
.bulk { display: inline-flex; align-items: center; gap: 10px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.bulk button { padding: 6px 2px; color: var(--muted); border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.bulk button:hover { color: var(--gold-soft); border-color: var(--line); }
.rm-grid { position: relative; display: grid; gap: 14px; }
.rm-card {
  position: relative; border-radius: 22px; padding: 20px 18px 16px;
  background: var(--card); border: 1px solid var(--line-2);
  transition: border-color .5s var(--ease), box-shadow .5s var(--ease), transform .5s var(--ease), opacity 1s var(--ease);
}
.rm-card.active { border-color: var(--line); box-shadow: 0 0 0 1px rgba(201,165,92,.12), 0 20px 60px -30px rgba(201,165,92,.35); }
.rm-head { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "num name ar" "num tag tag"; column-gap: 14px; align-items: baseline; width: 100%; text-align: left; }
.rm-num { grid-area: num; font-variant-numeric: lining-nums; font-feature-settings: "lnum"; font-family: "Cormorant", serif; font-weight: 600; font-size: 3.1rem; line-height: .9; align-self: center; }
.rm-name { grid-area: name; font-family: "Cormorant", serif; font-weight: 600; font-size: 1.85rem; line-height: 1.05; }
.rm-ar { grid-area: ar; font-size: 1.35rem; color: var(--gold-soft); line-height: 1; }
.rm-tag { grid-area: tag; font-size: .86rem; color: var(--muted); margin-top: 2px; }
.rm-steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.rm-steps button {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.025); font-size: .82rem; font-weight: 600; color: var(--text);
  transition: border-color .25s, background-color .25s, transform .3s var(--spring);
}
.rm-steps button:hover { border-color: var(--line); background: rgba(201,165,92,.09); }
.rm-steps button:active { transform: scale(.96); }
.rm-node { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 99px; background: rgba(201,165,92,.14); color: var(--gold); font-size: .7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rm-steps button.done .rm-node { background: var(--gold); color: #0B0F19; }
@media (min-width: 900px) {
  .rm-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .rm-grid::before { content: ""; position: absolute; top: 49px; left: 6%; right: 6%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 12%, var(--gold) 88%, transparent); transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.6s var(--ease) .2s; opacity: .55; }
  .rm-grid.in::before { transform: scaleX(1); }
  .rm-card { padding: 24px 22px 22px; background: var(--bg); background-image: var(--card); }
  .rm-card:hover { transform: translateY(-4px); border-color: var(--line); }
  .rm-head { grid-template-columns: 1fr; grid-template-areas: "num" "ar" "name" "tag"; row-gap: 6px; }
  .rm-num { font-size: 3.6rem; }
  .rm-ar { font-size: 1.5rem; margin-top: 6px; }
  .rm-steps { display: grid; gap: 0; margin-top: 18px; position: relative; }
  .rm-steps::before { content: ""; position: absolute; left: 20px; top: 16px; bottom: 16px; width: 1px; background: var(--line); }
  .rm-steps button { width: 100%; border: 0; background: none; padding: 6px 4px; border-radius: 10px; gap: 12px; font-size: .9rem; position: relative; }
  .rm-steps button:hover { background: rgba(201,165,92,.07); }
  .rm-node { background: var(--bg); border: 1px solid var(--line); min-width: 34px; height: 24px; }
}

/* ---------- Stations ---------- */
.station { position: relative; padding-bottom: clamp(70px, 12vw, 150px); }
.station::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .9; background: radial-gradient(70% 45% at 85% 30%, var(--glow, transparent), transparent 70%), radial-gradient(60% 40% at 5% 80%, var(--glow2, transparent), transparent 70%); }
.station[data-station="ihram"] { --glow: rgba(230, 160, 90, .07); --glow2: rgba(201,165,92,.04); }
.station[data-station="tawaf"] { --glow: rgba(201, 165, 92, .08); --glow2: rgba(120, 140, 200, .05); }
.station[data-station="sai"] { --glow: rgba(47, 143, 106, .09); --glow2: rgba(201,165,92,.035); }
.station[data-station="hair"] { --glow: rgba(244, 220, 180, .07); --glow2: rgba(230,170,120,.05); }
.station-kiswah { position: absolute; inset: 0; pointer-events: none; background: var(--kiswah) 0 0 / 360px; opacity: .07; mix-blend-mode: screen; }
:root[data-theme="day"] .station-kiswah { display: none; }

.st-hero { position: relative; height: min(86svh, 820px); min-height: 440px; overflow: hidden; color: #F4EFE6; }
.st-media { position: absolute; inset: 0; clip-path: inset(var(--clip, 0%) round var(--rad, 0px)); transform: scale(var(--sc, 1)); transform-origin: 50% 40%; will-change: clip-path, transform; }
.st-media picture { position: absolute; inset: -8% 0; }
.st-media img { width: 100%; height: 100%; object-fit: cover; transform: translateY(var(--py, 0px)); will-change: transform; background-size: cover; }
.st-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,15,25,.35) 0%, rgba(11,15,25,.05) 35%, rgba(11,15,25,.35) 62%, var(--bg) 100%); }
.st-title { position: absolute; left: 0; right: 0; bottom: clamp(36px, 7vw, 80px); width: var(--col); margin: 0 auto; }
.st-num { font-variant-numeric: lining-nums; font-feature-settings: "lnum"; font-family: "Cormorant", serif; font-weight: 600; font-size: clamp(1.2rem, 3vw, 1.5rem); letter-spacing: .18em; display: inline-flex; align-items: center; gap: 12px; }
.st-num::after { content: ""; width: 48px; height: 1px; background: currentColor; opacity: .6; }
.st-name { display: flex; align-items: baseline; gap: .35em; flex-wrap: wrap; font-family: "Cormorant", serif; font-weight: 600; font-size: clamp(3.4rem, 13vw, 7rem); line-height: .95; margin-top: 10px; letter-spacing: -.01em; text-shadow: 0 8px 40px rgba(0,0,0,.45); }
.st-name .ch { display: inline-block; }
.st-ar { font-family: "Amiri", serif; font-weight: 400; font-size: .42em; color: #E6CF9A; letter-spacing: 0; }
.st-tag { margin-top: 12px; font-size: clamp(.95rem, 2.8vw, 1.1rem); color: rgba(244,239,230,.86); max-width: 34ch; }
.js .st-name .ch { opacity: 0; transform: translateY(.45em) rotate(4deg); transition: opacity .9s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--i) * 45ms + .1s); }
.js .st-hero.in .st-name .ch { opacity: 1; transform: none; }

.st-body { position: relative; width: var(--col); margin: 0 auto; padding-top: 18px; }
.st-controls { display: flex; justify-content: flex-end; margin-bottom: 6px; }

/* Steps list + gold thread */
.steps { position: relative; list-style: none; margin: 0; padding: 0; }
.thread { list-style: none; position: absolute; left: 21px; top: 30px; bottom: 30px; width: 1px; background: var(--line-2); pointer-events: none; }
.thread i { position: absolute; inset: 0; background: linear-gradient(180deg, var(--gold-soft), var(--gold)); transform-origin: 50% 0; transform: scaleY(var(--fill, 0)); box-shadow: 0 0 10px rgba(201,165,92,.5); }
.step { position: relative; border-bottom: 1px solid var(--line-2); }
.step:last-child { border-bottom: 0; }
.step-head { display: grid; grid-template-columns: 44px 1fr 28px; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 18px 0; min-height: 76px; }
.node {
  position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); color: var(--gold);
  font-size: .74rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s, box-shadow .5s var(--ease), transform .4s var(--spring);
}
.step.passed .node { border-color: var(--gold); }
.step.here .node { box-shadow: 0 0 0 6px rgba(201,165,92,.08); }
.step.is-open .node { background: var(--gold); color: #0B0F19; border-color: var(--gold); box-shadow: 0 0 0 6px rgba(201,165,92,.14), 0 0 24px rgba(201,165,92,.35); transform: scale(1.04); }
.step-text { display: grid; gap: 2px; min-width: 0; }
.step-title { font-weight: 700; font-size: 1.07rem; line-height: 1.3; transition: color .25s; }
.step-sum { color: var(--muted); font-size: .94rem; line-height: 1.45; }
.step-head:hover .step-title { color: var(--gold-soft); }
.chev { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); transition: transform .45s var(--ease), border-color .3s, background-color .3s; }
.chev::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--gold); border-bottom: 1.6px solid var(--gold); transform: translate(-1px, 0) rotate(-45deg); }
.is-open > .step-head .chev, .is-open > .tg-head .chev, .is-open > .hd-head .chev { transform: rotate(90deg); border-color: var(--line); background: rgba(201,165,92,.08); }

.step-panel, .tg-panel, .hd-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease); }
.is-open > .step-panel, .is-open > .tg-panel, .is-open > .hd-panel { grid-template-rows: 1fr; }
.step-inner, .tg-inner, .hd-inner { min-height: 0; overflow: hidden; }
.step-inner > * { opacity: 0; transform: translateY(10px); transition: opacity .45s var(--ease), transform .6s var(--ease); }
.is-open > .step-panel > .step-inner > * { opacity: 1; transform: none; }
.is-open > .step-panel > .step-inner > *:nth-child(1) { transition-delay: .06s; }
.is-open > .step-panel > .step-inner > *:nth-child(2) { transition-delay: .1s; }
.is-open > .step-panel > .step-inner > *:nth-child(3) { transition-delay: .14s; }
.is-open > .step-panel > .step-inner > *:nth-child(4) { transition-delay: .18s; }
.is-open > .step-panel > .step-inner > *:nth-child(n+5) { transition-delay: .22s; }
.no-anim, .no-anim * { transition: none !important; }
.step-inner { padding-left: 58px; }
.step-inner > *:last-child { margin-bottom: 26px; }
.step-inner > * + * { margin-top: 18px; }
@media (max-width: 480px) { .step-inner { padding-left: 0; } .step.is-open > .step-panel { position: relative; z-index: 2; background: var(--bg); } .step-head { grid-template-columns: 40px 1fr 26px; gap: 12px; } .node { width: 40px; height: 40px; font-size: .7rem; } .thread { left: 19.5px; } }

/* Content blocks */
.details { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.details li { position: relative; padding-left: 22px; line-height: 1.55; }
.details li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); border-radius: 1px; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .rules { grid-template-columns: 1fr 1fr; } }
.rules li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-2); font-weight: 600; font-size: .95rem; }
.rules .ic { width: 22px; height: 22px; color: #D98B7A; }
:root[data-theme="day"] .rules .ic { color: #B0503C; }
.fig { margin: 0; position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow); transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease); background: var(--surface); }
.fig picture { display: block; height: 100%; }
.fig img { width: 100%; height: 100%; object-fit: cover; background-size: cover; }
.fig.portrait { max-width: 440px; aspect-ratio: 4 / 5; }
.fig.square { max-width: 440px; aspect-ratio: 1; }
.fig.wide { aspect-ratio: 16 / 9; }
.fig::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(500px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.12), transparent 45%); opacity: 0; transition: opacity .4s; }
.fig:hover::after { opacity: 1; }
.fig img { transition: transform 8s var(--ease); }
.is-open .fig img { transform: scale(1.06); }
.fig.pan img { object-position: 50% 100%; transition: object-position 6s var(--ease), transform 8s var(--ease); }
.is-open .fig.pan img { object-position: 50% 0%; transform: none; }
.fig.drift img { transform: scale(1.12) translateX(3%); transition: transform 14s linear; }
.is-open .fig.drift img { transform: scale(1.12) translateX(-3%); }
.fig.pour::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(90% 70% at 50% 30%, rgba(255,200,110,.32), transparent 70%); opacity: 0; transition: opacity 2.2s var(--ease) .3s; mix-blend-mode: screen; }
.is-open .fig.pour::before { opacity: 1; }
.fig.glint::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(110deg, transparent 40%, rgba(255,240,200,.35) 50%, transparent 60%); transform: translateX(-120%); }
.is-open .fig.glint::before { animation: glint 1.8s var(--ease-io) .5s 1 forwards; }
@keyframes glint { to { transform: translateX(120%); } }
.qrefs { font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }

/* Nested toggles */
.tg { border: 1px solid var(--line-2); border-radius: 16px; background: rgba(255,255,255,.018); transition: border-color .3s, background-color .3s; }
:root[data-theme="day"] .tg { background: rgba(255,255,255,.5); }
.tg.is-open { border-color: var(--line); }
.tg-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 14px 13px 16px; text-align: left; min-height: 52px; }
.tg-label { font-weight: 700; font-size: .93rem; flex: 1; }
.tg-count { font-size: .72rem; font-weight: 800; color: var(--gold); background: rgba(201,165,92,.12); border-radius: 99px; padding: 2px 8px; }
.tg-head .chev { width: 24px; height: 24px; }
.tg-body { padding: 2px 16px 16px; display: grid; gap: 12px; }
.tg .tg { background: transparent; }
.mini-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mini-table th { text-align: left; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); padding: 6px 8px 8px 0; font-weight: 700; }
.mini-table td { padding: 10px 8px 10px 0; border-top: 1px solid var(--line-2); vertical-align: top; }
.mini-table td:first-child { font-weight: 700; padding-right: 16px; }

/* Hadith toggle (house format) */
.hd { border-top: 1px solid var(--line-2); }
.hd:first-child { border-top: 0; }
.hd-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 0; text-align: left; min-height: 50px; }
.hd-title { flex: 1; min-width: 0; font-weight: 600; font-size: .92rem; }
.hd-ref { font-size: .74rem; color: var(--faint); font-weight: 600; text-align: right; max-width: 42%; line-height: 1.3; }
.hd-tag { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #E0A96D; border: 1px solid rgba(224,169,109,.4); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.hd-head .chev { width: 22px; height: 22px; }
.hd-body { padding: 0 0 18px; display: grid; gap: 14px; }
.hd-en { font-family: "Cormorant", serif; font-style: italic; font-weight: 500; font-size: 1.22rem; line-height: 1.5; }
.callout { background: var(--callout); border-radius: 14px; padding: 16px 18px; font-size: calc(var(--ar-size) * .7); line-height: 2.05; text-align: right; border: 1px solid var(--line-2); }
.hd-sec { display: grid; gap: 4px; font-size: .9rem; }
.hd-sec b { font-weight: 700; }
.hd-sec ul { margin: 2px 0 0; padding-left: 18px; }
.hd-sec li { margin: 2px 0; }
.hd-note { font-size: .86rem; color: var(--muted); font-style: italic; }
.dorar { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; color: var(--gold-soft); text-decoration: none; border-bottom: 1px solid var(--line); width: fit-content; padding-bottom: 1px; }
.dorar .ic { width: 15px; height: 15px; }
.dorar:hover { color: var(--gold); }

/* ---------- Du'a card ---------- */
.dua {
  position: relative; margin: 0; border-radius: 22px; padding: 20px 18px 16px;
  background: var(--card); border: 1px solid var(--line); overflow: hidden; isolation: isolate;
}
.dua::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--paper) 0 0 / 320px; opacity: .07; mix-blend-mode: screen; }
:root[data-theme="day"] .dua::before { opacity: .45; mix-blend-mode: multiply; }
.dua::after { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); opacity: .7; }
.dua-when { font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 10px; }
.dua-when::before { content: ""; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); flex: none; }
.dua-how { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.dua-how span { font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); }
.dua-how b { color: var(--gold); margin-right: 5px; }
.dua-part + .dua-part { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.ar {
  margin-top: 14px; font-family: "Amiri", serif; font-size: var(--ar-size); line-height: 2.05; text-align: center; color: var(--text);
  word-spacing: .08em;
}
.ar.quran { font-family: "Amiri Quran", "Amiri", serif; line-height: 2.25; }
.ar.quran::before, .ar.quran::after { color: var(--gold); font-family: "Amiri", serif; }
.ar.quran::before { content: "﴿"; margin-left: .15em; }
.ar.quran::after { content: "﴾"; margin-right: .15em; }
.ar .w { display: inline-block; cursor: pointer; border-radius: 6px; transition: color .25s, background-color .25s; padding: 0 .03em; }
.ar .w:hover { color: var(--gold-soft); }
.ar .w.hl { color: var(--gold-soft); background: rgba(201,165,92,.12); }
.ar.then { margin-top: 4px; }
.js .dua .ar .w { opacity: 0; filter: blur(6px); transform: translateY(6px); transition: opacity .7s var(--ease), filter .7s var(--ease), transform .7s var(--ease), color .25s, background-color .25s; transition-delay: calc(var(--i) * 45ms); }
.js .dua.seen .ar .w { opacity: 1; filter: none; transform: none; }
.tr { margin-top: 8px; text-align: center; font-style: italic; color: var(--muted); font-size: .98rem; }
.mn { margin-top: 6px; text-align: center; font-size: 1rem; line-height: 1.55; }
.hide-tr .tr { display: none; }
.hide-mn .mn { display: none; }
.dua-note { margin-top: 12px; font-size: .84rem; color: var(--muted); text-align: center; }
.dua .tg { margin-top: 14px; }
.wbw { display: flex; flex-wrap: wrap; gap: 8px; direction: rtl; }
.wbw .chip { direction: ltr; display: grid; justify-items: center; gap: 2px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); transition: border-color .3s, background-color .3s, transform .3s var(--spring); }
.wbw .chip.hl { border-color: var(--gold); background: rgba(201,165,92,.12); transform: translateY(-2px); }
.wbw .chip-ar { font-family: "Amiri", serif; font-size: 1.35rem; line-height: 1.5; }
.wbw .chip-en { font-size: .78rem; color: var(--muted); font-weight: 600; }
.dua-foot { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.src { font-size: .8rem; font-weight: 700; color: var(--muted); text-align: left; border-bottom: 1px dotted var(--line); padding-bottom: 1px; transition: color .2s; }
.src:hover { color: var(--gold-soft); }
.src-plain { font-size: .8rem; font-weight: 700; color: var(--muted); }
.acts { display: flex; gap: 6px; }
.act { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); font-size: .78rem; font-weight: 700; color: var(--muted); transition: color .2s, border-color .2s, background-color .2s, transform .25s var(--spring); }
.act .ic { width: 16px; height: 16px; }
.act:hover { color: var(--text); border-color: var(--line); background: rgba(201,165,92,.08); }
.act:active { transform: scale(.95); }
.act.ok { color: var(--gold-soft); border-color: var(--line); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 14px; font-weight: 700; font-size: .95rem; transition: transform .3s var(--spring), background-color .25s, border-color .25s, box-shadow .3s, color .25s; }
.btn:active { transform: scale(.96); }
.btn.gold { background: linear-gradient(180deg, #D8B96F, #B8924A); color: #0B0F19; box-shadow: 0 10px 30px -12px rgba(201,165,92,.7), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.gold:hover { box-shadow: 0 14px 38px -12px rgba(201,165,92,.85), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.ghost { border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.02); }
.btn.ghost:hover { background: rgba(201,165,92,.08); }
.btn.small { height: 40px; padding: 0 14px; font-size: .85rem; }
.btn.big { height: 64px; font-size: 1.05rem; border-radius: 18px; }
.btn .ic { width: 20px; height: 20px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.chip-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; border: 1px solid rgba(47,143,106,.45); background: rgba(47,143,106,.1); font-size: .84rem; font-weight: 700; color: var(--text); text-align: left; }
.chip-btn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #45B889; box-shadow: 0 0 10px #45B889; flex: none; }

/* ---------- Tawaf counter ---------- */
.tc { display: grid; justify-items: center; gap: 16px; padding: 8px 0; }
.tc-dial { position: relative; width: min(100%, 380px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #0B0F19; box-shadow: 0 0 0 1px var(--line), 0 30px 80px -30px rgba(0,0,0,.7); }
.tc-photo { position: absolute; inset: 0; background-size: cover; background-position: center; filter: saturate(.5) brightness(.4) contrast(1.1) blur(1.2px); transform: scale(1.04); }
.tc-dial::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(11,15,25,0) 30%, rgba(11,15,25,.8) 72%); pointer-events: none; }
.tc-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; overflow: visible; }
.tc-svg .seg-base { fill: none; stroke: rgba(230,207,154,.16); stroke-width: 10; stroke-linecap: round; }
.tc-svg .seg-fill { fill: none; stroke: url(#tcGold); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s var(--ease); filter: drop-shadow(0 0 6px rgba(201,165,92,.6)); }
.tc-svg .seg-fill.on { stroke-dashoffset: 0; }
.tc-svg .rabbana { fill: none; stroke: #45B889; stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .9; }
.tc-svg .rabbana-t { fill: #7FD3AE; font: 700 10.5px "Manrope", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.tc-svg .kaaba { fill: #06080D; stroke: #C9A55C; stroke-width: 1.4; }
.tc-svg .kaaba-in { fill: none; stroke: rgba(201,165,92,.45); stroke-width: .8; }
.tc-svg .door { fill: #C9A55C; }
.tc-svg .hijr { fill: none; stroke: #EDE7DA; stroke-width: 3; stroke-linecap: round; }
.tc-svg .maqam { fill: #E6CF9A; stroke: #9A7733; stroke-width: 1; }
.tc-svg .stone { fill: #D9DDE3; stroke: #fff; stroke-width: 1.2; }
.tc-svg .startline { stroke: #45B889; stroke-width: 2; stroke-dasharray: 3 4; }
.tc-svg .dirarrow { fill: none; stroke: rgba(244,239,230,.55); stroke-width: 1.4; stroke-linecap: round; }
.tc-svg .hot { cursor: pointer; }
.tc-svg .hot text { fill: #F4EFE6; font: 700 11.5px "Manrope", sans-serif; letter-spacing: .02em; paint-order: stroke; stroke: rgba(11,15,25,.85); stroke-width: 3.5px; transition: fill .25s; }
.tc-svg .hot:hover text, .tc-svg .hot.sel text { fill: #E6CF9A; }
.tc-svg .hot .hit { fill: transparent; }
.tc-svg .orbit { transform-origin: 200px 200px; animation: orbit 14s linear infinite; }
@keyframes orbit { to { transform: rotate(-360deg); } }
.tc-svg .orb { fill: #FFE7B0; filter: drop-shadow(0 0 6px #E6CF9A) drop-shadow(0 0 14px rgba(201,165,92,.8)); }
.tc-svg .orb-t { fill: #E6CF9A; }
.tc-cap { min-height: 3.2em; max-width: 380px; text-align: center; font-size: .92rem; color: var(--muted); padding: 0 8px; }
.tc-cap b { color: var(--text); }
.tc-count { display: flex; align-items: baseline; gap: 10px; }
.odo { font-feature-settings: "lnum"; font-variant-numeric: lining-nums tabular-nums; height: 1.08em; overflow: hidden; font-family: "Cormorant", serif; font-weight: 600; font-size: 4.4rem; line-height: 1.08; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.odo-col { display: grid; transition: transform .8s var(--spring); transform: translateY(calc(var(--n, 0) * -1.08em)); }
.tc-of { font-feature-settings: "lnum"; font-family: "Cormorant", serif; font-size: 1.6rem; color: var(--muted); }
.tc-tag { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); min-height: 1.2em; }
.tc-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tc-actions .btn.gold { min-width: 190px; }
.tc-done { display: grid; justify-items: center; gap: 10px; text-align: center; font-family: "Cormorant", serif; font-size: 1.7rem; font-weight: 600; color: var(--gold-soft); }
.tc-done[hidden] { display: none; }
.tc.complete .tc-dial { box-shadow: 0 0 0 1px var(--gold), 0 0 60px -10px rgba(201,165,92,.7); }
.burst { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.burst i { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: #F2D48E; box-shadow: 0 0 8px #E6CF9A; animation: burst 1.2s var(--ease) forwards; }
@keyframes burst { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(.2); opacity: 0; } }

/* ---------- Sa'i track ---------- */
.sai { display: grid; gap: 16px; justify-items: center; padding: 8px 0; }
.sai-head { text-align: center; }
.sai-lap { font-feature-settings: "lnum"; font-family: "Cormorant", serif; font-weight: 600; font-size: 2.4rem; line-height: 1.1; color: var(--gold-soft); }
.sai-dir { font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.sai-track { position: relative; width: min(100%, 380px); height: 380px; display: grid; }
.sai-rail { position: absolute; left: 50%; top: 56px; bottom: 56px; width: 4px; transform: translateX(-50%); border-radius: 4px; background: linear-gradient(180deg, rgba(230,207,154,.25), rgba(230,207,154,.12)); }
.sai-green { position: absolute; left: 50%; top: calc(56px + (100% - 112px) * .32); height: calc((100% - 112px) * .18); width: 64px; transform: translateX(-50%); border-radius: 14px; background: rgba(47,143,106,.18); border: 1px solid rgba(69,184,137,.5); box-shadow: 0 0 30px rgba(69,184,137,.25), inset 0 0 18px rgba(69,184,137,.2); animation: greenpulse 3s ease-in-out infinite; }
.sai-green span { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #7FD3AE; }
@keyframes greenpulse { 50% { box-shadow: 0 0 44px rgba(69,184,137,.4), inset 0 0 24px rgba(69,184,137,.3); } }
.sai-hill { position: absolute; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 0; text-align: center; }
.sai-hill svg { width: 110px; height: 38px; }
.sai-hill path { fill: rgba(201,165,92,.14); stroke: var(--gold); stroke-width: 1.2; }
.sai-hill b { font-family: "Cormorant", serif; font-weight: 600; font-size: 1.25rem; line-height: 1; }
.sai-hill small { font-family: "Amiri", serif; font-size: 1rem; color: var(--gold-soft); line-height: 1.2; }
.sai-hill.safa { top: 0; }
.sai-hill.safa svg { order: 2; }
.sai-hill.marwah { bottom: 0; }
.sai-hill.at path { fill: rgba(201,165,92,.35); }
.sai-marker { position: absolute; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFF1C9, #D2AE62); box-shadow: 0 0 0 5px rgba(201,165,92,.2), 0 0 24px rgba(230,207,154,.8); z-index: 2; }
.sai-dots { display: flex; gap: 8px; }
.sai-dots i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line); transition: background-color .4s, transform .4s var(--spring); }
.sai-dots i.on { background: var(--gold); border-color: var(--gold); transform: scale(1.15); }
.sai-arrive { min-height: 2.6em; text-align: center; max-width: 360px; font-size: .92rem; }
.sai-arrive button { color: var(--text); border-bottom: 1px dotted var(--line); font-weight: 600; }
@media (min-width: 900px) {
  .sai-track { width: 100%; max-width: 640px; height: 200px; }
  .sai-rail { left: 90px; right: 90px; top: 50%; bottom: auto; width: auto; height: 4px; transform: translateY(-50%); background: linear-gradient(90deg, rgba(230,207,154,.25), rgba(230,207,154,.12)); }
  .sai-green { top: 50%; left: calc(90px + (100% - 180px) * .32); width: calc((100% - 180px) * .18); height: 60px; transform: translateY(-50%); }
  .sai-green span { left: 50%; top: calc(100% + 10px); transform: translateX(-50%); }
  .sai-hill { top: 50% !important; bottom: auto !important; transform: translateY(-50%); }
  .sai-hill.safa { left: 0; }
  .sai-hill.safa svg { order: 0; }
  .sai-hill.marwah { left: auto; right: 0; }
  .sai-marker { top: 50% !important; margin: -11px 0 0 -11px; }
}

/* ---------- Finale & footer ---------- */
.finale { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; color: #F4EFE6; isolation: isolate; }
.finale-bg, .finale-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.finale-bg img { filter: brightness(.5) saturate(.7) sepia(.15); transform: scale(1.08); transition: filter 4.5s var(--ease), transform 7s var(--ease); }
.finale.lit .finale-bg img { filter: brightness(.92) saturate(1.05) sepia(0); transform: scale(1); }
.finale-shade { position: absolute; inset: 0; background: linear-gradient(180deg, var(--bg) 0%, rgba(11,15,25,.1) 22%, rgba(11,15,25,.15) 60%, rgba(11,15,25,.85) 100%); }
.finale-copy { position: relative; z-index: 1; text-align: center; padding: 0 var(--gutter); display: grid; justify-items: center; gap: 14px; }
.finale-star { width: 44px; height: 44px; color: #E6CF9A; opacity: 0; transform: scale(.6) rotate(-45deg); transition: opacity 1.2s var(--ease) .4s, transform 1.6s var(--ease) .4s; }
.finale.lit .finale-star { opacity: 1; transform: none; }
.finale-title { font-family: "Cormorant", serif; font-weight: 600; font-size: clamp(3rem, 11vw, 6.4rem); line-height: 1; text-shadow: 0 10px 50px rgba(0,0,0,.5); }
.finale-title .ch { display: inline-block; opacity: 0; transform: translateY(.3em); filter: blur(6px); transition: opacity 1s var(--ease), transform 1.2s var(--ease), filter 1s var(--ease); transition-delay: calc(.8s + var(--i) * 55ms); }
.finale.lit .finale-title .ch { opacity: 1; transform: none; filter: none; }
.finale-line { font-size: clamp(1rem, 3.4vw, 1.3rem); color: rgba(244,239,230,.9); opacity: 0; transition: opacity 1.4s var(--ease) 2.1s; }
.finale.lit .finale-line { opacity: 1; }
.footer { width: var(--col); margin: 0 auto; padding: 56px 0 calc(40px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 14px; text-align: center; color: var(--muted); font-size: .86rem; }
.footer .ic { color: var(--gold); width: 26px; height: 26px; }
.footer p { max-width: 52ch; }

/* ---------- Dock & dots ---------- */
.dock {
  position: fixed; z-index: 110; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  height: 64px; border-radius: 22px; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line-2); box-shadow: 0 18px 50px -20px rgba(0,0,0,.6);
  transform: translateY(0); transition: transform .5s var(--ease), opacity .5s;
}
.first-visit .dock { animation: dockin .8s var(--ease) 1.6s both; }
@keyframes dockin { from { transform: translateY(120%); opacity: 0; } }
.dock button { display: grid; justify-items: center; align-content: center; gap: 3px; font-size: .68rem; font-weight: 700; color: var(--muted); border-radius: 18px; transition: color .25s; }
.dock button .ic { width: 22px; height: 22px; transition: transform .35s var(--spring), color .25s; }
.dock button:active .ic { transform: scale(.86); }
.dock button:hover, .dock button.on { color: var(--gold-soft); }
.dock .ic { color: inherit; }
@media (min-width: 900px) { .dock { display: none; } }

/* ---------- Step tracker ----------
   ≥1100px: rail on the left listing every station and step.
   <1100px: pill under the top bar (prev · current step · next); tap it for the full list. */
.tracker { position: fixed; z-index: 96; opacity: 0; pointer-events: none; transition: opacity .45s var(--ease), transform .55s var(--ease); }
.tracker.show { opacity: 1; pointer-events: auto; }
.trk-bar { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 2px; }
.trk-arrow { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--gold-soft); transition: background-color .2s, transform .25s var(--spring), opacity .2s; }
.trk-arrow .ic { width: 20px; height: 20px; }
.trk-arrow:hover { background: rgba(201,165,92,.1); }
.trk-arrow:active { transform: scale(.9); }
.trk-arrow[disabled] { opacity: .28; pointer-events: none; }
.trk-now { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; height: 40px; padding: 0 6px; border-radius: 12px; font-weight: 700; font-size: .88rem; }
.trk-now-id { flex: none; font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #0B0F19; background: var(--gold); border-radius: 99px; padding: 2px 8px; line-height: 1.5; }
.trk-now-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-now .chev { flex: none; width: 22px; height: 22px; transform: rotate(90deg); }
.tracker.open .trk-now .chev { transform: rotate(-90deg); border-color: var(--line); }
.trk-count { display: none; }

.trk-st-head { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 7px 8px; border-radius: 10px; text-align: left; color: var(--muted); transition: color .3s, background-color .2s; }
.trk-st-head:hover { background: rgba(201,165,92,.07); color: var(--text); }
.trk-st-num { font-family: "Cormorant", serif; font-weight: 600; font-size: 1.02rem; font-feature-settings: "lnum"; color: var(--gold); opacity: .75; }
.trk-st-name { font-family: "Cormorant", serif; font-weight: 600; font-size: 1.14rem; line-height: 1.1; }
.trk-st-ar { margin-left: auto; font-size: .92rem; line-height: 1; color: var(--gold-soft); opacity: .7; }
.trk-st.cur .trk-st-head, .trk-st.done .trk-st-head { color: var(--text); }
.trk-st.cur .trk-st-num, .trk-st.cur .trk-st-ar { opacity: 1; }
.trk-st.done .trk-st-num::after { content: " ✓"; font-family: "Manrope", sans-serif; font-size: .7rem; }
.trk-steps-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.trk-st.cur .trk-steps-wrap { grid-template-rows: 1fr; }
.trk-steps { position: relative; min-height: 0; overflow: hidden; list-style: none; margin: 0; padding: 0; }
.trk-steps::before, .trk-steps::after { content: ""; position: absolute; left: 16.5px; top: 16px; bottom: 16px; width: 1px; background: var(--line-2); }
.trk-steps::after { background: var(--gold); transform-origin: 50% 0; transform: scaleY(var(--fill, 0)); transition: transform .6s var(--ease); box-shadow: 0 0 8px rgba(201,165,92,.5); }
.trk-steps button { position: relative; display: grid; grid-template-columns: 17px auto minmax(0, 1fr); align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border-radius: 10px; text-align: left; font-size: .82rem; font-weight: 600; color: var(--faint); transition: color .25s, background-color .25s; }
.trk-steps button:hover { color: var(--text); background: rgba(201,165,92,.07); }
.trk-dot { position: relative; z-index: 1; justify-self: center; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); transition: background-color .3s, border-color .3s, box-shadow .4s var(--ease), transform .35s var(--spring); }
.trk-id { font-size: .68rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--gold); opacity: .8; }
.trk-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-steps button.passed { color: var(--muted); }
.trk-steps button.passed .trk-dot { background: var(--gold-deep); border-color: var(--gold); }
.trk-steps button.cur { color: var(--text); background: rgba(201,165,92,.13); }
.trk-steps button.cur .trk-id { opacity: 1; }
.trk-steps button.cur .trk-dot { background: var(--gold); border-color: var(--gold); transform: scale(1.3); box-shadow: 0 0 0 4px rgba(201,165,92,.18), 0 0 12px rgba(201,165,92,.65); }
:root[data-theme="day"] .trk-steps button.cur { background: rgba(154,119,51,.12); }

@media (max-width: 1099px) {
  .tracker { top: calc(64px + env(safe-area-inset-top)); left: 50%; width: min(440px, calc(100% - 24px)); transform: translate(-50%, -10px); }
  .tracker.show { transform: translate(-50%, 0); }
  .trk-bar { position: relative; height: 48px; padding: 4px; border-radius: 16px; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); border: 1px solid var(--line-2); box-shadow: 0 14px 40px -18px rgba(0,0,0,.55); }
  :root[data-theme="day"] .trk-bar { box-shadow: 0 14px 34px -20px rgba(60,45,20,.4); }
  .trk-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .6s var(--ease); }
  .trk-list { display: none; position: relative; margin-top: 8px; max-height: min(62svh, 540px); overflow-y: auto; overscroll-behavior: contain; padding: 8px 6px; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line); box-shadow: var(--shadow); }
  .tracker.open .trk-list { display: block; animation: pop .3s var(--spring); }
  .tracker.open .trk-steps-wrap { grid-template-rows: 1fr; }
  .trk-st + .trk-st { margin-top: 4px; }
  .trk-steps button { min-height: 42px; font-size: .9rem; }
}
@media (max-width: 380px) { .trk-now { font-size: .82rem; gap: 7px; } }

@media (min-width: 1100px) {
  .tracker {
    left: 18px; top: max(92px, calc(50vh - 230px)); transform: translateX(-14px);
    width: clamp(136px, calc((100vw - 760px) / 2 - 40px), 228px);
    display: flex; flex-direction: column; gap: 6px; padding: 10px 8px 8px; border-radius: 20px;
    background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
    border: 1px solid var(--line-2); box-shadow: 0 24px 60px -30px rgba(0,0,0,.6);
  }
  .tracker.show { transform: none; }
  .trk-list { order: 1; }
  .trk-bar { order: 2; grid-template-columns: 34px minmax(0, 1fr) 34px; padding-top: 6px; border-top: 1px solid var(--line-2); }
  .trk-bar .trk-arrow { width: 34px; height: 34px; border-radius: 10px; }
  .trk-now { display: none; }
  .trk-count { display: block; text-align: center; font-size: .7rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .trk-st-ar { display: none; }
}
@media (min-width: 1280px) { .trk-st-ar { display: inline; } }

/* ---------- Overlays ---------- */
.scrim { position: fixed; inset: 0; z-index: 180; background: rgba(5,7,12,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .45s var(--ease); }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; z-index: 190; left: 0; right: 0; bottom: 0; height: 90svh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -30px 80px -20px rgba(0,0,0,.7);
  transform: translateY(104%); transition: transform .6s var(--ease); overflow: hidden;
}
.sheet.on { transform: translateY(var(--drag, 0px)); }
.sheet.dragging { transition: none; }
.sheet-grab { position: absolute; top: 0; left: 0; right: 0; height: 26px; z-index: 3; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grab span { width: 42px; height: 4px; border-radius: 4px; background: rgba(244,239,230,.35); }
.sheet-hero { position: relative; height: 190px; flex: none; color: #F4EFE6; touch-action: none; }
.sheet-hero picture, .sheet-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.sheet-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,15,25,.55), rgba(11,15,25,.1) 40%, var(--bg)); }
.sheet-title { position: absolute; left: 20px; bottom: 14px; font-family: "Cormorant", serif; font-weight: 600; font-size: 2.8rem; line-height: 1; }
.sheet-title.small { position: static; font-size: 1.9rem; color: var(--text); }
.sheet-tools { position: absolute; right: 14px; top: 20px; display: flex; gap: 8px; }
.sheet-tools .tool-btn { background: rgba(11,15,25,.45); border-color: rgba(255,255,255,.15); color: #F4EFE6; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 30px 16px 12px; flex: none; touch-action: none; }
.sheet-head .tabs { margin-left: auto; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px calc(28px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-group { margin-top: 22px; }
.sheet-group:first-child { margin-top: 6px; }
.sheet-group h3 { display: flex; align-items: baseline; gap: 10px; font-family: "Cormorant", serif; font-weight: 600; font-size: 1.55rem; margin-bottom: 12px; }
.sheet-group h3 span { font-family: "Amiri", serif; font-weight: 400; font-size: 1.05rem; color: var(--gold-soft); }
.sheet-group .dua + .dua { margin-top: 14px; }
@media (min-width: 900px) {
  .sheet { left: auto; top: 0; width: 560px; height: 100%; border-radius: 28px 0 0 28px; border: 1px solid var(--line); border-right: 0; transform: translateX(104%); }
  .sheet.on { transform: translateX(0); }
  .sheet-grab { display: none; }
  .sheet-hero { height: 230px; }
  .sheet-body { padding: 10px 26px 40px; }
}
.tabs { display: inline-flex; padding: 4px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); }
.tabs button { padding: 7px 16px; border-radius: 9px; font-weight: 700; font-size: .88rem; color: var(--muted); transition: background-color .25s, color .25s; }
.tabs button[aria-selected="true"] { background: var(--gold); color: #0B0F19; }

.mode { position: fixed; inset: 0; z-index: 220; background: var(--bg); display: flex; flex-direction: column; opacity: 0; transform: scale(.98); transition: opacity .4s var(--ease), transform .5s var(--ease); }
.mode.on { opacity: 1; transform: none; }
.mode-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 14px 10px; }
.mode-track { flex: 1; display: flex; gap: 4px; }
.mode-track i { flex: 1; height: 4px; border-radius: 4px; background: var(--line-2); transition: background-color .4s; }
.mode-track i.on { background: var(--gold); }
.mode-track i.st-start { margin-left: 5px; }
.mode-stage { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px 18px 24px; }
.mode-screen { width: min(640px, 100%); margin: 0 auto; animation: modein .55s var(--ease); }
.mode-screen.back { animation-name: modeback; }
@keyframes modein { from { opacity: 0; transform: translateX(28px); } }
@keyframes modeback { from { opacity: 0; transform: translateX(-28px); } }
.mode-st { font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); display: flex; gap: 10px; align-items: center; }
.mode-st span[lang] { font-family: "Amiri", serif; font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--gold-soft); }
.mode-title { font-feature-settings: "lnum"; margin-top: 10px; font-family: "Cormorant", serif; font-weight: 600; font-size: clamp(2.4rem, 9vw, 3.4rem); line-height: 1.02; }
.mode-sum { margin-top: 12px; font-size: 1.22rem; line-height: 1.5; font-weight: 600; }
.mode-screen .details { margin-top: 18px; }
.mode-screen .dua, .mode-screen .module, .mode-screen .rules { margin-top: 20px; }
.mode-bottom { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); background: var(--bg); }

.reading-close { position: absolute; z-index: 3; top: calc(14px + env(safe-area-inset-top)); right: 14px; color: #F4EFE6; background: rgba(11,15,25,.4); border-color: rgba(255,255,255,.14); opacity: 0; transition: opacity .3s var(--ease); }
.reading.on .reading-close { opacity: 1; transition-delay: .5s; }

/* Reading scroll — the Arabic opens like a scroll: two gold rollers part,
   the paper unrolls, the words arrive one by one, then Close appears. */
.reading {
  position: fixed; inset: 0; z-index: 240; display: grid; place-items: center;
  padding: calc(66px + env(safe-area-inset-top)) 16px calc(26px + env(safe-area-inset-bottom));
  background: radial-gradient(90% 70% at 50% 45%, rgba(26,36,64,.55), rgba(5,7,12,.86) 70%);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .42s var(--ease) .14s;
}
.reading.on { opacity: 1; transition-delay: 0s; }
:root[data-theme="day"] .reading { background: radial-gradient(90% 70% at 50% 45%, rgba(246,242,234,.35), rgba(40,32,18,.55) 75%); }
.scroll { position: relative; width: min(820px, calc(100% - 40px)); --paper-bg: linear-gradient(180deg, #161F36 0%, #111829 100%); }
:root[data-theme="day"] .scroll { --paper-bg: linear-gradient(180deg, #FFFDF7 0%, #F6EEDD 100%); }
.paper {
  position: relative; max-height: calc(100svh - 150px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(34px, 6vw, 58px) clamp(18px, 5vw, 58px) clamp(24px, 4vw, 34px); text-align: center; color: var(--text);
  background: var(--paper-bg); border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  box-shadow: inset 0 18px 22px -18px rgba(0,0,0,.55), inset 0 -18px 22px -18px rgba(0,0,0,.55), 0 40px 90px -30px rgba(0,0,0,.7);
  clip-path: inset(50% 0 50% 0); transition: clip-path .38s var(--ease-io) .1s;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.reading.on .paper { clip-path: inset(0 0 0 0); transition: clip-path .85s var(--ease-io) .3s; }
:root[data-theme="day"] .paper { box-shadow: inset 0 18px 22px -18px rgba(90,70,30,.28), inset 0 -18px 22px -18px rgba(90,70,30,.28), 0 40px 90px -30px rgba(60,45,20,.45); }
.roller {
  position: absolute; z-index: 2; left: -14px; right: -14px; height: 16px; border-radius: 8px; pointer-events: none;
  background: linear-gradient(180deg, #5E4718 0%, #F2D48E 34%, #C9A55C 58%, #7C5E22 82%, #4A3812 100%);
  box-shadow: 0 8px 18px -4px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,247,222,.5);
  opacity: 0; scale: .3 1;
  transition: translate .38s var(--ease-io) .1s, scale .22s var(--ease) .4s, opacity .16s ease .44s;
}
.roller::before, .roller::after { content: ""; position: absolute; top: 50%; width: 11px; height: 24px; margin-top: -12px; border-radius: 6px; background: linear-gradient(180deg, #4A3812, #D8B96F 45%, #4A3812); }
.roller::before { left: -8px; }
.roller::after { right: -8px; }
.roller.top { top: -8px; translate: 0 calc(var(--h, 320px) / 2); }
.roller.bottom { bottom: -8px; translate: 0 calc(var(--h, 320px) / -2); }
.reading.on .roller { opacity: 1; scale: 1 1; translate: 0 0; transition: opacity .2s var(--ease), scale .45s var(--spring), translate .85s var(--ease-io) .3s; }

.reading-inner { display: grid; gap: 16px; }
.reading-inner .lbl { margin: 0; }
.reading-inner .ar { margin: 0; font-size: clamp(2.1rem, min(8.4vw, 6.6vh), 4.2rem); line-height: 2.05; color: var(--text); }
.reading-inner .ar.then { margin-top: -8px; }
.reading-inner .ar.hadith { font-size: clamp(1.5rem, min(5.6vw, 4.2vh), 2.5rem); line-height: 2.1; }
.reading-inner.len-m .ar { font-size: clamp(1.8rem, min(7vw, 5.2vh), 3.2rem); }
.reading-inner.len-l .ar { font-size: clamp(1.6rem, min(6vw, 4.4vh), 2.7rem); }
.reading-inner.len-m .ar.hadith, .reading-inner.len-l .ar.hadith { font-size: clamp(1.4rem, min(5.2vw, 3.9vh), 2.3rem); }
.reading-inner .ar .w { cursor: text; }
.reading-orn { display: grid; place-items: center; color: var(--gold); }
.reading-orn .ic { width: 22px; height: 22px; }
.reading-inner .tr { margin: 0; font-size: clamp(1rem, 3.4vw, 1.18rem); color: var(--muted); }
.reading-inner .mn { margin: 0; font-size: clamp(1.02rem, 3.5vw, 1.22rem); line-height: 1.6; }
.reading-inner .mn.hd-en { font-family: "Cormorant", serif; font-style: italic; font-size: clamp(1.2rem, 4vw, 1.45rem); }
.reading-ref { font-size: .82rem; color: var(--faint); }
.reading-end { display: flex; justify-content: center; margin-top: clamp(22px, 4vw, 30px); }
.reading-done { min-width: 170px; }

/* closing: everything fades fast, then the scroll rolls shut */
.reading .ar .w, .reading .lbl, .reading-orn, .reading .tr, .reading .mn, .reading-ref, .reading-end { opacity: 0; transition: opacity .14s ease, transform .14s ease, filter .14s ease; }
.reading .ar .w { transform: translateY(10px); filter: blur(7px); }
.reading-orn, .reading .tr, .reading .mn, .reading-ref, .reading-end { transform: translateY(8px); }
.reading.on .ar .w { opacity: 1; transform: none; filter: none; transition: opacity .7s var(--ease), transform .8s var(--ease), filter .7s var(--ease); transition-delay: calc(.9s + var(--i, 0) * var(--step, 70ms)); }
.reading.on .lbl { opacity: 1; transition: opacity .6s var(--ease) .75s; }
.reading.on .reading-orn, .reading.on .tr, .reading.on .mn, .reading.on .reading-ref, .reading.on .reading-end { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .7s var(--ease); }
.reading.on .reading-orn { transition-delay: var(--after, 1.6s); }
.reading.on .tr { transition-delay: calc(var(--after, 1.6s) + .1s); }
.reading.on .mn, .reading.on .reading-ref { transition-delay: calc(var(--after, 1.6s) + .2s); }
.reading.on .reading-end { transition-delay: calc(var(--after, 1.6s) + .45s); }

/* Arabic you can tap to open */
.dua .ar, .callout[data-hread] { cursor: zoom-in; border-radius: 14px; transition: background-color .3s; }
.fine .dua .ar:hover, .fine .callout[data-hread]:hover { background-color: rgba(201,165,92,.06); }
.dua-part:has(.wbw-tg.is-open) .ar { cursor: auto; }
.dua-part:has(.wbw-tg.is-open) .ar:hover { background-color: transparent; }

.toast { position: fixed; z-index: 280; left: 50%; bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: .86rem; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .35s, transform .45s var(--spring); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }

/* ---------- Day theme adjustments ---------- */
:root[data-theme="day"] .rm-card { background: rgba(255,255,255,.65); }
@media (min-width: 900px) { :root[data-theme="day"] .rm-card { background: #fff; } }
:root[data-theme="day"] .node { background: var(--bg); }
:root[data-theme="day"] .btn.gold { color: #1b1406; }
:root[data-theme="day"] .dock { box-shadow: 0 18px 40px -22px rgba(60,45,20,.4); }
:root[data-theme="day"] .sheet-grab span { background: rgba(20,24,42,.25); }
:root[data-theme="day"] .sheet-hero .sheet-grab span { background: rgba(255,255,255,.6); }
:root[data-theme="day"] .tc-cap b { color: var(--text); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .15s !important; transition-delay: 0s !important; }
  .grain { display: none; }
  .js [data-reveal], .js .dua .ar .w, .js .st-name .ch, .finale-title .ch, .reading.on .ar .w, .reading.on .lbl, .reading.on .reading-orn, .reading.on .tr, .reading.on .mn, .reading.on .reading-ref, .reading.on .reading-end { opacity: 1 !important; transform: none !important; filter: none !important; }
  .paper { clip-path: none !important; }
  .reading.on .roller { translate: 0 0 !important; }
}

.hon { font-family: "Amiri", serif; font-size: 1.04em; unicode-bidi: isolate; white-space: nowrap; }

/* Version 2: natural framing for recognition photographs. */
.fig[data-image] { aspect-ratio: auto; }
.fig[data-image] picture, .fig[data-image] img { height: auto; }
.fig[data-image] img { display: block; transform: none !important; }
.fig[data-image="start-line-light-detail"] { max-width: 320px; }
.fig[data-image="black-stone-corner"] { max-width: 380px; }
.fig[data-image="yemeni-corner"], .fig[data-image="hijr-ismail"] { max-width: 680px; }
.version-links { display:flex; justify-content:center; gap:16px; flex-wrap:wrap; padding:18px; font-size:12px; letter-spacing:.04em; border-top:1px solid var(--line-2); }
.version-links a { color:var(--gold-soft); text-decoration:underline; text-underline-offset:4px; }

.version-badge { color: var(--gold-soft); font-size: 11px; font-weight: 700; text-decoration: none; }
/* =========================================================
   Upgrade pass — smoke, videos, classical sources, library,
   My Umrah progress, finish details, print pocket card.
   ========================================================= */

/* ---------- Finish details ---------- */
::selection { background: var(--gold); color: #0B0F19; }
@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: rgba(201,165,92,.35) transparent; }
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-thumb { background: rgba(201,165,92,.3); border-radius: 8px; border: 3px solid var(--bg); }
}
.hairline { width: min(520px, 70%); height: 1px; margin: 0 auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .55; transform: scaleX(0); transition: transform 1.2s var(--ease-io); }
.hairline.in { transform: scaleX(1); }

/* ---------- Gold smoke ---------- */
.smoke { position: absolute; pointer-events: none; mix-blend-mode: screen; }
.hero-smoke { left: 0; right: 0; bottom: 0; width: 100%; height: 70%; z-index: 2; opacity: .92; }
.st-smoke { left: 0; right: 0; bottom: 0; width: 100%; height: 34%; z-index: 1; opacity: .7; }
.finale-smoke { inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; transition: opacity 2.4s var(--ease); }
.finale.lit .finale-smoke { opacity: 1; }
:root[data-theme="day"] .smoke { display: none; }

/* ---------- Watch pill & step tick ---------- */
.watch-pill { display: inline-flex; align-items: center; gap: 4px; vertical-align: 2px; margin-left: 10px; padding: 2px 9px 2px 6px; border-radius: 99px; border: 1px solid var(--line); color: var(--gold); font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.watch-pill svg { width: 11px; height: 11px; }
.step { --tick-w: 40px; }
.step-head { padding-right: var(--tick-w); }
.step-tick { position: absolute; z-index: 2; right: 40px; top: 24px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); color: transparent; background: transparent; transition: border-color .3s, background-color .3s, color .3s, transform .35s var(--spring), box-shadow .4s; }
.step-tick .ic { width: 15px; height: 15px; }
.step-tick:hover { border-color: var(--line); color: var(--gold); }
.step-tick.on { background: var(--gold); border-color: var(--gold); color: #0B0F19; box-shadow: 0 0 16px rgba(201,165,92,.4); }
.step-tick.on:active, .step-tick:active { transform: scale(.9); }
.step.done > .step-head .node { background: var(--gold); color: #0B0F19; border-color: var(--gold); }
.step.done > .step-head .step-title { color: var(--muted); }

/* Progress ring on the dock and top nav */
.dock [data-action="mode"] { position: relative; }
.dock [data-action="mode"]::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 34px; height: 34px; border-radius: 50%; opacity: 0; transition: opacity .5s;
  background: conic-gradient(var(--gold) calc(var(--prog, 0) * 360deg), rgba(244,239,230,.09) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); }
:root.has-prog .dock [data-action="mode"]::before { opacity: 1; }
.topnav [data-action="mode"] { position: relative; }
.topnav [data-action="mode"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--gold); transform-origin: 0 50%; transform: scaleX(var(--prog, 0)); opacity: 0; transition: transform .6s var(--ease), opacity .4s; }
:root.has-prog .topnav [data-action="mode"]::after { opacity: .9; }

/* ---------- Video facade & player ---------- */
.vid { margin-top: 18px; }
.vid-face { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; text-align: left; border: 1px solid var(--line-2); background: #0D1322; transition: border-color .3s, transform .45s var(--ease), box-shadow .5s; }
.vid-face:hover { border-color: var(--line); transform: translateY(-2px); box-shadow: 0 24px 60px -30px rgba(0,0,0,.7); }
.vid-poster { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 110%, rgba(201,165,92,.16), transparent 60%), var(--kiswah) 0 0 / 320px, linear-gradient(200deg, #141C31, #0B0F19); }
.vid-poster::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 50% 45%, transparent, rgba(11,15,25,.55)); }
.vp-star { position: absolute; right: 14px; top: 14px; width: 20px; height: 20px; color: rgba(201,165,92,.5); }
.vid-ring { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(11,15,25,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: transform .4s var(--spring), background-color .3s, box-shadow .5s; }
.vid-ring svg { width: 24px; height: 24px; fill: var(--gold-soft); transform: translateX(1px); }
.vid-face:hover .vid-ring { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 0 10px rgba(201,165,92,.08), 0 0 34px rgba(201,165,92,.25); }
.vid-meta { position: absolute; left: 16px; right: 16px; bottom: 12px; display: grid; gap: 2px; }
.vid-title { font-weight: 700; font-size: .95rem; color: #F4EFE6; text-shadow: 0 2px 14px rgba(0,0,0,.5); }
.vid-time { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-soft); }
.vid-shell { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.vid-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vid-alts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vid-alt { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); font-size: .8rem; font-weight: 600; transition: color .25s, border-color .25s, background-color .25s; }
.vid-alt b { color: var(--gold); font-variant-numeric: tabular-nums; }
.vid-alt:hover { color: var(--text); border-color: var(--line); background: rgba(201,165,92,.06); }
.clips { display: grid; gap: 6px; margin-top: 12px; }
.clip { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--text); font-size: .88rem; transition: border-color .25s, background-color .25s; }
.clip-ic { width: 14px; height: 14px; color: var(--gold); }
.clip b { color: var(--gold); font-size: .78rem; font-variant-numeric: tabular-nums; }
.clip:hover { border-color: var(--line); background: rgba(201,165,92,.05); }
.vid-sheet .sheet-body { padding: 14px; }
#full-vid .vid-shell { border-radius: 12px; }
:root[data-theme="day"] .vid-poster { background: radial-gradient(120% 90% at 50% 110%, rgba(154,119,51,.18), transparent 60%), linear-gradient(200deg, #232B44, #141A2C); }

/* ---------- From the classical sources ---------- */
.tg.classical > .tg-head .tg-label::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 9px; background: var(--gold); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.kn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.kn { border-bottom: 1px solid var(--line-2); }
.kn:last-child { border-bottom: 0; }
.kn-line { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; width: 100%; text-align: left; padding: 11px 2px; transition: color .2s; }
.kn-line:hover .kn-en { color: var(--gold-soft); }
.kn-en { font-size: .93rem; line-height: 1.5; transition: color .25s; }
.kn-imam { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.kn-imam:empty { display: none; }
.kn-more { padding: 2px 2px 14px; }
.kn-more .callout { margin: 6px 0 10px; }
.kn.open > .kn-line .kn-en { color: var(--gold-soft); }
.kn-cite { font-size: .8rem; color: var(--muted); }
.kn-cite a { color: var(--gold); border-bottom: 1px solid transparent; transition: border-color .2s; }
.kn-cite a:hover { border-color: var(--line); }
.kn-cite .ic { width: 12px; height: 12px; vertical-align: -1px; margin-left: 3px; }
.kn-part { display: inline-block; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line-2); font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); vertical-align: 1px; }
.kn-nested { margin-top: 6px; }

/* ---------- Roadmap extras ---------- */
.rm-after { margin-top: clamp(26px, 4vw, 44px); display: grid; gap: 18px; }
.watch-all { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wa-lead { font-size: .92rem; color: var(--muted); font-weight: 600; margin-right: 4px; }
.wa-btn { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 99px; border: 1px solid var(--line-2); font-size: .84rem; font-weight: 700; color: var(--text); transition: border-color .25s, background-color .25s, transform .35s var(--spring); }
.wa-btn b { color: var(--gold); font-variant-numeric: tabular-nums; font-size: .76rem; }
.wa-btn:hover { border-color: var(--line); background: rgba(201,165,92,.06); transform: translateY(-1px); }
.rm-after .tg { border-top: 1px solid var(--line-2); }

/* ---------- The library ---------- */
.library { position: relative; width: var(--col); margin: 0 auto; padding: clamp(56px, 9vw, 110px) 0 clamp(70px, 10vw, 130px); }
.library .hairline { margin-bottom: clamp(40px, 7vw, 70px); }
.lib-sub { margin-top: 10px; color: var(--muted); font-size: 1rem; }
.lib-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(20px, 3.5vw, 32px); }
.lib-tabs [role="tab"] { padding: 10px 16px; border-radius: 99px; border: 1px solid var(--line-2); font-size: .88rem; font-weight: 700; color: var(--muted); transition: color .25s, border-color .25s, background-color .25s; }
.lib-tabs [role="tab"]:hover { color: var(--text); border-color: var(--line); }
.lib-tabs [role="tab"][aria-selected="true"] { color: #0B0F19; background: linear-gradient(180deg, #D8B96F, #B8924A); border-color: transparent; }
.lib-tabs .hon { font-family: "Amiri", serif; }
.lib-tabs [role="tab"][aria-selected="true"] .hon { color: #0B0F19; }
.lib-body { margin-top: clamp(18px, 3vw, 28px); }
.lib-panel { display: grid; gap: 16px; animation: libin .5s var(--ease); }
@keyframes libin { from { opacity: 0; transform: translateY(10px); } }
.virt, .fq, .src-imam { border: 1px solid var(--line-2); border-radius: 18px; padding: 18px 18px 14px; background: var(--card); }
.virt-ar { font-family: "Amiri", serif; font-weight: 400; font-size: 1.5rem; line-height: 1.9; color: var(--gold-soft); margin: 0 0 8px; }
.virt-mn { font-size: .95rem; line-height: 1.6; margin-bottom: 8px; }
.virt-note { position: relative; margin-top: 10px; padding-left: 14px; font-size: .86rem; color: var(--muted); font-style: italic; }
.virt-note::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--line); }
.tl { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 22px; }
.tl::before { content: ""; position: absolute; left: 21px; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(180deg, var(--gold-soft), var(--gold), transparent); opacity: .5; }
.tl-item { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.tl-n { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); font-family: "Cormorant", serif; font-weight: 600; font-size: 1.3rem; }
.tl-body h3 { font-family: "Cormorant", serif; font-weight: 600; font-size: 1.5rem; }
.tl-body h3 span[lang] { font-family: "Amiri", serif; font-size: .95em; color: var(--gold-soft); margin-left: 6px; }
.tl-year { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 2px 0 6px; }
.tl-line { font-size: .93rem; line-height: 1.55; margin-bottom: 6px; }
.tl-rec { margin-top: 18px; border-top: 1px solid var(--line-2); }
.fq h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; }
.fq .mini-table { width: 100%; }
.fq td:nth-child(1) { white-space: nowrap; font-weight: 700; }
.fq td a { color: var(--gold); }
.src-imam h3 { font-size: 1.05rem; font-weight: 700; }
.src-imam h3 span[lang] { font-family: "Amiri", serif; font-weight: 400; color: var(--gold-soft); margin-left: 6px; }
.src-works { font-size: .88rem; margin: 6px 0 8px; }
.src-works a { color: var(--gold); }
.src-std { font-size: .82rem; color: var(--faint); font-style: italic; margin-top: 4px; }

/* ---------- Footer actions ---------- */
.foot-acts { margin-top: 14px; display: flex; justify-content: center; align-items: center; gap: 12px; color: var(--faint); }
.link-btn { font-size: .86rem; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line-2); padding-bottom: 1px; transition: color .25s, border-color .25s; }
.link-btn:hover { color: var(--gold-soft); border-color: var(--line); }

/* ---------- Print pocket card ---------- */
.print-card { display: none; }
@media print {
  body > *:not(.print-card) { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  .print-card { display: block; font: 10.5pt/1.45 Georgia, "Times New Roman", serif; color: #000; }
  .print-card h1 { font-size: 17pt; margin: 0 0 2pt; }
  .pc-sub { font-size: 9pt; color: #444; margin: 0 0 10pt; }
  .pc-st { break-inside: avoid-page; margin-bottom: 10pt; padding-top: 6pt; border-top: 1pt solid #999; }
  .pc-st h2 { font-size: 12.5pt; margin: 0 0 4pt; }
  .pc-steps { margin: 0 0 6pt 14pt; padding: 0; }
  .pc-steps li { margin-bottom: 1.5pt; font-size: 9.5pt; }
  .pc-dua { break-inside: avoid; margin: 5pt 0; padding-left: 8pt; border-left: 1.5pt solid #999; }
  .pc-when { font-size: 7.5pt; letter-spacing: .12em; text-transform: uppercase; color: #555; margin: 0; }
  .pc-ar { font-family: "Amiri", serif; font-size: 13pt; line-height: 1.9; margin: 2pt 0; }
  .pc-tr { font-style: italic; font-size: 8.5pt; color: #333; margin: 0; }
  .pc-mn { font-size: 9pt; margin: 1pt 0 0; }
}


/* ---------- Du'a sheet: collapsed cards, status labels, PDF ---------- */
.sheet-note { font-size: .84rem; color: var(--muted); margin: 4px 2px 16px; line-height: 1.5; }
.sheet-note .pdf-a { color: var(--gold); font-weight: 700; border-bottom: 1px solid var(--line); }
.dua-tg { border: 1px solid var(--line-2); border-radius: 16px; margin-bottom: 10px; background: var(--card); overflow: hidden; }
.dua-tg > .tg-head { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 15px 16px; }
.dua-tg > .tg-head .tg-label { font-weight: 700; font-size: .98rem; flex: 1; }
.dua-tg > .tg-panel .tg-body { padding: 0 12px 12px; }
.dua-tg .dua { margin-top: 0; }
.dua-tg.is-open { border-color: var(--line); }
.dua-tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-left: 8px; border: 1px solid; vertical-align: 2px; white-space: nowrap; }
.dua-tag.req { color: #E8C77E; border-color: rgba(201,165,92,.55); background: rgba(201,165,92,.12); }
.dua-tag.sun { color: #7FD3AE; border-color: rgba(47,143,106,.5); background: rgba(47,143,106,.1); }
.dua-tag.opt { color: var(--muted); border-color: var(--line-2); background: rgba(255,255,255,.03); }
:root[data-theme="day"] .dua-tag.req { color: #7C5E22; }
:root[data-theme="day"] .dua-tag.sun { color: #1F6A4E; }

/* ---------- Calm fallback when smoke is off (reduced motion / save-data / battery) ---------- */
:root.smoke-off .hero-smoke { opacity: 1; background: radial-gradient(70% 60% at 50% 100%, rgba(201,165,92,.10), transparent 70%); }
:root.smoke-off .finale-smoke { background: radial-gradient(60% 50% at 50% 68%, rgba(201,165,92,.16), transparent 72%); }

/* ---------- Video posters (user screenshots at assets/img/video/<slug>.jpg) ---------- */
.vid-shot { position: absolute; inset: 0; background-size: cover; background-position: center; }
.vid-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,15,25,.12) 40%, rgba(11,15,25,.78) 100%); }

/* ---------- Step layout: boxed text, image alongside, premium video card ---------- */
.step-inner > .details { background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: 16px 18px; }
.step-inner > .rules { background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: 16px 18px; }
@media (min-width: 900px) {
  .step-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); column-gap: 18px; }
  .step-inner > * { grid-column: 1 / -1; }
  .step-inner > .details:first-child:has(+ .fig) { grid-column: 1; grid-row: 1; align-self: stretch; }
  .step-inner > .details:first-child + .fig { grid-column: 2; grid-row: 1; align-self: stretch; margin-top: 0; }
  .step-inner > .details:first-child + .fig picture, .step-inner > .details:first-child + .fig img { height: 100%; }
  .step-inner > .details:first-child + .fig img { object-fit: cover; }
}
.vid-brand { position: absolute; left: 14px; top: 12px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 7px; border-radius: 99px; background: rgba(11,15,25,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--line-2); }
.vid-brand svg { width: 22px; height: 16px; border-radius: 4px; }
.vid-brand b { font-size: .68rem; font-weight: 800; letter-spacing: .06em; color: #F4EFE6; }
.vid-sub { font-size: .74rem; color: rgba(244,239,230,.72); }
.vid-face { box-shadow: 0 16px 44px -22px rgba(0,0,0,.65); }
.vid-face:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Tracker: the current step stands out ---------- */
.trk-steps button.cur { font-size: .95rem; font-weight: 800; color: var(--gold-soft); padding: 11px 10px; border-radius: 12px; background: rgba(201,165,92,.14); border: 1px solid var(--line); box-shadow: 0 8px 26px -14px rgba(201,165,92,.6); }
.trk-steps button.cur .trk-t { white-space: normal; line-height: 1.3; }
.trk-steps button.cur .trk-id { font-size: .76rem; opacity: 1; }
.trk-now-t { font-size: .94rem; }
:root[data-theme="day"] .trk-steps button.cur { background: rgba(154,119,51,.14); color: var(--gold-deep); }
.step-inner > .details { align-content: start; }

/* ---------- Open step reads as a card; the next step glows ---------- */
.step { margin: 0 -14px; padding: 0 14px; border-radius: 18px; transition: background-color .5s var(--ease), box-shadow .6s var(--ease), border-color .4s; }
.step.is-open { background: linear-gradient(180deg, rgba(201,165,92,.055), rgba(201,165,92,.012) 160px, transparent 320px), var(--card); box-shadow: 0 0 0 1px var(--line), 0 24px 60px -34px rgba(201,165,92,.4); border-bottom-color: transparent; }
.step.is-open > .step-head .step-title { color: var(--gold-soft); }
:root[data-theme="day"] .step.is-open { box-shadow: 0 0 0 1px var(--line), 0 20px 44px -30px rgba(122,94,34,.35); }

.step.is-open + .step:not(.is-open) > .step-head .node {
  border-color: var(--gold); color: var(--gold-soft);
  animation: next-pulse 2.4s var(--ease-io) infinite;
}
@keyframes next-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,165,92,.0), 0 0 10px rgba(201,165,92,.25); }
  50% { box-shadow: 0 0 0 7px rgba(201,165,92,.12), 0 0 22px rgba(201,165,92,.55); }
}
.step.is-open + .step:not(.is-open) > .step-head .step-title::after {
  content: "Next"; display: inline-block; vertical-align: 2px; margin-left: 10px; padding: 2px 10px; border-radius: 99px;
  font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #0B0F19;
  background: linear-gradient(100deg, #B8924A 20%, #F2D48E 40%, #B8924A 60%);
  background-size: 220% 100%; animation: next-shimmer 2.8s linear infinite;
  box-shadow: 0 4px 14px -6px rgba(201,165,92,.7);
}
@keyframes next-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
:root.rm .step.is-open + .step > .step-head .node,
:root.rm .step.is-open + .step > .step-head .step-title::after { animation: none; }

/* ---------- Round-3 art: brand mark, card backgrounds, tracker, emblems, companion ---------- */
.brand-img { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(201,165,92,.35)); }
.rm-card[data-station="ihram"], .rm-card[data-station="tawaf"], .rm-card[data-station="sai"], .rm-card[data-station="hair"] { background-size: cover; background-position: center; }
.rm-card[data-station="ihram"] { background-image: linear-gradient(180deg, rgba(11,15,25,.3), rgba(11,15,25,.6)), url(../img/rm-bg-ihram.jpg); }
.rm-card[data-station="tawaf"] { background-image: linear-gradient(180deg, rgba(11,15,25,.3), rgba(11,15,25,.6)), url(../img/rm-bg-tawaf.jpg); }
.rm-card[data-station="sai"] { background-image: linear-gradient(180deg, rgba(11,15,25,.3), rgba(11,15,25,.6)), url(../img/rm-bg-sai.jpg); }
.rm-card[data-station="hair"] { background-image: linear-gradient(180deg, rgba(11,15,25,.3), rgba(11,15,25,.6)), url(../img/rm-bg-hair.jpg); }
:root[data-theme="day"] .rm-card[data-station] { background-image: none; }
.tracker .trk-list { background-image: linear-gradient(rgba(11,15,25,.66), rgba(11,15,25,.84)), url(../img/tracker-bg.jpg); background-size: cover; background-position: center top; }
:root[data-theme="day"] .tracker .trk-list { background-image: none; }
.tg.classical > .tg-head .tg-label::before, .tg.evidence > .tg-head .tg-label::before {
  content: ""; display: inline-block; width: 26px; height: 26px; margin-right: 11px; vertical-align: -8px;
  background: center / contain no-repeat; clip-path: none; transform: none; filter: drop-shadow(0 2px 8px rgba(201,165,92,.35));
}
.tg.classical > .tg-head .tg-label::before { background-image: url(../icons/emblem-classical.png); }
.tg.evidence > .tg-head .tg-label::before { background-image: url(../icons/emblem-evidence.png); }
.companion { display: none; }
@media (min-width: 1100px) {
  .companion { display: block; position: fixed; right: 56px; top: 9vh; width: 50px; z-index: 60; pointer-events: none;
    transition: top 1.1s var(--ease); transform-origin: 50% 0;
    filter: drop-shadow(0 10px 26px rgba(201,165,92,.45));
    animation: lantern-sway 6s ease-in-out infinite; }
}
@keyframes lantern-sway { 0%, 100% { transform: rotate(2.4deg); } 50% { transform: rotate(-2.4deg); } }
:root.rm .companion { display: none; }

/* ---------- IndoPak script option (Lateef, SIL OFL) ---------- */
@font-face { font-family: "Lateef"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/lateef-arabic-400-normal.woff2") format("woff2"); }
:root[data-script="indopak"] .ar,
:root[data-script="indopak"] .callout,
:root[data-script="indopak"] .quran,
:root[data-script="indopak"] .chip-ar { font-family: "Lateef", "Amiri", serif; }
:root[data-script="indopak"] .ar { line-height: 2.2; }

/* ---------- Knowledge banner across Evidence & Classical sources ---------- */
.tg.evidence > .tg-head, .tg.classical > .tg-head {
  background: linear-gradient(90deg, rgba(11,15,25,.94) 0%, rgba(11,15,25,.8) 55%, rgba(11,15,25,.5) 100%), url(../img/knowledge-banner.jpg) right center / cover no-repeat;
  border: 1px solid var(--line-2); border-radius: 14px; padding: 13px 14px;
  transition: border-color .3s;
}
.tg.evidence > .tg-head:hover, .tg.classical > .tg-head:hover { border-color: var(--line); }
.tg.evidence > .tg-head .tg-label, .tg.classical > .tg-head .tg-label { color: #F4EFE6; }
.tg.evidence.is-open > .tg-head, .tg.classical.is-open > .tg-head { border-color: var(--line); }

/* ---------- Library toggles ---------- */
.lib-tg { border-top: 1px solid var(--line-2); margin-top: 8px; }
.lib-tg > .tg-head { padding: 10px 2px; }

/* ---------- Gold-framed knowledge banners ---------- */
.tg.evidence > .tg-head, .tg.classical > .tg-head {
  border: 1px solid transparent;
  background:
    linear-gradient(90deg, rgba(11,15,25,.94) 0%, rgba(11,15,25,.8) 55%, rgba(11,15,25,.5) 100%) padding-box,
    url(../img/knowledge-banner.jpg) right center / cover no-repeat padding-box,
    linear-gradient(100deg, #8F6B2E, #E8C77E 45%, #8F6B2E 80%) border-box;
  box-shadow: 0 10px 30px -18px rgba(201,165,92,.55);
}
.tg.evidence > .tg-head:hover, .tg.classical > .tg-head:hover { box-shadow: 0 14px 36px -18px rgba(201,165,92,.8); }

/* ---------- The family journey (per-station companion) ---------- */
.family { display: none; }
@media (min-width: 1100px) {
  .family { display: block; position: fixed; right: 44px; bottom: 8vh; width: 150px; z-index: 60; pointer-events: none;
    opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .7s var(--ease), transform .8s var(--ease);
    filter: drop-shadow(0 14px 34px rgba(0,0,0,.5)) drop-shadow(0 0 24px rgba(201,165,92,.18)); }
  .family.on { opacity: 1; transform: none; }
}
:root.rm .family { display: none; }

/* ---------- Real-paper du'a cards ---------- */
.dua { background: linear-gradient(180deg, rgba(15,20,34,.9), rgba(11,15,25,.94)), url(../img/texture-dua.jpg) center / cover; }
:root[data-theme="day"] .dua { background: linear-gradient(180deg, rgba(255,254,250,.82), rgba(255,254,250,.86)), url(../img/texture-dua.jpg) center / cover; }

/* ---------- The Library: night-library backdrop, framed ---------- */
.library { isolation: isolate; padding-left: 20px; padding-right: 20px; }
.library::before { content: ""; position: absolute; inset: clamp(28px, 5vw, 60px) -4px 8px; z-index: -1; border-radius: 26px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(11,15,25,.78), rgba(11,15,25,.94) 65%), url(../img/library-bg.jpg) center / cover no-repeat;
  box-shadow: 0 40px 90px -50px rgba(0,0,0,.8); }
:root[data-theme="day"] .library::before { background: var(--surface); box-shadow: none; }

/* ---------- Family choreography: alternate sides, walk in, bob, parallax, arrival glow ---------- */
.family-wrap { display: none; }
@media (min-width: 1100px) {
  .family-wrap { display: block; position: fixed; bottom: 6vh; width: 172px; z-index: 60; pointer-events: none; opacity: 0;
    transition: transform 1s cubic-bezier(.22, 1, .36, 1), opacity .55s ease;
    will-change: transform, opacity; }
  .family-wrap[data-side="right"] { right: 42px; left: auto; transform: translateX(140%) translateY(16px) rotate(2.5deg); }
  .family-wrap[data-side="left"] { left: 42px; right: auto; transform: translateX(-140%) translateY(16px) rotate(-2.5deg); }
  .family-wrap.on { opacity: 1; transform: translateX(0) translateY(calc(var(--fp, 0) * -34px)) rotate(0deg); }
  .family-wrap::after { content: ""; position: absolute; inset: 8% -14% -6%; z-index: -1; border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 62%, rgba(201,165,92,.32), transparent 70%); opacity: 0; }
  .family-wrap.on::after { animation: fam-glow 1.5s ease-out .55s 1; }
  .fam-img { display: block; width: 100%; filter: drop-shadow(0 16px 34px rgba(0,0,0,.55)) drop-shadow(0 0 22px rgba(201,165,92,.15));
    animation: fam-bob 5.4s ease-in-out infinite; transform-origin: 50% 100%; }
}
@keyframes fam-bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-7px) rotate(.7deg); } }
@keyframes fam-glow { 0% { opacity: 0; transform: scale(.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }
:root.rm .family-wrap { display: none; }

/* ---------- Distinct banners: Evidence vs Classical, stronger left fade ---------- */
.tg.evidence > .tg-head {
  background:
    linear-gradient(90deg, rgba(11,15,25,.97) 0%, rgba(11,15,25,.92) 38%, rgba(11,15,25,.42) 100%) padding-box,
    url(../img/knowledge-banner-evidence.jpg) right center / cover no-repeat padding-box,
    linear-gradient(100deg, #8F6B2E, #E8C77E 45%, #8F6B2E 80%) border-box;
}
.tg.classical > .tg-head {
  background:
    linear-gradient(90deg, rgba(11,15,25,.97) 0%, rgba(11,15,25,.92) 38%, rgba(11,15,25,.42) 100%) padding-box,
    url(../img/knowledge-banner-classical.jpg) right center / cover no-repeat padding-box,
    linear-gradient(100deg, #8F6B2E, #E8C77E 45%, #8F6B2E 80%) border-box;
}

/* ---------- Script toggle: always at hand, bottom right ---------- */
.script-fab { position: fixed; z-index: 115; right: 12px; bottom: calc(var(--dock-h, 0px) + 84px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 99px;
  background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); box-shadow: 0 12px 30px -16px rgba(0,0,0,.6);
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: var(--muted);
  transition: color .25s, border-color .25s, background-color .25s, transform .35s var(--spring); }
.script-fab span[lang] { font-family: "Amiri", serif; font-size: 1rem; line-height: 1; color: var(--gold-soft); }
.script-fab:hover { border-color: var(--line); color: var(--text); }
.script-fab:active { transform: scale(.94); }
.script-fab.on { background: linear-gradient(180deg, #D8B96F, #B8924A); color: #0B0F19; border-color: transparent; box-shadow: 0 12px 30px -12px rgba(201,165,92,.7); }
.script-fab.on span[lang] { color: #0B0F19; font-family: "Lateef", serif; }
@media (max-width: 899px) { .script-fab { bottom: calc(84px + env(safe-area-inset-bottom)); } }
@media (min-width: 900px) { .script-fab { bottom: 18px; } }

/* ---------- First family scene smaller ---------- */
@media (min-width: 1100px) { .family-wrap[data-fam="ihram"] { width: 118px; } }

/* ---------- Script switch: top right, self-explaining ---------- */
.watch-pill { display: none; }
.script-fab { top: 74px; right: 12px; bottom: auto; padding: 8px 14px 8px 10px; gap: 10px; text-align: left; letter-spacing: 0; }
@media (min-width: 900px) { .script-fab { bottom: auto; top: 78px; } }
@media (max-width: 899px) { .script-fab { bottom: auto; } }
.script-fab .sf-ar { font-size: 1.25rem; line-height: 1; }
.script-fab .sf-txt { display: grid; gap: 1px; }
.script-fab .sf-name { font-size: .74rem; font-weight: 800; letter-spacing: .04em; color: var(--text); }
.script-fab small { font-size: .62rem; font-weight: 600; color: var(--muted); }
.script-fab.on .sf-name, .script-fab.on small { color: #0B0F19; }
.script-fab.on .sf-ar { font-family: "Lateef", serif; font-size: 1.45rem; }

/* ---------- Video players: compact, unmistakably a video ---------- */
@media (min-width: 720px) {
  .vid, .vid-shell { max-width: 480px; }
}
.vid-face { border: 1px solid rgba(201,165,92,.45); box-shadow: 0 0 0 1px rgba(11,15,25,.8), 0 14px 36px -20px rgba(0,0,0,.7), 0 0 24px -12px rgba(201,165,92,.5); }
.vid-face::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #8F6B2E, #E8C77E, #8F6B2E); opacity: .9; }
.vid-ring { width: 56px; height: 56px; border-color: var(--gold); background: rgba(11,15,25,.66); }

/* ---------- Focus: blur the other steps while one is open ---------- */
.steps:has(> .step.is-open) > .step:not(.is-open):not(.thread) {
  filter: blur(3px) saturate(.85); opacity: .5;
  transition: filter .5s var(--ease), opacity .5s var(--ease);
}
.steps:has(> .step.is-open) > .step:not(.is-open):hover,
.steps:has(> .step.is-open) > .step:not(.is-open):focus-within { filter: none; opacity: 1; }
:root.rm .steps > .step { filter: none !important; opacity: 1 !important; }

/* ---------- Done / Next step actions ---------- */
.step-actions { display: flex; gap: 10px; align-items: center; margin: 20px 0 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.step-actions .btn { flex: none; }
.step-actions .btn.gold .ic { width: 16px; height: 16px; }

/* ---------- Script switch: sample word carries the style ---------- */
.script-fab { align-items: center; }
.script-fab .sf-ar { font-size: 1.6rem; font-family: "Amiri", serif; }
.script-fab.on .sf-ar { font-family: "Lateef", serif; font-size: 1.9rem; }
.script-fab .sf-txt small { font-size: .64rem; }

/* ---------- Text box holds the bullets and the du'a toggles ---------- */
.txtbox { background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: 16px 18px; display: grid; gap: 12px; align-content: start; }
.txtbox > .details, .txtbox > .rules { background: none; border: 0; border-radius: 0; padding: 0; }
.txtbox .dua-tg { margin-bottom: 0; background: rgba(11,15,25,.35); }
:root[data-theme="day"] .txtbox .dua-tg { background: rgba(255,255,255,.55); }
.txtbox .dua-tg > .tg-head { padding: 12px 14px; }
.txtbox .dua-tg .tg-label { font-size: .92rem; }
@media (min-width: 900px) {
  .step-inner > .txtbox:first-child:has(+ .fig) { grid-column: 1; grid-row: 1; align-self: stretch; }
  .step-inner > .txtbox:first-child + .fig { grid-column: 2; grid-row: 1; align-self: stretch; margin-top: 0; }
  .step-inner > .txtbox:first-child + .fig picture, .step-inner > .txtbox:first-child + .fig img { height: 100%; }
  .step-inner > .txtbox:first-child + .fig img { object-fit: cover; }
}

/* ---------- Page turn between stations ---------- */
.pageveil { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: opacity .34s var(--ease-io); }
.pageveil.on { opacity: 1; pointer-events: auto; }
.veil-star { width: 46px; height: 46px; color: var(--gold); animation: veil-pulse 1.3s var(--ease-io) infinite; }
@keyframes veil-pulse { 0%, 100% { transform: scale(.9) rotate(0deg); opacity: .5; } 50% { transform: scale(1.06) rotate(22.5deg); opacity: .95; } }
.page-in main { animation: page-in .55s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(26px); } }
:root.rm .pageveil { display: none; }

/* ---------- Open du'a toggles: full width, one clean card ---------- */
@media (min-width: 900px) {
  .step-inner > .txtbox:has(.dua-tg.is-open) { grid-column: 1 / -1; }
  .step-inner > .txtbox:has(.dua-tg.is-open) + .fig { grid-column: 1 / -1; grid-row: auto; align-self: start; }
  .step-inner > .txtbox:has(.dua-tg.is-open) + .fig picture, .step-inner > .txtbox:has(.dua-tg.is-open) + .fig img { height: auto; }
}
.txtbox .dua-tg > .tg-panel .tg-body { padding: 0 12px 14px; }
.txtbox .dua { border: 0; box-shadow: none; max-width: 640px; margin: 0 auto; width: 100%; }
.txtbox .dua .dua-when { letter-spacing: .1em; line-height: 1.6; }
.step-actions { border-top: 0; padding-top: 2px; margin: 14px 0 6px; }

/* ---------- Tick gets its own column, clear of the chevron ---------- */
.step-head { grid-template-columns: 44px 1fr 30px 28px; padding-right: 0; }
.step-head .chev { grid-column: 4; }
.step-tick { right: 56px; top: 23px; }

/* ---------- Stations as pages ---------- */
.station:not(.st-active) { display: none; }
body:not(.show-end) .finale, body:not(.show-end) .library { display: none; }
.st-next { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: clamp(44px, 7vw, 80px) 0 14px; }
.stn-lead { font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.st-next .btn.big { min-width: min(340px, 100%); justify-content: center; gap: 12px; }

/* ---------- Station headers at a reasonable height ---------- */
.st-hero { height: min(52svh, 470px); min-height: 300px; }
.st-name { font-size: clamp(2.7rem, 8.5vw, 4.6rem); }
.st-title { bottom: clamp(22px, 4vw, 42px); }
.st-num { font-size: clamp(1rem, 2.4vw, 1.3rem); }
.st-tag { margin-top: 8px; font-size: clamp(.9rem, 2.4vw, 1rem); }

/* ---------- Guide download chooser ---------- */
.hero-dl { margin-top: 20px; }
.hero-dl .btn { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); background: rgba(11,15,25,.35); }
.dlmenu { position: fixed; z-index: 260; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100% - 32px));
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.dl-title { font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 2px 2px 12px; }
.dl-opt { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); margin-bottom: 8px; text-decoration: none; color: var(--text); transition: border-color .2s, background-color .2s; }
.dl-opt:last-child { margin-bottom: 0; }
.dl-opt b { font-size: .95rem; }
.dl-opt span { font-size: .8rem; color: var(--muted); }
.dl-opt:hover { border-color: var(--line); background: rgba(201,165,92,.07); }

/* ---------- Finale at a calmer height ---------- */
.finale { min-height: min(56svh, 520px); }
.finale-title { font-size: clamp(2.4rem, 7.5vw, 4.4rem); }
.finale-star { width: 36px; height: 36px; }

/* ---------- Download: unmissable ---------- */
.hero-dl .btn.gold { background: linear-gradient(180deg, #D8B96F, #B8924A); height: 52px; padding: 0 26px; font-size: 1rem; box-shadow: 0 14px 40px -14px rgba(201,165,92,.85), inset 0 1px 0 rgba(255,255,255,.35); animation: dl-glow 3s var(--ease-io) infinite; }
@keyframes dl-glow { 0%, 100% { box-shadow: 0 14px 40px -14px rgba(201,165,92,.7), inset 0 1px 0 rgba(255,255,255,.35); } 50% { box-shadow: 0 14px 52px -10px rgba(201,165,92,1), inset 0 1px 0 rgba(255,255,255,.45); } }
.topnav .dl-nav { color: var(--gold-soft); border: 1px solid var(--line); border-radius: 12px; }
.topnav .dl-nav:hover { background: rgba(201,165,92,.1); }
:root.rm .hero-dl .btn.gold { animation: none; }

/* ---------- Roadmap cards: steps behind one toggle ---------- */
.rm-tg { margin-top: 6px; border-top: 1px solid var(--line-2); }
.rm-tg > .tg-head { padding: 10px 2px; }
.rm-tg > .tg-head .tg-label { font-size: .82rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rm-tg.is-open > .tg-head .tg-label { color: var(--gold-soft); }
.rm-tg .rm-steps { padding-top: 2px; }

/* ---------- Roadmap STEPS label breathing room ---------- */
.rm-tg > .tg-head { padding: 10px 6px 10px 10px; }

/* ---------- Tracker shows only the current station ---------- */
.trk-st:not(.cur) { display: none; }
.trk-st.cur .trk-st-head { pointer-events: none; }

/* ---------- Station switcher: 01–04 blocks on the right ---------- */
.stswitch { display: none; }
@media (min-width: 1100px) {
  .dots { display: none !important; }
  .stswitch { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: 96; display: grid; gap: 9px; }
  .stswitch button { display: grid; justify-items: center; gap: 1px; width: 66px; padding: 9px 4px 8px; border-radius: 14px;
    border: 1px solid var(--line-2); background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    color: var(--muted); box-shadow: 0 10px 26px -16px rgba(0,0,0,.55);
    transition: color .25s, border-color .25s, background-color .25s, transform .35s var(--spring); }
  .stswitch button b { font-family: "Cormorant", serif; font-weight: 600; font-size: 1.1rem; line-height: 1.1; color: var(--gold); font-feature-settings: "lnum"; }
  .stswitch button span { font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .stswitch button:hover { color: var(--text); border-color: var(--line); transform: translateX(-2px); }
  .stswitch button.on { background: linear-gradient(180deg, #D8B96F, #B8924A); border-color: transparent; color: #0B0F19; box-shadow: 0 12px 30px -12px rgba(201,165,92,.75); }
  .stswitch button.on b { color: #0B0F19; }
}

/* ---------- Station blocks: bigger, and only present mid-journey ---------- */
@media (min-width: 1100px) {
  .stswitch { gap: 11px; opacity: 0; pointer-events: none; transform: translateY(-50%) translateX(16px); transition: opacity .5s var(--ease), transform .6s var(--ease); }
  .stswitch.show { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
  .stswitch button { width: 86px; padding: 13px 6px 11px; border-radius: 16px; gap: 2px; }
  .stswitch button b { font-size: 1.45rem; }
  .stswitch button span { font-size: .66rem; }
}

/* ---------- The Library: on every page, and a change of register ---------- */
body:not(.show-end) .library { display: block; }
.in-library .tracker, .in-library .stswitch, .in-library .family-wrap { opacity: 0 !important; pointer-events: none !important; }
.library .lib-head, .library .lib-tabs, .library .lib-body { opacity: .3; transform: translateY(16px); filter: saturate(.8); transition: opacity 1s var(--ease), transform 1.1s var(--ease), filter 1s var(--ease); }
.library .lib-tabs { transition-delay: .12s; }
.library .lib-body { transition-delay: .22s; }
.in-library .lib-head, .in-library .lib-tabs, .in-library .lib-body { opacity: 1; transform: none; filter: none; }
#lib-title { font-family: "Amiri", "Cormorant", serif; font-weight: 400; letter-spacing: .24em; opacity: .55; filter: blur(1.2px); transition: letter-spacing 1.4s var(--ease), opacity 1.2s var(--ease), filter 1.2s var(--ease); }
.in-library #lib-title { letter-spacing: .01em; opacity: 1; filter: none; }
.lib-sub { font-family: "Amiri", serif; font-style: italic; font-size: 1.08rem; }
.library::after { content: ""; position: absolute; inset: clamp(28px, 5vw, 60px) -4px 8px; border-radius: 26px; z-index: -1; pointer-events: none;
  background: radial-gradient(62% 48% at 72% 16%, rgba(232,185,100,.26), transparent 68%);
  mix-blend-mode: screen; opacity: 0; transition: opacity 2.4s var(--ease); }
.in-library .library::after { opacity: 1; }
:root.rm .library .lib-head, :root.rm .library .lib-tabs, :root.rm .library .lib-body, :root.rm #lib-title { opacity: 1; transform: none; filter: none; letter-spacing: normal; }

/* ---------- Open step: gold Next in the tick slot ---------- */
.step-next-top { position: absolute; z-index: 2; right: 50px; top: 21px; height: 34px; padding: 0 13px 0 15px; border-radius: 99px;
  display: none; align-items: center; gap: 7px; font-size: .78rem; font-weight: 800; letter-spacing: .02em; color: #0B0F19;
  background: linear-gradient(180deg, #D8B96F, #B8924A);
  box-shadow: 0 10px 24px -10px rgba(201,165,92,.8), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .3s var(--spring), box-shadow .3s; white-space: nowrap; }
.step-next-top .ic { width: 14px; height: 14px; }
.step-next-top:hover { box-shadow: 0 12px 30px -10px rgba(201,165,92,1), inset 0 1px 0 rgba(255,255,255,.4); }
.step-next-top:active { transform: scale(.94); }
.step.is-open > .step-next-top { display: inline-flex; }
.step.is-open > .step-tick { display: none; }
.step.is-open > .step-head { padding-right: 132px; }

/* ---------- Next pill owns the right edge; chevron rests while open ---------- */
.step.is-open > .step-head .chev { opacity: 0; }
.step-next-top { right: 14px; }

/* ---------- Entering The Library changes the world ---------- */
body { transition: background-color 1.5s var(--ease); }
body.in-library { background-color: #0A0704; }
.in-library .station-kiswah { opacity: 0; }
.library::after { animation: none; }
.in-library .library::after { animation: lamp-flicker 6s ease-in-out .8s infinite; }
@keyframes lamp-flicker { 0%, 100% { opacity: 1; } 52% { opacity: .82; } 57% { opacity: .96; } 74% { opacity: .88; } }

/* Manuscript typography inside the Library */
.library, .library .virt-mn, .library .tl-line, .library .virt-note, .library .kn-en, .library .fq h3, .library .src-works, .library .src-std, .library .tl-body h3 {
  font-family: "Cormorant", Georgia, serif;
}
.library .virt-mn { font-size: 1.18rem; line-height: 1.65; }
.library .kn-en { font-size: 1.05rem; }
.library .tl-line { font-size: 1.08rem; }
.library .virt-note { font-size: 1rem; }
.library .fq h3 { font-size: 1.35rem; }
.library .kn-imam, .library .kn-cite, .library .tag, .library .mini-table, .library .tl-year, .library .kn-part { font-family: "Manrope", sans-serif; }
.lib-body .virt:first-child .virt-mn::first-letter { font-family: "Cormorant", serif; font-weight: 600; font-size: 3em; float: left; line-height: .78; padding: 4px 10px 0 0; color: var(--gold-soft); }

/* Book-index layout: contents down the side, text as the page */
@media (min-width: 980px) {
  .library { display: grid; grid-template-columns: 210px minmax(0, 1fr); column-gap: 36px; }
  .library .hairline, .library .lib-head { grid-column: 1 / -1; }
  .library .lib-tabs { grid-column: 1; align-self: start; position: sticky; top: 92px; display: grid; gap: 6px; border: 0; }
  .library .lib-tabs [role="tab"] { width: 100%; text-align: left; border-radius: 10px; border: 1px solid transparent; padding: 10px 14px; font-family: "Cormorant", serif; font-weight: 600; font-size: 1.12rem; letter-spacing: .01em; text-transform: none; }
  .library .lib-tabs [role="tab"]:hover { border-color: var(--line-2); }
  .library .lib-tabs [role="tab"][aria-selected="true"] { background: rgba(201,165,92,.14); color: var(--gold-soft); border-color: var(--line); box-shadow: none; }
  .library .lib-tabs [role="tab"][aria-selected="true"] .hon { color: var(--gold-soft); }
  .library .lib-body { grid-column: 2; margin-top: clamp(18px, 3vw, 28px); }
}
@media (min-width: 980px) {
  body:not(.show-end) .library, body.show-end .library { display: grid; }
}

/* ---------- Top step nav: previous beside next, and gentle exits ---------- */
.step-topnav { position: absolute; z-index: 2; right: 14px; top: 21px; display: none; align-items: center; gap: 8px; }
.step.is-open > .step-topnav { display: flex; }
.step-topnav .step-next-top { position: static; display: inline-flex; }
.step-prev-top { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--gold); background: rgba(11,15,25,.4); transition: background-color .25s, transform .3s var(--spring), border-color .25s; }
.step-prev-top .ic { width: 15px; height: 15px; }
.step-prev-top:hover { background: rgba(201,165,92,.12); }
.step-prev-top:active { transform: scale(.92); }
.step.leaving .step-inner > * { opacity: 0 !important; transform: translateY(-8px) !important; transition: opacity .2s ease, transform .2s ease !important; }
.step.leaving > .step-topnav { opacity: 0; transition: opacity .2s ease; }

/* ---------- Active station block levitates ---------- */
@media (min-width: 1100px) {
  .stswitch button.on { animation: block-float 6s ease-in-out infinite; will-change: transform; }
  .stswitch button.on:hover { transform: none; }
}
@keyframes block-float {
  0%, 100% { transform: translateX(-5px) translateY(0) rotate(-.7deg); box-shadow: 0 14px 32px -12px rgba(201,165,92,.7); }
  33% { transform: translateX(-9px) translateY(-5px) rotate(.6deg); box-shadow: 0 24px 46px -14px rgba(201,165,92,.95); }
  66% { transform: translateX(-4px) translateY(3px) rotate(-.35deg); box-shadow: 0 16px 36px -12px rgba(201,165,92,.8); }
}
:root.rm .stswitch button.on { animation: none; }

/* ---------- The Library, illuminated: veil, corners, divider, watermark ---------- */
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url(../img/library-veil.jpg) center / cover no-repeat #0A0704;
  opacity: 0; transition: opacity 1.8s var(--ease); }
body.in-library::before { opacity: 1; animation: veil-drift 46s ease-in-out infinite alternate; }
@keyframes veil-drift { from { transform: scale(1); } to { transform: scale(1.07) translateX(-1.2%); } }

.library { position: relative; }
.lib-corner { position: absolute; width: clamp(90px, 12vw, 150px); z-index: 1; pointer-events: none;
  opacity: 0; transform: scale(.6); transition: opacity 1s var(--ease), transform 1.2s var(--ease);
  filter: drop-shadow(0 0 14px rgba(201,165,92,.25)); }
.c-tl { left: -6px; top: clamp(16px, 3vw, 44px); }
.c-tr { right: -6px; top: clamp(16px, 3vw, 44px); transform: scale(.6) scaleX(-1); }
.c-bl { left: -6px; bottom: -6px; transform: scale(.6) scaleY(-1); }
.c-br { right: -6px; bottom: -6px; transform: scale(.6) scale(-1); }
.in-library .lib-corner { opacity: .9; }
.in-library .c-tl { transform: scale(1); transition-delay: .25s; }
.in-library .c-tr { transform: scaleX(-1); transition-delay: .4s; }
.in-library .c-bl { transform: scaleY(-1); transition-delay: .55s; }
.in-library .c-br { transform: scale(-1); transition-delay: .7s; }

.lib-head::after { content: ""; display: block; height: 30px; margin-top: 20px;
  background: url(../img/ornament-divider.png) center / contain no-repeat;
  opacity: 0; transform: scaleX(.35); transition: opacity 1.1s var(--ease) .35s, transform 1.3s var(--ease) .35s; }
.in-library .lib-head::after { opacity: .95; transform: scaleX(1); }
.lib-panel > .virt:not(:first-child) { margin-top: 52px; position: relative; }
.lib-panel > .virt:not(:first-child)::before { content: ""; position: absolute; top: -42px; left: 12%; right: 12%; height: 26px;
  background: url(../img/ornament-divider.png) center / contain no-repeat; opacity: .7; }

.lib-body { position: relative; }
.lib-body::before { content: ""; position: absolute; top: 30px; right: -20px; width: min(420px, 62%); aspect-ratio: 1;
  background: url(../img/watermark-ilm.png) center / contain no-repeat;
  opacity: 0; z-index: -1; pointer-events: none; transform: rotate(-4deg);
  transition: opacity 2.6s var(--ease) .6s; }
.in-library .lib-body::before { opacity: .055; }
:root.rm body::before { transition: none; animation: none !important; }
:root.rm .lib-corner { transition: none; }

/* ---------- Top bar: aligned, and it changes with the Library ---------- */
.topnav [data-action="mode"]::after { display: none; }
.topnav { align-items: center; }
.topnav .nav-btn { height: 40px; display: inline-flex; align-items: center; padding: 0 12px; }
.topnav .dl-nav { height: 40px; padding: 0 16px; }
.top-tools { display: flex; align-items: center; gap: 8px; }
.top-tools .tool-btn { height: 40px; min-width: 40px; display: inline-flex; align-items: center; justify-content: center; }

.in-library .topbar { background: rgba(10, 7, 4, .78); -webkit-backdrop-filter: blur(18px) saturate(1.1); backdrop-filter: blur(18px) saturate(1.1); border-bottom: 1px solid rgba(201,165,92,.16); }
.in-library .topnav .nav-btn span, .in-library .topnav .dl-nav span { font-family: "Cormorant", serif; font-weight: 600; font-size: 1.05rem; letter-spacing: .02em; }
.in-library .brand-en { color: var(--gold-soft); }
.in-library .script-fab { background: rgba(10, 7, 4, .72); border-color: rgba(201,165,92,.22); }
.in-library .script-fab.on { box-shadow: 0 8px 20px -12px rgba(201,165,92,.5); filter: saturate(.92); }
.in-library .progress span { background: linear-gradient(90deg, #6E531E, #C9A55C); }


/* ---------- Library restyle: the approved mockup (room backdrop, gold-bar tabs, dark paper cards) ---------- */
body::before {
  background:
    linear-gradient(100deg, rgba(8,5,3,.42) 0%, rgba(8,5,3,.62) 42%, rgba(8,5,3,.78) 100%),
    url(../img/library-bg.jpg) center / cover no-repeat #0A0704;
}
/* No framed panel behind the section: content sits on the room itself */
.library::before, .library::after { display: none; }
.library .hairline { display: none; }
/* Top corners only, larger */
.lib-corner { display: none !important; }
.lib-corner { width: clamp(110px, 14vw, 185px); filter: drop-shadow(0 0 18px rgba(201,165,92,.3)); }
.c-tl { top: clamp(4px, 1.5vw, 20px); }
.c-tr { top: clamp(4px, 1.5vw, 20px); }
/* Heading scale */
.library #lib-title { font-size: clamp(3rem, 8.5vw, 5.3rem); font-weight: 500; color: #F5EDDD; }
.lib-sub { font-size: 1.16rem; color: #D6C9B2; }
.lib-head { padding-top: clamp(18px, 4vw, 48px); }
/* Sidebar tabs: hairline-separated serif rows, gold bar on the active one */
@media (min-width: 980px) {
  .library { grid-template-columns: 230px minmax(0, 1fr); }
  .library .lib-tabs { gap: 0; }
  .library .lib-tabs [role="tab"] {
    border: 0; border-radius: 0; border-bottom: 1px solid rgba(201,165,92,.16);
    padding: 15px 16px; font-size: 1.18rem; color: #D8CDBA;
  }
  .library .lib-tabs [role="tab"]:hover { border-color: rgba(201,165,92,.16); color: #F0E7D6; }
  .library .lib-tabs [role="tab"][aria-selected="true"] {
    background: linear-gradient(90deg, rgba(201,165,92,.26), rgba(201,165,92,.05));
    color: var(--gold-soft); border-color: rgba(201,165,92,.3); border-radius: 0 6px 6px 0;
    box-shadow: inset 3px 0 0 #C9A55C;
  }
}
/* Mobile pills, matched to the same language */
.lib-tabs [role="tab"][aria-selected="true"] { background: rgba(201,165,92,.16); color: var(--gold-soft); border-color: rgba(201,165,92,.4); }
.lib-tabs [role="tab"][aria-selected="true"] .hon { color: var(--gold-soft); }
/* Cards: dark textured paper */
.library .virt, .library .fq, .library .src-imam {
  background-color: #17110A; background-image: url(../img/texture-dua.jpg);
  background-size: cover; background-blend-mode: multiply;
  border: 1px solid rgba(201,165,92,.14); border-radius: 14px;
  padding: clamp(22px, 3.2vw, 34px);
  box-shadow: 0 28px 56px -34px rgba(0,0,0,.85);
}
.library .virt-ar { font-size: clamp(1.5rem, 2.1vw, 1.85rem); line-height: 1.85; color: #D9B36B; margin-bottom: 14px; }
.library .virt-mn { color: #EFE6D3; }
.lib-panel { gap: 30px; }
/* No ornament between cards, no drop cap: clean spacing, like the mockup */
.lib-panel > .virt:not(:first-child) { margin-top: 0; }
.lib-panel > .virt:not(:first-child)::before { display: none; }
.lib-body .virt:first-child .virt-mn::first-letter { float: none; font-family: inherit; font-weight: inherit; font-size: inherit; padding: 0; color: inherit; line-height: inherit; }
/* Toggle rows: bordered rounded rows with the chevron circle */
.library .lib-tg { border: 1px solid rgba(233,220,193,.15); border-radius: 12px; margin-top: 12px; background: rgba(8,5,3,.32); }
.library .lib-tg > .tg-head { padding: 14px 16px; justify-content: flex-start; gap: 7px; }
.library .lib-tg > .tg-head .chev { margin-left: auto; }
.library .lib-tg .tg-label { flex: none; }
.library .lib-tg .tg-label { font-family: "Cormorant", serif; font-weight: 600; font-size: 1.1rem; color: #EFE6D3; }
.library .lib-tg .tg-count { background: none; padding: 0; font-family: "Cormorant", serif; font-weight: 600; font-size: 1.02rem; color: #EFE6D3; }
.library .lib-tg .tg-count::before { content: "("; }
.library .lib-tg .tg-count::after { content: ")"; }
.library .lib-tg .tg-inner { padding: 0 16px; }

@media (min-width: 980px) {
  .library { width: min(1080px, calc(100% - 2 * var(--gutter))); }
  .library .virt-ar { font-size: clamp(1.6rem, 2.2vw, 2rem); }
}


/* ---------- Library threshold: enter by choice ---------- */
body:not(.lib-open) .library .lib-head,
body:not(.lib-open) .library .lib-tabs,
body:not(.lib-open) .library .lib-body { display: none !important; }
body.lib-open .lib-gate { display: none; }
.lib-gate { grid-column: 1 / -1; min-height: 42vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 6px; padding: clamp(36px, 6vw, 72px) 20px; }
.lg-kicker { font-family: "Manrope", sans-serif; font-size: .74rem; font-weight: 800; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); margin: 0; }
.lg-title { font-family: "Cormorant", serif; font-weight: 500; font-size: clamp(2.4rem, 6.5vw, 4rem); line-height: 1.05; color: #F5EDDD; margin: 6px 0 0; }
.lg-sub { font-family: "Amiri", serif; font-style: italic; font-size: 1.08rem; color: var(--muted); margin: 8px 0 0; max-width: 40ch; }
.lg-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.lg-enter, .lg-stay { border-radius: 999px; padding: 13px 26px; font-weight: 700; font-size: .95rem; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s, color .3s; }
.lg-enter { background: linear-gradient(180deg, #D8B96F, #B8924A); color: #0B0F19; box-shadow: 0 14px 30px -16px rgba(201,165,92,.55); }
.lg-enter:hover { transform: translateY(-2px); box-shadow: 0 20px 38px -16px rgba(201,165,92,.7); }
.lg-stay { border: 1px solid var(--line); color: var(--muted); background: transparent; }
.lg-stay:hover { color: var(--text); border-color: var(--gold); }
