:root {
  --bg: #f6f3ec; --card: #fffdf8; --ink: #1f1c17; --muted: #7a7266; --hair: #e6dfd1; --soft: #efe9dc; --acc: #8a5a1f; --acc2: #2f6b5a;
  --q: #6b3d12; --shadow: 0 1px 2px rgba(60, 40, 10, .05), 0 8px 28px rgba(60, 40, 10, .06); --fs: 19px; --side: 320px;
}
:root[data-theme="dark"] {
  --bg: #13120e; --card: #1c1a15; --ink: #ece6da; --muted: #9a9286; --hair: #2d2920; --soft: #24211a; --acc: #d9a560; --acc2: #7cc4ad; --q: #e8be86;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13120e; --card: #1c1a15; --ink: #ece6da; --muted: #9a9286; --hair: #2d2920; --soft: #24211a; --acc: #d9a560; --acc2: #7cc4ad; --q: #e8be86;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, sans-serif; transition: background .3s }
button { font: inherit; color: inherit }
a { color: inherit }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column }
.side { position: fixed; inset: 0 auto 0 0; z-index: 20; inline-size: min(100vw, 420px); background: var(--card); display: flex; flex-direction: column;
  transform: translateX(-102%); transition: transform .38s cubic-bezier(.2, .8, .2, 1); padding-top: env(safe-area-inset-top); box-shadow: 0 0 40px rgba(0, 0, 0, .18) }
.side.on { transform: none }
@media (min-width: 1000px) {
  .side { position: sticky; top: 0; block-size: 100vh; inline-size: var(--side); transform: none; box-shadow: none; border-inline-end: 1px solid var(--hair) }
  .menu, .close-side { display: none !important }
  .dock { display: none !important }
}

/* ---------- surah list ---------- */
.side-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--hair); display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none }
.brand b { display: block; font-size: 16px }
.brand small { color: var(--muted); font-size: 12px }
.logo { inline-size: 38px; block-size: 38px; border-radius: 12px; background: var(--acc); color: #fff; display: grid; place-items: center; font: 20px/1 "Noto Sans Tifinagh", sans-serif }
.side-head input { grid-column: 1 / -1; inline-size: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--hair); background: var(--bg); color: var(--ink); font: inherit; outline: none }
.side-head input:focus { border-color: var(--acc) }
.slist { list-style: none; margin: 0; padding: 8px; overflow: auto; flex: 1; overscroll-behavior: contain }
.slist a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; text-decoration: none; transition: background .15s }
.slist a:hover { background: var(--soft) }
.slist a.cur { background: var(--soft) }
.sn { inline-size: 34px; block-size: 34px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--soft); font-size: 12.5px; font-weight: 600; color: var(--muted);
  transform: rotate(45deg) scale(.82) }
.sn i { transform: rotate(-45deg); font-style: normal }
.slist a.cur .sn { background: var(--acc); color: #fff }
.se { flex: 1; min-width: 0 }
.se b { display: block; font-weight: 600; font-size: 14px }
.se small { color: var(--muted); font-size: 12px }
.sa { font: 21px "Amiri Quran", serif; color: var(--q); white-space: nowrap }
.side-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair); font-size: 13.5px }
.side-foot a { color: var(--acc) }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--hair);
  transition: transform .3s ease }
