/* Qalbda Islom Mini App
   Tokens: cool paper + ink + one accent (Madina green). Shape rule: cards 16px, inputs 12px,
   chips and primary buttons full pill. Arabic set in Amiri Quran; UI in Golos Text (full Uzbek Cyrillic). */

:root {
  --bg: #F2F5F2;
  --surface: #FFFFFF;
  --surface-2: #E8EEE9;
  --ink: #14201B;
  --ink-2: #53625B;
  --line: #D9E1DB;
  --accent: #0E5E4E;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCEDE7;
  --danger: #B42318;
  --shadow: 0 1px 2px rgb(14 40 32 / 0.06), 0 8px 24px rgb(14 40 32 / 0.06);

  --tj-silent: #9AA59F; --tj-madd2: #3D6FE0; --tj-maddj: #2F47D8; --tj-maddw: #1F3AA8; --tj-maddl: #12208C;
  --tj-qalqala: #C8102E; --tj-ikhfa: #8E1DA6; --tj-ikhfas: #C0149E; --tj-idgham: #117A5E; --tj-idghamn: #2E8A0E;
  --tj-iqlab: #0A8FC7; --tj-ghunna: #D9650B;

  --r-card: 16px; --r-input: 12px; --r-pill: 999px;
  --font-ui: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Amiri Quran", "Scheherazade New", "Noto Naskh Arabic", serif;
  --ar-size: 27px;
  --tabbar-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: 0px; --safe-r: 0px;
  --hero-1: #0B4A3E; --hero-2: #127560; --hero-ink: #F3FBF7;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

:root[data-theme="dark"] {
  --bg: #0C1210;
  --surface: #141C19;
  --surface-2: #1B2521;
  --ink: #E6EEEA;
  --ink-2: #96A69E;
  --line: #25312C;
  --accent: #5DB9A0;
  --accent-ink: #062019;
  --accent-soft: #17302A;
  --danger: #F2877D;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  --hero-1: #0E3A31; --hero-2: #145C4C; --hero-ink: #E9F6F0;
  --tj-silent: #7E8A84; --tj-madd2: #7FA3FF; --tj-maddj: #8C97FF; --tj-maddw: #9BB0FF; --tj-maddl: #B3BCFF;
  --tj-qalqala: #FF7A85; --tj-ikhfa: #D58AF0; --tj-ikhfas: #F08AD6; --tj-idgham: #5FD3AE; --tj-idghamn: #8ED86A;
  --tj-iqlab: #6ACBF5; --tj-ghunna: #FFAE63;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#view {
  padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) calc(var(--tabbar-h) + var(--safe-b) + 24px) calc(16px + var(--safe-l));
  max-width: 720px;
  margin: 0 auto;
  min-height: 100dvh;
}
body.has-player #view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }

