/* Qur'an reader (quran.arriqaaq.com). One column, white page, nothing on screen
   that is not the text until you ask for it (tap the page, Kindle-style).
   Colours, type and measure come from the site's tokens (tokens.css, loaded
   first); the only hex values here are the tajweed colours, a documented
   exception in DESIGN.md -> Qur'an reader. */
@font-face{font-family:"QPC Hafs";src:url(../fonts/hafs.woff2) format("woff2");font-display:block}
@font-face{font-family:"IndoPak";src:url(../fonts/indopak.woff2) format("woff2");font-display:swap}
@font-face{font-family:"Surah Names";src:url(../fonts/surah.woff2) format("woff2");font-display:block}

:root{
  --bg:var(--page); --soft:var(--ink-2); --muted:var(--ink-3);
  --faint:color-mix(in srgb,var(--ink-3) 52%,var(--page)); --veil:var(--line-strong);
  --wash:var(--surface); --accent:var(--pine-ink); --accent-wash:var(--pine-soft);
  --bar:color-mix(in srgb,var(--page) 90%,transparent);
  --shadow:0 10px 40px color-mix(in srgb,var(--ink) 12%,transparent),0 1px 3px color-mix(in srgb,var(--ink) 6%,transparent);
  /* QPC Hafs, not the site's Amiri Quran: the word timings and tajweed rules are keyed to the QPC text */
  --quran:"QPC Hafs",var(--font-arabic);
  --serif:var(--font-read); --sans:var(--font-sans);
  --ar-size:31px; --ease:cubic-bezier(.22,.61,.36,1);
}
/* tajweed: the conventional colours readers know from printed tajweed mushafs and quran.com */
:root{
  --tj-silent:#a8a8a8; --tj-madd2:#537fff; --tj-madd246:#4050ff; --tj-madd45:#2144c1; --tj-madd6:#000ebc;
  --tj-ghunnah:#ff7e1e; --tj-ikhfa:#9400a8; --tj-ikhfa-sh:#d500b7; --tj-idgham-g:#169777; --tj-idgham:#169200;
  --tj-idgham-sh:#58b800; --tj-iqlab:#26bffd; --tj-qalqalah:#dd0008;
}
:root[data-script="indopak"]{--quran:"IndoPak","QPC Hafs",serif}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-padding-top:30vh}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.6 var(--sans);
  -webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;
  transition:background-color .3s,color .3s}
a{color:inherit}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
svg{width:22px;height:22px;fill:currentColor;display:block}
[hidden]{display:none!important}

/* ---------- top bar (hides while reading) ---------- */
.bar{position:fixed;top:0;left:0;right:0;z-index:30;padding-top:env(safe-area-inset-top);
  background:var(--bar);backdrop-filter:saturate(160%) blur(14px);-webkit-backdrop-filter:saturate(160%) blur(14px);
  border-bottom:1px solid var(--line);transition:transform .35s var(--ease),opacity .35s}