.bar.hide { transform: translateY(-100%) }
.ib { inline-size: 42px; block-size: 42px; flex: none; border: 0; border-radius: 13px; background: transparent; display: grid; place-items: center; cursor: pointer }
.ib:hover { background: var(--soft) }
.ib svg { inline-size: 22px; block-size: 22px }
.ttl { flex: 1; min-width: 0; border: 0; background: transparent; cursor: pointer; text-align: center; line-height: 1.25; padding: 2px 6px; border-radius: 12px }
.ttl:hover { background: var(--soft) }
@media (min-width: 1000px) { .ttl { text-align: start; cursor: default } .ttl:hover { background: transparent } }
.t1 { display: block; font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.t2 { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.prog { position: absolute; inset: auto 0 -1px 0; block-size: 2px; background: var(--acc); transform-origin: left; transform: scaleX(0); transition: transform .15s linear }

/* ---------- main ---------- */
main { inline-size: 100%; max-width: 1180px; margin: 0 auto; padding: 8px clamp(12px, 3vw, 40px) 110px }
@media (min-width: 1000px) { main { padding-bottom: 60px } }

/* home: surah grid */
.hero { padding: 28px 4px 10px }
.hero h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.01em }
.hero p { margin: 0; color: var(--muted); max-width: 70ch }
.hero .cont { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 16px; border-radius: 999px; background: var(--acc); color: #fff; text-decoration: none; font-weight: 600 }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 22px }
.gcard { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--hair); text-decoration: none;
  transition: transform .2s, border-color .2s, box-shadow .2s; animation: rise .4s ease both }
.gcard:hover { transform: translateY(-2px); border-color: var(--acc); box-shadow: var(--shadow) }
.gsearch { display: none; inline-size: 100%; margin-top: 18px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--hair); background: var(--card); color: var(--ink); font: inherit; outline: none }
@media (max-width: 999px) { .gsearch { display: block } }

/* surah view */
.shead { text-align: center; padding: 26px 0 6px; animation: rise .45s ease both }
.shead .ar { font: clamp(34px, 6vw, 46px)/2 "Amiri Quran", serif; color: var(--q); padding-bottom: .15em; margin-bottom: 4px }
.shead .en { font-weight: 700; font-size: 17px }
.shead .meta { color: var(--muted); font-size: 13px; margin-top: 2px }
.shead .vbtn { margin-top: 14px; border: 1px solid var(--hair); background: var(--card); padding: 8px 14px; border-radius: 999px; cursor: pointer; color: var(--muted) }
.shead .vbtn:hover { border-color: var(--acc); color: var(--acc) }
.pagehead { display: flex; align-items: center; gap: 12px; margin: 28px 2px 10px; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase }
.pagehead::after { content: ""; flex: 1; height: 1px; background: var(--hair) }

.unit { position: relative; background: var(--card); border: 1px solid var(--hair); border-radius: 20px; padding: 16px 18px; margin: 10px 0; box-shadow: var(--shadow);
}
.unit.flash { animation: flash 1.6s ease }
@keyframes flash { 0%, 40% { border-color: var(--acc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 22%, transparent) } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.q { font: calc(var(--fs) * 1.3)/2 "Amiri Quran", serif; color: var(--q); direction: rtl; text-align: right }
.tam > div + div { margin-top: 2px }
.tam .arb { font: var(--fs)/2 "Scheherazade New", serif; direction: rtl; text-align: right }
.tam .lat { font-size: calc(var(--fs) * .92); line-height: 1.55; color: var(--acc2); font-weight: 500 }
.tam .tif { font: calc(var(--fs) * 1.05)/1.75 "Noto Sans Tifinagh", sans-serif; letter-spacing: .04em }
.tam + .tam { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--hair) }
.q + .tam { margin-top: 8px }
.num { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--soft); color: var(--acc); font: 600 12.5px Inter }
.num b { inline-size: 24px; block-size: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--acc); color: #fff; font-size: 11.5px }
.com { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hair); font: calc(var(--fs) * .82)/1.95 "Scheherazade New", serif; color: var(--muted); direction: rtl; text-align: right }
.com + .com { border-top: 0; margin-top: 0; padding-top: 0 }
.colA:empty, .colA:empty + .colL:empty + .colB .com:first-child { }
.colA:empty + .colL:empty + .colB > .com:first-child { border-top: 0; margin-top: 0; padding-top: 0 }
.colA:empty { display: none }
body.nocomm .com { display: none }

/* wide screens: Latin / Tifinagh on the left, the Arabic (Quran + Tamajaq in Arabic letters) on the right */
@media (min-width: 860px) {
  .unit.wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start }
  .unit.wide .colA { grid-column: 2; grid-row: 1 }
  .unit.wide .colL { grid-column: 1; grid-row: 1; padding-top: 6px; border-inline-end: 1px solid var(--hair); padding-inline-end: 24px; min-block-size: 100% }
  .unit.wide .colB { grid-column: 1 / -1 }
}
.colL:empty { display: none }

