:root {
  --bg: #faf6ee; --paper: #fffdf8; --ink: #1d2a2a; --mute: #56635f; --line: #e6dfd0;
  --green: #0f3d3e; --green-2: #17595a; --gold: #a8782a; --gold-ink: #86601f; --gold-soft: #f1e6cf; --on-green: #f6f1e4;
  --ok: #2f6b4f; --warn: #9a6a12; --bad: #9a3b2e;
  --ar-scale: 1; --r: 14px; --shadow: 0 1px 2px rgba(20, 40, 40, .06), 0 8px 24px rgba(20, 40, 40, .06);
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Lora, Georgia, "Times New Roman", serif;
  --arabic: Amiri, "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --quran: "Amiri Quran", Amiri, "Scheherazade New", serif;
}
:root[data-theme="dark"] {
  --bg: #0c1717; --paper: #122222; --ink: #ece6d8; --mute: #9aa9a5; --line: #223636;
  --green: #0a2c2d; --green-2: #7fc3b4; --gold: #d9b36a; --gold-ink: #d9b36a; --gold-soft: #2a2a1c; --on-green: #ece6d8;
  --ok: #7fc3a0; --warn: #d9b36a; --bad: #e08a7c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--ui); min-height: 100vh; display: flex; flex-direction: column; }
html[lang="ar"] body { font-family: var(--arabic); font-size: 18px; }
main { flex: 1; }
a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
html[lang="ar"] h1, html[lang="ar"] h2 { font-family: var(--arabic); letter-spacing: 0; line-height: 1.5; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); }
h2 { font-size: 1.3rem; margin: 2.4rem 0 1rem; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.small { font-size: .85rem; color: var(--mute); }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { inset-inline-start: 8px; }
.ic { width: 22px; height: 22px; flex: none; }

/* header */
.top { position: sticky; top: 0; z-index: 40; background: var(--green); color: var(--on-green); }
.top-in { display: flex; align-items: center; gap: 12px; height: 60px; min-width: 0; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--on-green); font-family: var(--serif); font-weight: 600; font-size: 1.12rem; white-space: nowrap; }
html[lang="ar"] .logo { font-family: var(--arabic); font-size: 1.3rem; }
.logo:hover { text-decoration: none; }
.logo-star { color: #d9b36a; }
.nav { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.nav > a { color: var(--on-green); padding: 8px 10px; border-radius: 8px; font-size: .93rem; opacity: .9; white-space: nowrap; }
.nav > a:hover { background: rgba(255, 255, 255, .1); text-decoration: none; opacity: 1; }
.langs { display: flex; gap: 2px; margin-inline-start: 8px; padding-inline-start: 10px; border-inline-start: 1px solid rgba(255, 255, 255, .2); }
.langs a { color: var(--on-green); opacity: .7; font-size: .82rem; padding: 6px 7px; border-radius: 6px; font-family: var(--ui); }
.langs a[lang="ar"] { font-family: var(--arabic); font-size: .95rem; }
.langs a[aria-current] { opacity: 1; background: rgba(255, 255, 255, .14); }
.top-btns { display: flex; gap: 2px; }
.ib { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: inherit; border-radius: 50%; }
.ib:hover { background: rgba(127, 127, 127, .18); }
.menu-btn { display: none; }
@media (max-width: 1120px) {
  .menu-btn { display: inline-grid; }
  .top-btns { margin-inline-start: auto; }
  .nav { display: none; position: absolute; top: 60px; inset-inline: 0; background: var(--green); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; margin: 0; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav > a { padding: 13px 8px; font-size: 1rem; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .langs { margin: 12px 0 0; padding: 0; border: 0; }
  .langs a { padding: 10px 14px; font-size: .95rem; }
}

/* hero */
.hero { background: var(--green); color: var(--on-green); padding: 28px 0 44px; text-align: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 32 32'%3E%3Cpath d='M16 2.5 19.900 6.600h5.500v5.500l4.100 3.900-4.100 3.900v5.500h-5.500L16 29.500l-3.900-4.100H6.600v-5.500L2.500 16l4.100-3.900V6.600h5.500L16 2.500Z' fill='none' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E"); }
.hero .wrap { position: relative; z-index: 1; max-width: 760px; }
.bas-hero { font-family: var(--quran); font-size: 1.7rem; margin: 0 0 14px; color: #e3c88d; line-height: 2; }
.hero h1 { color: #fff; }
.hero .lead { color: var(--on-green); opacity: .85; }
.lead { font-size: 1.06rem; color: var(--mute); margin: .7rem 0 0; }
.search { display: flex; align-items: center; gap: 8px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 16px; margin: 22px 0 0; box-shadow: var(--shadow); }
[dir="rtl"] .search { padding: 6px 16px 6px 6px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: inherit; padding: 10px 4px; outline: none; }
.search .ic { color: var(--mute); }
.now { margin-top: 18px; font-size: .92rem; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.now a { color: var(--on-green); border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: 5px 12px; }
.now a:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 10px 18px; min-height: 44px; font-weight: 500; }
.btn.primary { background: var(--green-2); border-color: var(--green-2); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0c1717; }
.btn:hover { filter: brightness(1.06); }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.grid.one { grid-template-columns: 1fr; margin-top: 20px; }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.card:hover { text-decoration: none; border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-1px); }
.card-t { font-weight: 600; display: flex; align-items: center; gap: 4px; }
.card-ar { font-family: var(--arabic); font-size: 1.15rem; color: var(--gold-ink); line-height: 1.7; }
.card-m { font-size: .82rem; color: var(--mute); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.aud { display: inline-flex; align-items: center; gap: 2px; color: var(--ok); }
.aud .ic { width: 12px; height: 12px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cat { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; row-gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.cat:hover { text-decoration: none; border-color: var(--gold); box-shadow: var(--shadow); }
.cat-i { grid-row: span 3; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; }
.cat-n { font-weight: 600; }
.cat-d { font-size: .86rem; color: var(--mute); line-height: 1.45; }
.cat-c { font-size: .78rem; color: var(--gold-ink); }

/* daily */
.daily-c { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 20px; color: var(--ink); box-shadow: var(--shadow); border-top: 3px solid var(--gold); }
.daily-c:hover { text-decoration: none; border-color: var(--gold); }
.daily-c .ar { text-align: center; }
.daily-c .me { text-align: center; color: var(--mute); margin: 8px 0 14px; }
.daily-c .card-t { justify-content: center; color: var(--green-2); }

/* item page */
.crumbs { font-size: .84rem; color: var(--mute); padding: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--mute); }
.dh { padding: 18px 0 8px; }
.kicker { margin: 0 0 6px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; }
html[lang="ar"] .kicker { letter-spacing: 0; font-size: .95rem; }
.h-ar { font-family: var(--arabic); font-size: 1.6rem; color: var(--gold); margin: 6px 0 0; line-height: 1.8; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 6px; position: sticky; top: 60px; z-index: 20; background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--line); }
.tg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); overflow: hidden; }
.tb { border: 0; background: none; min-width: 44px; min-height: 44px; padding: 0 12px; font-size: .88rem; font-weight: 500; display: inline-grid; place-items: center; border-inline-end: 1px solid var(--line); }
.tb:last-child { border: 0; }
.tb:hover { background: var(--gold-soft); }
.tog[aria-pressed="true"] { color: var(--green-2); font-weight: 600; }
.tog[aria-pressed="false"] { color: var(--mute); text-decoration: line-through; }
#favBtn[aria-pressed="true"] { color: #c0392b; }
#favBtn[aria-pressed="true"] .ic { fill: currentColor; }
.note { font-size: .88rem; color: var(--mute); background: var(--gold-soft); border-radius: 10px; padding: 8px 12px; }
.parts { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.part { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 18px 16px; scroll-margin-top: 140px; transition: border-color .2s, box-shadow .2s; }
.part.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft), var(--shadow); }
.part.bas { text-align: center; padding: 10px 18px; background: none; border-style: dashed; }
.part.bas .ar { text-align: center; margin: 0; }
.part-h { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--mute); }
.no { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); font-weight: 600; font-size: .85rem; display: inline-grid; place-items: center; margin-inline-end: auto; }
.part-h .pb:first-child { margin-inline-start: auto; }
.no + .pb { margin-inline-start: 0 !important; }
.pb { border: 1px solid var(--line); background: none; border-radius: 999px; min-width: 40px; height: 40px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; color: var(--mute); font-size: .85rem; }
.pb:hover { border-color: var(--gold); color: var(--ink); }
.pb .ic { width: 18px; height: 18px; }
.pb.play { color: var(--green-2); border-color: var(--green-2); }
.cnt b { font-variant-numeric: tabular-nums; color: var(--ink); }
.cnt i { font-style: normal; }
.cnt.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.cnt.done b { color: #fff; }
.ar { font-family: var(--arabic); font-size: calc(1.75rem * var(--ar-scale)); line-height: 2.15; word-spacing: .08em; margin: 6px 0 10px; text-align: start; color: var(--ink); }
.ar.q { font-family: var(--quran); line-height: 2.5; }
.ok, .me { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.ok { font-style: italic; color: var(--ink); }
.me { color: var(--ink); }
.lbl { display: block; font-style: normal; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; margin-bottom: 2px; }
.hide-ok .ok, .hide-me .part .me { display: none; }
.box { background: var(--paper); border: 1px solid var(--line); border-inline-start: 3px solid var(--gold); border-radius: var(--r); padding: 14px 18px; margin-top: 18px; }
.box h2 { font-size: 1rem; margin: 0 0 4px; }
.box p { margin: 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 999px; padding: 2px 10px; margin-inline-start: 6px; border: 1px solid currentColor; }
.g-sahih { color: var(--ok); } .g-hasen { color: var(--warn); } .g-zayif { color: var(--bad); }
.rel { margin-bottom: 20px; }
.prose p { font-size: 1.05rem; }

/* player */
.player { position: fixed; inset-inline: 0; bottom: 0; z-index: 50; background: var(--green); color: var(--on-green); box-shadow: 0 -6px 24px rgba(0, 0, 0, .2); padding-bottom: env(safe-area-inset-bottom); }
.player[hidden] { display: none; }
.bar { height: 3px; background: rgba(255, 255, 255, .15); }
.bar i { display: block; height: 100%; width: 0; background: #d9b36a; }
.pl-in { display: flex; align-items: center; gap: 2px; height: 60px; }
.pl-t { flex: 1; min-width: 0; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib.big { background: #d9b36a; color: #0f3d3e; }
.ib.big:hover { background: #e6c583; }
.ib.txt { font-size: .82rem; font-weight: 600; font-family: var(--ui); }
#plRep[aria-pressed="true"] { color: #d9b36a; }
body.playing { padding-bottom: 70px; }

/* zikirmatik */
.zk { text-align: center; }
.zk-presets { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 10px; scrollbar-width: thin; }
.zk-p { flex: none; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 8px 14px; display: flex; flex-direction: column; align-items: center; font-family: var(--arabic); font-size: 1.1rem; }
.zk-p small { font-family: var(--ui); font-size: .72rem; color: var(--mute); }
.zk-p[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); }
.zk-ar { text-align: center; font-size: 2.2rem; margin: 18px 0 8px; }
.zk-btn { width: min(72vw, 280px); aspect-ratio: 1; border-radius: 50%; border: 6px solid var(--gold); background: var(--green); color: #fff; display: grid; place-content: center; margin: 12px auto; box-shadow: var(--shadow); transition: transform .08s; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
.zk-btn:active { transform: scale(.96); }
.zk-btn > span { font-size: 4.2rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; font-family: var(--ui); }
.zk-btn small { opacity: .75; font-size: 1rem; font-family: var(--ui); }
.zk-btn.done { border-color: var(--ok); }
.zk-row { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 16px 0 40px; }

/* esma */
.esma { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin: 14px 0 40px; }
.es { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; text-align: center; position: relative; display: flex; flex-direction: column; gap: 2px; }
.es-n { position: absolute; top: 8px; inset-inline-start: 10px; font-size: .72rem; color: var(--gold-ink); font-weight: 600; }
.es-ar { font-family: var(--arabic); font-size: 1.9rem; line-height: 1.9; color: var(--green-2); }
.es-t { font-weight: 600; }
.es-m { font-size: .84rem; color: var(--mute); line-height: 1.4; }

/* footer */
.foot { margin-top: 48px; background: var(--paper); border-top: 1px solid var(--line); text-align: center; padding: 26px 0 30px; color: var(--mute); font-size: .92rem; }
.foot p { margin: 6px 0; }
.orn { height: 14px; margin: 0 auto 12px; width: 120px; background: linear-gradient(var(--gold), var(--gold)) center/100% 1px no-repeat; position: relative; }
.orn::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; background: var(--gold); transform: translate(-50%, -50%) rotate(45deg); outline: 4px solid var(--paper); }
.toast { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-size: .9rem; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
@media (max-width: 560px) {
  .part { padding: 10px 14px 14px; }
  .ar { font-size: calc(1.6rem * var(--ar-scale)); }
  .tools { gap: 8px; position: static; }
  .tools .btn.primary { flex: 1 1 100%; justify-content: center; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid.one { grid-template-columns: 1fr; }
  .cats { grid-template-columns: 1fr; }
  .pl-t { display: none; }
  .pl-in { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .top, .tools, .player, .foot, .part-h, .rel { display: none !important; } }
.now[hidden] { display: none; }
html:not([lang="ar"]) .h-ar { text-align: left; }

/* audit fixes */
:root[data-theme="dark"] .cnt.done, :root[data-theme="dark"] .cnt.done b { color: #0c1717; }
.search:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.parts-h { font-size: 1.05rem; margin: 1.4rem 0 0; color: var(--mute); font-family: var(--ui); font-weight: 600; letter-spacing: 0; }
.no { margin-inline-end: 0; }
.part-h .pb:first-child, .no + .pb { margin-inline-start: 0 !important; }
.sp { flex: 1; }
.qref { font-size: .78rem; color: var(--gold-ink); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.parts.multi .part { content-visibility: auto; contain-intrinsic-size: auto 260px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--ink); font-size: .93rem; }
.chips a:hover { border-color: var(--gold); text-decoration: none; background: var(--gold-soft); }

/* review fixes 2 */
#nowList { display: contents; }
.now a { display: inline-block; max-width: 100%; }
.noaud { font-size: .74rem; color: var(--mute); border: 1px dashed var(--line); border-radius: 999px; padding: 2px 9px; }