/* ── Top bar ─────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0 0 8px; }
.topbar h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.01em; flex: 1; line-height: 1.25; }
.topbar .sub { color: var(--ink-2); font-size: 13px; font-weight: 400; display: block; }
.icon-btn {
  width: 44px; height: 44px; border-radius: var(--r-pill); border: 0; background: transparent;
  display: grid; place-items: center; font-size: 22px; color: var(--ink);
  transition: background .15s var(--ease), transform .1s var(--ease);
}
.icon-btn:active { transform: scale(.94); background: var(--surface-2); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }

/* ── Tab bar ─────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-2); text-decoration: none; font-size: 11px; font-weight: 500;
}
.tabbar a .tab-ico { display: grid; place-items: center; width: 56px; height: 30px; border-radius: var(--r-pill); transition: background .2s var(--ease); }
.tabbar a i { font-size: 23px; }
.tabbar a.active { color: var(--accent); }
.tabbar a.active .tab-ico { background: var(--accent-soft); }
.tabbar a:active .tab-ico { transform: scale(.94); }

/* ── Surfaces ────────────────────────────── */
.card { background: var(--surface); border-radius: var(--r-card); padding: 16px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 12px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 24px 4px 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.list { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px;
  width: 100%; border: 0; background: transparent; text-align: left; text-decoration: none; color: var(--ink);
}
.list-item + .list-item { border-top: 1px solid var(--line); }
.list-item:active { background: var(--surface-2); }
.list-item .title { font-weight: 500; }
.list-item .meta { color: var(--ink-2); font-size: 13px; }
.list-item i.lead { font-size: 22px; color: var(--accent); width: 28px; text-align: center; }
.list-item i.trail { color: var(--ink-2); font-size: 18px; }

.num-badge {
  width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none;
}
.ar-name { font-family: var(--font-ar); font-size: 22px; color: var(--ink); direction: rtl; }

/* ── Controls ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 500;
  transition: transform .1s var(--ease), background .15s var(--ease);
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.field { display: grid; gap: 6px; min-width: 0; }
.field select.input { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
input[type="range"] { accent-color: var(--accent); }
.row.wrap { flex-wrap: wrap; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-input);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
textarea.input { min-height: 110px; resize: vertical; }
.search { position: relative; }
.search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-size: 18px; }
.search .input { padding-left: 42px; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); transition: background .2s var(--ease); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ── Home ────────────────────────────────── */
.hello { margin: 8px 4px 16px; }
.hello h1 { font-size: 26px; font-weight: 600; margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
.continue {
  display: block; text-decoration: none; color: var(--accent-ink); background: var(--accent);
  border-radius: var(--r-card); padding: 18px; position: relative; overflow: hidden;
}
.continue .label { font-size: 13px; opacity: .85; }
.continue .ref { font-size: 22px; font-weight: 600; margin-top: 2px; }
.continue .ar { position: absolute; right: 16px; top: 8px; font-family: var(--font-ar); font-size: 26px; opacity: .35; direction: rtl; }
.continue .ref { position: relative; }
.stat { background: var(--surface); border-radius: var(--r-card); padding: 14px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: block; }
.stat .value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 13px; color: var(--ink-2); }
.next-prayer { display: flex; justify-content: space-between; align-items: baseline; }
.next-prayer .time { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prayer-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 12px; text-align: center; }
.prayer-strip div { font-size: 12px; color: var(--ink-2); padding: 6px 0; border-radius: 10px; }
.prayer-strip div b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prayer-strip div.now { background: var(--accent-soft); color: var(--accent); }
.prayer-strip div.now b { color: var(--accent); }

/* ── Reader ──────────────────────────────── */
.reader-head { text-align: center; padding: 8px 0 16px; }
.reader-head .ar-title { font-family: var(--font-ar); font-size: 36px; line-height: 1.6; direction: rtl; }
.reader-head .meta { color: var(--ink-2); font-size: 13px; }
.bismillah { font-family: var(--font-ar); font-size: 30px; text-align: center; direction: rtl; margin: 4px 0 16px; line-height: 1.8; }
.ayah { padding: 18px 4px 14px; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; transition: background .3s var(--ease); }
.ayah.playing { background: var(--accent-soft); border-radius: var(--r-card); border-bottom-color: transparent; padding-left: 12px; padding-right: 12px; }
.ayah .surah-sep { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.ayah .ar {
  font-family: var(--font-ar); font-size: var(--ar-size); line-height: 2.15; direction: rtl; text-align: right;
  word-spacing: 2px; margin: 0 0 10px;
}
.ayah .end-mark { color: var(--accent); white-space: nowrap; }
.ayah .translit { font-style: italic; color: var(--ink-2); margin: 0 0 8px; font-size: 14px; }
.ayah .tr { margin: 0; font-size: 15px; line-height: 1.6; }
.ayah .tools { display: flex; gap: 2px; margin-top: 8px; margin-left: -10px; }
.ayah .tools .icon-btn { width: 40px; height: 40px; font-size: 20px; color: var(--ink-2); }
.ayah .tools .icon-btn.on { color: var(--accent); background: transparent; }
.ayah .ref { color: var(--ink-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; align-self: center; }
.hide-tr .ayah .tr, .hide-tr .ayah .translit { display: none; }

.tj-h, .tj-s, .tj-l, .tj-d, .tj-b { color: var(--tj-silent); }
.tj-n { color: var(--tj-madd2); } .tj-p { color: var(--tj-maddj); } .tj-o { color: var(--tj-maddw); } .tj-m { color: var(--tj-maddl); }
.tj-q { color: var(--tj-qalqala); } .tj-f { color: var(--tj-ikhfa); } .tj-c { color: var(--tj-ikhfas); }
.tj-a { color: var(--tj-idgham); } .tj-w, .tj-u { color: var(--tj-idghamn); } .tj-i { color: var(--tj-iqlab); } .tj-g { color: var(--tj-ghunna); }
.legend { display: grid; gap: 10px; }
.legend .item { display: grid; grid-template-columns: 14px 1fr; gap: 10px; align-items: start; }
.legend .dot { width: 14px; height: 14px; border-radius: 4px; margin-top: 3px; background: currentColor; }

.pager { display: flex; gap: 10px; margin: 20px 0 0; }
.pager .btn { flex: 1; }

/* ── Player ──────────────────────────────── */
.playbar {
  position: fixed; left: 8px; right: 8px; z-index: 19;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px);
  background: var(--ink); color: var(--bg); border-radius: var(--r-card);
  padding: 8px 8px 8px 16px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .25); max-width: 704px; margin: 0 auto;
}
.playbar .info { flex: 1; min-width: 0; }
.playbar .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playbar .s { font-size: 12px; opacity: .7; }
.playbar .icon-btn { color: var(--bg); }
.playbar .icon-btn:active { background: rgb(255 255 255 / .12); }
.playbar .progress { position: absolute; left: 16px; right: 16px; bottom: 4px; height: 2px; background: rgb(255 255 255 / .15); border-radius: 2px; overflow: hidden; }
.playbar .progress b { display: block; height: 100%; width: 0; background: var(--accent); }

/* ── Sheet ───────────────────────────────── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgb(6 14 11 / .45); animation: fade .2s var(--ease); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 86dvh; overflow: auto;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 16px calc(24px + var(--safe-b));
  animation: rise .28s var(--ease); max-width: 720px; margin: 0 auto;
}
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 6px auto 12px; }
.sheet h2 { font-size: 18px; margin: 0 0 12px; font-weight: 600; }
.sheet .body-text { white-space: pre-wrap; line-height: 1.65; }
.words { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.word { background: var(--surface); border-radius: 12px; padding: 10px; text-align: center; box-shadow: var(--shadow); }
.word .w-ar { font-family: var(--font-ar); font-size: 26px; direction: rtl; line-height: 1.8; }
.word .w-mean { font-size: 13px; color: var(--ink-2); }

/* ── Hifz / quiz ─────────────────────────── */
.reveal { position: relative; border-radius: var(--r-card); background: var(--surface-2); padding: 16px; min-height: 120px; }
.reveal .ar { font-family: var(--font-ar); font-size: 28px; line-height: 2.1; direction: rtl; text-align: right; transition: filter .3s var(--ease); }
.reveal.hidden .ar { filter: blur(12px); user-select: none; }
.reveal .cover { position: absolute; inset: 0; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink); font-weight: 600; }
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.option { width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--r-input); border: 1px solid var(--line); background: var(--surface); min-height: 52px; }
.option.ar-opt { font-family: var(--font-ar); font-size: 22px; direction: rtl; text-align: right; line-height: 1.9; }
.option.right { border-color: var(--accent); background: var(--accent-soft); }
.option.wrong { border-color: var(--danger); color: var(--danger); }
.meter { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.meter b { display: block; height: 100%; background: var(--accent); border-radius: 8px; }

/* ── States ──────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 12px; }
.sk-line { height: 14px; margin: 10px 0; }
.sk-ar { height: 36px; margin: 16px 0 10px; }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.empty i { font-size: 40px; color: var(--accent); display: block; margin-bottom: 8px; }
.empty .btn { margin-top: 14px; }
.error-box { border: 1px solid var(--danger); color: var(--danger); border-radius: var(--r-card); padding: 14px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60; bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-pill); font-size: 14px; max-width: 90vw;
  animation: rise .2s var(--ease);
}

@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.view-enter { animation: rise .22s var(--ease); }

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


/* ── Home hero ───────────────────────────── */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px 18px 14px; color: var(--hero-ink);
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(255 255 255 / .10), transparent 55%),
    linear-gradient(160deg, var(--hero-1), var(--hero-2));
  box-shadow: 0 12px 32px rgb(11 74 62 / .25);
}
/* eight-point star lattice, drawn with gradients (no image) */
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .06; pointer-events: none;
  background-image:
    repeating-conic-gradient(from 22.5deg at 50% 50%, currentColor 0 12.5%, transparent 0 25%),
    repeating-conic-gradient(from 0deg at 50% 50%, transparent 0 12.5%, currentColor 0 25%);
  background-size: 44px 44px, 44px 44px; background-position: 0 0, 22px 22px;
  -webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 75%); mask-image: linear-gradient(200deg, #000 10%, transparent 75%);
}
.hero > * { position: relative; }
.hero a { color: inherit; text-decoration: none; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-hello { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.hero-date { font-size: 13px; opacity: .8; margin-top: 2px; }
.hero-settings { width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center; background: rgb(255 255 255 / .12); font-size: 20px; flex: none; }
.hero-main { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 22px; gap: 12px; }
.hero-label { font-size: 12px; opacity: .75; }
.hero-prayer { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.hero-count { font-size: 13px; opacity: .85; margin-top: 2px; }
.hero-time { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.hero-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 16px; }
.hero-slot { text-align: center; padding: 7px 0; border-radius: 12px; font-size: 11px; opacity: .8; }
.hero-slot b { display: block; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-slot.past { opacity: .5; }
.hero-slot.now { background: rgb(255 255 255 / .16); opacity: 1; }
.hero-continue { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgb(255 255 255 / .12); font-weight: 600; }
.hero-continue small { display: block; font-weight: 400; font-size: 12px; opacity: .8; }
.hero-continue i { font-size: 22px; }
.hero-continue:active { background: rgb(255 255 255 / .2); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 4px; }
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-size: 12px; font-weight: 500; text-align: center; }
.quick-ico { width: 56px; height: 56px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 24px; color: var(--accent); transition: transform .12s var(--ease); }
.quick-item:active .quick-ico { transform: scale(.94); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.stats .stat { padding: 12px 8px; text-align: center; }
.stats .stat .value { font-size: 20px; }
.stats .stat .label { font-size: 11px; line-height: 1.25; }
.stat-ico { color: var(--accent); font-size: 18px; display: block; margin-bottom: 2px; }
.ayah-card .ar { font-family: var(--font-ar); font-size: 26px; line-height: 2.05; direction: rtl; text-align: right; margin: 8px 0; }
.ayah-card .tr { margin: 0 0 12px; line-height: 1.6; }

/* ── Reader bar ──────────────────────────── */
.reader-bar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 6px;
  margin: calc(-12px - var(--safe-t)) calc(-16px - var(--safe-r)) 8px calc(-16px - var(--safe-l));
  padding: calc(6px + var(--safe-t)) calc(10px + var(--safe-r)) 8px calc(6px + var(--safe-l));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.reader-bar-title { flex: 1; min-width: 0; line-height: 1.2; }
.reader-bar-title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-bar-title span { font-size: 12px; color: var(--ink-2); }
.reader-bar-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.reader-bar-progress b { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s var(--ease); }
.icon-btn.accent { color: var(--accent); font-size: 30px; }
.reader-tools { flex-wrap: wrap; overflow: visible; }
.reader-tools .chip { display: inline-flex; align-items: center; gap: 6px; }
.reader-head .ar-title { margin-bottom: 6px; line-height: 1.9; }
.reader-tools .chip i { font-size: 16px; }

.tafsir-block + .tafsir-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.tafsir-author { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--accent); margin-bottom: 6px; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); }
.sheet { padding-top: calc(8px); max-height: calc(86dvh - var(--safe-t)); }
@media (min-width: 560px) { .quick-ico { width: 64px; height: 64px; } }

/* ── Listen ──────────────────────────────── */
.reciter-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.reciter-chip > i:first-child { font-size: 24px; color: var(--accent); }
.reciter-chip small { display: block; font-size: 12px; color: var(--ink-2); }
.reciter-chip b { font-weight: 600; }
.reciter-chip > i:last-child { color: var(--ink-2); }
.num-badge.live { background: var(--accent); color: var(--accent-ink); font-size: 18px; }
.play-lead { font-size: 30px; color: var(--accent); flex: none; }

/* the mihrab arch is the page's one ornament: surah name set inside a prayer-niche silhouette */
.listen-art { display: grid; place-items: center; margin: 4px 0 18px; }
.arch {
  position: relative; width: min(64vw, 260px); aspect-ratio: 3 / 4; overflow: hidden; color: var(--hero-ink);
  border-radius: 999px 999px 28px 28px; display: grid; place-items: center; align-content: center; gap: 6px;
  background: radial-gradient(90% 60% at 50% 18%, rgb(255 255 255 / .14), transparent 60%), linear-gradient(170deg, var(--hero-1), var(--hero-2));
  box-shadow: 0 18px 40px rgb(11 74 62 / .28), inset 0 0 0 6px rgb(255 255 255 / .06), inset 0 0 0 7px rgb(255 255 255 / .12);
}
.arch::before {
  content: ""; position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background-image: repeating-conic-gradient(from 22.5deg at 50% 50%, currentColor 0 12.5%, transparent 0 25%), repeating-conic-gradient(from 0deg at 50% 50%, transparent 0 12.5%, currentColor 0 25%);
  background-size: 40px 40px, 40px 40px; background-position: 0 0, 20px 20px;
}
.arch > * { position: relative; }
.arch-ar { font-family: var(--font-ar); font-size: clamp(34px, 11vw, 48px); line-height: 1.7; direction: rtl; padding: 0 14px; text-align: center; }
.arch-num { font-family: var(--font-ar); font-size: 22px; opacity: .75; }
.listen-title { text-align: center; }
.listen-title h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.listen-title .muted { font-size: 14px; margin-top: 2px; }
.seek-wrap { margin: 18px 4px 4px; }
.seek { width: 100%; height: 28px; margin: 0; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.listen-controls { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0 4px; }
.listen-controls .icon-btn { width: 52px; height: 52px; font-size: 26px; color: var(--ink); }
.listen-controls .icon-btn.off { opacity: .3; pointer-events: none; }
.play-main { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 34px; display: grid; place-items: center; box-shadow: 0 10px 24px rgb(14 94 78 / .35); transition: transform .12s var(--ease); }
.play-main:active { transform: scale(.95); }
.rate-chips { justify-content: center; }
body.on-listen .playbar { display: none; }
body.on-listen.has-player #view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.grid-2 > .btn { min-width: 0; white-space: normal; text-align: center; line-height: 1.2; padding: 6px 12px; }