.snav { display: flex; gap: 10px; margin: 30px 0 0 }
.snav a { flex: 1; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--hair); background: var(--card); text-decoration: none; transition: border-color .2s }
.snav a:hover { border-color: var(--acc) }
.snav small { display: block; color: var(--muted); font-size: 12px }
.snav b { font-size: 15px }
.snav .nx { text-align: end }
.loading { display: grid; place-items: center; padding: 80px 0 }
.loading span { inline-size: 32px; block-size: 32px; border-radius: 50%; border: 3px solid var(--hair); border-top-color: var(--acc); animation: spin .8s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }
.more { display: block; margin: 18px auto 0; padding: 11px 20px; border: 1px solid var(--hair); border-radius: 999px; background: var(--card); cursor: pointer; color: var(--muted) }

/* ---------- bottom dock (phones) ---------- */
.dock { position: fixed; inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px; z-index: 10; display: flex; gap: 6px; padding: 6px; border-radius: 22px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--hair);
  box-shadow: 0 10px 30px rgba(40, 25, 5, .14); transition: transform .3s ease, opacity .3s }
.dock.hide { transform: translateY(140%); opacity: 0 }
.dock.off { display: none }
.dk { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 6px; border-radius: 16px; border: 0; background: transparent; text-decoration: none;
  font-weight: 600; font-size: 13.5px; cursor: pointer; min-width: 0 }
.dk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.dk svg { inline-size: 18px; block-size: 18px; flex: none }
.dk.mid { background: var(--acc); color: #fff; flex: 1.1 }
.dk.dis { opacity: .35; pointer-events: none }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 15; background: rgba(20, 14, 4, .38); opacity: 0; pointer-events: none; transition: opacity .3s }
.scrim.on { opacity: 1; pointer-events: auto }
.sheet { position: fixed; z-index: 30; inset: auto 0 0 0; max-height: 82vh; overflow: auto; background: var(--card); border-radius: 24px 24px 0 0;
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom)); transform: translateY(103%); transition: transform .4s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -10px 40px rgba(0, 0, 0, .18) }
.sheet.on { transform: none }
@media (min-width: 760px) { .sheet { inset: auto auto 50% 50%; inline-size: 480px; border-radius: 24px; transform: translate(-50%, 60%) scale(.96); opacity: 0; transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .25s ease; pointer-events: none }
  .sheet.on { transform: translate(-50%, 50%); opacity: 1; pointer-events: auto } }
