/* zaher.me/quran: light, calm, typographic. No dark mode by design. */
@font-face {
  font-family: "DigitalKhatt";
  src: url("fonts/dk.3278d1110c.woff2") format("woff2");
  font-display: block;
}
@font-face {
  font-family: "Readex Pro";
  src: url("fonts/ui.6729933e5b.woff2") format("woff2");
  font-weight: 300 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fbf9f4;
  --paper-2: #f4f0e6;
  --card: #fffdf9;
  --ink: #201c17;
  --ink-2: #57504a;
  --ink-3: #8a8277;
  --line: #e8e1d3;
  --line-2: #d8cfbd;
  --gold: #9b7535;
  --gold-2: #b89250;
  --gold-soft: #efe3c7;
  --hl: #f0dfb0;
  --hl-ayah: rgba(212, 180, 110, 0.13);
  --sel: rgba(155, 117, 53, 0.1);
  --shadow: 0 18px 40px -22px rgba(52, 38, 16, 0.35), 0 2px 8px -3px rgba(52, 38, 16, 0.12);
  --ui: "Readex Pro", system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  --quran: "DigitalKhatt", "KFGQPC Uthmanic Script HAFS", "Amiri Quran", serif;
  --qsize: clamp(1.6rem, 1.05rem + 1.7vw, 2.2rem);
  --top-h: 58px;
  --player-h: 0px;
  --wrap: 47rem;
  --r: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
:root[data-paper="white"] {
  --paper: #ffffff;
  --paper-2: #f5f4f1;
  --card: #ffffff;
  --line: #e9e6e0;
  --line-2: #dbd6cc;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--player-h) + 40px + env(safe-area-inset-bottom));
}
::selection { background: rgba(184, 146, 80, 0.25); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 8px; }
svg { display: block; }
[hidden] { display: none !important; }
.skip { position: fixed; inset-inline-start: 10px; top: 10px; transform: translateY(-160%); background: var(--card); padding: 8px 12px; border-radius: 10px; z-index: 100; box-shadow: var(--shadow); }
.skip:focus { transform: none; }
body { overflow-x: clip; }
.quran { font-family: var(--quran); font-weight: normal; direction: rtl; }

/* ------------------------------------------------------------ top bar */
.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  background: rgba(251, 249, 244, 0.93);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top-in {
  height: 100%; max-width: 72rem; margin: 0 auto; padding: 0 14px;
  display: flex; align-items: center; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; padding: 6px 8px; border-radius: 10px; }
.brand .star { width: 24px; height: 24px; color: var(--gold); }
.brand small { color: var(--ink-3); font-weight: 400; font-size: 12.5px; }
.top-title { flex: 1; min-width: 0; text-align: center; line-height: 1.2; }
.top-title b { display: block; font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title span { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.spacer { flex: 1; }
.ib {
  width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.ib:hover { background: var(--paper-2); color: var(--ink); }
.ib svg { width: 21px; height: 21px; }

/* ------------------------------------------------------------ home */
.home { max-width: 72rem; margin: 0 auto; padding: 0 16px 40px; }
.hero { text-align: center; padding: 34px 0 26px; }
.hero .orn { width: 64px; height: 64px; margin: 0 auto 6px; color: var(--gold); }
.hero h1 { margin: 0; font-size: clamp(2.6rem, 1.8rem + 3vw, 4rem); line-height: 1.9; color: var(--ink); word-spacing: 0.22em; }
.hero p { margin: 0 auto; max-width: 34rem; color: var(--ink-2); font-size: 15.5px; }
.hero .rule { width: 120px; height: 12px; margin: 16px auto 0; color: var(--gold-2); }
.searchbox {
  margin: 22px auto 0; max-width: 34rem; width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink-3); text-align: start; box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.searchbox:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.searchbox svg { width: 19px; height: 19px; flex: none; }
.searchbox span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.searchbox kbd { font: 11px/1 var(--ui); border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 6px; color: var(--ink-3); }

.resume {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 4px 0 26px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 13.5px; color: var(--ink-2);
  transition: border-color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--gold-2); color: var(--ink); }
.chip svg { width: 16px; height: 16px; color: var(--gold); }
.chip.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.primary svg { color: var(--gold-soft); }
.chip.primary:hover { background: #000; }

.tabs { display: flex; justify-content: center; gap: 4px; margin: 6px 0 18px; }
.tab { padding: 8px 18px; border-radius: 999px; color: var(--ink-3); font-size: 14px; }
.tab[aria-selected="true"] { background: var(--paper-2); color: var(--ink); font-weight: 500; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.card {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-height: 68px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
}
.card:hover { border-color: var(--gold-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.badge { position: relative; width: 38px; height: 38px; flex: none; display: grid; place-items: center; color: var(--gold-2); }
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.badge b { position: relative; font-weight: 500; font-size: 12.5px; color: var(--ink); }
.card .names { flex: 1; min-width: 0; line-height: 1.35; }
.card .names b { display: block; font-weight: 500; font-size: 16px; }
.card .names span { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .side { text-align: end; font-size: 12px; color: var(--ink-3); line-height: 1.4; white-space: nowrap; }
.card .side .qn { font-family: var(--quran); font-size: 21px; color: var(--ink-2); line-height: 1.5; display: block; }

.foot { margin: 48px auto 0; max-width: 46rem; text-align: center; color: var(--ink-3); font-size: 12.5px; line-height: 1.8; }
.foot a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.foot a:hover { color: var(--ink); }

/* ------------------------------------------------------------ reader */
.reader { max-width: var(--wrap); margin: 0 auto; padding: 8px 18px 20px; }
.shead { text-align: center; padding: 18px 0 6px; }
.frame { position: relative; max-width: 520px; margin: 0 auto; color: var(--gold-2); }
.frame svg { width: 100%; height: auto; }
.frame h1 {
  position: absolute; inset: 0; margin: 0; display: grid; place-items: center;
  font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.95rem); color: var(--ink); line-height: 1; padding-top: 0.2em;
}
.smeta { margin: 10px 0 0; color: var(--ink-3); font-size: 13px; }
.sacts { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.basmala {
  text-align: center; font-size: calc(var(--qsize) * 1.02); line-height: 2.2; margin: 18px 0 6px;
  font-feature-settings: "bism" 1; color: var(--ink); border-radius: 12px; transition: background 0.3s;
}
.basmala.on { background: var(--hl-ayah); }

.qtext {
  font-family: var(--quran);
  font-size: var(--qsize);
  line-height: 2.32;
  word-spacing: 0.14em;
  text-align: justify;
  text-justify: inter-word;
  margin: 0;
  direction: rtl;
  isolation: isolate;
  color: var(--ink);
}
.w { position: relative; cursor: pointer; border-radius: 0.3em; }
.w::before {
  content: ""; position: absolute; inset: 0.46em -0.1em 0.3em; border-radius: 0.3em;
  background: var(--hl); opacity: 0; transition: opacity 0.14s; z-index: -1; pointer-events: none;
}
.w.on::before { opacity: 1; }
.w:hover::before { opacity: 0.45; }
.w.on:hover::before { opacity: 1; }
.no-word-hl .w.on::before { opacity: 0; }
.ayah { border-radius: 0.35em; transition: background 0.3s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ayah.on { background: var(--hl-ayah); }
.ayah.sel { background: var(--sel); }
.ayah.flash { animation: flash 1.8s var(--ease); }
@keyframes flash { 0%, 40% { background: rgba(212, 180, 110, 0.35); } 100% { background: transparent; } }
.end { color: var(--gold); cursor: pointer; white-space: nowrap; }
.ayah.bm .end { color: #a4452c; }
.rub, .sajda { color: var(--gold); }

.pg-foot {
  display: flex; align-items: center; justify-content: center; margin: 14px 0 20px; color: var(--ink-3);
  font-size: 12px; user-select: none;
  background: linear-gradient(to right, transparent, var(--line-2) 22%, var(--line-2) 78%, transparent) center / 100% 1px no-repeat;
}
.pg-foot .pn { display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: var(--paper); font-variant-numeric: tabular-nums; }
.card .side.bmk { color: var(--gold); }
.card .side.bmk svg { width: 18px; height: 18px; }
.size .aa.sm { font-size: 18px; }
.size .aa.lg { font-size: 30px; }

.vlist .vrow { padding: 12px 4px 14px; border-bottom: 1px solid var(--line); }
.vlist .vrow:last-child { border-bottom: 0; }
.vlist .qtext { text-align: start; }
.vref { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }

.snav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 34px 0 8px; }
.snav a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); transition: border-color 0.15s; }
.snav a:hover { border-color: var(--gold-2); }
.snav small { display: block; color: var(--ink-3); font-size: 12px; }
.snav b { font-weight: 500; }
.snav .next { text-align: end; }

.loading { display: grid; place-items: center; min-height: 40vh; color: var(--ink-3); }
.spin { width: 22px; height: 22px; animation: rot 0.9s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.err { text-align: center; padding: 60px 10px; color: var(--ink-2); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 14px; color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--gold-2); }
.btn svg { width: 18px; height: 18px; }
.btn.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.dark:hover { background: #000; }
.btn .sub { color: var(--ink-3); font-size: 12.5px; }

/* ------------------------------------------------------------ player */
.player {
  position: fixed; z-index: 40; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(760px, calc(100% - 20px));
  background: rgba(255, 253, 249, 0.97);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  padding: 10px 12px 10px; overflow: hidden;
  animation: rise 0.28s var(--ease);
}
@keyframes rise { from { transform: translate(-50%, 16px); opacity: 0; } }
.p-track { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--line); }
.p-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--gold-2); }
.p-seek { position: absolute; left: 0; right: 0; top: -6px; height: 16px; width: 100%; margin: 0; opacity: 0; cursor: pointer; }
.p-row { display: flex; align-items: center; gap: 10px; }
.p-info { flex: 1; min-width: 0; line-height: 1.3; }
.p-info b { display: block; font-weight: 500; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-info button { display: block; max-width: 100%; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: start; }
.p-info button:hover { color: var(--ink); }
.p-transport { display: flex; align-items: center; gap: 4px; direction: ltr; }
.p-play {
  width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; transition: transform 0.15s var(--ease), background 0.15s;
}
.p-play:hover { background: #000; transform: scale(1.04); }
.p-play svg { width: 22px; height: 22px; }
.p-tools { display: flex; align-items: center; gap: 2px; }
.p-tools .ib { width: 36px; height: 36px; }
.p-tools .ib[aria-pressed="true"] { color: var(--gold); background: var(--paper-2); }
.p-speed { font-size: 12.5px; font-weight: 500; min-width: 40px; height: 32px; border-radius: 10px; color: var(--ink-2); }
.p-speed:hover { background: var(--paper-2); }
.p-time { font-size: 11.5px; color: var(--ink-3); min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; }

.fab {
  position: fixed; z-index: 35; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 20px 0 16px;
  background: var(--ink); color: var(--paper); border-radius: 999px; box-shadow: var(--shadow);
  font-size: 14.5px; transition: transform 0.15s var(--ease), background 0.15s;
}
.fab:hover { background: #000; transform: translateX(-50%) translateY(-1px); }
.fab svg { width: 20px; height: 20px; }
.fab span { white-space: nowrap; }
.fab small { color: #cfc6b6; font-size: 12.5px; white-space: nowrap; max-width: 48vw; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ selection bar */
.selbar {
  position: fixed; z-index: 45; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--player-h) + 20px + env(safe-area-inset-bottom));
  width: max-content; max-width: calc(100% - 20px);
  display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: rise 0.22s var(--ease); overflow-x: auto;
}
.fab:not([hidden]) ~ .selbar { bottom: calc(80px + env(safe-area-inset-bottom)); }
.selbar .ref { padding: 0 10px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.selbar button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 11px; font-size: 13.5px; white-space: nowrap; }
.selbar button:hover { background: var(--paper-2); }
.selbar button svg { width: 18px; height: 18px; color: var(--gold); }
.selbar button.x svg { color: var(--ink-3); }

/* ------------------------------------------------------------ overlays */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(40, 33, 24, 0.22); animation: fade 0.18s; }
@keyframes fade { from { opacity: 0; } }
.panel {
  position: fixed; z-index: 61; left: 50%; top: 9vh; transform: translateX(-50%);
  width: min(640px, calc(100% - 20px)); max-height: 82vh; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  animation: drop 0.22s var(--ease); overflow: hidden;
}
@keyframes drop { from { transform: translate(-50%, -8px); opacity: 0; } }
.panel-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 18px; border-bottom: 1px solid var(--line); }
[dir="rtl"] .panel-h { padding: 12px 18px 10px 12px; }
.panel-h h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 500; }
.panel-b { overflow-y: auto; padding: 8px 18px 18px; }
.sfield { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sfield svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.sfield input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 16px var(--ui); color: var(--ink); -webkit-appearance: none; appearance: none; }
.sfield input::-webkit-search-cancel-button, .sfield input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.sfield input::placeholder { color: var(--ink-3); }
.hint { color: var(--ink-3); font-size: 12.5px; padding: 12px 2px 4px; line-height: 1.9; }
.hint b { font-weight: 500; color: var(--ink-2); }
.rsec { margin: 12px 0 4px; font-size: 12px; color: var(--ink-3); }
.ritem { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 12px; cursor: pointer; }
.ritem:hover, .ritem.act { background: var(--paper-2); }
.ritem .badge { width: 32px; height: 32px; }
.ritem .rt { flex: 1; min-width: 0; }
.ritem .rt b { display: block; font-weight: 500; }
.ritem .rt span { display: block; font-size: 12.5px; color: var(--ink-3); }
.aitem { display: block; padding: 12px 10px; border-radius: 12px; cursor: pointer; }
.aitem:hover, .aitem.act { background: var(--paper-2); }
.aitem .ar { font-family: var(--quran); font-size: 23px; line-height: 2.15; word-spacing: 0.16em; direction: rtl; text-align: right; isolation: isolate; }
.aitem .ar mark { position: relative; background: none; color: inherit; }
.aitem .ar mark::before { content: ""; position: absolute; inset: 0.46em -0.1em 0.3em; border-radius: 0.3em; background: var(--hl); z-index: -1; }
.aitem .rf { font-size: 12px; color: var(--gold); }
.empty { color: var(--ink-3); padding: 20px 4px; font-size: 14px; }

.set { padding: 14px 0; border-bottom: 1px solid var(--line); }
.set:last-child { border-bottom: 0; }
.set > label, .set > .lbl { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--paper-2); gap: 2px; flex-wrap: wrap; }
.seg button { padding: 7px 14px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14.5px; }
.sw { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: var(--line-2); transition: background 0.18s; }
.sw::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform 0.18s var(--ease); }
.sw[aria-checked="true"] { background: var(--gold-2); }
.sw[aria-checked="true"]::after { transform: translateX(18px); }
[dir="rtl"] .sw[aria-checked="true"]::after { transform: translateX(-18px); }
.size { display: flex; align-items: center; gap: 12px; }
.size input { flex: 1; accent-color: var(--gold); }
.size .aa { font-family: var(--quran); color: var(--ink-2); }
.preview { font-family: var(--quran); text-align: center; line-height: 2.1; margin-top: 8px; color: var(--ink); word-spacing: 0.14em; font-feature-settings: "bism" 1; }
.rlist .ritem .chk { width: 20px; height: 20px; color: var(--gold); visibility: hidden; }
.rlist .ritem[aria-selected="true"] .chk { visibility: visible; }
.rlist .ritem[aria-selected="true"] .rt b { color: var(--gold); }
.tagl { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); margin-inline-start: 6px; vertical-align: 1px; }

.toast {
  position: fixed; z-index: 70; left: 50%; transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
  bottom: calc(var(--player-h) + 24px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: 13.5px;
  transition: opacity 0.2s, transform 0.2s var(--ease); box-shadow: var(--shadow); max-width: calc(100% - 30px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ about */
.about { max-width: 42rem; margin: 0 auto; padding: 20px 18px 40px; font-size: 15px; line-height: 1.85; }
.about h1 { font-weight: 500; font-size: 24px; margin: 18px 0 6px; }
.about h2 { font-weight: 500; font-size: 17px; margin: 28px 0 6px; }
.about p, .about li { color: var(--ink-2); }
.about a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold-2); text-underline-offset: 3px; }
.about ul { padding-inline-start: 20px; }
.about .dev { margin-top: 26px; padding: 4px 0 6px; scroll-margin-top: 74px; }
.about .dev h2 { margin-top: 0; }
.dev-card { display: flex; align-items: center; gap: 14px; margin: 10px 0 8px; }
.dev-n { display: block; font-size: 18px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.dev-r { display: block; font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.about .dev-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.about .dev-links a.chipb { text-decoration: none; color: var(--ink-2); }
.about .dev-links a.chipb:hover { color: var(--ink); }
.about kbd { font: 12px var(--ui); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; background: var(--card); }

/* ------------------------------------------------------------ small screens */

/* ---------- rosette (shared) */
.ros { overflow: visible; }
.ros { display: block; width: 100%; height: 100%; }
.ros .ros-g { fill: none; stroke: var(--gold-2); stroke-width: 5; opacity: 0.3; }
.ros .ros-p { fill: none; stroke: var(--gold); stroke-width: 6; opacity: 0.85; transition: opacity 1.2s, filter 1.2s; }
.ros .ros-p path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }

/* ---------- ink layers (live recital and home) */
.ink-box { position: relative; font-family: var(--quran); direction: rtl; text-align: center; line-height: 2.05; word-spacing: 0.16em; }
.ink-l.gold, .ink-l.ink { position: absolute; inset: 0; }
.ink-l.ghost { color: rgba(40, 33, 24, 0.13); -webkit-user-select: none; user-select: none; }
.ink-l.gold { color: #b8862e; -webkit-user-select: none; user-select: none; }
.ink-l.ink { color: var(--ink); }
.ink-l .end { color: var(--gold); }
.ink-l.ghost .end { color: rgba(155, 117, 53, 0.24); }
.pen {
  position: absolute; left: 0; top: 0; width: 1.4em; height: 1.4em; margin: -0.7em 0 0 -0.7em; border-radius: 50%;
  pointer-events: none; opacity: 0; transition: opacity 0.35s; will-change: transform, opacity;
  background: radial-gradient(closest-side, rgba(236, 188, 90, 0.5), rgba(236, 188, 90, 0.16) 55%, rgba(236, 188, 90, 0));
}

/* ---------- live recital */
body.reciting { overflow: hidden; }
body.reciting .top, body.reciting .player, body.reciting .fab, body.reciting .selbar { display: none !important; }
.rec { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--paper); overflow: hidden; }
.rec-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bloom { position: absolute; border-radius: 50%; will-change: transform; }
.bloom.b1 { width: 70vmax; height: 70vmax; left: -24vmax; top: -36vmax; background: radial-gradient(closest-side, rgba(240, 214, 156, 0.62), rgba(240, 214, 156, 0)); animation: drift1 26s ease-in-out infinite alternate; }
.bloom.b2 { width: 62vmax; height: 62vmax; right: -22vmax; bottom: -32vmax; background: radial-gradient(closest-side, rgba(233, 204, 184, 0.5), rgba(233, 204, 184, 0)); animation: drift2 31s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-7vmax, -5vmax) scale(1.1); } }
.rec-seal { display: block; width: 30px; height: 30px; margin: 2px auto -4px; }
.rec.done .rec-seal .ros-p { opacity: 1; filter: drop-shadow(0 0 3px rgba(226, 180, 90, 0.55)); }
.rv.sealed .ink-l.ink .end { animation: sealed 1.8s var(--ease) 1; }
@keyframes sealed { 0%, 100% { text-shadow: 0 0 0 rgba(226, 180, 90, 0); } 35% { text-shadow: 0 0 0.3em rgba(226, 180, 90, 0.6); } }
.rec-top { position: relative; z-index: 2; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 14px 0; }
.rec-title { text-align: center; min-width: 0; }
.rec-title b { display: block; font-size: 30px; line-height: 1.75; word-spacing: 0.2em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-title span { display: block; min-height: 1.3em; font-size: 12.5px; line-height: 1.3; color: var(--ink-3); }
.rec-stage { position: relative; z-index: 1; min-height: 0; padding: 2vh 6vw 3vh; }
.rv { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease); }
.rv.enter { opacity: 0; transform: translate(-50%, calc(-50% + 18px)); filter: blur(3px); }
.rv.leave { opacity: 0; transform: translate(-50%, calc(-50% - 18px)); filter: blur(3px); pointer-events: none; }
.rv.scroll { overflow-y: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(transparent, #000 7%, #000 93%, transparent); }
.rv.scroll::-webkit-scrollbar { display: none; }
.rv.bas .ink-l.ink { color: var(--ink-2); }
.rec-cta {
  position: absolute; z-index: 5; left: 50%; bottom: calc(112px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 14px; padding: 9px 24px 9px 9px; border-radius: 999px; max-width: calc(100% - 28px);
  background: var(--ink); color: var(--paper); box-shadow: 0 18px 40px -16px rgba(52, 38, 16, 0.55); animation: rise 0.4s var(--ease);
}
.rec-cta-i { flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #d7ad5c, #a97c30); animation: pulse 2.4s infinite; }
.rec-cta-i svg { width: 24px; height: 24px; }
.rec-cta-t { display: grid; min-width: 0; text-align: start; line-height: 1.4; }
.rec-cta-t b { font-weight: 500; font-size: 16px; white-space: nowrap; }
.rec-cta-t small { color: #d9cfbd; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(215, 173, 92, 0.55); } 70% { box-shadow: 0 0 0 16px rgba(215, 173, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(215, 173, 92, 0); } }
.rec-end {
  position: absolute; z-index: 5; left: 50%; bottom: calc(108px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(540px, calc(100% - 28px)); padding: 14px 18px 16px; text-align: center; border-radius: 22px;
  background: rgba(255, 253, 249, 0.94); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise 0.5s var(--ease);
}
.rec-end .star { display: block; width: 30px; height: 30px; margin: 0 auto 2px; color: var(--gold); }
.rec-end .star svg { width: 100%; height: 100%; }
.rec-end b { display: block; font-weight: 500; font-size: 17px; margin-bottom: 12px; }
.rec-end-b { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rec-ctl {
  position: relative; z-index: 3; width: min(620px, calc(100% - 20px)); margin: 0 auto calc(12px + env(safe-area-inset-bottom));
  padding: 9px 10px 8px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow);
  background: rgba(255, 253, 249, 0.9); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
}
.rec-prog { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--line); }
.rec-prog i { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 0; background: var(--gold-2); transition: width 0.25s linear; }
.rec-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.rec-rc { justify-self: start; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; height: 36px; padding: 0 10px; border-radius: 10px; font-size: 13px; color: var(--ink-2); }
.rec-rc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-rc svg { flex: none; width: 18px; height: 18px; color: var(--gold); }
.rec-rc:hover { background: var(--paper-2); }
.rec-tools { justify-self: end; display: flex; align-items: center; gap: 2px; }
.rec-tools .ib { width: 36px; height: 36px; }
.rec-tools .ib[aria-pressed="true"] { color: var(--gold); background: var(--paper-2); }

/* ---------- home */
.hero2 { position: relative; isolation: isolate; text-align: center; padding: 22px 0 14px; }
.hero-bg { position: absolute; z-index: -1; inset: -30px -16px 0; overflow: hidden; pointer-events: none; background: radial-gradient(60% 55% at 50% 36%, rgba(240, 214, 156, 0.4), rgba(240, 214, 156, 0) 72%); }
.hero-seal { display: block; width: 40px; height: 40px; margin: 0 auto 6px; }
.hero-lbl { margin: 0 0 2px; font-size: 13px; color: var(--gold); }
.hero-stage { min-height: clamp(130px, 27vh, 240px); display: grid; place-items: center; }
/* the pen glow starts at the edge of the verse and must not widen the page on a phone */
.home { overflow-x: clip; }
.hero-stage { overflow-x: clip; overflow-clip-margin: 0; }
.hero-demo { margin: 0 auto; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), filter 0.6s var(--ease); }
.hero-demo.enter { opacity: 0; transform: translateY(10px); filter: blur(2px); }
.hero-demo.leave { opacity: 0; transform: translateY(-10px); filter: blur(2px); }
.hero2 h1 { margin: 6px auto; max-width: 31rem; font-size: clamp(21px, 1.05rem + 1.1vw, 29px); font-weight: 500; line-height: 1.6; color: var(--ink); }
.hero-sub { margin: 0 auto; font-size: 13.5px; color: var(--ink-3); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0 14px; }
.btn.big { height: 50px; padding: 0 22px; font-size: 15px; }
.btn.live svg { color: #e2bd6f; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.votd { position: relative; max-width: 46rem; margin: 20px auto 6px; padding: 16px 22px 16px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.votd .lbl { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gold); }
.votd .lbl .star { display: inline-block; width: 18px; height: 18px; }
.votd .lbl .star svg { width: 100%; height: 100%; }
.votd .v { margin: 6px 0 2px; min-height: 2.2em; font-size: clamp(22px, 1.1rem + 0.8vw, 28px); line-height: 2.15; word-spacing: 0.14em; color: var(--ink); }
.votd .ref { margin: 0; font-size: 13px; color: var(--ink-3); }
.votd .acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }

/* ---------- share sheet */
.panel.wide { width: min(900px, calc(100% - 20px)); }
.share { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; padding-top: 14px; }
.sh-prev { position: relative; display: grid; place-items: center; min-height: 200px; padding: 12px; border-radius: 16px; background: var(--paper-2); }
.sh-c { display: block; width: auto; height: auto; max-width: 100%; max-height: 60vh; border-radius: 10px; box-shadow: 0 10px 30px -14px rgba(52, 38, 16, 0.45); }
.sh-rec { position: absolute; left: 12px; right: 12px; bottom: 12px; display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 253, 249, 0.95); box-shadow: var(--shadow); }
.sh-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.sh-bar i { display: block; height: 100%; width: 0; background: var(--gold-2); transition: width 0.2s linear; }
.sh-msg { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.sh-rec .btn { justify-self: start; }
.sh-side { display: grid; align-content: start; gap: 12px; }
.sh-acts { display: grid; gap: 8px; }
.sh-acts .btn { width: 100%; justify-content: flex-start; }
.sh-note { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-3); }
.sh-done { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.sh-ok { margin: 0; display: flex; align-items: center; gap: 6px; }
.sh-ok svg { width: 18px; height: 18px; color: var(--gold); }
.sh-v { width: 100%; max-height: 34vh; border-radius: 10px; background: var(--paper-2); }
.measure { position: fixed; left: 0; top: 0; z-index: -1; visibility: hidden; pointer-events: none; font-family: var(--quran); direction: rtl; text-align: center; line-height: 2.05; word-spacing: 0.16em; }
.measure .bl { display: inline-block; width: 0; height: 0; }
.measure-svg { position: fixed; left: 0; top: 0; width: 0; height: 0; overflow: hidden; visibility: hidden; }
/* ---------- rhythm poster */
.pp { max-width: 78rem; margin: 0 auto; padding: 8px 16px 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 28px; align-items: start; }
.pp-stage { position: relative; display: grid; place-items: start center; padding: 16px; border-radius: 22px; background: var(--paper-2); }
.pp-c { display: block; width: 100%; max-width: 620px; height: auto; border-radius: 10px; background: #fbf8f1; box-shadow: 0 16px 40px -22px rgba(52, 38, 16, 0.5); }
.pp-tip { position: absolute; z-index: 3; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 9px; background: var(--ink); color: var(--paper); font-size: 12.5px; white-space: nowrap; pointer-events: none; }
.pp-load { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); pointer-events: none; }
.pp-load svg { width: 30px; height: 30px; animation: rot 1s linear infinite; }
.pp-load[hidden] { display: none; }
.pp-side { display: grid; gap: 14px; align-content: start; }
.pp-side h1 { margin: 0; font-size: 20px; font-weight: 500; }
.pp-name { margin: -6px 0 0; font-size: 44px; line-height: 1.7; word-spacing: 0.18em; }
.pp-lead { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.8; }
.pp-acts { display: grid; gap: 8px; }
.pp-acts .btn { width: 100%; justify-content: flex-start; }
.pp-note { margin: 0; min-height: 1em; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 860px) { .pp { grid-template-columns: 1fr; gap: 16px; } .pp-side { order: -1; } .pp-name { font-size: 36px; } }
/* ---------- shared pills */
.grid > .card, .grid .card .names { min-width: 0; }
.grid .card .names > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chipb { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: 13.5px; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.chipb svg { width: 16px; height: 16px; color: var(--gold); }
.chipb:hover { border-color: var(--gold-2); color: var(--ink); }
.chipb[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 2px 0 6px; }

/* ---------- people, places and concepts */
.ppl, .ent { max-width: 62rem; margin: 0 auto; padding: 6px 16px 48px; }
.ppl .tabs { justify-content: center; }
.ppl-lead { margin: 6px auto 14px; max-width: 42rem; text-align: center; color: var(--ink-2); font-size: 14.5px; line-height: 1.9; }
.ppl-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-bottom: 16px; }
.ppl-q { flex: 1 1 220px; max-width: 320px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 14px; color: var(--ink); }
.ppl-q:focus { outline: 2px solid var(--gold-2); outline-offset: 1px; }
.ppl-f { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 10px; }
.pcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "dk dk" "n c"; gap: 2px 10px; align-items: end; padding: 12px 16px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); transition: border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s; }
.pcard:hover { border-color: var(--gold-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.pc-dk { grid-area: dk; font-size: 34px; line-height: 1.9; color: var(--ink); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-spacing: 0.14em; }
.ccard .pc-dk { font-family: var(--ui); font-size: 22px; line-height: 2; font-weight: 500; }
.pc-n { grid-area: n; display: grid; min-width: 0; line-height: 1.5; }
.pc-n b { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-n small { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-c { grid-area: c; text-align: end; color: var(--ink-3); font-size: 12px; line-height: 1.5; white-space: nowrap; }
.ppl-empty { grid-column: 1 / -1; text-align: center; color: var(--ink-3); }
.ppl-credit { margin: 26px auto 0; max-width: 44rem; text-align: center; font-size: 12px; line-height: 1.8; color: var(--ink-3); }
.ent-back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 13.5px; margin: 6px 0 0; }
.ent-back svg { width: 16px; height: 16px; transform: rotate(-90deg); }
[dir="rtl"] .ent-back svg { transform: rotate(90deg); }
.ent-h { text-align: center; padding: 6px 0 14px; }
.ent-h h1 { margin: 0; font-size: clamp(46px, 8vw, 72px); line-height: 1.7; font-weight: normal; word-spacing: 0.16em; }
.ent-h .ent-sub { margin: 0; font-size: 16px; color: var(--ink-2); }
.ent-h .ent-stat { margin: 4px 0 0; font-size: 13.5px; color: var(--gold); }
.ent-h .ent-note { margin: 8px auto 0; max-width: 40rem; font-size: 13px; line-height: 1.8; color: var(--ink-3); }
.ent-h .ent-note .quran { color: var(--ink-2); font-size: 18px; }
.ent-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.vl { max-width: 48rem; margin: 6px auto 0; }
.vl-s { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 500; }
.vl-s small { color: var(--ink-3); font-weight: 400; font-size: 12.5px; }
.vl-r { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(232, 225, 211, 0.6); }
.vl-ref { font-size: 12.5px; color: var(--ink-3); text-align: center; }
.vl-t { margin: 0; font-size: 25px; line-height: 2.2; word-spacing: 0.14em; color: var(--ink); }
.vl-t mark { background: none; color: var(--gold); font-weight: normal; border-radius: 6px; box-shadow: 0 0 0 3px rgba(240, 223, 176, 0.75); background-color: rgba(240, 223, 176, 0.75); }
.vl-e { color: var(--gold-2); }
.vl-a { display: flex; gap: 2px; }
.vl-a .ib { width: 36px; height: 36px; color: var(--gold); }
.vl .more { display: flex; margin: 18px auto 0; justify-content: center; }
.vl .more[hidden] { display: none; }
@media (max-width: 640px) { .vl-r { grid-template-columns: 1fr auto; grid-template-areas: "ref a" "t t"; } .vl-ref { grid-area: ref; text-align: start; } .vl-a { grid-area: a; } .vl-t { grid-area: t; font-size: 23px; } }

/* ---------- map */
body.mapview { overflow: hidden; }
body.mapview .fab, body.mapview .selbar { display: none !important; }
.mp { position: fixed; z-index: 10; inset: var(--top-h) 0 0 0; background: var(--paper); overflow: hidden; touch-action: none; }
.mp-c { display: block; touch-action: none; cursor: grab; }
.mp-c:active { cursor: grabbing; }
.mp-p { position: absolute; z-index: 3; top: 12px; inset-inline-start: 12px; width: min(360px, 42vw); max-height: calc(100% - 24px); overflow-y: auto; padding: 16px 18px 18px; border-radius: 20px; background: rgba(255, 253, 249, 0.95); border: 1px solid var(--line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.mp-p h1 { margin: 0 0 2px; font-size: 19px; font-weight: 500; }
.mp-p h1.quran { font-size: 40px; line-height: 1.7; text-align: center; word-spacing: 0.16em; font-weight: normal; }
.mp-lead, .mp-how { margin: 6px 0 10px; font-size: 13px; line-height: 1.85; color: var(--ink-2); }
.mp-how { font-size: 12px; color: var(--ink-3); }
.mp-sub { margin: 0 0 10px; text-align: center; font-size: 13px; color: var(--ink-3); }
h1:not(.quran) + .mp-sub { text-align: start; }
.mp-x { position: absolute; top: 8px; inset-inline-end: 8px; width: 34px; height: 34px; }
.mp-q { width: 100%; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 13.5px; color: var(--ink); }
.mp-q:focus { outline: 2px solid var(--gold-2); outline-offset: 1px; }
.mp-res { margin-top: 8px; }
.mp-lay { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 6px; }
.mp-lay .chipb { height: 32px; padding: 0 12px; font-size: 12.5px; }
.mp-leg { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.mp-leg li { display: flex; align-items: center; gap: 8px; }
.mp-leg .d { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.mp-leg .d.s { background: var(--card); border: 2px solid var(--gold); }
.mp-leg .d.s.med { border-color: #4a5f57; }
.mp-leg .d.n { background: #b86a4e; width: 10px; height: 10px; margin: 2px; }
.mp-leg .d.c { background: #6f8f6a; width: 10px; height: 10px; margin: 2px; }
.mp-links { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }
.mp-links a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.mp-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 4px; }
.mp-acts .btn { height: 36px; padding: 0 12px; font-size: 13px; }
.mp-h { margin: 14px 0 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; color: var(--ink); }
.mchip small { color: var(--ink-3); font-size: 11px; }
.mchip[data-k="n"] { border-color: rgba(184, 106, 78, 0.5); background: rgba(184, 106, 78, 0.07); }
.mchip[data-k="c"] { border-color: rgba(111, 143, 106, 0.55); background: rgba(111, 143, 106, 0.08); }
.mchip[data-k="s"] { border-color: rgba(184, 134, 46, 0.5); }
.mchip:hover { border-color: var(--ink); }
.mp-zoom { position: absolute; z-index: 2; bottom: calc(var(--player-h) + 16px); inset-inline-end: 14px; display: grid; gap: 6px; }
.mp-zoom .ib { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 253, 249, 0.95); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 20px; line-height: 1; color: var(--ink-2); }
@media (max-width: 760px) {
  .mp-p { top: auto; bottom: calc(var(--player-h) + 8px); inset-inline: 8px; width: auto; max-height: 42%; padding: 14px 14px 14px; border-radius: 18px; }
  .mp-p .mp-lead, .mp-p .mp-how { display: none; }
  .mp-p h1.quran { font-size: 32px; }
  .mp-zoom { bottom: auto; top: 12px; }
}
@media (max-width: 700px) {
  .share { grid-template-columns: 1fr; }
  .sh-c { max-height: 40vh; }
}

@media (max-width: 640px) {
  :root { --top-h: 54px; --qsize: clamp(1.45rem, 1.1rem + 1.6vw, 1.75rem); }
  .brand small { display: none; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hero { padding-top: 22px; }
  .reader { padding: 4px 14px 20px; }
  .p-time, .p-tools .opt { display: none; }
  .panel { top: auto; bottom: 0; width: 100%; max-height: 88vh; border-radius: 20px 20px 0 0; animation: up 0.24s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  @keyframes up { from { transform: translate(-50%, 30px); opacity: 0; } }
  .selbar .lbl { display: none; }
  .selbar { gap: 0; padding: 5px; }
  .selbar button { padding: 0 9px; }
  .selbar .ref { padding: 0 6px 0 4px; font-size: 12.5px; }
  .snav { grid-template-columns: 1fr; }
  .rec-title b { font-size: 24px; }
  .rec-stage { padding: 1vh 4vw 2vh; }
  .rec-rc span { max-width: 24vw; }
  .rec-tools .p-speed { min-width: 34px; }
  .btn.big { height: 46px; padding: 0 18px; font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .top, .player, .fab, .selbar, .sacts, .snav { display: none !important; }
  body { padding: 0; background: #fff; }
}

/* ------------------------------------------------------------ accounts and library */
.acct-btn .avatar { width: 28px; height: 28px; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gold-soft); color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1; font-family: var(--ui); }
.avatar.big { width: 56px; height: 56px; font-size: 22px; flex: none; }
.acct { max-width: 34rem; margin: 0 auto; padding: 18px 16px 56px; }
.acct h1 { margin: 6px 0 6px; font-size: 26px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.acct-lead { margin: 0 0 16px; color: var(--ink-2); font-size: 14.5px; line-height: 1.9; }
.acct-tabs { justify-content: flex-start; margin: 0 0 16px; }
.fm { display: grid; gap: 14px; }
.fl label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--ink-3); }
.fl-in { position: relative; }
.fl-in input, .fl-in textarea {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card); font: 16px var(--ui); color: var(--ink); -webkit-appearance: none; appearance: none;
}
.fl-in textarea { height: auto; padding: 12px 14px; line-height: 1.7; resize: vertical; }
.fl-in input:focus, .fl-in textarea:focus { outline: 2px solid var(--gold-2); outline-offset: 1px; border-color: var(--gold-2); }
.fl-in input::placeholder, .fl-in textarea::placeholder { color: var(--ink-3); }
.fl-in.pw input { padding-inline-end: 76px; }
.pw-t { position: absolute; inset-inline-end: 6px; top: 6px; height: 36px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; color: var(--ink-2); }
.pw-t:hover { background: var(--paper-2); }
.fl-h { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
.fm-msg { margin: 0; font-size: 13.5px; line-height: 1.7; }
.fm-msg:empty { display: none; }
.fm-msg.bad { color: #a4452c; }
.fm-msg.ok { color: #6d5320; background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; }
.lnk { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; font: inherit; padding: 0; }
.acct-alt { margin: 14px 0 0; font-size: 13.5px; }
.acct-priv { margin: 22px 0 0; font-size: 12.5px; line-height: 1.9; color: var(--ink-3); }
.acct-card { margin: 14px 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.acct-card h2 { margin: 0 0 10px; font-size: 15px; font-weight: 500; }
.acct-card.danger { border-color: rgba(164, 69, 44, 0.35); }
.acct-card.danger p { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.8; }
.acct-det summary { cursor: pointer; font-size: 15px; font-weight: 500; }
.acct-det form { margin-top: 14px; }
.prof-h { display: flex; align-items: center; gap: 14px; margin: 8px 0 12px; min-width: 0; }
.prof-h > div { min-width: 0; }
.prof-h h1 { margin: 0; font-size: 22px; }
.prof-e, .prof-s { margin: 0; font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.prof-sync { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.prof-sync svg { width: 20px; height: 20px; color: var(--gold); flex: none; }
.prof-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.prof-acts.main { margin: 18px 0 4px; }
.prof-n { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }
.lib-st { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.lib-st svg { width: 20px; height: 20px; color: var(--gold); flex: none; }
.lib-st > span:first-of-type { flex: 1; min-width: 11rem; }
.lib-st.warn { background: #fbf3e2; border-color: #ead9ae; }
.lib-st-a { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.lib { max-width: 48rem; margin: 0 auto; padding: 10px 16px 56px; }
.lib-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 0 14px; }
.lib-top h1 { margin: 0; font-size: 26px; font-weight: 500; }
.lib-n2 { color: var(--ink-3); font-size: 13.5px; }
.lib-tools { display: grid; gap: 10px; margin: 6px 0 14px; }
.lib-q { width: 100%; height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font: 16px var(--ui); color: var(--ink); -webkit-appearance: none; appearance: none; }
.lib-q:focus { outline: 2px solid var(--gold-2); outline-offset: 1px; }
.lib-sort { justify-self: start; }
.lib-cols { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-cols .cn { margin-inline-start: 8px; padding: 0 7px; min-width: 22px; border-radius: 999px; background: rgba(155, 117, 53, 0.13); font-size: 12px; line-height: 20px; text-align: center; }
.lib-cols .chipb[aria-pressed="true"] .cn { background: rgba(255, 255, 255, 0.22); }
.lib-c { margin-bottom: 10px; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.lib-h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lib-ref b { display: block; font-weight: 500; font-size: 15px; }
.lib-ref small { color: var(--ink-3); font-size: 12px; }
.lib-a { display: flex; gap: 2px; flex: none; }
.lib-a .ib { width: 36px; height: 36px; color: var(--gold); }
.lib-v { margin: 8px 0 4px; font-size: 25px; line-height: 2.2; word-spacing: 0.14em; color: var(--ink); }
.lib-n { margin: 6px 0 4px; padding: 8px 12px; border-radius: 10px; background: var(--paper-2); font-size: 14px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.lib-col { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; color: var(--ink-2); }
.lib-empty { padding: 34px 10px; text-align: center; color: var(--ink-3); line-height: 1.9; }
.lib .more { display: flex; margin: 16px auto 0; }
.lib .more[hidden] { display: none; }
#tabbody .lib { padding: 0; }
.nt { padding-top: 12px; }
.nt-ref { margin: 0 0 6px; font-size: 13px; color: var(--ink-3); }
.nt-v { margin: 0 0 12px; font-size: 24px; line-height: 2.1; word-spacing: 0.14em; max-height: 9.5em; overflow-y: auto; }
.nt .fl { margin-bottom: 12px; }
.nt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 14px; }
.nt-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pn-t { margin: 8px 0 14px; font-size: 14px; line-height: 1.9; color: var(--ink-2); }
.chk { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 14px; }
.chk input { width: 20px; height: 20px; accent-color: var(--gold); }
.btn.danger-b { background: #a4452c; border-color: #a4452c; color: #fff; }
.btn.danger-b:hover { background: #8b3a24; }
.toast.has-act { pointer-events: auto; display: flex; align-items: center; gap: 16px; }
.toast-act { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; font-size: 13.5px; white-space: nowrap; }
@media (max-width: 640px) { .lib-v { font-size: 23px; } .acct h1 { font-size: 23px; } }