.bar-in{max-width:56rem;margin:0 auto;height:52px;display:flex;align-items:center;gap:6px;padding:0 8px}
.chrome-off .bar{transform:translateY(-105%);opacity:0}
.home .bar{position:sticky}
.brand{font:600 15px var(--sans);text-decoration:none;padding:0 8px;letter-spacing:-.01em;min-height:44px;display:flex;align-items:center}
.brand .ar{font-family:var(--quran);font-weight:400;font-size:19px;color:var(--accent);margin-left:6px}
.sp{flex:1}
.ic{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;color:var(--soft);font-size:15px;font-weight:600;flex:none}
.ic:hover{background:var(--wash);color:var(--ink)}
.bar-title{flex:1;text-align:center;font-size:14px;color:var(--soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bt-en{font-weight:600;color:var(--ink)}
.bt-v:not(:empty)::before{content:" · "}
.progress{position:fixed;top:0;left:0;height:2px;width:0;background:var(--accent);z-index:31;opacity:.6;
  transition:opacity .3s}

/* ---------- surah list ---------- */
.list-wrap{max-width:40rem;margin:0 auto;padding:24px 16px 80px}
.intro{padding:36px 0 22px}
.intro h1{font:400 2.6rem/1.1 var(--serif);margin:0 0 10px;letter-spacing:-.02em}
.intro p{color:var(--muted);margin:0;font:1.08rem/1.55 var(--serif);max-width:30rem}
.resume{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:6px 0 22px;padding:16px 18px;
  border:1px solid var(--line);border-radius:14px;text-decoration:none;background:var(--wash)}
.resume b{font-weight:600}
.resume span{color:var(--muted);font-size:14px}
.filter input{width:100%;height:48px;border:1px solid var(--line);border-radius:12px;padding:0 16px;
  font:16px var(--sans);background:var(--bg);color:var(--ink);outline:none}
.filter input:focus{border-color:var(--faint)}
.slist{margin-top:12px}
.srow{display:flex;align-items:center;gap:14px;padding:14px 4px;border-bottom:1px solid var(--line);text-decoration:none;min-height:64px}
.srow:hover .se{color:var(--accent)}
.sn{width:30px;font-size:13px;color:var(--faint);font-variant-numeric:tabular-nums;text-align:center;flex:none}
.sm{flex:1;min-width:0;display:flex;flex-direction:column}
.se{font-weight:550;font-size:15.5px;transition:color .15s}
.st{font-size:13px;color:var(--muted)}
.sa{font-family:"Surah Names";font-size:30px;line-height:1;color:var(--ink);flex:none;direction:rtl}

/* ---------- reading column ---------- */
.read{max-width:calc(var(--measure) + 40px);margin:0 auto;padding:calc(84px + env(safe-area-inset-top)) 20px 45vh}
.shead{text-align:center;padding:24px 0 30px}
.sname{font-family:"Surah Names";font-size:min(108px,28vw);line-height:1.1;color:var(--ink);direction:rtl}
.shead h1{font:400 1.5rem/1.2 var(--serif);margin:6px 0 4px;letter-spacing:-.01em}
.smeta{margin:0;font-size:13.5px;color:var(--muted)}
.bism{font-family:var(--quran);font-size:calc(var(--ar-size) * .92);line-height:2;margin:34px 0 0;color:var(--ink);
  transition:color .4s}
.bism.reciting{color:var(--accent)}

.ayah{padding:26px 0 28px;position:relative;
  opacity:var(--ink-o,1);transform:translateY(var(--ink-y,0));
  transition:opacity .5s var(--ease),transform .7s var(--ease)}
.ayah+.ayah{border-top:1px solid var(--line)}
.ar{font-family:var(--quran);font-size:var(--ar-size);line-height:2.15;margin:0;text-align:right;
  word-spacing:.04em;color:var(--ink)}
:root[data-script="indopak"] .ar{line-height:2.4}
.w{border-radius:6px;transition:color .35s var(--ease),background-color .35s;cursor:pointer;
  -webkit-box-decoration-break:clone;box-decoration-break:clone}
.end{font-family:"QPC Hafs",serif;font-size:.92em;color:var(--accent);padding:0 .12em;line-height:1;
  min-width:44px;min-height:44px;vertical-align:middle;border-radius:50%}
.end:hover{background:var(--accent-wash)}
.tr{font:1.125rem/1.62 var(--serif);color:var(--soft);margin:14px 0 0;max-width:36rem}
.vn{font:600 11px var(--sans);color:var(--faint);margin-right:9px;font-variant-numeric:tabular-nums;vertical-align:2px}
:root[data-trans="off"] .tr{display:none}

/* Listening: the ayah being recited goes faint, and each word comes back to full ink as it is said. */
.tj.ham_wasl,.tj.slnt,.tj.laam_shamsiyah,.tj.idgham_mutajanisayn,.tj.idgham_mutaqaribayn{color:var(--tj-silent)}
.tj.madda_normal{color:var(--tj-madd2)} .tj.madda_permissible{color:var(--tj-madd246)}
.tj.madda_obligatory{color:var(--tj-madd45)} .tj.madda_necessary{color:var(--tj-madd6)}
.tj.ghunnah{color:var(--tj-ghunnah)} .tj.ikhafa{color:var(--tj-ikhfa)} .tj.ikhafa_shafawi{color:var(--tj-ikhfa-sh)}
.tj.idgham_ghunnah{color:var(--tj-idgham-g)} .tj.idgham_wo_ghunnah{color:var(--tj-idgham)}
.tj.idgham_shafawi{color:var(--tj-idgham-sh)} .tj.iqlab{color:var(--tj-iqlab)} .tj.qalaqah{color:var(--tj-qalqalah)}
:root[data-tajweed="off"] .ar .tj{color:inherit}
/* while listening, words not yet recited wait in grey (colours too) and come back as they are said */
.ayah.now .w:not(.said):not(.on),.ayah.now .w:not(.said):not(.on) .tj{color:var(--faint)}
.ayah.now .w.on{background:var(--accent-wash);box-shadow:0 0 0 .08em var(--accent-wash)}
.ayah.now .end{background:var(--accent-wash)}
.ayah.sel{background:linear-gradient(to right,transparent,var(--wash) 12%,var(--wash) 88%,transparent)}

.pager{display:flex;gap:12px;margin-top:56px;padding-top:24px;border-top:1px solid var(--line)}
.pager a,.pager>span{flex:1}
.pager a{display:block;padding:14px 16px;border:1px solid var(--line);border-radius:12px;text-decoration:none;font-weight:550}
.pager a span{display:block;font:500 11px var(--sans);text-transform:uppercase;letter-spacing:.1em;color:var(--faint);margin-bottom:2px}
.pager .nx{text-align:right}

/* ---------- reading footer (Kindle-style, always quiet) ---------- */
.foot{position:fixed;left:0;right:0;bottom:0;z-index:20;text-align:center;font-size:11.5px;color:var(--muted);
  padding:6px 16px env(safe-area-inset-bottom);pointer-events:none;font-variant-numeric:tabular-nums;
  background:linear-gradient(to top,var(--bg) 62%,transparent);transition:opacity .3s}
.foot button{pointer-events:auto;min-height:44px;padding:0 14px;font-size:inherit;color:inherit;font-variant-numeric:tabular-nums}
.chrome-on .foot,.playing .foot,.locked .foot{opacity:0}
.chrome-on .foot button,.playing .foot button,.locked .foot button{pointer-events:none}

/* ---------- player ---------- */
.player{position:fixed;left:50%;bottom:calc(14px + env(safe-area-inset-bottom));z-index:30;
  transform:translateX(-50%);display:flex;align-items:center;gap:2px;padding:5px 6px 5px 5px;
  background:var(--bg);border:1px solid var(--line);border-radius:999px;box-shadow:var(--shadow);
  transition:transform .4s var(--ease),opacity .3s;max-width:calc(100vw - 24px)}
.chrome-off:not(.playing) .player{transform:translate(-50%,calc(100% + 30px));opacity:0;pointer-events:none}
.pl-line{position:absolute;left:22px;right:22px;top:-1px;height:2px;border-radius:2px;overflow:hidden}
.pl-line span{display:block;height:100%;width:0;background:var(--accent)}
.pl-b{flex:none;width:44px;height:44px;display:grid;place-items:center;border-radius:50%;color:var(--soft)}
.pl-b svg{width:18px;height:18px}
.pl-b:hover{background:var(--wash)}
.pl-play{flex:none;width:46px;height:46px;border-radius:50%;background:var(--ink);color:var(--bg);display:grid;place-items:center;position:relative;
  transition:transform .15s}
.pl-play:active{transform:scale(.94)}
/* buffering: a thin ring turns around the play button */
.buffering .pl-play::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:2px solid transparent;
  border-top-color:var(--accent);animation:spin .8s linear infinite}
.pl-play svg:last-child,.playing .pl-play svg:first-child{display:none}
.playing .pl-play svg:last-child{display:block}
.pl-info{display:flex;flex-direction:column;align-items:flex-start;padding:0 14px 0 8px;line-height:1.25;min-height:44px;justify-content:center;min-width:0}
#plAyah{font-size:14px;font-weight:600;white-space:nowrap}
#plWho{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:42vw}

.pl-away{display:none;align-items:center;gap:6px;height:44px;padding:0 12px;border-radius:999px;font-size:13.5px;font-weight:550;color:var(--soft);white-space:nowrap}
.pl-away svg{width:16px;height:16px;flex:none}
.pl-away b{font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
.pl-away:hover{background:var(--wash)}
.away .pl-away{display:flex}
.away .pl-b,.away .pl-info{display:none}
.away #plBack{background:var(--wash)}
.follow{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(84px + env(safe-area-inset-bottom));z-index:29;
  display:flex;align-items:center;gap:8px;height:40px;padding:0 16px 0 12px;border-radius:999px;
  background:var(--ink);color:var(--bg);font-size:13.5px;font-weight:550;box-shadow:var(--shadow)}
.follow svg{width:18px;height:18px}
.chrome-off:not(.playing) .follow{bottom:calc(36px + env(safe-area-inset-bottom))}
.saw{font-family:"IndoPak",serif;font-size:.95em;line-height:0;font-style:normal}

/* ---------- ayah toolbar and word gloss ---------- */
/* phones: a thumb-height bar fixed to the bottom edge; wide screens: a small popover under the ayah */
.actions{position:fixed;left:0;right:0;bottom:0;z-index:40;background:var(--bg);border-top:1px solid var(--line);
  box-shadow:0 -8px 30px rgba(20,18,12,.08);padding:8px 8px calc(8px + env(safe-area-inset-bottom));animation:up .28s var(--ease)}
.act-key{font-size:12px;color:var(--muted);text-align:center;font-weight:550;padding:2px 0 6px}
.act-row{display:flex;justify-content:space-around}
.actions button{flex:1;min-width:0;min-height:58px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  border-radius:12px;font-size:11.5px;font-weight:550;color:var(--soft)}
.actions button svg{width:22px;height:22px}
.actions button:active,.actions button:hover{background:var(--wash);color:var(--ink)}
.acting .player,.acting .foot{opacity:0;pointer-events:none}
@media (min-width:700px){
  .actions{position:absolute;left:auto;right:auto;bottom:auto;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:4px;animation:none}
  .act-key{display:none}
  .actions button{flex:none;flex-direction:row;min-height:44px;padding:0 13px;font-size:14px;gap:7px}
  .actions button svg{width:17px;height:17px}
  .acting .player{opacity:1;pointer-events:auto}
}
.gloss{position:absolute;z-index:26;display:flex;flex-direction:column;align-items:center;gap:2px;min-width:150px;max-width:260px;
  padding:12px 14px 8px;background:var(--bg);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);text-align:center}
.g-ar{font-family:var(--quran);font-size:30px;line-height:1.7}
.g-en{font:1rem/1.4 var(--serif);color:var(--soft)}
.g-play{display:flex;align-items:center;gap:6px;margin-top:6px;height:40px;padding:0 12px;border-radius:10px;font-size:13px;color:var(--accent);font-weight:550}
.g-play svg{width:16px;height:16px}
.g-play:hover{background:var(--accent-wash)}

/* ---------- sheets: one card that rises from the bottom, the width of the reading column.
   Phones: full width, attached to the bottom edge. Wider screens: floats just above it.
   The text column never moves or gets covered from the side. ---------- */
.sheet{position:fixed;inset:0;z-index:50}
.sh-back{position:absolute;inset:0;background:rgba(18,16,12,.24);animation:fade .3s var(--ease);touch-action:none}
.sh-panel{position:absolute;left:0;right:0;bottom:0;margin:0 auto;width:100%;max-width:44rem;height:86vh;height:86dvh;
  display:flex;flex-direction:column;background:var(--bg);border-radius:22px 22px 0 0;
  box-shadow:0 -12px 50px rgba(20,18,12,.16);animation:up .42s var(--ease);padding-bottom:env(safe-area-inset-bottom);
  will-change:transform}
.sh-panel.narrow{max-width:30rem;height:auto;max-height:86vh;max-height:86dvh}
.sheet.closing .sh-panel{animation:down .24s cubic-bezier(.4,0,1,1) forwards}
.sheet.closing .sh-back{animation:fadeout .24s ease-in forwards}
.sh-grab{height:24px;flex:none;position:relative;cursor:grab;touch-action:none}
.sh-grab::after{content:"";position:absolute;left:50%;top:9px;width:36px;height:5px;margin-left:-18px;border-radius:3px;background:var(--veil)}
.sh-head{display:flex;align-items:center;gap:2px;padding:0 8px 4px;flex:none}
.sh-head h2{flex:1;margin:0;font:600 16px var(--sans);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sh-head h2 span{color:var(--muted);font-weight:500;font-variant-numeric:tabular-nums}
.sh-head .ic svg{width:20px;height:20px}
.sh-head .ic:disabled{opacity:.3;cursor:default}
.tabs{display:flex;gap:24px;padding:0 20px;overflow-x:auto;scrollbar-width:none;flex:none;border-bottom:1px solid var(--line)}
.tabs::-webkit-scrollbar{display:none}
.tabs button{height:44px;min-width:44px;padding:0 2px;font-size:14.5px;font-weight:550;color:var(--muted);white-space:nowrap;position:relative;flex:none}
.tabs button[aria-selected="true"]{color:var(--ink)}
.tabs button[aria-selected="true"]::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;border-radius:2px;background:var(--ink)}
/* the ayah being studied: two lines, tap for all of it */
.sh-ayah{font-family:var(--quran);font-size:22px;line-height:2;margin:12px 20px 0;color:var(--ink);flex:none;text-align:right;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;cursor:pointer;border-radius:8px}
.sh-ayah.open{display:block;max-height:34vh;overflow:auto}
.sh-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:4px 20px 32px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.sets{flex:initial}
@media (min-width:700px){
  .sh-panel{bottom:16px;border-radius:22px;height:min(80vh,820px);box-shadow:0 20px 70px rgba(20,18,12,.2),0 2px 8px rgba(20,18,12,.06)}
  .sh-panel.narrow{max-height:min(80vh,760px)}
  .sh-grab{display:none}
  .sh-head{padding:10px 8px 4px}
}
@keyframes up{from{transform:translateY(100%)}}
@keyframes down{to{transform:translateY(105%)}}
@keyframes fade{from{opacity:0}}
@keyframes fadeout{to{opacity:0}}
@keyframes spin{to{transform:rotate(360deg)}}

/* tafsir */
.tafsir{font:1.05rem/1.75 var(--serif);color:var(--ink)}
.tafsir h2,.tafsir h3{font:600 1.02rem/1.4 var(--sans);margin:1.6em 0 .5em}
.tafsir p{margin:.8em 0}
.tafsir .translation{font-style:italic;color:var(--soft);border-left:2px solid var(--line);padding-left:12px}
.tafsir .arabic,.tafsir [lang="ar"]{font-family:var(--quran);font-size:1.25em;line-height:2;direction:rtl;text-align:right}
.tafsir .gray{color:var(--muted)}
.tafsir .translation span{margin:0 .25em;color:var(--faint);font-style:normal;font-size:.85em}
.tafsir.ar-t{direction:rtl;text-align:right;font-family:"Noto Naskh Arabic","Geeza Pro","Segoe UI","Arial",sans-serif;font-size:1.12rem;line-height:2}
.t-note{font-size:13px;color:var(--muted);margin:2px 0 10px;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.t-note .seg{margin:0}
.loading,.empty{color:var(--muted);font-size:14.5px;padding:22px 0;text-align:center}

/* similar */
.sim{display:block;padding:16px 0;border-bottom:1px solid var(--line);text-decoration:none}
.sim-k{font-size:12.5px;color:var(--muted);font-weight:550;display:flex;justify-content:space-between}
.sim-ar{font-family:var(--quran);font-size:22px;line-height:2;direction:rtl;text-align:right;margin:4px 0}
.sim-ar mark{background:var(--accent-wash);color:var(--accent);border-radius:4px;padding:0 2px}
.sim-tr{font:.96rem/1.6 var(--serif);color:var(--soft)}

/* hadith */
.hd{padding:16px 0;border-bottom:1px solid var(--line)}
.hd-k{font-size:12.5px;color:var(--muted);font-weight:600;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.hd-g{font-weight:500;border:1px solid var(--line);border-radius:999px;padding:1px 8px}
.hd-ar{font-family:"Noto Naskh Arabic","Geeza Pro","Segoe UI","Arial",sans-serif;font-size:1.15rem;line-height:2;direction:rtl;text-align:right;margin:6px 0}
.hd-en{font:1rem/1.65 var(--serif)}

/* manuscripts */
.ms-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;margin-top:8px}
.ms{display:flex;flex-direction:column;gap:6px;text-align:left}
.ms img{width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:8px;background:var(--wash);border:1px solid var(--line)}
.ms b{font-size:12.5px;font-weight:550;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.ms span{font-size:11.5px;color:var(--muted)}
.ms-more{display:block;margin:18px auto 0;height:44px;padding:0 18px;border:1px solid var(--line);border-radius:12px;font-weight:550}
.credit{font-size:12px;color:var(--muted);margin-top:18px;line-height:1.5}
.lightbox{position:fixed;inset:0;z-index:60;background:rgba(8,8,8,.94);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:56px 12px 20px}
.lightbox img{max-width:100%;max-height:calc(100vh - 130px);object-fit:contain;border-radius:4px}
.lightbox .x{position:absolute;top:calc(8px + env(safe-area-inset-top));right:8px;color:#eee}
.lb-cap{color:#ccc;font-size:13px;text-align:center;max-width:36rem;margin:12px 0 0;line-height:1.5}
.lb-cap a{color:#fff}

/* settings */
.sets{padding-top:4px}
.sets h3{font:600 12px var(--sans);text-transform:uppercase;letter-spacing:.1em;color:var(--faint);margin:26px 0 4px}
.set{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 0;border-bottom:1px solid var(--line)}
.set-l{font-size:14.5px;color:var(--soft)}
.seg{display:flex;background:var(--wash);border-radius:11px;padding:3px;gap:2px;flex-wrap:wrap;justify-content:flex-end}
.seg button{min-height:44px;min-width:44px;padding:0 12px;border-radius:9px;font-size:13.5px;color:var(--muted);font-weight:550}
.seg button[aria-pressed="true"]{background:var(--bg);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.1)}
.size{display:flex;align-items:center;gap:6px}
.size button{width:44px;height:44px;border-radius:11px;background:var(--wash);font-family:var(--serif);font-size:15px}
.size button:last-child{font-size:22px}
.size-dots{display:flex;gap:5px}
.size-dots i{width:6px;height:6px;border-radius:50%;background:var(--veil)}
.size-dots i.on{background:var(--ink)}
.sets select{height:44px;border:1px solid var(--line);border-radius:11px;background:var(--bg);color:var(--ink);font:14px var(--sans);padding:0 10px;max-width:60%}
.set-note{font-size:13px;color:var(--muted);margin:10px 0 0;line-height:1.5}
.legend{border-bottom:1px solid var(--line);padding:4px 0 12px}
.legend summary{min-height:44px;display:flex;align-items:center;font-size:14px;color:var(--accent);font-weight:550;cursor:pointer;list-style:none}
.legend summary::-webkit-details-marker{display:none}
.legend ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;font-size:13.5px;color:var(--soft)}
.legend li{display:flex;align-items:center;gap:8px}
.legend i{font-style:normal;font-size:14px}

.toast{position:fixed;left:50%;top:calc(20px + env(safe-area-inset-top));transform:translate(-50%,-150%);z-index:70;background:var(--ink);color:var(--bg);
  padding:10px 16px;border-radius:999px;font-size:13.5px;transition:transform .35s var(--ease);pointer-events:none}
.toast.on{transform:translate(-50%,0)}

@media (min-width:700px){
  :root{--ar-size:36px}
  .read{padding-left:32px;padding-right:32px}
  .tr{font-size:1.2rem;line-height:1.6}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
  .ayah{opacity:1!important;transform:none!important}
}

/* transliteration: under each word (as on quran.com), or a line per ayah */
.tl{display:none}
:root[data-translit="words"] .ar .w{display:inline-flex;flex-direction:column;align-items:center;vertical-align:top;margin:0 .06em .2em;line-height:1.75}
:root[data-translit="words"] .ar .w .tl{display:block;font:400 calc(var(--ar-size) * .4)/1.3 var(--sans);direction:ltr;color:var(--muted);
  letter-spacing:0;white-space:nowrap;margin-top:.1em}
:root[data-translit="words"] .ayah.now .w:not(.said):not(.on) .tl{color:var(--faint)}
.tl-line{display:none;font:italic 1rem/1.6 var(--serif);color:var(--muted);margin:12px 0 0}
:root[data-translit="ayah"] .tl-line{display:block}