.grab { inline-size: 42px; block-size: 4px; border-radius: 2px; background: var(--hair); margin: 4px auto 12px }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 9px }
.sheet h3:first-of-type { margin-top: 4px }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 7px }
.vgrid a { display: grid; place-items: center; block-size: 44px; border-radius: 12px; background: var(--soft); text-decoration: none; font-weight: 600; font-size: 14px; transition: background-color .15s, color .15s }
.vgrid a:hover { background: var(--acc); color: #fff }
.chips { display: flex; flex-wrap: wrap; gap: 8px }
.chips span, .tog span { display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--hair); cursor: pointer; user-select: none; transition: background-color .2s, border-color .2s, color .2s }
.chips input, .tog input { position: absolute; opacity: 0; pointer-events: none }
.chips input:checked + span { background: var(--acc); border-color: var(--acc); color: #fff }
.tog span { border: 0; padding: 4px 0 }
.tog span::before { content: ""; inline-size: 38px; block-size: 22px; border-radius: 11px; background: var(--hair) radial-gradient(circle at 11px 11px, #fff 8px, transparent 8.5px); transition: background-color .2s, background-position .2s }
.tog input:checked + span::before { background: var(--acc2) radial-gradient(circle at 27px 11px, #fff 8px, transparent 8.5px) }
.row { display: flex; align-items: center; gap: 10px; margin-top: 12px }
.row select { flex: 1; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--hair); background: var(--bg); color: var(--ink); font: inherit }

.seg { display: flex; background: var(--soft); padding: 4px; border-radius: 15px; gap: 4px }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 11px; cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s }
.seg button.on { background: var(--card); box-shadow: var(--shadow); font-weight: 600 }
.note { color: var(--muted); font-size: 12.5px; margin-top: 18px }
.about { max-width: 780px; margin: 30px auto; background: var(--card); border: 1px solid var(--hair); border-radius: 22px; padding: 22px 26px; animation: rise .4s ease both }
.about h1 { margin-top: 0; font-size: 26px }
.about a { color: var(--acc) }
.sw-enter { animation: rise .35s ease both }

/* verse by verse */
.unit.verse { padding-top: 12px }
.vhead { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px }
.vno { font: 600 12.5px Inter; color: var(--acc); background: var(--soft); padding: 4px 11px; border-radius: 999px }
.vpg { font-size: 11.5px; color: var(--muted) }
.q.vq { font-size: calc(var(--fs) * 1.38); line-height: 2.15 }
.comfold { margin-top: 10px; border-top: 1px solid var(--hair); padding-top: 8px }
.comfold summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; display: inline-flex; align-items: center; gap: 6px; user-select: none }
.comfold summary::-webkit-details-marker { display: none }
.comfold summary::before { content: "\203A"; display: inline-block; transition: transform .2s; font-size: 16px }
.comfold[open] summary::before { transform: rotate(90deg) }
.comfold .com { border-top: 0; margin-top: 6px; padding-top: 0 }
body.nocomm .comfold { display: none }
@media (min-width: 860px) { .unit.verse.wide .colA, .unit.verse.wide .colL { grid-row: 2 } }

/* the Warsh mushaf text (Scheherazade New draws the Warsh marks best of the open fonts) */
@font-face { font-family: "KFGQPC Warsh"; src: url(fonts/kfgqpc-warsh.woff2) format("woff2"); font-display: swap }
:root { --qf: "KFGQPC Warsh", "Scheherazade New", serif }
:root[data-qfont="scheh"] { --qf: "Scheherazade New", serif }
:root[data-qfont="amiri"] { --qf: "Amiri Quran", serif }
:root[data-qfont="noto"] { --qf: "Noto Naskh Arabic", serif }
.wq { font-family: var(--qf) !important; color: var(--q) }
.q.vq.wq { font-size: calc(var(--fs) * 1.45); line-height: 2.2 }
.basm { font-size: clamp(22px, 4vw, 28px); line-height: 2; margin-top: 10px; direction: rtl }

/* Mushaf view: the surah as continuous text on a page-like sheet, as in a printed mushaf */
.mushaf { max-width: 860px; margin: 18px auto 0; padding: clamp(22px, 4vw, 54px) clamp(18px, 4vw, 60px); background: var(--card);
  border-radius: 6px; box-shadow: var(--shadow), inset 0 0 0 1px var(--hair), inset 0 0 0 7px var(--card), inset 0 0 0 8px color-mix(in srgb, var(--acc) 45%, transparent);
  direction: rtl; text-align: justify; text-align-last: center; font-size: calc(var(--fs) * 1.55); line-height: 2.35; color: var(--ink); animation: rise .45s ease both }
.mushaf .ay { cursor: pointer; border-radius: 8px; transition: background .2s; padding: 2px 0 }
.mushaf .ay:hover { background: color-mix(in srgb, var(--acc) 8%, transparent) }
.mushaf .ay.sel { background: color-mix(in srgb, var(--acc) 16%, transparent) }
.mushaf .ae { color: var(--acc); white-space: nowrap }
.mhint { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 12px }
.sheet.tall { max-height: 88vh }
@media (min-width: 760px) { .sheet.tall { inline-size: min(860px, 92vw) } }
#vsBody .unit { box-shadow: none; border: 0; padding: 4px 0; margin: 0 }

/* ---------- verse rows in the style of quran.com's translation view ---------- */
.vrow { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding: 26px 4px 22px; border-bottom: 1px solid var(--hair); animation: rise .35s ease both }
.vrow.flash { animation: flash2 1.8s ease }
@keyframes flash2 { 0%, 45% { background: color-mix(in srgb, var(--acc) 9%, transparent) } }
.vact { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 6px }
.vkey { font: 600 13px Inter; color: var(--muted); margin-bottom: 4px; white-space: nowrap }
.vb { inline-size: 34px; block-size: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s }
.vb:hover { background: var(--soft); color: var(--acc) }
.vb.ok { color: var(--acc2) }
.vb svg { inline-size: 19px; block-size: 19px }
.vmain { min-width: 0 }
.vq2 { direction: rtl; text-align: right; font-size: calc(var(--fs) * 1.6); line-height: 2.25; color: var(--ink); margin-bottom: 18px }
.vq2 .ae { color: var(--acc) }
.tr2 { margin-top: 16px }
.tr2 .t { font-size: calc(var(--fs) * .95); line-height: 1.75; color: var(--ink) }
.tr2 .t.lat { font-weight: 400 }
.tr2 .t.arb { direction: rtl; text-align: right; font: var(--fs)/2 "Scheherazade New", serif }
.tr2 .t.tif { font-family: "Noto Sans Tifinagh", sans-serif; letter-spacing: .04em }
.tr2 .by { margin-top: 4px; font-size: 12px; color: var(--muted) }
.vpg2 { margin-top: 14px; font-size: 11.5px; color: var(--muted); opacity: .8 }
@media (max-width: 700px) {
  .vrow { grid-template-columns: 1fr; gap: 6px; padding: 18px 2px 18px }
  .vact { flex-direction: row; align-items: center; padding: 0; gap: 2px }
  .vkey { margin: 0 auto 0 0; background: var(--soft); padding: 3px 10px; border-radius: 999px; font-size: 12px }
}
.tabs { display: inline-flex; margin-top: 18px; padding: 4px; border-radius: 999px; background: var(--soft); gap: 4px }
.tabs button { border: 0; background: transparent; padding: 8px 20px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); transition: background-color .2s, color .2s, box-shadow .2s }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow) }
.shead .vbtn { display: block; margin: 12px auto 0 }
#vsBody h3 { margin-top: 4px }
#vsBody .com { margin: 0 0 10px; border: 0; padding: 0 }

