/* Layout: one 480px app column, sticky greeting, atmospheric hero, cards, fixed 4-tab bar.
 * Sprint 2 adds: location presets, alert settings, quiet hours, reminder bar, Adhan screen.
 * Sprint 3 adds: audio source picker and Now playing panel, Quran reader, Qibla compass, More tools.
 * Sprint 4 adds: EN/FR language pill, muezzin voice list, sticky Quran recitation player. */
:root {
  /* Light: ivory ground, deep emerald ink, warm gold */
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --surface-2: #F3EFE6;
  --fg: #0E1F18;
  --fg-muted: #5A6A62;
  --line: rgba(6, 78, 59, 0.12);
  --emerald: #064E3B;
  --emerald-deep: #022C22;
  --on-emerald: #FAF8F5;
  --gold: #D4AF37;
  --amber: #F59E0B;
  --gold-ink: #8C6D12;
  --gold-soft: rgba(212, 175, 55, 0.16);
  --emerald-soft: rgba(6, 78, 59, 0.07);
  --shadow: 0 1px 2px rgba(2, 44, 34, 0.06), 0 8px 24px rgba(2, 44, 34, 0.06);
  --tabbar-bg: rgba(250, 248, 245, 0.86);
  --pattern-opacity: 0;

  --font-sans: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Geeza Pro", "Times New Roman", serif;

  --radius: 20px;
  --radius-sm: 12px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050B08;
    --surface: #0A1511;
    --surface-2: #0F1F18;
    --fg: #F1ECE2;
    --fg-muted: #98AAA1;
    --line: rgba(212, 175, 55, 0.14);
    --emerald: #0B6B50;
    --emerald-deep: #022C22;
    --on-emerald: #F1ECE2;
    --gold-ink: #E3C15A;
    --gold-soft: rgba(212, 175, 55, 0.13);
    --emerald-soft: rgba(16, 185, 129, 0.08);
    --shadow: 0 0 0 1px rgba(212, 175, 55, 0.06);
    --tabbar-bg: rgba(5, 11, 8, 0.86);
    --pattern-opacity: 0.07;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #050B08;
  --surface: #0A1511;
  --surface-2: #0F1F18;
  --fg: #F1ECE2;
  --fg-muted: #98AAA1;
  --line: rgba(212, 175, 55, 0.14);
  --emerald: #0B6B50;
  --emerald-deep: #022C22;
  --on-emerald: #F1ECE2;
  --gold-ink: #E3C15A;
  --gold-soft: rgba(212, 175, 55, 0.13);
  --emerald-soft: rgba(16, 185, 129, 0.08);
  --shadow: 0 0 0 1px rgba(212, 175, 55, 0.06);
  --tabbar-bg: rgba(5, 11, 8, 0.86);
  --pattern-opacity: 0.07;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .6s ease, color .6s ease;
  min-height: 100%;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }

/* Geometric eight-point star watermark (visible in Night) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--pattern-opacity);
  transition: opacity .6s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23D4AF37' stroke-width='1'%3E%3Crect x='28' y='28' width='32' height='32'/%3E%3Crect x='28' y='28' width='32' height='32' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='8'/%3E%3Cpath d='M0 0 21.4 21.4M88 0 66.6 21.4M0 88l21.4-21.4M88 88 66.6 66.6M44 0v21.4M44 88V66.6M0 44h21.4M88 44H66.6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 88px 88px;
  z-index: 0;
}

/* ---------- App shell ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(var(--sat) + 14px);
  padding-bottom: calc(var(--tabbar-h) + var(--sab) + 24px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.greet-ar {
  font-family: var(--font-ar);
  font-size: 1.65rem;
  line-height: 1.25;
  color: var(--gold-ink);
}
.greet-en {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}
.icon-btn.small { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn svg, .loc-pill svg, .tab svg, .btn svg, .audio-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 14px;
}
.loc-pill {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--emerald-soft);
  color: var(--fg);
  font-size: .82rem; font-weight: 600;
}
.loc-pill svg { width: 16px; height: 16px; color: var(--gold-ink); flex: none; }
.loc-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dates { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.3; }
.hijri { font-size: .85rem; font-weight: 700; color: var(--gold-ink); }
/* Sprint 15: the Hijri date is a button that opens the moon-sighting note */
button.hijri { appearance: none; -webkit-appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; font-size: .85rem; font-weight: 700; color: var(--gold-ink); cursor: pointer; text-align: right; line-height: 1.3; border-bottom: 1px dotted currentColor; border-radius: 0; }
button.hijri:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; border-radius: 4px; }
.hijri-note { margin: 6px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); color: var(--fg); font-size: .82rem; line-height: 1.45; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.hijri-note[hidden] { display: none; }
.hijri-note p { margin: 0; }
.greg { font-size: .78rem; color: var(--fg-muted); }

.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  font-size: .82rem;
}
.link-btn {
  background: none; border: 0; padding: 4px 0;
  color: var(--gold-ink); font-weight: 700; font-size: .82rem;
  text-decoration: underline; text-underline-offset: 3px;
  flex: none;
}

/* ---------- Views ---------- */
.views { margin-top: 16px; }
.view { display: flex; flex-direction: column; gap: 14px; animation: viewIn .35s ease both; }
@keyframes viewIn { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }

/* ---------- Hero ---------- */
.hero {
  --sky: linear-gradient(180deg, #020617 0%, #022C22 60%, #064E3B 100%);
  --orb-x: 78%; --orb-y: 22%; --orb-size: 46px;
  --orb: radial-gradient(circle at 35% 35%, #FFF8E1, #F3D27A 70%);
  --orb-glow: rgba(243, 210, 122, .35);
  --stars: 1;
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  color: #FBF7EE;
  isolation: isolate;
  min-height: 300px;
  box-shadow: 0 12px 32px rgba(2, 44, 34, .22);
}
.hero-sky { position: absolute; inset: 0; background: var(--sky); z-index: -1; transition: background 1s ease; }
.orb {
  position: absolute;
  left: var(--orb-x); top: var(--orb-y);
  width: var(--orb-size); height: var(--orb-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--orb);
  box-shadow: 0 0 40px 12px var(--orb-glow);
  transition: left 1s ease, top 1s ease, background 1s ease;
}
.stars {
  position: absolute; inset: 0;
  opacity: var(--stars);
  transition: opacity 1s ease;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 44% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 33%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 88% 50%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 58%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 34% 76%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 14%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 70%, #fff 50%, transparent 51%);
}
.horizon {
  position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 120' preserveAspectRatio='none'%3E%3Cpath fill='%23000' fill-opacity='.28' d='M0 120V92h40v-8h18v8h30V70l8-10 8 10v22h44V58c0-12 10-22 22-26 12 4 22 14 22 26v34h40V64l8-12 8 12v28h36v-6h20v6h42V76l7-9 7 9v16h36V84h22v36Z'/%3E%3C/svg%3E") bottom / 100% 70% no-repeat;
}
.hero[data-window="fajr"] {
  --sky: linear-gradient(180deg, #111A3E 0%, #3B2A6B 50%, #B86A8A 88%, #F2B68A 100%);
  --orb-x: 22%; --orb-y: 86%; --orb-size: 54px;
  --orb: radial-gradient(circle, #FFE7C2, #F7B977 70%);
  --orb-glow: rgba(247, 185, 119, .45);
  --stars: .55;
}
.hero[data-window="sunrise"] {
  --sky: linear-gradient(180deg, #0B3B5C 0%, #136A8A 55%, #E7A84B 100%);
  --orb-x: 26%; --orb-y: 62%; --orb-size: 50px;
  --orb: radial-gradient(circle, #FFF6D8, #F8C35C 70%);
  --orb-glow: rgba(248, 195, 92, .5);
  --stars: 0;
}
.hero[data-window="dhuhr"] {
  --sky: linear-gradient(180deg, #0A4A68 0%, #0E6E7C 55%, #0F766E 100%);
  --orb-x: 50%; --orb-y: 14%; --orb-size: 52px;
  --orb: radial-gradient(circle, #FFFDF2, #FBE08A 70%);
  --orb-glow: rgba(251, 224, 138, .55);
  --stars: 0;
}
.hero[data-window="asr"] {
  --sky: linear-gradient(180deg, #4A1A0B 0%, #8A3A12 50%, #C9741A 100%);
  --orb-x: 76%; --orb-y: 34%; --orb-size: 50px;
  --orb: radial-gradient(circle, #FFF2CF, #F59E0B 75%);
  --orb-glow: rgba(245, 158, 11, .45);
  --stars: 0;
}
.hero[data-window="maghrib"] {
  --sky: linear-gradient(180deg, #2A0B4A 0%, #7A1A4F 45%, #D2542A 85%, #F59E0B 100%);
  --orb-x: 80%; --orb-y: 82%; --orb-size: 62px;
  --orb: radial-gradient(circle, #FFD9A0, #F36F2A 75%);
  --orb-glow: rgba(243, 111, 42, .55);
  --stars: .2;
}
.hero[data-window="isha"] .orb {
  /* crescent moon */
  background: transparent;
  box-shadow: inset -12px 6px 0 0 #F3D27A, 0 0 30px 2px rgba(243, 210, 122, .18);
}

.hero-body {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 18px 18px 26px;
}
.hero-now {
  font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(251, 247, 238, .82);
  background: rgba(0, 0, 0, .18);
  padding: 4px 12px; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ring-wrap { position: relative; width: 196px; height: 196px; margin: 14px 0 6px; max-width: 100%; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 5; }
.ring-fill {
  fill: none; stroke: #F3D27A; stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 339.29; stroke-dashoffset: 339.29;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px rgba(243, 210, 122, .55));
}
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label { font-size: .78rem; color: rgba(251, 247, 238, .78); }
.countdown {
  font-size: 2.15rem; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.hero-ar { font-family: var(--font-ar); font-size: 2.1rem; line-height: 1.35; color: #F3D27A; }
.hero-name { font-size: 1.05rem; font-weight: 700; }
.hero-at { font-weight: 500; color: rgba(251, 247, 238, .8); }

/* ---------- Schedule ---------- */
.method-chip {
  font-size: .72rem; font-weight: 600; color: var(--fg-muted);
  padding: 3px 10px; border-radius: 999px; background: var(--surface-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%;
}
.prayer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.prayer-row {
  display: grid;
  grid-template-columns: 1fr auto 44px;
  align-items: center;
  gap: 10px;
  padding: 10px 6px 10px 12px;
  border-radius: 14px;
  transition: background-color .3s ease;
}
.prayer-row .p-names { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.p-en { font-weight: 600; }
.p-ar { font-family: var(--font-ar); font-size: 1.15rem; color: var(--fg-muted); line-height: 1; }
.p-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.p-tag {
  display: inline-block; margin-left: 6px;
  font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; vertical-align: 2px;
}
.prayer-row.is-passed .p-en, .prayer-row.is-passed .p-time { color: var(--fg-muted); font-weight: 500; }
.prayer-row.is-current { background: var(--emerald-soft); }
.prayer-row.is-current .p-tag { background: var(--emerald); color: var(--on-emerald); }
.prayer-row.is-next { background: var(--gold-soft); }
.prayer-row.is-next .p-time { color: var(--gold-ink); }
.prayer-row.is-next .p-tag { background: var(--gold); color: #1A1405; }
.prayer-row.is-sunrise .p-en { font-weight: 500; }

.audio-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px; border: 0;
  background: transparent; color: var(--fg-muted);
}
.audio-btn[data-mode="adhan"] { color: var(--emerald); }
:root[data-theme="dark"] .audio-btn[data-mode="adhan"] { color: #34D399; }
.audio-btn[data-mode="chime"] { color: var(--gold-ink); }
.audio-btn:hover { background: var(--surface-2); }

.sunnah {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.sunnah > div { display: flex; flex-direction: column; }
.sunnah-label { font-size: .74rem; color: var(--fg-muted); }
.sunnah-time { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Ayah + tasbih ---------- */
.ref { font-size: .78rem; font-weight: 600; color: var(--gold-ink); }
.ayah-ar {
  font-family: var(--font-ar);
  font-size: 1.6rem; line-height: 2;
  text-align: right;
  color: var(--fg);
}
.ayah-en { margin-top: 6px; font-size: .95rem; line-height: 1.6; max-width: 62ch; }
.ayah-src { margin-top: 6px; font-size: .72rem; color: var(--fg-muted); }

.tasbih {
  display: flex; align-items: center; gap: 16px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.tasbih-btn {
  position: relative; flex: none;
  width: 108px; height: 108px;
  border-radius: 50%; border: 0;
  background: radial-gradient(circle at 35% 30%, #0B6B50, var(--emerald-deep));
  color: #FBF7EE;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(2, 44, 34, .28);
  transition: transform .08s ease;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
.tasbih-btn:active { transform: scale(.96); }
.tasbih-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tasbih-ring .ring-fill { stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset .2s ease; }
.tasbih-count { position: relative; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.tasbih-of { position: relative; font-size: .7rem; opacity: .75; }
.tasbih-side { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.tasbih-ar { font-family: var(--font-ar); font-size: 1.5rem; line-height: 1.3; color: var(--gold-ink); }
.tasbih-phrase { font-weight: 700; }
.tasbih-total { font-size: .78rem; color: var(--fg-muted); }
.tasbih.pulse .tasbih-btn { animation: pulse .6s ease; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px var(--gold-soft); } }

/* ---------- Install ---------- */
.install-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.install-text p { font-size: .84rem; color: var(--fg-muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border-radius: 14px; border: 0;
  font-weight: 700; font-size: .92rem;
}
.btn-gold { background: linear-gradient(180deg, #E2C25A, var(--gold)); color: #1A1405; }
.btn-emerald { background: var(--emerald); color: var(--on-emerald); width: 100%; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--fg); width: 100%; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; }
.step-n {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-ink); font-weight: 800; font-size: .78rem;
}
.inline-ico { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: #0A84FF; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Placeholders + More ---------- */
.placeholder { text-align: center; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.placeholder p { color: var(--fg-muted); max-width: 34ch; }
.ph-ar { font-family: var(--font-ar); font-size: 2.6rem; line-height: 1.3; color: var(--gold-ink) !important; }
.soon {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink);
}
.more-list { padding: 6px; display: flex; flex-direction: column; }
.more-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 12px; border: 0; background: transparent; text-align: left;
  border-radius: 12px; font-weight: 600;
}
.more-item + .more-item { border-top: 1px solid var(--line); }
button.more-item:hover { background: var(--surface-2); }
.more-sub { font-size: .8rem; font-weight: 500; color: var(--fg-muted); text-align: right; }
.more-item.is-soon { color: var(--fg-muted); }
.privacy-note { font-size: .8rem; color: var(--fg-muted); text-align: center; padding: 0 12px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 20;
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(6px + var(--sab)) max(8px, env(safe-area-inset-right, 0px));
  background: var(--tabbar-bg);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 52px; justify-content: center;
  border: 0; background: transparent;
  color: var(--fg-muted);
  font-size: .7rem; font-weight: 600;
  border-radius: 12px;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { color: var(--emerald); }
:root[data-theme="dark"] .tab.is-active { color: var(--gold); }
.tab.is-active svg { stroke-width: 2.1; }

/* ---------- Sheets ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(2, 12, 9, .5);
  animation: fade .25s ease both;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-width: 480px; margin: 0 auto;
  max-height: 88vh; max-height: 88dvh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--line); border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .25);
  animation: sheetUp .32s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 0; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px max(18px, env(safe-area-inset-right, 0px)) 8px max(18px, env(safe-area-inset-left, 0px));
}
.sheet-head h2 { font-size: 1.1rem; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 4px max(18px, env(safe-area-inset-right, 0px)) calc(24px + var(--sab)) max(18px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { font-size: .82rem; font-weight: 700; color: var(--fg-muted); padding: 0; margin-bottom: 8px; }
fieldset.field > legend { margin-bottom: 8px; }
select, input[type="search"], input[type="url"], input[type="text"], input[type="time"] {
  width: 100%; min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 16px;
}
.hint { font-size: .78rem; color: var(--fg-muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 52px; padding: 6px 4px;
  border: 0; border-radius: 10px; background: transparent;
  font-weight: 700; font-size: .88rem;
  text-align: center;
}
.seg button small { font-size: .66rem; font-weight: 500; color: var(--fg-muted); line-height: 1.25; }
.seg button[aria-checked="true"] { background: var(--surface); box-shadow: var(--shadow), 0 0 0 1.5px var(--gold); }

.offsets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.offset {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px;
  padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--surface-2);
}
.offset-name { font-weight: 600; font-size: .86rem; }
.stepper { display: flex; align-items: center; gap: 2px; }
.stepper button {
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 700; line-height: 1;
}
.stepper output { min-width: 34px; text-align: center; font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.stepper output.is-set { color: var(--gold-ink); }

.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.results button {
  width: 100%; text-align: left;
  display: flex; flex-direction: column;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid transparent; background: var(--surface-2);
}
.results button:hover { border-color: var(--gold); }
.results .r-name { font-weight: 700; }
.results .r-sub { font-size: .78rem; color: var(--fg-muted); }
.results .r-empty { padding: 10px 4px; font-size: .84rem; color: var(--fg-muted); }

.toast {
  position: fixed; left: 50%; z-index: 60;
  bottom: calc(var(--tabbar-h) + var(--sab) + 16px);
  transform: translateX(-50%);
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: 12px;
  background: var(--emerald-deep); color: #FBF7EE;
  font-size: .86rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  animation: fade .2s ease both;
}

/* ================================================================== *
 * Sprint 2
 * ================================================================== */

/* ---------- Notices ---------- */
.notice.warn { background: rgba(245, 158, 11, .14); align-items: flex-start; }
.notice.warn p { line-height: 1.5; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem;
  padding: 1px 6px; border-radius: 6px; background: var(--surface-2); white-space: nowrap;
}
.noscript { padding: 20px; text-align: center; }

/* ---------- Schedule extras ---------- */
.chips { display: flex; gap: 6px; min-width: 0; justify-content: flex-end; }
.chips .method-chip { max-width: none; }
.reminder-chip { background: var(--gold-soft); color: var(--gold-ink); }
.reminder-chip.is-off { background: var(--surface-2); color: var(--fg-muted); }
.audio-spacer { width: 40px; height: 40px; }
.audio-btn[data-mode="vibrate"] { color: var(--fg); }
.audio-btn[data-mode="silent"] { color: var(--fg-muted); opacity: .7; }

@media (max-width: 400px) {
  .schedule .card-head { flex-wrap: wrap; }
  .chips { justify-content: flex-start; }
}

/* ---------- Reminder bar ---------- */
.reminder-bar {
  position: sticky; top: calc(var(--sat) + 8px); z-index: 15;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  margin-top: 12px; padding: 10px 10px 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--emerald-deep); color: #FBF7EE;
  box-shadow: 0 10px 30px rgba(2, 44, 34, .3);
  animation: dropIn .35s cubic-bezier(.2, .8, .2, 1) both;
}
.reminder-bar > svg { width: 22px; height: 22px; fill: none; stroke: #F3D27A; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rb-title { font-weight: 700; font-size: .92rem; }
.rb-sub { font-size: .78rem; opacity: .8; }
.reminder-bar .icon-btn { background: rgba(255, 255, 255, .08); border-color: transparent; color: #FBF7EE; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- Sheet sections ---------- */
.sheet-section {
  font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--gold-ink);
  padding-top: 14px; margin-bottom: -6px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 8px;
}
.sheet-body > .sheet-section:first-child { border-top: 0; padding-top: 0; }
.field-label { font-size: .82rem; font-weight: 700; color: var(--fg-muted); }

/* Per-prayer sound */
.mode-grid { display: flex; flex-direction: column; gap: 6px; }
.mode-row {
  display: grid; grid-template-columns: 1fr minmax(0, 170px); align-items: center; gap: 10px;
  padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--surface-2);
}
.mode-name { display: flex; align-items: baseline; gap: 8px; font-weight: 600; font-size: .9rem; }
.mode-row select { min-height: 40px; background: var(--surface); font-size: 15px; padding: 0 10px; }

.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg.four button { min-height: 44px; }

/* Test sounds */
.test-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.test-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 10px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); text-align: left; font-weight: 700; font-size: .8rem; line-height: 1.25;
}
.test-btn small { font-size: .68rem; font-weight: 700; color: var(--gold-ink); text-transform: uppercase; letter-spacing: .06em; }
.test-btn:hover { border-color: var(--gold); }
.test-btn:active { transform: scale(.97); }
.stop-link { align-self: flex-start; }
@media (max-width: 380px) { .test-grid { grid-template-columns: 1fr 1fr; } }

/* Volume */
.vol-out { float: right; font-variant-numeric: tabular-nums; color: var(--fg); }
input[type="range"] { width: 100%; accent-color: var(--gold); min-height: 32px; }

/* Adhan URL */
.url-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.btn.small-btn { min-height: 46px; width: auto; padding: 0 16px; font-size: .86rem; }
.btn.wide { width: 100%; }
.btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Notifications */
.notif-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--surface-2); }
.notif-status { font-size: .84rem; font-weight: 600; }

/* Switch */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: var(--surface-2); cursor: pointer;
  font-weight: 700;
}
.switch-row small { display: block; font-size: .76rem; font-weight: 500; color: var(--fg-muted); }
.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 48px; height: 28px; border-radius: 999px; margin: 0;
  background: var(--line); position: relative; cursor: pointer; transition: background .2s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s ease;
}
.switch:checked { background: var(--emerald); }
:root[data-theme="dark"] .switch:checked { background: var(--gold); }
.switch:checked::after { transform: translateX(20px); }

/* Quiet hours */
.quiet-body { display: flex; flex-direction: column; gap: 14px; transition: opacity .2s ease; }
.quiet-body.is-off { opacity: .55; }
.quiet-list { display: flex; flex-direction: column; gap: 8px; }
.quiet-win { padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.qw-top { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.qw-top input { min-height: 40px; font-weight: 700; }
.qw-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qw-times label { display: flex; flex-direction: column; gap: 4px; font-size: .74rem; font-weight: 700; color: var(--fg-muted); }
.qw-times input { min-height: 40px; color: var(--fg); }
.qw-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day {
  min-height: 34px; border-radius: 9px; border: 1px solid var(--line); background: transparent;
  font-weight: 700; font-size: .78rem; color: var(--fg-muted);
}
.day.is-on { background: var(--emerald); border-color: var(--emerald); color: var(--on-emerald); }
:root[data-theme="dark"] .day.is-on { background: var(--gold); border-color: var(--gold); color: #1A1405; }
.quiet-add, .presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-weight: 600; font-size: .84rem;
}
.chip:hover { border-color: var(--gold); }
.chip.is-on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }

/* ---------- Adhan screen ---------- */
.adhan-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: calc(var(--sat) + 20px) 20px calc(var(--sab) + 20px);
  background: radial-gradient(120% 80% at 50% 0%, rgba(6, 95, 70, .92), rgba(2, 20, 15, .96));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: fade .4s ease both;
}
.adhan-card {
  position: relative; overflow: hidden;
  width: min(400px, 100%);
  padding: 34px 24px 24px;
  border-radius: 28px;
  text-align: center; color: #FBF7EE;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border: 1px solid rgba(243, 210, 122, .28);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  animation: rise .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.adhan-glow {
  position: absolute; left: 50%; top: -90px; width: 260px; height: 260px; margin-left: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 210, 122, .45), rgba(243, 210, 122, 0) 70%);
  animation: glow 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glow { 50% { transform: scale(1.12); opacity: .7; } }
.adhan-kicker { position: relative; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(251, 247, 238, .75); }
.adhan-ar { position: relative; font-family: var(--font-ar); font-size: 3.4rem; line-height: 1.4; color: #F3D27A; margin-top: 6px; }
.adhan-title { position: relative; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.adhan-time { position: relative; margin-top: 4px; color: rgba(251, 247, 238, .8); font-weight: 500; }
.adhan-mode {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  margin-top: 18px; padding: 6px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, .22); font-size: .82rem; font-weight: 600;
}
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: #F3D27A; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; }
.eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.adhan-mode:not([data-mode="adhan"]):not([data-mode="chime"]) .eq { display: none; }
.adhan-actions { position: relative; display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.adhan-actions .btn { width: 100%; }
.btn-light { background: #FBF7EE; color: var(--emerald-deep); }
.btn-outline-light { background: transparent; color: #FBF7EE; border: 1px solid rgba(251, 247, 238, .35); }

@media (max-width: 360px) {
  .ring-wrap { width: 170px; height: 170px; }
  .countdown { font-size: 1.9rem; }
  .offsets { grid-template-columns: 1fr; }
  .tasbih { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ================================================================== *
 * Sprint 3
 * ================================================================== */
.stack { display: flex; flex-direction: column; gap: 14px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.h-ar { font-family: var(--font-ar); font-weight: 400; color: var(--gold-ink); font-size: 1.05em; margin-left: 6px; }
.kicker { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }
.card h2 { font-size: 1.05rem; margin: 0; }
.link-btn.danger, .btn.danger { color: #B42318; }
:root[data-theme="dark"] .link-btn.danger, :root[data-theme="dark"] .btn.danger { color: #F97066; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: .86rem; font-weight: 600; }
.check-row input { width: 20px; height: 20px; accent-color: var(--gold); }
.sub-label { font-size: .78rem; font-weight: 700; color: var(--fg-muted); }
.q-empty { padding: 18px 8px; text-align: center; color: var(--fg-muted); font-size: .88rem; list-style: none; }
.flag { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--emerald-soft); color: var(--emerald); }
:root[data-theme="dark"] .flag { color: #6EE7B7; }
.flag.gold { background: var(--gold-soft); color: var(--gold-ink); }
.icon-btn.is-on { color: var(--gold-ink); background: var(--gold-soft); }
.icon-btn.is-on svg { fill: currentColor; fill-opacity: .25; }

/* ---------- Audio settings ---------- */
.mode-all { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mode-all .chip { min-height: 32px; padding: 0 12px; font-size: .78rem; }
.mode-legend { margin: 2px 0 0; padding: 10px 12px 10px 28px; border-radius: 12px; background: var(--surface-2); font-size: .76rem; color: var(--fg-muted); display: flex; flex-direction: column; gap: 3px; }
.mode-legend strong { color: var(--fg); }
.src-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; border: 1px dashed var(--line); background: var(--surface); }
.file-pick { cursor: pointer; }
.file-pick svg, .file-info svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.file-info { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); }
.file-info svg { color: var(--gold-ink); }
.fi-text { min-width: 0; }
.fi-name { font-weight: 700; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-meta { font-size: .74rem; color: var(--fg-muted); }
.test-btn.is-playing { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 1.5px var(--gold) inset; }
.now-playing {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
  transition: background .2s ease, border-color .2s ease;
}
.now-playing .eq i { background: var(--gold); animation-play-state: running; }
.now-playing[data-state="idle"] .eq i, .now-playing[data-state="silent"] .eq i { animation-play-state: paused; transform: scaleY(.3); opacity: .45; }
.now-playing[data-state="vibrate"] .eq { animation: shake .25s linear infinite; }
@keyframes shake { 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
.now-playing:not([data-state="idle"]) { border-color: var(--gold); background: var(--gold-soft); }
.now-playing[data-fallback="1"] .np-sub { color: var(--gold-ink); }
.np-text { min-width: 0; }
.np-title { font-weight: 800; font-size: .9rem; }
.np-sub { font-size: .76rem; color: var(--fg-muted); }
.np-stop svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }

/* ---------- Quran ---------- */
.q-resume { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "ref btn" "ar ar"; gap: 6px 12px; align-items: center; background: linear-gradient(135deg, var(--emerald), var(--emerald-deep)); color: var(--on-emerald); border: 0; }
.q-resume .kicker { color: #F3D27A; }
.q-resume > div { grid-area: ref; }
.q-resume-ref { font-weight: 800; }
.q-resume-ar { grid-area: ar; font-family: var(--font-ar); font-size: 1.4rem; line-height: 1.4; color: #F3D27A; text-align: right; }
.q-resume .btn { grid-area: btn; }
.q-lang, .q-listseg { margin-bottom: 10px; }
.q-listseg button { min-height: 40px; }
.q-search { margin-bottom: 8px; }
.surah-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.surah-row {
  width: 100%; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; border-radius: 10px;
}
.surah-row:hover { background: var(--surface-2); }
.surah-row.is-last { background: var(--gold-soft); }
.s-num { width: 34px; height: 34px; display: grid; place-items: center; font-weight: 800; font-size: .78rem; color: var(--gold-ink);
  background: var(--gold-soft); clip-path: polygon(50% 0, 63% 14%, 85% 15%, 86% 37%, 100% 50%, 86% 63%, 85% 85%, 63% 86%, 50% 100%, 37% 86%, 15% 85%, 14% 63%, 0 50%, 14% 37%, 15% 15%, 37% 14%); }
.s-main { min-width: 0; display: flex; flex-direction: column; }
.s-en { font-weight: 700; font-size: .92rem; }
.s-sub { font-size: .74rem; color: var(--fg-muted); }
.s-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.s-ar { font-family: var(--font-ar); font-size: 1.15rem; line-height: 1.3; color: var(--gold-ink); }
.s-flags { display: flex; gap: 4px; }
.s-prog { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 4px; max-width: 160px; }
.s-prog i { display: block; height: 100%; background: var(--gold); border-radius: 4px; width: 0; transition: width .3s ease; }
.bm-list { display: flex; flex-direction: column; gap: 6px; }
.bm-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.bm-open { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); text-align: left; }
.bm-ref { font-weight: 700; display: flex; gap: 8px; align-items: baseline; }
.bm-snip { font-size: .78rem; color: var(--fg-muted); }
.pr-row .s-prog { width: 100%; max-width: none; }

.reader-bar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  margin: 0 -4px; padding: calc(var(--sat) + 6px) 4px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.rb-titles { min-width: 0; text-align: center; }
.rb-en { font-weight: 800; }
.rb-ar { font-family: var(--font-ar); color: var(--gold-ink); line-height: 1.2; }
.mem-toggle { display: inline-flex; align-items: center; gap: 6px; }
.mem-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mem-toggle.is-on { background: var(--emerald); color: var(--on-emerald); border-color: var(--emerald); }
:root[data-theme="dark"] .mem-toggle.is-on { background: var(--gold); color: #1A1405; border-color: var(--gold); }
.reader-head { text-align: center; }
.rh-ar { font-family: var(--font-ar); font-size: 2.2rem; line-height: 1.4; color: var(--gold-ink); }
.rh-en { font-weight: 800; }
.rh-meta { font-size: .78rem; color: var(--fg-muted); }
.rh-bism { font-family: var(--font-ar); font-size: 1.7rem; line-height: 1.8; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.rh-tools { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.rh-tools .chip { min-height: 32px; font-size: .78rem; }
.rh-tools .chip[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.mem-bar { display: flex; flex-direction: column; gap: 10px; border-color: var(--gold); }
.mb-title { font-weight: 800; }
.mb-prog { display: flex; flex-direction: column; gap: 2px; }
.mb-prog .s-prog { max-width: none; }
.ayah-list { --q-scale: 1; display: flex; flex-direction: column; gap: 10px; }
.ayah { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; scroll-margin-top: calc(var(--sat) + 72px); }
.ayah.is-target { box-shadow: 0 0 0 2px var(--gold); }
.ayah-top { display: flex; align-items: center; gap: 6px; }
.ayah-num { font-size: .74rem; font-weight: 800; color: var(--gold-ink); background: var(--gold-soft); padding: 2px 8px; border-radius: 999px; }
.ayah-tools { margin-left: auto; display: flex; gap: 2px; }
.ayah-tools svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.ayah-text { font-family: var(--font-ar); font-size: calc(1.6rem * var(--q-scale)); line-height: 2.1; text-align: right; margin: 8px 0 4px; word-spacing: .08em; }
.ayah-end { color: var(--gold-ink); font-size: .85em; white-space: nowrap; }
.ayah-tr { font-size: .9rem; color: var(--fg-muted); line-height: 1.55; }
.ayah .w { font: inherit; color: inherit; background: none; border: 0; padding: 0 .04em; margin: 0; border-radius: 6px; line-height: inherit; }
.ayah button.w { cursor: pointer; }
.ayah button.w.is-hidden { color: transparent; background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--gold); text-shadow: none; }
.ayah button.w.is-hidden:hover { background: var(--gold-soft); }
.ayah button.w:not(.is-hidden) { animation: wordIn .25s ease; }
@keyframes wordIn { from { background: var(--gold-soft); } to { background: transparent; } }
.mem-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin: 4px 0 8px; }
.mem-actions .chip { min-height: 32px; font-size: .76rem; padding: 0 12px; }
.mem-actions .done-chip { background: var(--emerald); color: var(--on-emerald); border-color: var(--emerald); }
:root[data-theme="dark"] .mem-actions .done-chip { background: var(--gold); color: #1A1405; border-color: var(--gold); }
.q-state { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 28px 18px; }
.qs-title { font-weight: 800; }
.qs-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.qs-actions .btn { width: auto; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reader-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reader-foot .btn { flex-direction: column; gap: 0; min-height: 56px; }
.reader-foot small { font-size: .72rem; font-weight: 600; color: var(--fg-muted); }

/* ---------- Qibla ---------- */
.loc-pill.small { font-size: .76rem; padding: 4px 10px 4px 6px; max-width: 55%; }
.compass { position: relative; width: min(78vw, 290px); aspect-ratio: 1; margin: 10px auto 4px; }
.compass-dial { position: absolute; inset: 0; transition: transform .15s linear; }
.compass-dial svg { width: 100%; height: 100%; overflow: visible; }
.cd-ring { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; }
.cd-ticks line { stroke: var(--fg-muted); stroke-width: 1; opacity: .5; }
.cd-ticks line.maj { stroke-width: 2; opacity: .9; }
.cd-n, .cd-l { font-family: var(--font-sans); font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
.cd-n { fill: #C0392B; font-size: 16px; }
.cd-l { fill: var(--fg-muted); font-size: 13px; }
.compass-needle { position: absolute; inset: 0; transition: transform .15s linear; pointer-events: none; }
.needle-line { position: absolute; left: 50%; top: 13%; bottom: 50%; width: 4px; margin-left: -2px; border-radius: 4px; background: linear-gradient(180deg, var(--gold), rgba(212, 175, 55, .2)); }
.kaaba-icon { position: absolute; left: 50%; top: 2%; width: 34px; height: 34px; margin-left: -17px; display: grid; place-items: center; border-radius: 10px; background: #111; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.kaaba-icon svg { width: 24px; height: 24px; fill: #1b1b1b; stroke: #D4AF37; stroke-width: 1.4; stroke-linejoin: round; }
.kaaba-icon .kb-band { fill: none; }
.compass-top { position: absolute; left: 50%; top: -6px; width: 0; height: 0; margin-left: -8px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 12px solid var(--emerald); }
:root[data-theme="dark"] .compass-top { border-top-color: var(--gold); }
.compass-center { position: absolute; inset: 32%; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.compass-center span { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.compass-center small { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }
.compass.is-aligned .cd-ring { fill: var(--gold-soft); stroke: var(--gold); }
.compass.is-aligned .compass-center { box-shadow: 0 0 0 4px var(--gold-soft); }
.qb-guide { text-align: center; font-weight: 800; font-size: 1.05rem; margin-top: 8px; }
.compass.is-aligned + .qb-guide { color: var(--gold-ink); }
.qb-card { text-align: center; font-size: .82rem; color: var(--fg-muted); text-transform: capitalize; }
.qb-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 12px; }
.qb-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.qs-label { font-size: .7rem; font-weight: 700; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .04em; }
.qs-val { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.qs-sub { font-size: .76rem; color: var(--fg-muted); }
.qibla-card .hint { margin-top: 6px; }
.qb-cal { margin-top: 12px; border-radius: 12px; border: 1px solid var(--line); padding: 0 12px; }
.qb-cal summary { cursor: pointer; font-weight: 700; padding: 12px 0; font-size: .88rem; }
.qb-cal[open] { padding-bottom: 12px; }
.qb-cal .field { margin-bottom: 12px; }
.qb-coords { margin-top: 12px; font-size: .74rem; color: var(--fg-muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.qb-coords .link-btn { font-size: .74rem; }
.map-links { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.map-btn { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--emerald); color: var(--on-emerald); text-decoration: none; }
.map-btn svg { width: 26px; height: 26px; fill: none; stroke: #F3D27A; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.map-btn strong { display: block; }
.map-btn small { font-size: .76rem; opacity: .8; }
.map-alt { font-size: .76rem; color: var(--fg-muted); margin: 0 0 8px 4px; }
.map-alt a { color: var(--gold-ink); font-weight: 700; }

/* ---------- More ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 12px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); text-align: left; min-height: 104px; }
.tool:hover { border-color: var(--gold); }
.tool-ar { font-family: var(--font-ar); font-size: 1.3rem; line-height: 1.5; color: var(--gold-ink); }
.tool-en { font-weight: 800; font-size: .86rem; line-height: 1.2; }
.tool small { font-size: .7rem; color: var(--fg-muted); }
@media (max-width: 360px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
.panel-bar { display: flex; align-items: center; gap: 10px; }
.panel-bar h2 { margin: 0; font-size: 1.15rem; }
.panel-bar .icon-btn svg, .reader-bar .icon-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.tb-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.tb-ar { font-family: var(--font-ar); font-size: 2rem; line-height: 1.5; color: var(--gold-ink); }
.tb-en { font-weight: 800; font-size: 1.05rem; }
.tb-meaning { font-size: .82rem; color: var(--fg-muted); }
.tb-big {
  position: relative; width: min(66vw, 240px); aspect-ratio: 1; margin: 14px 0 8px;
  border-radius: 50%; border: 0;
  background: radial-gradient(circle at 35% 30%, #0B6B50, var(--emerald-deep));
  color: #FBF7EE; display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(2, 44, 34, .3);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform .08s ease;
}
.tb-big:active { transform: scale(.97); }
.tb-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tb-ring .ring-track { stroke-width: 7; }
.tb-ring .ring-fill { stroke-width: 7; stroke-dasharray: 552.92; stroke-dashoffset: 552.92; transition: stroke-dashoffset .2s ease; }
.tb-count { position: relative; font-size: 3.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tb-of { position: relative; font-size: .86rem; opacity: .8; }
.tb-tap { position: relative; font-size: .7rem; opacity: .6; margin-top: 6px; text-transform: uppercase; letter-spacing: .08em; }
.tb-big.is-done { box-shadow: 0 0 0 6px var(--gold-soft), 0 10px 28px rgba(2, 44, 34, .3); }
.tb-big.pulse { animation: pulse .6s ease; }
.tb-total { font-size: .82rem; color: var(--fg-muted); }
.tb-actions { display: flex; gap: 8px; margin-top: 8px; }
.tb-actions .btn { width: auto; }
.tb-phrases { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-phrases .chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-ar { font-family: var(--font-ar); font-size: 1.05rem; }
.tb-card + .card { display: flex; flex-direction: column; gap: 14px; }

.ad-prog { text-align: center; }
.ad-list { display: flex; flex-direction: column; gap: 10px; }
.card-lite { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.dhikr.is-done { border-color: var(--gold); background: linear-gradient(0deg, var(--gold-soft), var(--gold-soft)), var(--surface); }
.dk-title { margin: 0 0 6px; font-size: .9rem; font-weight: 800; }
.dk-ar { font-family: var(--font-ar); font-size: 1.45rem; line-height: 2; text-align: right; margin: 4px 0 8px; }
.dk-en { font-size: .86rem; color: var(--fg-muted); line-height: 1.55; }
.dk-note { font-size: .8rem; margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: var(--emerald-soft); }
.dk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.dk-src { font-size: .72rem; color: var(--gold-ink); font-weight: 600; }
.dk-count { flex: none; min-width: 84px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--gold); background: var(--gold-soft); color: var(--gold-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.dhikr.is-done .dk-count { background: var(--emerald); border-color: var(--emerald); color: var(--on-emerald); }
.travel-notes { display: flex; flex-direction: column; gap: 10px; }
.tn { padding-top: 10px; border-top: 1px solid var(--line); }
.tn-h { font-weight: 800; font-size: .88rem; }
.tn-p { font-size: .86rem; margin: 2px 0; }

.names-intro { font-size: .86rem; text-align: center; padding: 0 8px; }
.names-intro .dk-src { display: block; }
.names-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.name-card { position: relative; padding: 14px 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.nc-num { position: absolute; top: 8px; left: 10px; font-size: .68rem; font-weight: 800; color: var(--gold-ink); }
.nc-ar { font-family: var(--font-ar); font-size: 1.6rem; line-height: 1.6; color: var(--gold-ink); }
.nc-tr { font-weight: 800; font-size: .86rem; }
.nc-en { font-size: .76rem; color: var(--fg-muted); line-height: 1.35; }
@media (min-width: 420px) { .names-grid { grid-template-columns: repeat(3, 1fr); } }

.zk-form { display: flex; flex-direction: column; gap: 12px; }
.zk-row { display: flex; flex-direction: column; gap: 6px; }
.zk-row label, .zk-group legend, .zk-pair label { font-size: .8rem; font-weight: 700; color: var(--fg-muted); }
.zk-row label small { display: block; font-weight: 500; font-size: .72rem; }
.zk-cur { flex-direction: row; align-items: center; justify-content: space-between; }
.zk-cur input { max-width: 110px; text-transform: uppercase; text-align: center; }
.zk-group { border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px 10px; margin: 0; }
.zk-group legend { padding: 0 4px; }
.zk-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.zk-pair label { display: flex; flex-direction: column; gap: 4px; }
.zk-val { font-size: .76rem; color: var(--gold-ink); font-weight: 700; min-height: 1em; margin-top: 4px; }
input[type="number"] { width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 16px; font-variant-numeric: tabular-nums; }
.zk-result { display: flex; flex-direction: column; gap: 10px; }
.zk-sum { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.zk-sum > div { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; }
.zk-sum dt { color: var(--fg-muted); }
.zk-sum dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.zk-due { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.zk-due strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.zk-result[data-state="due"] .zk-due { background: linear-gradient(135deg, var(--emerald), var(--emerald-deep)); color: var(--on-emerald); }
.zk-result[data-state="due"] .zk-due strong { color: #F3D27A; }
.zk-status { font-size: .86rem; font-weight: 600; }
.zk-warn:empty { display: none; }

.privacy-card { display: flex; flex-direction: column; gap: 10px; }
.pv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pv-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: .86rem; }
.pv-list strong { display: block; }
.pv-val { display: block; color: var(--fg-muted); font-size: .8rem; }
.pv-dot { width: 22px; height: 22px; border-radius: 50%; margin-top: 1px; background: var(--line); display: grid; place-items: center; }
.pv-list li[data-ok="true"] .pv-dot { background: var(--emerald); }
:root[data-theme="dark"] .pv-list li[data-ok="true"] .pv-dot { background: var(--gold); }
.pv-list li[data-ok="true"] .pv-dot::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.pv-list li[data-ok="false"] .pv-dot { background: var(--gold-soft); box-shadow: inset 0 0 0 2px var(--gold); }
.pv-more summary { cursor: pointer; font-weight: 700; font-size: .86rem; }
.pv-net { margin: 8px 0; padding-left: 18px; font-size: .8rem; color: var(--fg-muted); display: flex; flex-direction: column; gap: 4px; }
.pv-net strong { color: var(--fg); }

/* ---------- Sprint 4: language pill ---------- */
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.lang-pill { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.lang-pill button {
  min-width: 36px; min-height: 36px; padding: 0 8px;
  border: 0; border-radius: 9px; background: transparent;
  font-size: .74rem; font-weight: 800; letter-spacing: .06em; color: var(--fg-muted);
}
.lang-pill button[aria-checked="true"], .lang-pill button.is-on { background: var(--surface); color: var(--emerald); box-shadow: var(--shadow), 0 0 0 1.5px var(--gold); }
:root[data-theme="dark"] .lang-pill button[aria-checked="true"], :root[data-theme="dark"] .lang-pill button.is-on { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lang-pill button[aria-checked="true"] { color: var(--gold); } }

/* ---------- Sprint 4: muezzin list ---------- */
.mz-list { display: flex; flex-direction: column; gap: 6px; }
.mz-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center;
  padding: 6px 6px 6px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mz-row.is-on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: linear-gradient(0deg, var(--gold-soft), var(--gold-soft)), var(--surface); }
.mz-row.is-playing .mz-test { color: var(--gold-ink); background: var(--gold-soft); border-color: var(--gold); }
.mz-pick { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 48px; padding: 4px 6px; border: 0; background: transparent; text-align: left; border-radius: 10px; }
.mz-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--fg-muted); display: grid; place-items: center; }
.mz-row.is-on .mz-dot { border-color: var(--gold); }
.mz-row.is-on .mz-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.mz-text { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; min-width: 0; }
.mz-name { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mz-ar { font-family: var(--font-ar); color: var(--gold-ink); font-size: .95rem; line-height: 1.2; white-space: nowrap; }
.mz-status { grid-column: 1 / -1; font-size: .72rem; color: var(--fg-muted); line-height: 1.35; }
.mz-test svg, .mz-dl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mz-dl.is-saved { color: var(--emerald); border-color: var(--emerald); background: var(--emerald-soft); }
:root[data-theme="dark"] .mz-dl.is-saved { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.mz-dl.is-busy svg { animation: spin 1s linear infinite; }
.mz-dl:disabled { opacity: 1; cursor: progress; }
.mz-gap { width: 36px; height: 36px; }
.mz-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.mz-tools .hint { margin: 0; }
.mz-pick:focus-visible, .lang-pill button:focus-visible, .qp-play:focus-visible, .qp-rep:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Sprint 4: Quran recitation player ---------- */
body.has-qplayer .app { padding-bottom: calc(var(--tabbar-h) + var(--sab) + 118px); }
.qplayer {
  position: fixed; left: 0; right: 0; z-index: 18;
  bottom: calc(var(--tabbar-h) + var(--sab) + 8px);
  max-width: 464px; margin: 0 auto;
  width: calc(100% - 16px);
  border-radius: 18px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(2, 44, 34, .18);
  animation: rise .25s ease both;
}
.qplayer[hidden] { display: none; }
.qp-panel { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 4px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.qp-panel[hidden] { display: none; }
.qp-panel .hint { margin: 0; }
.qp-panel select { width: 100%; }
.qp-progress { height: 3px; background: var(--line); }
.qp-progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s linear; }
.qp-main { display: grid; grid-template-columns: auto auto auto 1fr auto auto; gap: 6px; align-items: center; padding: 8px 10px; }
.qp-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qp-play {
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: var(--emerald); color: var(--on-emerald);
}
:root[data-theme="dark"] .qp-play { background: var(--gold); color: #1A1405; }
.qp-play svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.qplayer[data-state="loading"] .qp-play { animation: pulse 1.2s ease infinite; }
.qp-info { min-width: 0; padding: 0 2px; }
.qp-title { font-weight: 800; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-sub { font-size: .72rem; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qplayer[data-state="error"] .qp-sub { color: #B4463A; white-space: normal; }
.qp-rep { min-width: 44px; height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: .78rem; font-weight: 800; }
.qp-rep.is-on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
@media (max-width: 360px) { .qp-main { gap: 4px; padding: 8px 6px; } .qp-rep { min-width: 38px; } }

/* Playing ayah */
.ayah.is-playing { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); background: linear-gradient(0deg, var(--gold-soft), var(--gold-soft)), var(--surface); }
.ayah.is-playing .ayah-num { background: var(--gold); color: #1A1405; }
.ayah-tools [data-act="play"] svg { width: 18px; height: 18px; }
.listen-chip { gap: 6px; }
.listen-chip::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent currentColor; }

/* ================================================================== *
 * Sprint 4.1: layering, solid surfaces and touch targets
 * ================================================================== */
:root { --surface-elevated: #FFFFFF; --radius: 18px; --pattern-opacity: 0.035; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --surface-elevated: #0F1F18; --pattern-opacity: 0.045; } }
:root[data-theme="dark"] { --surface-elevated: #0F1F18; --pattern-opacity: 0.045; }
:root[data-theme="light"] { --surface-elevated: #FFFFFF; --pattern-opacity: 0.035; }

/* Cards are always solid, so text never sits on the watermark. */
.card, .card-lite, .ayah, .dhikr {
  background-color: var(--surface);
  border-radius: 18px;
}
.card { padding: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); }
:root[data-theme="dark"] .card { box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.06), 0 8px 24px rgba(0, 0, 0, .35); }

/* Layers: page < tab bar < Quran player < sheets < Adhan screen < toast */
.tabbar { z-index: 100; }
.qplayer { z-index: 110; }
.scrim {
  z-index: 999;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sheet { z-index: 1000; background: var(--surface-elevated); }
.sheet-head, .sheet-body { background: var(--surface-elevated); }
.sheet-head { border-radius: 24px 24px 0 0; }
.adhan-overlay { z-index: 1000; background-color: #021A13; }
.toast { z-index: 1100; }
body.has-qplayer .toast { bottom: calc(var(--tabbar-h) + var(--sab) + 96px); }

/* Header: the greeting shrinks, the EN/FR pill and gear never wrap. */
.topbar { flex-wrap: nowrap; }
.greet { min-width: 0; flex: 1 1 auto; }
.greet-ar { white-space: nowrap; overflow: hidden; text-overflow: clip; font-size: clamp(1.25rem, 6vw, 1.65rem); }
.greet-en { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { flex: none; }

/* Touch targets of at least 44px */
.lang-pill button { min-width: 44px; min-height: 44px; }
.sheet-head .icon-btn, .icon-btn.small.mz-test, .icon-btn.small.mz-dl, .qp-btn, .qp-rep { width: 44px; height: 44px; min-height: 44px; }
.qp-rep { width: auto; min-width: 48px; }
.mz-gap { width: 44px; height: 44px; }
.qp-play { width: 48px; height: 48px; }
.ayah-tools .icon-btn.small { width: 44px; height: 44px; }
#qbStart, .qibla-card .btn, .qibla-card .chip, .qibla-card input[type="range"] { min-height: 44px; }
body.has-qplayer .app { padding-bottom: calc(var(--tabbar-h) + var(--sab) + 124px); }

/* ---------- Sprint 5: Sakina brand, Install pill, Refresh GPS, install sheet, compass ---------- */
:root { --brand-ink: var(--emerald); --install-bg: var(--emerald); --install-fg: #FFF8E1; }
:root[data-theme="dark"] { --brand-ink: var(--gold); --install-bg: var(--gold); --install-fg: #1A1405; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --brand-ink: var(--gold); --install-bg: var(--gold); --install-fg: #1A1405; }
}

/* Brand mark: "Sakina" with سكينة beside it; it wraps under on narrow phones. */
.brand {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 0;
  margin: 0; min-width: 0; overflow: hidden; line-height: 1.15;
}
.brand-mark { width: 26px; height: 26px; flex: none; align-self: center; }
.brand-mark .bm-star { fill: var(--gold-soft); stroke: var(--gold); stroke-width: 1.3; stroke-linejoin: round; }
.brand-mark .bm-moon { fill: var(--gold); }
.brand-name { font-size: clamp(1.15rem, 5.2vw, 1.4rem); font-weight: 800; letter-spacing: -.01em; color: var(--brand-ink); }
.brand-ar { font-family: var(--font-ar); font-size: clamp(1.05rem, 4.8vw, 1.3rem); font-weight: 700; color: var(--gold-ink); white-space: nowrap; }
.greet-en { margin-top: 2px; font-size: .68rem; }
.greet-en .greet-ar { font-size: .9rem; letter-spacing: 0; text-transform: none; color: var(--gold-ink); white-space: nowrap; margin-left: 4px; }

/* Install pill: high contrast, right beside EN | FR. Hidden once installed. */
.install-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px 0 11px;
  border-radius: 999px; border: 0;
  background: var(--install-bg); color: var(--install-fg);
  font: inherit; font-size: .8rem; font-weight: 800; letter-spacing: .01em;
  box-shadow: 0 0 0 2px var(--gold), 0 6px 16px rgba(2, 44, 34, .22);
  cursor: pointer; white-space: nowrap;
}
.install-pill[hidden] { display: none; }
.install-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.install-pill:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.install-pill:active { transform: scale(.97); }
@media (max-width: 400px) {
  .topbar { gap: 8px; }
  .topbar-actions { gap: 6px; }
  .install-pill { padding: 0 12px; }
  .install-pill svg, .brand-mark { display: none; }
}
@media (max-width: 350px) { .greet-en { display: none; } }

/* Location pill + Refresh GPS */
.loc-group { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.loc-group .loc-pill { min-width: 0; }
.loc-refresh {
  position: relative; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--gold-ink);
  cursor: pointer;
}
.loc-refresh::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; } /* 44px touch target */
.loc-refresh svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.loc-refresh.is-busy svg { animation: sk-spin .9s linear infinite; }
.loc-refresh:disabled { opacity: .85; cursor: progress; }
@keyframes sk-spin { to { transform: rotate(360deg); } }

/* Install sheet: two crisp steps with a mock Safari toolbar and share menu */
.inst-lead { font-size: .92rem; color: var(--fg-muted); margin-bottom: 14px; }
.inst-steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.inst-steps[hidden] { display: none; }
.inst-step { display: flex; gap: 12px; align-items: flex-start; }
.inst-step .step-n { width: 28px; height: 28px; font-size: .86rem; background: var(--install-bg); color: var(--install-fg); }
.inst-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; font-size: .94rem; }
.inst-visual { border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.inst-bar { display: flex; justify-content: space-around; align-items: center; padding: 8px 6px; }
.ib-ico { width: 40px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--fg-muted); }
.ib-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ib-share { color: #0A84FF; background: rgba(10, 132, 255, .12); box-shadow: 0 0 0 2px #0A84FF; animation: sk-pulse 1.8s ease-in-out infinite; }
.inst-menu { display: flex; flex-direction: column; padding: 4px; }
.im-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: .88rem; color: var(--fg-muted); }
.im-row + .im-row { border-top: 1px solid var(--line); }
.im-row svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.im-hit { color: var(--fg); font-weight: 700; background: var(--surface); box-shadow: 0 0 0 2px var(--gold); animation: sk-pulse 1.8s ease-in-out infinite; }
@keyframes sk-pulse { 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .ib-share, .im-hit, .loc-refresh.is-busy svg { animation: none; } }

/* Qibla: JS animates the dial by the shortest way, so no CSS transition on transform. */
.compass-dial, .compass-needle { transition: none; will-change: transform; }
.compass.is-aligned .compass-center { box-shadow: 0 0 0 4px var(--gold-soft), 0 0 28px rgba(212, 175, 55, .5); }
.compass.is-aligned .needle-line { filter: drop-shadow(0 0 6px rgba(212, 175, 55, .8)); }
.compass.is-aligned + .qb-guide { color: var(--brand-ink); }
.qb-start { width: 100%; font-size: .98rem; }
.qb-start svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qb-fig8 { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); font-size: .84rem; }
.qb-fig8[hidden] { display: none; }
.qb-fig8 svg { width: 64px; height: 32px; flex: none; overflow: visible; }
.qb-fig8 .f8-path { fill: none; stroke: var(--gold-ink); stroke-width: 2; stroke-dasharray: 4 3; }
.qb-fig8 .f8-dot { fill: var(--brand-ink); }
.qb-decl { margin-top: 6px; }

/* Your own file, nothing chosen yet: the button opens the picker */
.mz-choose { color: var(--gold-ink); }

/* About line in Privacy */
.about-line { font-size: .88rem; color: var(--fg-muted); margin: 4px 0 12px; }
.about-brand { color: var(--brand-ink); font-weight: 800; }
.about-ar { font-family: var(--font-ar); color: var(--gold-ink); font-size: 1.05rem; }

/* ===================================================================
 * Sprint 6: lock-screen guidance, late Adhan screen, Quran reading aids
 * =================================================================== */

/* Tajweed and vowel colours: strong contrast on ivory (light) and on true black (night). */
:root {
  --v-fatha: #C2410C;
  --v-kasra: #4338CA;
  --v-damma: #0F766E;
  --v-sukun: #64748B;
  --v-shadda: #A21CAF;
  --tj-madd: #B91C1C;
  --tj-madd2: #7F1D1D;
  --tj-ghunnah: #15803D;
  --tj-idgham: #4D7C0F;
  --tj-qalqalah: #0369A1;
  --tj-silent: #A8A29E;
  --tj-stop: #A16207;
  --word-hl: rgba(212, 175, 55, 0.30);
}
:root[data-theme="dark"] {
  --v-fatha: #FB923C;
  --v-kasra: #A5B4FC;
  --v-damma: #5EEAD4;
  --v-sukun: #94A3B8;
  --v-shadda: #F0ABFC;
  --tj-madd: #F87171;
  --tj-madd2: #FCA5A5;
  --tj-ghunnah: #4ADE80;
  --tj-idgham: #BEF264;
  --tj-qalqalah: #7DD3FC;
  --tj-silent: #78716C;
  --tj-stop: #FACC15;
  --word-hl: rgba(212, 175, 55, 0.26);
}
.v-fatha { color: var(--v-fatha); }
.v-kasra { color: var(--v-kasra); }
.v-damma { color: var(--v-damma); }
.v-sukun { color: var(--v-sukun); }
.v-shadda { color: var(--v-shadda); }
.tj-madd { color: var(--tj-madd); }
.tj-madd2 { color: var(--tj-madd2); }
.tj-ghunnah { color: var(--tj-ghunnah); }
.tj-idgham { color: var(--tj-idgham); }
.tj-qalqalah { color: var(--tj-qalqalah); }
.tj-silent { color: var(--tj-silent); }
.tj-stop { color: var(--tj-stop); }
.tj-madd2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .45em; }
/* Hidden words in Memorize stay hidden even when coloured. */
.ayah button.w.is-hidden, .ayah button.w.is-hidden * { color: transparent !important; text-decoration: none !important; }

/* Reading aids card */
.read-aids { display: flex; flex-direction: column; gap: 10px; }
.ra-title { font-weight: 800; font-size: .92rem; }
.ra-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.ra-toggle { min-height: 36px; font-size: .8rem; display: inline-flex; align-items: center; gap: 6px; }
.ra-toggle[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.ra-toggle:disabled { opacity: .5; }
.ra-dots { display: inline-flex; gap: 2px; }
.ra-dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.ra-dots i:nth-child(1) { background: var(--v-fatha); }
.ra-dots i:nth-child(2) { background: var(--v-kasra); }
.ra-dots i:nth-child(3) { background: var(--v-damma); }
.ra-repeat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ra-repeat .sub-label { margin: 0; }
.ra-repeat .seg { flex: 1; min-width: 180px; }
.ra-repeat .seg button { min-height: 36px; }
#raHint[hidden] { display: none; }

/* Colour legend */
.tj-legend[hidden] { display: none; }
.tl-title { font-size: .78rem; font-weight: 700; color: var(--fg-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; }
.tl-list li { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: .78rem; }
.tl-sample { font-family: var(--font-ar); font-size: 1.35rem; line-height: 1; min-width: 34px; text-align: center; padding: 2px 4px; border-radius: 8px; background: var(--surface-2); }
.tl-label { color: var(--fg); }

/* Transliteration under the Arabic */
.ayah-translit { font-size: .86rem; font-style: italic; color: var(--fg-muted); margin: 0 0 6px; line-height: 1.5; }

/* Word-by-word: the word being recited, and tappable words */
.ayah .w { transition: background-color .15s ease, box-shadow .15s ease; }
.ayah span.w.is-tap { cursor: pointer; }
.ayah span.w.is-tap:hover { background: var(--surface-2); }
.ayah .w.is-reciting { background: var(--word-hl); box-shadow: 0 0 0 2px var(--word-hl); border-radius: 8px; }
.ayah.is-reciting { border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--gold); }
@media (prefers-reduced-motion: reduce) { .ayah .w { transition: none; } }

/* Lock-screen guidance in Settings */
.lock-guide { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.lg-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .88rem; }
.lg-title svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lg-now { font-size: .84rem; padding: 8px 10px; border-radius: 10px; background: var(--gold-soft); color: var(--fg); }
.lg-now:empty { display: none; }
.lg-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--fg-muted); line-height: 1.45; }
.lg-list strong { color: var(--fg); }
.lock-guide .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Adhan screen: a missed prayer, and the big Play button */
.adhan-play-big { min-height: 56px; font-size: 1.05rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.adhan-play-big svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.adhan-play-big[hidden] { display: none; }
.adhan-overlay.is-late .adhan-kicker { color: #FDE68A; }

/* =====================================================================
   Sprint 7 · lock-screen alarm sync, Keep Screen Awake, missed-alert
   banner, Salat al-Ibrahimiyyah
   ===================================================================== */

/* Missed alert after unlock */
.missed-bar {
  position: sticky; top: calc(var(--sat) + 8px); z-index: 16;
  margin-top: 12px; padding: 12px 12px 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--emerald-deep); color: #FBF7EE;
  border: 1px solid rgba(243, 210, 122, .35);
  box-shadow: 0 10px 30px rgba(2, 44, 34, .32);
  display: flex; flex-direction: column; gap: 10px;
  animation: dropIn .35s cubic-bezier(.2, .8, .2, 1) both;
}
.missed-bar[hidden] { display: none; }
.mb-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.mb-head > svg { width: 24px; height: 24px; margin-top: 2px; fill: none; stroke: #F3D27A; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mb-titles { min-width: 0; }
.mb-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: #FDE68A; }
.mb-title { font-weight: 800; font-size: 1rem; line-height: 1.3; }
.mb-sub { font-size: .8rem; opacity: .8; }
.missed-bar .icon-btn { background: rgba(255, 255, 255, .08); border-color: transparent; color: #FBF7EE; }
.mb-status { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .8rem; line-height: 1.4; text-align: left; }
.mb-status li { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; }
.mb-status strong { font-weight: 800; }
.mb-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #FBBF24; }
.mb-status li[data-ok="yes"] .mb-dot { background: #34D399; }
.mb-status li[data-ok="no"] .mb-dot { background: #F97066; }
.mb-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.mb-play { min-height: 52px; font-size: 1rem; font-weight: 800; width: 100%; }
.mb-play svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.mb-play.is-playing svg { display: none; }
.mb-sync { background: transparent; color: #FBF7EE; border: 1px solid rgba(251, 247, 238, .35); width: 100%; min-height: 44px; font-size: .86rem; }
.mb-sync svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 420px) { .mb-actions { grid-template-columns: 1fr 1fr; } }

/* The same account on the Adhan screen for a missed prayer */
.adhan-overlay { overflow-y: auto; }
.adhan-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); color: #FBF7EE; position: relative; }
.adhan-note[hidden] { display: none; }
.adhan-sync[hidden] { display: none; }

/* Home: quick link to Salat al-Ibrahimiyyah under the prayer list */
.sched-link {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  width: 100%; margin-top: 12px; padding: 10px 12px; min-height: 48px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--emerald-soft);
  color: var(--fg); text-align: left; font-weight: 700; font-size: .84rem; cursor: pointer;
}
.sched-link .sl-ar { font-family: var(--font-ar); font-size: 1.05rem; color: var(--gold-ink); line-height: 1.4; }
.sched-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 380px) { .sched-link .sl-ar { display: none; } .sched-link { grid-template-columns: 1fr auto; } }

/* Home: lock-screen alarms card */
.alarm-card { display: flex; flex-direction: column; gap: 10px; }
.alarm-head { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.alarm-head h2 { margin: 0; font-size: 1rem; }
.alarm-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-ink); }
.alarm-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.alarm-sub { font-size: .8rem; color: var(--fg-muted); line-height: 1.45; margin-top: 2px; }
.alarm-status, .lg-sync { font-size: .8rem; font-weight: 600; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--fg); line-height: 1.4; }
.alarm-status:empty, .lg-sync:empty { display: none; }
.alarm-status[data-state="ok"], .lg-sync[data-state="ok"] { background: var(--emerald-soft); }
.alarm-status[data-state="none"], .alarm-status[data-state="soon"], .alarm-status[data-state="expired"], .alarm-status[data-state="moved"],
.lg-sync[data-state="none"], .lg-sync[data-state="soon"], .lg-sync[data-state="expired"], .lg-sync[data-state="moved"] { background: var(--gold-soft); }
.alarm-card .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.alarm-card .switch-row small { margin-top: 2px; line-height: 1.4; }

/* Keep Screen Awake in Settings */
#wakeField { display: flex; flex-direction: column; gap: 8px; }
.wake-scope { transition: opacity .2s ease; }
.wake-scope.is-off { opacity: .55; }
.wake-now { font-size: .82rem; font-weight: 600; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); line-height: 1.4; }
.wake-now:empty { display: none; }
.wake-now[data-state="on"] { background: var(--emerald-soft); }
.wake-now[data-state="warn"] { background: var(--gold-soft); }

/* More: the Salat al-Ibrahimiyyah tile spans the grid */
.tool-wide { grid-column: 1 / -1; min-height: 0; background: linear-gradient(135deg, var(--emerald-soft), var(--gold-soft)); border-color: var(--gold); }
.tool-wide .tool-ar { font-size: 1.45rem; }

/* Salat al-Ibrahimiyyah panel */
.ib-intro { display: flex; flex-direction: column; gap: 10px; }
.ib-title-ar { font-family: var(--font-ar); font-size: 1.9rem; line-height: 1.6; text-align: center; color: var(--gold-ink); }
.ib-lead { font-size: .9rem; text-align: center; color: var(--fg-muted); line-height: 1.5; }
.ib-h3 { margin: 4px 0 0; font-size: .92rem; }
.ib-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ib-steps li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 12px; font-size: .86rem; line-height: 1.4; }
.ib-steps li.is-here { background: var(--gold-soft); box-shadow: 0 0 0 1.5px var(--gold); }
.ib-step-sub { display: block; font-size: .8rem; color: var(--fg-muted); }
.ib-aids { display: flex; gap: 6px; flex-wrap: wrap; }
.ib-aids .chip[aria-pressed="false"] { opacity: .7; }
.ib-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ib-line { padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: background-color .2s ease, box-shadow .2s ease; cursor: default; }
.ib-line.is-reciting { background: var(--gold-soft); border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--gold); }
.ib-ar { font-family: var(--font-ar); font-size: 1.6rem; line-height: 2.1; text-align: right; color: var(--fg); }
.ib-tr { font-size: .88rem; font-style: italic; color: var(--fg-muted); line-height: 1.5; margin-top: 2px; }
.ib-mean { font-size: .88rem; line-height: 1.5; margin-top: 4px; }
.ib-source { margin-top: 10px; font-size: .76rem; font-weight: 600; color: var(--gold-ink); line-height: 1.45; }
.ib-player { display: flex; flex-direction: column; gap: 10px; }
.ib-player .card-head { margin-bottom: 0; }
.ib-controls { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; }
.ib-play { width: 54px; height: 54px; }
.ib-play .i-pause { display: none; }
.ib-player[data-state="playing"] .ib-play .i-play { display: none; }
.ib-player[data-state="playing"] .ib-play .i-pause { display: block; }
.ib-stop { width: auto; min-height: 44px; padding: 0 12px; }
.ib-stop svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ib-stop:disabled { opacity: .5; }
.ib-rep { grid-template-columns: repeat(3, 1fr); }
.ib-rep button { min-height: 40px; }
.ib-progress { border-radius: 2px; overflow: hidden; }
.ib-status { font-size: .84rem; font-weight: 600; min-height: 1.3em; }
@media (max-width: 380px) { .ib-controls { grid-template-columns: auto 1fr; } .ib-rep { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .ib-line { transition: none; } }

/* =====================================================================
 * Sprint 8 · Compact Learn & Tajweed toolbar, Play Full Surah,
 * playback speed and the "screen awake" line in the Quran player
 * ===================================================================== */
.read-aids.ra-compact { gap: 8px; }
.ra-row { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px 1px 4px; margin: 0 -1px; }
.ra-row::-webkit-scrollbar { display: none; }
.ra-row .chip { flex: 0 0 auto; white-space: nowrap; min-height: 36px; font-size: .8rem; }
.ra-expand { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.ra-caret { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.ra-expand.is-open { background: var(--emerald-soft); border-color: var(--emerald); }
.ra-expand.is-open .ra-caret { transform: rotate(180deg); }
.ra-legend-btn.is-on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.ra-legend-btn[hidden] { display: none; }
.ra-compact .tj-legend, .ra-drawer { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.ra-drawer { display: flex; flex-direction: column; gap: 8px; }
.ra-drawer[hidden] { display: none; }
.ra-intro { margin: 0; font-size: .8rem; line-height: 1.45; color: var(--fg-muted); }
.ra-drawer .hint { margin: 0; }
.ra-compact .tl-list li { min-height: 26px; }

.reader-head .q-playfull { display: flex; width: max-content; max-width: 100%; align-items: center; justify-content: center; gap: 8px; margin: 12px auto 0; min-height: 44px; }
.q-playfull svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.q-playfull.is-on { box-shadow: 0 0 0 2px var(--gold); }

.qp-main { grid-template-columns: auto auto auto 1fr auto auto auto; }
.qp-speed { min-width: 52px; font-variant-numeric: tabular-nums; }
.qp-awake { display: flex; align-items: center; gap: 6px; margin: 0; padding: 5px 12px 0; font-size: .72rem; font-weight: 600; color: var(--emerald); }
:root[data-theme="dark"] .qp-awake { color: #6EE7B7; }
.qp-awake::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.qp-awake[data-state="warn"] { color: var(--gold-ink); }
.qp-awake[hidden] { display: none; }
.qp-panel .check-row { font-size: .8rem; }
.qp-panel .check-row[hidden] { display: none; }
#qpSpeedSeg button { min-height: 40px; font-variant-numeric: tabular-nums; }
@media (max-width: 360px) { .qp-main { gap: 3px; } .qp-speed { min-width: 44px; padding: 0 4px; } }
@media (prefers-reduced-motion: reduce) { .ra-caret { transition: none; } }

/* =====================================================================
 * Sprint 9 · Play All / Stop in the bottom player, pause between verses
 * ===================================================================== */
.qp-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px 0; }
.qp-all, .qp-stop { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.qp-all { background: var(--emerald); color: var(--on-emerald); border: 0; }
:root[data-theme="dark"] .qp-all { background: var(--gold); color: #1A1405; }
.qp-all.is-on { box-shadow: 0 0 0 2px var(--gold); }
.qp-stop { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.qp-stop:disabled { opacity: .45; }
.qp-all svg, .qp-stop svg { width: 15px; height: 15px; fill: currentColor; stroke: none; flex: 0 0 auto; }
.qp-all:focus-visible, .qp-stop:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.qp-top .qp-awake { padding: 0; margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-gap { display: flex; flex-direction: column; gap: 8px; }
.qp-gap.is-off { opacity: .55; }
#qpGapSeg button { min-height: 40px; }
@media (max-width: 360px) { .qp-all, .qp-stop { padding: 0 10px; } .qp-top .qp-awake { font-size: .68rem; } }
.qp-gap-note { margin: 0; font-size: .74rem; color: var(--muted); }

/* =====================================================================
 * Sprint 10 · one floating recitation pill, settings as a sheet
 * ===================================================================== */
:root { --qpill-h: 60px; }
.qplayer.qpill {
  position: fixed; left: 50%; right: auto; margin: 0; z-index: 260;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  width: min(460px, calc(100vw - 24px)); max-width: none;
  border-radius: 30px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(2, 44, 34, .22), 0 2px 6px rgba(2, 44, 34, .08);
  animation: none;
  opacity: 0; transform: translateX(-50%) translateY(14px) scale(.98);
  transition: opacity .2s ease, transform .22s ease;
  pointer-events: none;
}
.qplayer.qpill.is-in { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.qpill .qp-progress { position: absolute; left: 22px; right: 22px; bottom: 0; height: 2px; background: transparent; }
.qpill .qp-progress i { border-radius: 2px; }
.qpill .qp-main { display: flex; align-items: center; gap: 4px; min-height: var(--qpill-h); padding: 6px 8px 6px 6px; }
.qpill .qp-play { flex: 0 0 auto; }
.qpill .qp-stop { flex: 0 0 auto; border-radius: 50%; padding: 0; justify-content: center; }
.qpill .qp-stop svg { fill: currentColor; stroke: none; width: 16px; height: 16px; }
.qp-info {
  flex: 1 1 auto; min-width: 0; min-height: 44px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 12px;
}
.qp-info:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.qpill .qp-title, .qpill .qp-sub { display: block; max-width: 100%; }
.qpill .qp-title { font-variant-numeric: tabular-nums; }
.qpill.is-awake .qp-title::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--emerald); vertical-align: middle; }
:root[data-theme="dark"] .qpill.is-awake .qp-title::after { background: #6EE7B7; }
.qp-badges { display: flex; flex: 0 0 auto; gap: 3px; }
.qpill .qp-rep { min-width: 44px; height: 36px; min-height: 36px; padding: 0 7px; border-radius: 999px; font-size: .74rem; display: inline-flex; align-items: center; justify-content: center; gap: 3px; position: relative; }
.qpill .qp-rep::after { content: ""; position: absolute; inset: -4px 0; }   /* 44px tall to the touch */
.qp-repbadge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qpill .qp-btn { flex: 0 0 auto; }
.qplayer.qpill[data-state="error"] .qp-sub { white-space: nowrap; }
@media (max-width: 380px) {
  .qpill .qp-main { gap: 2px; padding: 6px 6px 6px 5px; }
  .qpill .qp-rep { min-width: 40px; padding: 0 5px; }
  .qpill .qp-speed { min-width: 44px; }
  .qpill #qpMenu { width: 40px; }
}
@media (prefers-reduced-motion: reduce) { .qplayer.qpill, .qplayer.qpill.is-in { transition: none; transform: translateX(-50%); } }

/* The settings sheet opens from the pill or the surah header, above whichever is lowest. */
.qp-panel.qp-sheet {
  position: fixed; left: 0; right: 0; z-index: 261;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  width: min(460px, calc(100vw - 24px)); max-width: none; margin: 0 auto;
  max-height: min(64vh, 560px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 14px 14px; border: 1px solid var(--line); border-radius: 22px;
  background: var(--surface); box-shadow: 0 14px 36px rgba(2, 44, 34, .24);
  animation: rise .2s ease both;
}
.qp-panel.qp-sheet.over-pill { bottom: calc(76px + env(safe-area-inset-bottom, 0px) + var(--qpill-h) + 10px); }
.qp-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qp-sheet-title { margin: 0; font-weight: 800; font-size: .92rem; }
.qp-steps { display: flex; gap: 8px; }
.qp-steps[hidden] { display: none; }
.qp-steps .chip { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.qp-steps svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qp-sheet .qp-awake { padding: 0; }
.rh-play { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.reader-head .rh-play .q-playfull { margin: 0; }
.rh-settings { flex: 0 0 auto; }

/* Room under the last verse for the pill and the tab bar, and when jumping to an ayah. */
body.has-qplayer .app { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px) + var(--qpill-h) + 56px); }
body.has-qplayer .ayah { scroll-margin-bottom: calc(76px + env(safe-area-inset-bottom, 0px) + var(--qpill-h) + 24px); }
body.has-qplayer .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px) + var(--qpill-h) + 16px); }

/* =====================================================================
 * Sprint 12 (v13) · Ramadan Companion
 * Home Suhoor & Iftar card, the More chip, and the Ramadan panel. Colours come from the
 * theme variables only, so Light (ivory) and Night (true black) both work.
 * ===================================================================== */
.ram-card { display: flex; flex-direction: column; gap: 12px; background: linear-gradient(160deg, var(--surface), var(--surface) 55%, var(--gold-soft)); border-color: var(--gold); }
.ram-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.ram-ico, .ram-chip-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-ink); flex: none; }
.ram-ico svg, .ram-chip-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ram-titles { min-width: 0; }
.ram-titles h2 { margin: 0; font-size: 1rem; }
.ram-sub { font-size: .8rem; color: var(--fg-muted); line-height: 1.4; margin-top: 1px; }
.ram-open { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px 0 12px; white-space: nowrap; }
.ram-open svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ram-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ram-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; min-width: 0; transition: background-color .3s ease, border-color .3s ease; }
.ram-tile.is-live { background: var(--emerald-soft); border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.ram-tile.is-done { opacity: .72; }
.ram-tl { font-size: .76rem; font-weight: 700; color: var(--fg-muted); line-height: 1.25; }
.ram-tl small { display: block; font-weight: 500; font-size: .7rem; }
.ram-tt { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--fg); line-height: 1.25; }
.ram-tile.is-live .ram-tt { color: var(--gold-ink); }
.ram-ts { font-size: .74rem; font-weight: 600; color: var(--fg-muted); min-height: 1.1em; }
.ram-count { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; background: linear-gradient(135deg, var(--emerald), var(--emerald-deep)); color: var(--on-emerald); }
.ram-cl { font-size: .84rem; font-weight: 700; }
.ram-cd { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #F3D27A; letter-spacing: .01em; }
.ram-bar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-top: -4px; }
.ram-bar i, .ram-kbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--amber)); border-radius: 2px; transition: width .6s ease; }
.ram-card[data-phase="eid"] .ram-tile { opacity: .6; }
.ram-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ram-actions .btn { flex: 1 1 140px; min-height: 44px; }
.ram-fast { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ram-fast svg { width: 18px; height: 18px; }
.ram-fast.is-on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.ram-duas { display: flex; flex-direction: column; gap: 8px; }
.ram-ics { padding-top: 2px; }
.ram-ics small { line-height: 1.35; }

/* Duas (Home quick view and panel) */
.ram-dualist { display: flex; flex-direction: column; gap: 10px; }
.ram-dua-item { padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.ram-dua-title { font-size: .8rem; font-weight: 800; color: var(--fg); }
.ram-kind { font-weight: 600; color: var(--gold-ink); font-size: .72rem; margin-left: 4px; }
.ram-dua-ar { font-family: var(--font-ar); font-size: 1.55rem; line-height: 2; text-align: right; color: var(--fg); margin-top: 4px; }
.ram-dua-tr { font-size: .86rem; font-style: italic; color: var(--fg-muted); line-height: 1.5; }
.ram-dua-mean { font-size: .88rem; line-height: 1.5; margin-top: 4px; }
.ram-note { font-size: .8rem; color: var(--fg-muted); line-height: 1.5; }
.ram-dua { margin-top: 4px; }

/* More: compact countdown chip */
.ram-chip { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 8px 12px 8px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); text-align: left; color: var(--fg); min-height: 56px; }
.ram-chip:hover { border-color: var(--gold); }
.ram-chip .ram-chip-ico { width: 36px; height: 36px; border-radius: 11px; }
.ram-chip-text { display: flex; flex-direction: column; min-width: 0; }
.ram-chip-text strong { font-size: .88rem; line-height: 1.25; }
.ram-chip-text small { font-size: .74rem; color: var(--fg-muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ram-chip > svg { width: 16px; height: 16px; fill: none; stroke: var(--fg-muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ram-chip.is-ramadan { background: linear-gradient(135deg, var(--emerald-soft), var(--gold-soft)); border-color: var(--gold); }

/* Panel */
.ram-intro { display: flex; flex-direction: column; gap: 8px; }
.ram-intro .ib-h3 { text-align: center; margin: 0; }
.ram-state { font-size: .84rem; font-weight: 600; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); line-height: 1.45; }
.ram-jumps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ram-jumps .chip { min-height: 34px; padding: 0 12px; font-size: .8rem; }
.ram-fasts, .ram-khatmah, .ram-nights, .ram-fitr, .ram-duacard { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 76px; }
.ram-fasts .card-head, .ram-khatmah .card-head, .ram-nights .card-head, .ram-fitr .card-head, .ram-duacard .card-head { margin-bottom: 0; }
.ram-year { display: inline-flex; align-items: center; gap: 2px; }
.ram-year .icon-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ram-year .icon-btn:disabled { opacity: .35; }
.ram-year .method-chip { max-width: none; }
.ram-sum { font-size: .82rem; font-weight: 600; color: var(--fg); line-height: 1.45; }
.ram-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.ram-d { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; aspect-ratio: 1 / 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums; padding: 0; }
.ram-d .rd-i { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.ram-d.is-fasted { background: var(--emerald); border-color: var(--emerald); color: var(--on-emerald); }
.ram-d.is-fasted .rd-i { background: #F3D27A; }
.ram-d.is-missed { background: var(--gold-soft); border-color: var(--amber); color: var(--gold-ink); }
.ram-d.is-missed .rd-i { background: var(--amber); }
.ram-d.is-madeup { background: var(--emerald-soft); border-color: var(--emerald); color: var(--fg); }
.ram-d.is-madeup .rd-i { background: var(--emerald); box-shadow: 0 0 0 2px var(--surface); }
.ram-d.is-future:not(.is-fasted):not(.is-missed):not(.is-madeup) { opacity: .6; }
.ram-d.is-extra { border-style: dashed; }
.ram-d.is-today { box-shadow: 0 0 0 2px var(--gold); }
.ram-d.is-sel { outline: 2px solid var(--fg); outline-offset: 1px; }
.ram-d.has-note::after { content: ""; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.ram-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; font-size: .74rem; color: var(--fg-muted); }
.ram-legend li { display: inline-flex; align-items: center; gap: 5px; }
.ram-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.ram-legend .lg-fasted { background: var(--emerald); }
.ram-legend .lg-missed { background: var(--gold-soft); box-shadow: inset 0 0 0 1.5px var(--amber); }
.ram-legend .lg-madeup { background: var(--emerald-soft); box-shadow: inset 0 0 0 1.5px var(--emerald); }
.ram-day { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.ram-day .seg { background: var(--surface); }
.ram-day .seg button { min-height: 44px; font-size: .76rem; }
.ram-day-title { font-size: .86rem; font-weight: 800; }
.ram-day input[type="text"] { width: 100%; }
.ram-kbar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ram-juz { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rj { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 12px; }
.rj.is-today { background: var(--gold-soft); box-shadow: 0 0 0 1.5px var(--gold); }
.rj-check { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; color: transparent; padding: 0; }
.rj-check svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rj.is-read .rj-check { background: var(--emerald); border-color: var(--emerald); color: var(--on-emerald); }
.rj-text { display: flex; flex-direction: column; min-width: 0; }
.rj-text strong { font-size: .88rem; }
.rj-text small { font-size: .76rem; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rj.is-read .rj-text strong { color: var(--fg-muted); text-decoration: line-through; text-decoration-color: var(--gold); }
.rj-open { min-height: 36px; padding: 0 12px; font-size: .8rem; }
.ram-nightrow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ram-night { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 2px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); line-height: 1.2; }
.ram-night strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.ram-night small { font-size: .66rem; color: var(--fg-muted); white-space: nowrap; }
.ram-night.is-odd { background: var(--gold-soft); border-color: var(--gold); }
.ram-night.is-odd strong { color: var(--gold-ink); }
.ram-night.is-odd strong::after { content: " ★"; font-size: .7em; }
.ram-night.is-tonight { background: linear-gradient(135deg, var(--emerald), var(--emerald-deep)); border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--gold); }
.ram-night.is-tonight strong, .ram-night.is-tonight small { color: #F3D27A; }
.ram-night.is-past { opacity: .5; }
.ram-night.is-extra { border-style: dashed; }
.ram-fitr-grid { display: flex; flex-direction: column; gap: 10px; }
.ram-fitr .zk-row label small { display: block; font-weight: 500; font-size: .72rem; }
.ram-fitr .zk-row:first-child { flex-direction: row; align-items: center; justify-content: space-between; }
.ram-stepper button { width: 40px; height: 40px; font-size: 1.1rem; }
.ram-stepper output { min-width: 40px; font-size: 1rem; }
.ram-fitr .tool-ar { font-size: 1.2rem; }
.ram-fitr .zk-due strong { color: var(--gold-ink); }
@media (max-width: 360px) {
  .ram-grid { grid-template-columns: repeat(5, 1fr); }
  .ram-tt { font-size: 1.15rem; }
  .ram-cd { font-size: 1.35rem; }
  .ram-open span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ram-bar i, .ram-kbar i, .ram-tile { transition: none; } }

/* =================================================================== *
 * Sprint 13 (v14) · Ramadan preview pill, OpenDua recitation
 * =================================================================== */
.ram-preview { display: flex; flex-direction: column; gap: 8px; }
.ram-preview-pill {
  align-self: center; display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700; text-align: center;
  background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--line);
}
.ram-preview-pill .rp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
.ram-preview[data-mode="on"] .ram-preview-pill { background: var(--emerald-soft); color: var(--emerald); }
.ram-preview[data-mode="on"] .rp-dot { background: var(--emerald); }
.ram-preview-toggle { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) {
  .ram-preview-pill .rp-dot { animation: rpPulse 2.4s ease-in-out infinite; }
}
@keyframes rpPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.ib-audio-note { margin: 0; font-size: .8rem; font-weight: 600; color: var(--fg-muted); padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.ib-speed-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ib-speed-row .sub-label { margin: 0; }
.ib-speed { flex: 1 1 200px; }
.ib-credit, .pv-credit { margin: 0; font-size: .74rem; color: var(--fg-muted); line-height: 1.45; }
.ib-credit a, .pv-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
:root[data-theme="dark"] .ram-preview[data-mode="on"] .ram-preview-pill { color: #34D399; background: rgba(16, 185, 129, 0.12); }
:root[data-theme="dark"] .ram-preview[data-mode="on"] .rp-dot { background: #34D399; }

/* Sprint 14 (v15) · three Salat al-Ibrahimiyyah narrations */
.ib-versions button { line-height: 1.2; padding-left: 4px; padding-right: 4px; }
.ib-versions button small { white-space: normal; }
@media (max-width: 360px) { .ib-versions button { font-size: .8rem; } .ib-versions button small { font-size: .66rem; } }

/* ------------------------------------------------------------------ *
 * Sprint 15 (v16) · Dua Khatm al-Quran, alert options
 * ------------------------------------------------------------------ */
.q-khatm { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "ar arrow" "text arrow"; gap: 2px 10px; align-items: center; width: 100%; padding: 12px 14px; text-align: left; color: var(--fg); border: 1px solid var(--line); cursor: pointer; font: inherit; }
.q-khatm:hover { border-color: var(--gold); }
.q-khatm:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; }
.q-khatm-ar { grid-area: ar; font-family: var(--font-ar); font-size: 1.25rem; line-height: 1.7; color: var(--gold-ink); text-align: right; }
.q-khatm-text { grid-area: text; display: flex; flex-direction: column; min-width: 0; }
.q-khatm-text strong { font-size: .92rem; line-height: 1.3; }
.q-khatm-text small { font-size: .78rem; color: var(--fg-muted); line-height: 1.35; }
.q-khatm > svg { grid-area: arrow; width: 18px; height: 18px; fill: none; stroke: var(--fg-muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.q-khatm-end { background: linear-gradient(135deg, var(--emerald-soft), var(--gold-soft)); border-color: var(--gold); }
.q-khatm[hidden] { display: none; }
.kh-h3 { text-align: center; }
.kh-sources button { line-height: 1.2; padding-left: 4px; padding-right: 4px; }
.kh-sources button small { white-space: normal; }
@media (max-width: 360px) { .kh-sources button { font-size: .8rem; } .kh-sources button small { font-size: .66rem; } }
.kh-controls { grid-template-columns: auto auto 1fr; }
.kh-time { margin: 0; justify-self: end; font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fg-muted); }
#ramKhDua { align-self: flex-start; }

.alt-opts { margin-top: 4px; }
.alt-opts > .hint { margin: 8px 0 0; }
.alt-opt { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.alt-h { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .86rem; line-height: 1.3; color: var(--fg); }
.alt-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .74rem; font-weight: 800; background: var(--gold-soft); color: var(--gold-ink); }
.alt-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: .8rem; line-height: 1.45; color: var(--fg-muted); }
.alt-list strong { color: var(--fg); }
.alt-pick { margin: 10px 0 0; font-size: .82rem; line-height: 1.45; padding: 8px 10px; border-radius: 10px; background: var(--emerald-soft); color: var(--fg); }

/* v17 · Get Sakina on Your Phone (More panel, More tile, Home link) */
html.sakina-native [data-web-only] { display: none !important; }
.ga-home-link .ga-home-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-ink); }
.ga-home-link .ga-home-ico svg { width: 17px; height: 17px; }
.ga-tile .tool-ar { font-size: 1.3rem; }
.ga-hero { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; background: linear-gradient(135deg, var(--emerald-soft), var(--gold-soft)); border-color: var(--gold); }
.ga-icon { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow); }
.ga-hero h3 { margin: 0 0 4px; font-size: 1.05rem; }
.ga-lead { margin: 0; font-size: .86rem; color: var(--fg-muted); line-height: 1.45; }
.ga-feat-card h2, .ga-path h2 { margin: 0; font-size: 1rem; }
.ga-features { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
@media (max-width: 380px) { .ga-features { grid-template-columns: 1fr; } }
.ga-features li { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; font-size: .84rem; }
.ga-features strong { display: block; line-height: 1.3; }
.ga-features small { display: block; color: var(--fg-muted); font-size: .74rem; line-height: 1.35; margin-top: 1px; }
.ga-tick { width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--gold-soft); position: relative; }
.ga-tick::after { content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid var(--gold-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ga-path { display: flex; flex-direction: column; gap: 12px; }
.ga-path-head { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.ga-path-head .hint { margin: 2px 0 0; }
.ga-path-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--emerald-soft); color: var(--gold-ink); }
.ga-path-ico svg, .ga-path .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ga-dl { text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ga-path .btn-emerald { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ga-steps { margin: 0; gap: 10px; }
.ga-steps p { margin: 3px 0 0; font-size: .88rem; line-height: 1.4; }
.ga-path .hint { margin: 0; }
.ga-note { margin: 2px 0 0; font-size: .82rem; color: var(--fg-muted); line-height: 1.4; }
/* The path for this device comes first (v19: Android, iPhone / iPad, browser) */
.ga-panel[data-device="ios"] .ga-ios, .wl-paths[data-device="ios"] .ga-ios { order: 3; }
.ga-panel[data-device="ios"] .ga-android, .wl-paths[data-device="ios"] .ga-android { order: 4; }
.ga-panel[data-device="ios"] .ga-web, .wl-paths[data-device="ios"] .ga-web { order: 5; }
.ga-panel[data-device="other"] .ga-web, .wl-paths[data-device="other"] .ga-web { order: 3; }
.ga-panel[data-device="other"] .ga-android, .wl-paths[data-device="other"] .ga-android { order: 4; }
.ga-panel[data-device="other"] .ga-ios, .wl-paths[data-device="other"] .ga-ios { order: 5; }

/* v19 · Welcome page: first visit in a browser tab (index.html head script + getapp.js) */
.welcome {
  position: fixed; inset: 0; z-index: 900; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(120% 60% at 50% 0%, var(--emerald-soft), transparent 70%), var(--bg);
  color: var(--fg);
}
html.show-welcome .welcome, html.show-welcome .welcome[hidden] { display: block !important; }
html:not(.show-welcome) .welcome { display: none; }
html.show-welcome, html.show-welcome body { overflow: hidden; }
html.sakina-native .welcome, html.sakina-native .welcome[hidden] { display: none !important; }
.wl-inner {
  max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px;
  padding: calc(var(--sat) + 14px) 18px calc(var(--sab) + 32px);
}
.wl-top { display: flex; align-items: center; justify-content: space-between; }
.wl-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.02rem; color: var(--emerald); }
:root[data-theme="dark"] .wl-brand { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wl-brand { color: var(--gold); } }
.wl-brand img { border-radius: 8px; }
.wl-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 6px; }
.wl-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: var(--shadow), 0 0 0 1.5px var(--gold); }
.wl-ar { margin: 6px 0 0; font-family: var(--font-ar); font-size: 1.6rem; line-height: 1.2; color: var(--gold-ink); }
.wl-hero h1 { margin: 0; font-size: clamp(1.5rem, 6vw, 2rem); line-height: 1.2; letter-spacing: -.01em; }
.wl-hero h1:focus { outline: none; }
.wl-lead { margin: 0; max-width: 34ch; font-size: 1rem; line-height: 1.5; color: var(--fg-muted); }
.wl-cta { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; margin-top: 8px; }
.wl-cta .btn { width: 100%; min-height: 52px; font-size: 1rem; text-decoration: none; }
.wl-enter svg, .wl-path .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wl-small { margin: 2px 0 0; font-size: .8rem; color: var(--fg-muted); max-width: 36ch; }
.wl-h2 { margin: 0 0 10px; font-size: 1.05rem; }
.wl-feats { margin-top: 0; }
.wl-paths { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 12px; }
.wl-paths:focus { outline: none; }
.wl-paths .wl-h2 { order: 0; margin-bottom: 0; }
.wl-path h3, .ga-ios h3 { margin: 0; font-size: 1rem; }
.wl-path .btn-ghost { display: flex; align-items: center; justify-content: center; }
.wl-ics { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.wl-foot p { margin: 0; text-align: center; font-size: .82rem; color: var(--fg-muted); }
/* iPhone steps as pictures: Share > Add to Home Screen > Add */
.wl-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wl-flow li {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 12px 6px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: .8rem; line-height: 1.25;
}
.wl-flow li + li::before {
  content: ""; position: absolute; left: -7px; top: 32px; width: 6px; height: 6px;
  border: solid var(--gold-ink); border-width: 2px 2px 0 0; transform: rotate(45deg);
}
.wl-flow-ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface); color: #0A84FF; box-shadow: var(--shadow);
}
.wl-flow-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wl-flow-add { width: auto; padding: 0 12px; font-weight: 700; font-size: .9rem; }
.wl-flow-n {
  position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: .68rem; font-weight: 800;
  background: var(--gold-soft); color: var(--gold-ink);
}
.ga-panel .ga-ios .btn svg, .ga-panel .ga-web .btn svg { width: 20px; height: 20px; }
.ga-panel .btn-ghost { display: flex; align-items: center; justify-content: center; }
@media (min-width: 720px) {
  .wl-inner { max-width: 640px; padding-top: calc(var(--sat) + 28px); }
}
@media (prefers-reduced-motion: reduce) { .welcome { scroll-behavior: auto; } }

/* v21 · Android download links outside the Get Sakina panel */
.install-card .ga-dl { text-decoration: none; }
.lg-link { color: var(--gold-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.alt-dl { margin-top: 10px; }

/* =====================================================================
 * v22 · Floating dua player (dock.js) and Friday (Jumuʿah) Mode (friday.js)
 * ===================================================================== */
/* The dua player uses the Quran pill's shape. When both show, it sits just above the pill. */
.qplayer.qpill.adock { z-index: 259; border-radius: 24px; border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
body.has-qplayer .qplayer.qpill.adock { bottom: calc(76px + env(safe-area-inset-bottom, 0px) + var(--qpill-h) + 10px); }
.adock .qp-main { min-height: 54px; padding: 6px 8px 0 6px; }
.adock .qp-play { width: 44px; height: 44px; }
.adock[data-state="loading"] .qp-play { animation: pulse 1.2s ease infinite; }
.adock[data-state="error"] .qp-sub { color: #B4463A; white-space: normal; }
.adock .qp-rep.is-on { background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold); }
.ad-seekrow { display: flex; align-items: center; gap: 10px; padding: 2px 16px 9px 18px; }
.ad-seekrow.is-off .ad-seek { opacity: .35; }
.ad-seek {
  flex: 1 1 auto; min-width: 0; height: 22px; margin: 0; padding: 0; background: transparent;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
.ad-seek:disabled { cursor: default; }
.ad-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--gold) var(--pct, 0%), var(--line) var(--pct, 0%)); }
.ad-seek::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
.ad-seek::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--gold); }
.ad-seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--emerald); border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(2, 44, 34, .3); }
.ad-seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--emerald); border: 2px solid var(--surface); }
:root[data-theme="dark"] .ad-seek::-webkit-slider-thumb, :root[data-theme="dark"] .ad-seek::-moz-range-thumb { background: var(--gold); }
.ad-seek:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.ad-time { flex: 0 0 auto; min-width: 72px; text-align: right; font-size: .7rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
body.has-adock .app { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 100px); }
body.has-adock.has-qplayer .app { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px) + var(--qpill-h) + 120px); }
body.has-adock .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 96px); }
body.has-adock.has-qplayer .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px) + var(--qpill-h) + 106px); }
@media (prefers-reduced-motion: reduce) { .adock[data-state="loading"] .qp-play { animation: none; } }

/* The ▶ on each dua card */
.dk-play {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; margin: -4px 8px -4px 0; padding: 0; vertical-align: middle;
  border-radius: 50%; border: 1px solid var(--gold); background: var(--gold-soft); color: var(--gold-ink); cursor: pointer;
}
.dk-play::after { content: ""; position: absolute; inset: -6px; }   /* 44px to the touch */
.dk-play svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.dk-play[aria-pressed="true"] { background: var(--emerald); border-color: var(--emerald); color: var(--on-emerald); }
:root[data-theme="dark"] .dk-play[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1A1405; }
.dk-play:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.dk-credit { margin: 6px 2px 0; font-size: .72rem; line-height: 1.45; color: var(--fg-muted); }
.dk-credit:empty { display: none; }
.dk-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Friday: the badge by the date and a calm gold accent on the header */
.fri-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; padding: 2px 9px 2px 6px;
  border-radius: 999px; border: 1px solid var(--gold); background: var(--gold-soft); color: var(--gold-ink);
  font: inherit; font-size: .72rem; font-weight: 800; letter-spacing: .02em; cursor: pointer; min-height: 24px;
}
.fri-badge[hidden] { display: none; }
.fri-badge svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.fri-badge:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; }
html.friday-mode .topbar { position: relative; }
html.friday-mode .topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent); opacity: .55; pointer-events: none;
}
html.friday-mode .brand-mark .bm-star { fill: var(--gold); }

/* The Jumuʿah card on Home and in its panel */
.fri-card {
  display: flex; flex-direction: column; gap: 12px; border-color: var(--gold);
  background: linear-gradient(160deg, var(--surface), var(--surface) 50%, var(--gold-soft)),
              radial-gradient(120% 80% at 100% 0%, var(--emerald-soft), transparent 60%);
}
.fri-card[hidden] { display: none; }
.fri-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.fri-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--emerald); color: var(--gold); flex: none; }
.fri-ico svg { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.fri-titles { min-width: 0; }
.fri-titles h2 { margin: 0; font-size: 1.02rem; }
.fri-ar { margin: 0; font-family: var(--font-ar); font-size: 1.05rem; line-height: 1.4; color: var(--gold-ink); }
.fri-sub { margin: 1px 0 0; font-size: .8rem; color: var(--fg-muted); line-height: 1.4; }
.fri-open { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px 0 12px; white-space: nowrap; }
.fri-open svg, .fri-row .chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fri-kahf { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: var(--emerald); color: var(--on-emerald); }
.fri-kahf-ar { margin: 0; font-family: var(--font-ar); font-size: 1.5rem; line-height: 1.5; color: var(--gold); text-align: right; }
.fri-kahf-h { margin: 0; font-size: 1rem; color: inherit; }
.fri-kahf-sub { margin: 4px 0 0; font-size: .8rem; line-height: 1.45; opacity: .92; }
.fri-kahf .dk-src { color: inherit; opacity: .8; }
.fri-kahf-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fri-kahf-actions .btn { flex: 1 1 110px; min-height: 44px; width: auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fri-kahf-actions .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fri-kahf .fri-listen { background: linear-gradient(180deg, #E2C25A, var(--gold)); color: #1A1405; flex-basis: 100%; }
.fri-kahf .fri-listen svg { fill: currentColor; stroke: none; }
.fri-kahf .btn-ghost { color: var(--on-emerald); border-color: rgba(255, 255, 255, .35); }
.fri-kahf .fri-done.is-on { background: rgba(255, 255, 255, .14); border-color: var(--gold); color: var(--gold); }
.fri-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.fri-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fri-row-text strong { font-size: .9rem; }
.fri-row-text small { font-size: .78rem; color: var(--fg-muted); line-height: 1.45; }
.fri-row .dk-play { margin: 0; width: 40px; height: 40px; }
.fri-row .dk-play::after { inset: -2px; }
.fri-row .chip { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.fri-hour { font-weight: 700; color: var(--fg) !important; }
.fri-hour[data-state="now"] { color: var(--gold-ink) !important; }
.fri-note { margin: 0; font-size: .8rem; color: var(--fg-muted); line-height: 1.45; }
.fri-note:empty { display: none; }
.fri-foot { display: flex; flex-direction: column; gap: 6px; }
.fri-foot .link-btn { align-self: flex-start; }
.fri-foot .link-btn[hidden] { display: none; }
.fri-tile { background: linear-gradient(135deg, var(--gold-soft), var(--emerald-soft)); }
html.friday-mode .fri-tile { box-shadow: 0 0 0 2px var(--gold) inset; }
.fri-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; line-height: 1.5; }
.fri-list .dk-src { display: inline; margin-left: 4px; }
@media (max-width: 360px) { .fri-open span { display: none; } .fri-kahf-actions .btn { flex-basis: 100%; } }

/* ---------- v23 · a dua with no recording says so ---------- */
.dk-noaudio { margin: 2px 0 6px; font-size: .72rem; line-height: 1.4; color: var(--fg-muted); font-style: italic; }
.ram-dua-item .dk-noaudio { margin-top: 0; }
