:root { --bg:#16152a; --bg2:#201f3a; --card:#25244a; --ink:#fbf6ea; --mut:#b9b4d6; --gold:#f2c46d; --teal:#7fd3c6; --ar:"Amiri Quran","Amiri","Scheherazade New","Noto Naskh Arabic",serif;
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif; --ars:30px; --ens:17px; --pb:0px; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(var(--pb) + env(safe-area-inset-bottom)); }
a { color: var(--gold); }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--mut); }
.rbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; background: rgba(22,21,42,.94); backdrop-filter: blur(8px); border-bottom: 1px solid #ffffff14; }
.rb { background: none; border: 0; color: var(--ink); text-decoration: none; padding: 10px 10px; border-radius: 10px; font-size: 16px; min-width: 44px; min-height: 44px; }
.rb:hover, .rb:focus-visible { background: #ffffff14; }
.rb.title { font-weight: 600; max-width: 55vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.rgap { flex: 1; }
.rwho { padding: 6px 14px; font-size: 14px; color: var(--mut); background: #1d1c37; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rwho button { background: #2d2c55; border: 0; border-radius: 99px; padding: 6px 12px; font-size: 14px; }
.rwho button.sel { background: var(--gold); color: #222; }
main { max-width: 780px; margin: 0 auto; padding: 12px 14px 40px; }
/* index */
.search { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid #ffffff22; background: var(--bg2); color: var(--ink); font-size: 16px; }
.cards { display: grid; gap: 10px; margin: 12px 0; }
.cont { background: linear-gradient(135deg,#2c2a5c,#243c55); border-radius: 14px; padding: 14px 16px; text-decoration: none; color: var(--ink); display: block; }
.cont b { color: var(--gold); }
.stat { background: var(--card); border-radius: 14px; padding: 12px 16px; font-size: 15px; }
.tabs { display: flex; gap: 6px; margin: 14px 0 8px; }
.tabs button { flex: 1; background: var(--bg2); border: 0; border-radius: 10px; padding: 10px; }
.tabs button.on { background: var(--gold); color: #1b1a2b; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list li a { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid #ffffff10; color: var(--ink); text-decoration: none; min-height: 56px; }
.list li a:hover { background: #ffffff08; }
.num { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--bg2); font-size: 14px; color: var(--gold); }
.nm { flex: 1; min-width: 0; }
.nm small { display: block; color: var(--mut); font-size: 13px; }
.arn { font-family: var(--ar); font-size: 22px; direction: rtl; }
.hit { padding: 10px 6px; border-bottom: 1px solid #ffffff10; }
.hit a { color: var(--ink); text-decoration: none; display: block; }
.hit mark { background: #f2c46d55; color: inherit; border-radius: 3px; }
.hit .k { color: var(--gold); font-size: 13px; }
/* surah */
.shead { text-align: center; padding: 18px 10px 8px; }
.shead .arn { font-size: 40px; }
.shead h1 { margin: 2px 0; font-size: 22px; font-weight: 600; }
.shead p { margin: 2px 0; color: var(--mut); font-size: 14px; }
.shead .acts { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.pill { background: var(--gold); color: #1b1a2b; border: 0; border-radius: 99px; padding: 10px 18px; font-weight: 600; text-decoration: none; display: inline-block; }
.pill.ghost { background: #ffffff14; color: var(--ink); font-weight: 400; }
.basmala { font-family: var(--ar); font-size: calc(var(--ars) * 1.05); text-align: center; direction: rtl; margin: 10px 0 18px; color: var(--gold); line-height: 2; }
.div { text-align: center; color: var(--mut); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin: 18px 0 6px; }
.v { padding: 12px 6px 14px; border-bottom: 1px solid #ffffff10; scroll-margin-top: 90px; border-radius: 10px; transition: background .3s; }
.v.playing { background: #f2c46d1c; box-shadow: inset 3px 0 0 var(--gold); }
.v.target { background: #7fd3c61a; }
.v.inrange { box-shadow: inset 3px 0 0 var(--teal); }
.vt { display: flex; align-items: center; gap: 4px; }
.vk { font-size: 12px; color: var(--mut); flex: 1; }
.vb { background: none; border: 0; min-width: 40px; min-height: 40px; border-radius: 10px; font-size: 17px; color: var(--mut); }
.vb:hover { background: #ffffff12; }
.vb.on { color: var(--gold); }
.ar { font-family: var(--ar); font-size: var(--ars); line-height: 2.15; direction: rtl; text-align: right; margin: 4px 0 6px; word-spacing: .05em; }
.ar .end { color: var(--gold); white-space: nowrap; }
.ar.hide { filter: blur(9px); cursor: pointer; transition: filter .3s; }
.ar.hide.peek { filter: none; }
.en { font-size: var(--ens); line-height: 1.6; color: #e9e4f7; margin: 0; }
.noen .en { display: none; }
.sj { font-size: 12px; color: var(--teal); }
.nav2 { display: flex; justify-content: space-between; gap: 10px; margin: 24px 0; }
.foot { font-size: 12px; color: var(--mut); margin-top: 30px; line-height: 1.5; }
/* kid mode */
.kid { --ars: 40px; --ens: 20px; }
.kid .vk, .kid .div { display: none; }
.kid .v { background: #222146; border: 0; margin: 10px 0; border-radius: 18px; padding: 14px 14px 16px; }
.kid .v.playing { background: #3a3460; }
.kid .vb { font-size: 22px; min-width: 48px; min-height: 48px; }
.kid .shead .arn { font-size: 48px; }
/* player */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(32,31,58,.97); border-top: 1px solid #ffffff1c; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
.pl-info { font-size: 13px; text-align: center; margin-bottom: 4px; }
.pl-ctl { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.pl-ctl button { background: #ffffff12; border: 0; border-radius: 12px; min-width: 46px; min-height: 44px; font-size: 18px; }
.pl-ctl .big { background: var(--gold); color: #1b1a2b; min-width: 58px; font-size: 22px; }
.pl-ctl .txt { font-size: 13px; padding: 0 12px; }
.pl-ctl .txt.on { background: var(--teal); color: #102; }
.pl-credit { font-size: 11px; color: var(--mut); text-align: center; margin-top: 4px; }
.loopchip { margin-left: 8px; background: var(--teal); color: #102; border-radius: 99px; padding: 2px 8px; font-size: 12px; }
/* sheet */
.rsheet { position: fixed; inset: 0; z-index: 50; background: #0008; display: flex; align-items: flex-end; justify-content: center; }
.rpanel { position: relative; background: #24234a; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .rsheet { align-items: center; } .rpanel { border-radius: 18px; } }
.rpanel h3 { margin: 0 0 12px; }
.rpanel .x { position: absolute; right: 8px; top: 6px; background: none; border: 0; font-size: 28px; min-width: 44px; min-height: 44px; color: var(--mut); }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ffffff10; }
.opt input[type=range] { width: 50%; }
.opt select, .opt input[type=number] { background: var(--bg2); color: var(--ink); border: 1px solid #ffffff22; border-radius: 8px; padding: 8px; font-size: 16px; }
.opt input[type=checkbox] { width: 24px; height: 24px; }
.rpanel small { display: block; color: var(--mut); margin-top: 12px; line-height: 1.5; }
.rpanel .row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