/* text-size slider: thin rounded track filled up to the handle, round handle with a soft shadow */
.range { display: flex; align-items: center; gap: 12px }
.ra { color: var(--muted); font-weight: 600; line-height: 1; user-select: none }
.ra.small { font-size: 13px } .ra.big { font-size: 22px }
.range output { min-inline-size: 30px; text-align: center; font: 600 12.5px Inter; color: var(--acc); background: var(--soft); padding: 4px 8px; border-radius: 999px }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; block-size: 28px; background: transparent; cursor: pointer; margin: 0; --p: 30% }
input[type=range]:focus { outline: none }
input[type=range]::-webkit-slider-runnable-track { block-size: 6px; border-radius: 999px; background: linear-gradient(to right, var(--acc) var(--p), var(--hair) var(--p)) }
input[type=range]::-moz-range-track { block-size: 6px; border-radius: 999px; background: var(--hair) }
input[type=range]::-moz-range-progress { block-size: 6px; border-radius: 999px; background: var(--acc) }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; inline-size: 22px; block-size: 22px; margin-top: -8px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.04), 0 0 0 0 color-mix(in srgb, var(--acc) 25%, transparent); transition: transform .15s ease, box-shadow .2s ease }
input[type=range]::-moz-range-thumb { inline-size: 22px; block-size: 22px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease }
input[type=range]:hover::-webkit-slider-thumb { box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 0 0 6px color-mix(in srgb, var(--acc) 14%, transparent) }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 2px 6px rgba(0,0,0,.25), 0 0 0 8px color-mix(in srgb, var(--acc) 18%, transparent) }
input[type=range]:active::-moz-range-thumb { transform: scale(1.15) }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--acc) }

/* interface language chips */
.langs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--soft); margin-top: 14px }
.langs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font: 600 12.5px Inter; color: var(--muted); cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s }
.langs button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow) }
.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.side-foot .langs { margin-top: 0 }
.tqnote { margin-top: 8px }

/* play the Tamajaq: play icon, pause icon while playing */
.vplay .ipa { display: none } .vplay.on .ip { display: none } .vplay.on .ipa { display: block }
.vplay.on { color: var(--acc); background: var(--soft) }


/* interface language button and the Tamajaq script choice (2026-12-03) */
.ib.lang { font: 700 13px/1 Inter, system-ui, sans-serif; color: var(--muted); inline-size: auto; min-inline-size: 42px; padding: 0 10px }
.langs { display: grid; gap: 8px; padding: 0; background: none; border-radius: 0; margin-top: 14px; max-inline-size: 100% }
.langs .lrow { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--soft); justify-self: start }
.langs .lrow.scrs button { min-inline-size: 64px }
#langs3 { margin: 6px 0 4px } #langs3 .lrow { justify-self: stretch } #langs3 .lrow button { flex: 1; padding: 10px 14px; font-size: 14px }
#langSheet { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)) } #langSheet h3 { margin-bottom: 10px }
#uiScr { margin-top: 8px } #uiScr button[dir="rtl"] { font-family: "Noto Naskh Arabic", serif }
.langs button[dir="rtl"] { font-family: "Noto Naskh Arabic", serif; font-size: 14px }
.ui-arb [data-i], .ui-arb .meta, .ui-arb .se small, .ui-arb #t1, .ui-arb #t2 { font-family: "Noto Naskh Arabic", "Amiri", serif }

/* smoothness (2026-12-03): only the first cards of a page animate in (a long surah has hundreds); off-screen verses are not laid out
   until they come near the screen; panels move with transform only; reduced motion respected */
.vrow:nth-of-type(n+9), .gcard:nth-of-type(n+25) { animation: none }
.vrow { content-visibility: auto; contain-intrinsic-size: auto 220px }
.sheet, .side { will-change: transform }
.langs button, .ib, .vb { transition: background-color .2s, color .2s, box-shadow .2s }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important }
}
.uireg { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 13.5px; color: var(--muted) }
.uireg select { flex: 1; font: inherit; color: var(--ink); background: var(--soft); border: 0; border-radius: 12px; padding: 9px 10px }

/* install bar / iPhone steps */
.inst { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 22px; background: var(--card); color: var(--ink);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22); transform: translateY(140%); opacity: 0; transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .3s }
.inst.on { transform: none; opacity: 1 }
.inst img { inline-size: 44px; block-size: 44px; border-radius: 11px; flex: none }
.inst .tx { flex: 1; min-width: 0; display: grid } .inst .tx b { font-size: 15px } .inst .tx span { font-size: 12.5px; color: var(--muted) }
.inst button { border: 0; cursor: pointer; font: 600 13.5px Inter, system-ui, sans-serif; border-radius: 14px }
.inst .later { background: transparent; color: var(--muted); padding: 8px } .inst .go { background: var(--acc); color: #fff; padding: 10px 16px }
.inst.tall { display: block; padding: 18px } .inst .ios { display: grid; gap: 12px } .inst .ios b { font-size: 16px }
.inst ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px }
.inst li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; background: var(--soft); font-size: 14.5px }
.inst .ic { inline-size: 32px; block-size: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--card); color: #2f6fd6; flex: none }
.inst .ic svg { inline-size: 19px; block-size: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }

/* the hidden attribute always wins (e.g. the script row in Settings when Tamajaq is not chosen) */
[hidden] { display: none !important }

#langs4 { margin: 6px 0 4px } #langs4 .lrow { justify-self: stretch } #langs4 .lrow button { flex: 1; padding: 10px 14px; font-size: 14px }
