@font-face {
  font-family: "Amiri Quran";
  src: url("../fonts/amiri-quran-arabic-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+0020;
}

:root {
  --bg: #f6f2e7;
  --bg2: #efe9d8;
  --card: #fffdf7;
  --ink: #1d2a25;
  --ink2: #55645d;
  --line: #e2dac4;
  --brand: #0b5d45;
  --brand2: #0f7a5a;
  --brand-ink: #ffffff;
  --gold: #b8892b;
  --gold-soft: #f3e4b8;
  --danger: #b3261e;
  --shadow: 0 1px 2px rgba(20, 40, 30, .06), 0 8px 24px -12px rgba(20, 40, 30, .18);
  --star-hole: #0b5d45;
  --radius: 16px;
  --arab-size: 34px;

  --g-izhar: #0b8a7d;
  --g-idgham: #198a3c;
  --g-iqlab: #2563eb;
  --g-ikhfa: #d4560a;
  --g-ghunnah: #c026d3;
  --g-mad: #e11d48;
  --g-mad2: #a31238;
  --g-qalqalah: #0284c7;
  --g-alif-lam: #64748b;
  --g-tafkhim: #7c3aed;
  --g-waqf: #a16207;
  --g-khusus: #db2777;
}

:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1713; --bg2: #0e201a; --card: #12261f; --ink: #e8f0ec; --ink2: #9db3a9; --line: #1f3a31;
    --brand: #2fb98c; --brand2: #46d1a2; --brand-ink: #04231a; --gold: #e0b55a; --gold-soft: #3a3016;
    --danger: #ff8a80; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -12px rgba(0,0,0,.6);
    --star-hole: #0a1713;
    --g-izhar: #2dd4bf; --g-idgham: #4ade80; --g-iqlab: #60a5fa; --g-ikhfa: #fb923c; --g-ghunnah: #e879f9;
    --g-mad: #fb7185; --g-mad2: #f43f5e; --g-qalqalah: #38bdf8; --g-alif-lam: #94a3b8; --g-tafkhim: #a78bfa;
    --g-waqf: #facc15; --g-khusus: #f472b6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1713; --bg2: #0e201a; --card: #12261f; --ink: #e8f0ec; --ink2: #9db3a9; --line: #1f3a31;
  --brand: #2fb98c; --brand2: #46d1a2; --brand-ink: #04231a; --gold: #e0b55a; --gold-soft: #3a3016;
  --danger: #ff8a80; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -12px rgba(0,0,0,.6);
  --star-hole: #0a1713;
  --g-izhar: #2dd4bf; --g-idgham: #4ade80; --g-iqlab: #60a5fa; --g-ikhfa: #fb923c; --g-ghunnah: #e879f9;
  --g-mad: #fb7185; --g-mad2: #f43f5e; --g-qalqalah: #38bdf8; --g-alif-lam: #94a3b8; --g-tafkhim: #a78bfa;
  --g-waqf: #facc15; --g-khusus: #f472b6;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  background-image:
    radial-gradient(1200px 400px at 50% -200px, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%);
  background-repeat: no-repeat;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--card); padding: .5rem 1rem; border-radius: 8px; }
a { color: var(--brand); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 70%, transparent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.ar { font-family: "Amiri Quran", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif; direction: rtl; }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--brand); color: var(--brand-ink);
  padding-top: env(safe-area-inset-top);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M28 4l5 8 9-2-2 9 8 5-8 5 2 9-9-2-5 8-5-8-9 2 2-9-8-5 8-5-2-9 9 2z' fill='none' stroke='%23ffffff' stroke-opacity='.10' stroke-width='1.2'/%3E%3C/svg%3E");
  box-shadow: 0 2px 14px rgba(0,0,0,.22);
}
.top-in { max-width: 860px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: inherit; text-align: left; }
.brand svg { color: var(--gold-soft); --star-hole: var(--brand); flex: none; }
.brand-t { display: flex; flex-direction: column; line-height: 1.15; }
.brand-t b { font-size: 1.08rem; letter-spacing: .2px; }
.brand-t small { opacity: .8; font-size: .72rem; }
.top-act { display: flex; gap: 6px; }
.icon-btn { background: color-mix(in srgb, #fff 16%, transparent); border: 0; width: 38px; height: 38px; border-radius: 12px; font-size: 1.1rem; color: inherit; }
.icon-btn:hover { background: color-mix(in srgb, #fff 26%, transparent); }
.dlg .icon-btn { background: var(--bg2); color: var(--ink); }

main { max-width: 860px; margin: 0 auto; padding: 14px 14px 24px; outline: none; }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Kartu & form ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 14px; margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 10px; }
.row.end { align-items: stretch; }
.grow { flex: 1 1 140px; } .w90 { width: 92px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; color: var(--ink2); }
.fld > span { font-weight: 600; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; min-height: 44px;
}
textarea { font-family: "Amiri Quran", serif; font-size: 1.5rem; line-height: 2; resize: vertical; }
input[type=range] { padding: 0; min-height: 30px; accent-color: var(--brand); }
.btn { border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 10px 14px; min-height: 44px; font-weight: 650; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn.primary:hover { background: var(--brand2); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 6px 10px; font-size: .86rem; border-radius: 10px; }
.btn:active { transform: translateY(1px); }
.hint { color: var(--ink2); font-size: .84rem; margin: 10px 0 0; } .hint.small { font-size: .78rem; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg2); padding: 4px; border-radius: 14px; gap: 4px; margin-bottom: 8px; }
.seg-b { border: 0; background: transparent; padding: 9px 4px; border-radius: 10px; font-weight: 650; color: var(--ink2); }
.seg-b.on { background: var(--card); color: var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.chk { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.chk input { width: 22px; height: 22px; min-height: 0; accent-color: var(--brand); }
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.kv { display: flex; justify-content: space-between; padding: 4px 0; }

/* ---------- Hasil analisis ---------- */
.verse-card { padding: 16px 14px 14px; margin-bottom: 14px; position: relative; overflow: hidden; }
.verse-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--gold), var(--brand)); }
.vc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--gold-soft); color: color-mix(in srgb, var(--gold) 70%, var(--ink)); }
.vc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.arab { scroll-margin-top: 80px; font-family: "Amiri Quran", "Scheherazade New", "Noto Naskh Arabic", serif; direction: rtl; text-align: right;
  font-size: var(--arab-size); line-height: 2.25; margin: 6px 0 4px; word-spacing: .06em; font-feature-settings: "calt","liga","mark","mkmk"; text-rendering: optimizeLegibility; }
.arab .vn { font-size: .62em; color: var(--gold); margin-inline: .25em; }
.trans { color: var(--ink2); font-size: .95rem; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 6px; }

.tj { border-radius: .22em; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background .15s, outline-color .15s; cursor: pointer;
  color: var(--c); }
.tj.dim { color: inherit; background: none; }
.tj.focus { background: linear-gradient(transparent 30%, color-mix(in srgb, var(--c) 30%, transparent) 30% 80%, transparent 80%); }
.no-color .tj { color: inherit; background: none; }
.no-color .tj.focus { background: linear-gradient(transparent 30%, color-mix(in srgb, var(--gold) 40%, transparent) 30% 80%, transparent 80%); }
.g-izhar { --c: var(--g-izhar); } .g-idgham { --c: var(--g-idgham); } .g-iqlab { --c: var(--g-iqlab); } .g-ikhfa { --c: var(--g-ikhfa); }
.g-ghunnah { --c: var(--g-ghunnah); } .g-mad { --c: var(--g-mad); } .g-mad2 { --c: var(--g-mad2); } .g-qalqalah { --c: var(--g-qalqalah); }
.g-alif-lam { --c: var(--g-alif-lam); } .g-tafkhim { --c: var(--g-tafkhim); } .g-waqf { --c: var(--g-waqf); } .g-khusus { --c: var(--g-khusus); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.chip { --c: var(--ink2); display: inline-flex; align-items: center; gap: 6px; border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line)); background: color-mix(in srgb, var(--c) 9%, var(--card));
  color: var(--ink); border-radius: 99px; padding: 5px 11px; font-size: .8rem; font-weight: 650; min-height: 32px; }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }
.chip b { background: var(--c); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .72rem; }
.chip.off { opacity: .45; }
.chip.on { background: color-mix(in srgb, var(--c) 26%, var(--card)); }

.rules { list-style: none; counter-reset: r; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.rule { --c: var(--ink2); counter-increment: r; border: 1px solid var(--line); border-inline-start: 5px solid var(--c); background: var(--card); border-radius: 14px; padding: 12px 12px 10px 12px; position: relative; transition: box-shadow .2s, transform .2s; }
.rule.focus { box-shadow: 0 0 0 2px var(--c), var(--shadow); }
.rule-h { display: flex; gap: 10px; align-items: flex-start; }
.rule-n::before { content: counter(r); display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: .8rem; }
.rule-t { flex: 1; min-width: 0; }
.rule-name { font-weight: 800; font-size: 1.02rem; line-height: 1.3; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.rule-snip { font-family: "Amiri Quran", serif; direction: rtl; font-size: 1.7rem; line-height: 2.1; display: inline-block; background: color-mix(in srgb, var(--c) 10%, transparent); border-radius: 10px; padding: 0 12px; color: var(--ink); }
.rule dl { margin: 6px 0 0; display: grid; gap: 4px; }
.rule dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); font-weight: 800; margin-top: 4px; }
.rule dd { margin: 0; font-size: .95rem; }
.rule-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.pill { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.link-btn { background: none; border: 0; color: var(--brand); font-weight: 700; font-size: .84rem; padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px; }

.empty { text-align: center; color: var(--ink2); padding: 30px 10px; }
.empty .big { font-size: 2.4rem; }
.notice { background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); color: var(--ink); padding: 10px 12px; border-radius: 12px; font-size: .9rem; margin-bottom: 12px; }
.sum-line { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink2); font-size: .84rem; margin: 6px 0 0; }

/* ---------- Pencarian ---------- */
.res-list { display: grid; gap: 8px; margin-top: 10px; }
.res { text-align: start; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; width: 100%; }
.res:hover { border-color: var(--brand); }
.res .ar { font-size: 1.35rem; line-height: 1.9; text-align: right; }
.res small { color: var(--ink2); }
.res .meta { font-weight: 700; color: var(--brand); font-size: .82rem; }

/* ---------- Mushaf ---------- */
.surah-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.surah-item { width: 100%; display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; text-align: start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.surah-item:hover { border-color: var(--brand); }
.sn { width: 38px; height: 38px; display: grid; place-items: center; font-weight: 800; color: var(--brand); position: relative; font-size: .9rem; }
.sn::before { content: ""; position: absolute; inset: 0; background: var(--bg2); transform: rotate(45deg); border-radius: 8px; border: 1px solid var(--line); }
.sn span { position: relative; }
.si-name b { display: block; }
.si-name small { color: var(--ink2); }
.si-ar { font-family: "Amiri Quran", serif; font-size: 1.5rem; color: var(--brand); }
.reader-bar { position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 10; display: flex; gap: 8px; align-items: center; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 8px 0; }
.reader-bar .title { flex: 1; min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bismillah { text-align: center; font-family: "Amiri Quran", serif; direction: rtl; font-size: calc(var(--arab-size) + 4px); color: var(--brand); padding: 14px 0 6px; }
.ayah { padding: 12px 12px 10px; margin: 0 0 10px; }
.ayah-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.ayah-h .badge { font-size: .74rem; }
.ayah-act { display: flex; gap: 6px; }
.chips.legend { margin: 0 0 12px; }
.load-more { display: block; margin: 12px auto; }

/* ---------- Belajar ---------- */
.learn-g { margin-bottom: 18px; }
.learn-g h2 { font-size: 1rem; margin: 0 0 8px; color: var(--ink2); letter-spacing: .03em; }
.topic { margin-bottom: 8px; overflow: hidden; }
.topic > button { width: 100%; text-align: start; background: none; border: 0; padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.topic .tt { font-weight: 750; }
.topic .ta { font-family: "Amiri Quran", serif; direction: rtl; color: var(--brand); font-size: 1.25rem; }
.topic .body { padding: 0 14px 14px; display: none; }
.topic.open .body { display: block; }
.topic.open > button { border-bottom: 1px dashed var(--line); }
.topic .huruf { font-family: "Amiri Quran", serif; direction: rtl; font-size: 1.5rem; text-align: center; background: var(--bg2); border-radius: 12px; padding: 8px; margin: 10px 0; line-height: 1.9; }
.topic ul { padding-inline-start: 20px; margin: 8px 0; }
.topic .lbl { font-size: .74rem; font-weight: 800; text-transform: uppercase; color: var(--ink2); letter-spacing: .06em; margin-top: 10px; }
.examples { display: grid; gap: 8px; margin-top: 8px; }
.ex { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; text-align: start; width: 100%; }
.ex .arab { font-size: 1.5rem; line-height: 2; margin: 0; }
.ex small { color: var(--ink2); }

/* ---------- Kuis ---------- */
.quiz-card { padding: 16px; }
.q-top { display: flex; justify-content: space-between; color: var(--ink2); font-size: .86rem; margin-bottom: 8px; }
.q-q { font-weight: 750; margin: 8px 0; }
.opts { display: grid; gap: 8px; margin-top: 12px; }
.opt { text-align: start; background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 12px; font-weight: 650; }
.opt:hover { border-color: var(--brand); }
.opt.ok { border-color: #16a34a; background: color-mix(in srgb, #16a34a 16%, var(--card)); }
.opt.bad { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, var(--card)); }
.q-explain { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg2); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { text-align: center; padding: 10px 6px; }
.stat b { display: block; font-size: 1.4rem; color: var(--brand); }
.stat small { color: var(--ink2); }
.mark { background: linear-gradient(transparent 25%, color-mix(in srgb, var(--gold) 55%, transparent) 25% 85%, transparent 85%); border-bottom: 2px solid var(--gold); }

/* ---------- Simpan ---------- */
.saved-item { padding: 12px; margin-bottom: 10px; }

/* ---------- Tab bar ---------- */
.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); max-width: 860px; margin: 0 auto; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 24px -14px rgba(0,0,0,.35); }
.tab { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 12px; color: var(--ink2); font-size: .7rem; font-weight: 650; min-height: 52px; }
.tab i { font-style: normal; font-size: 1.3rem; filter: grayscale(.7); }
.tab.on { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.tab.on i { filter: none; }

/* ---------- Dialog / toast ---------- */
.dlg { border: 1px solid var(--line); border-radius: 20px; padding: 0; background: var(--card); color: var(--ink); width: min(520px, calc(100vw - 24px)); max-height: 88vh; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.dlg::backdrop { background: rgba(0, 20, 12, .55); backdrop-filter: blur(3px); }
.dlg-in { padding: 16px; display: grid; gap: 6px; }
.dlg-h { display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; }
.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); background: #111c17; color: #fff; padding: 10px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 24px); font-size: .92rem; }
.toast button { background: var(--brand2); color: var(--brand-ink); border: 0; border-radius: 10px; padding: 6px 12px; font-weight: 700; }

@media (min-width: 720px) {
  main { padding: 20px 20px 30px; }
  .tabbar { bottom: 10px; border-radius: 20px; border: 1px solid var(--line); left: 50%; transform: translateX(-50%); width: 560px; }
}
@media print {
  .top, .tabbar, .vc-actions, .btn, .reader-bar, #inputCard, .chips, .link-btn { display: none !important; }
  body { background: #fff; color: #000; padding: 0; } .card { box-shadow: none; break-inside: avoid; }
  .rule { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Pemandu Baca (video animasi) ---------- */
.btn.accent { background: var(--gold); color: #1d1500; border-color: transparent; }
.player { width: min(760px, 100vw); height: min(100dvh, 900px); max-height: 100dvh; border-radius: 22px; overflow: hidden; }
.player[open] { display: flex; }
@media (max-width: 640px) { .player { width: 100vw; height: 100dvh; border-radius: 0; border: 0; } }
.pl-wrap { display: flex; flex-direction: column; width: 100%; min-height: 0; background:
  radial-gradient(700px 300px at 50% -80px, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%), var(--card); }
.pl-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--brand); color: var(--brand-ink); }
.pl-bar .icon-btn { background: color-mix(in srgb, #fff 18%, transparent); color: inherit; }
.pl-chap { padding: 6px 14px; font-size: .82rem; font-weight: 700; color: var(--brand); background: var(--bg2); }
.pl-list { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; background: var(--bg2); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.pl-ch { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 5px 12px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.pl-ch.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.pl-main { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; }
.pl-title { font-weight: 850; font-size: 1.2rem; line-height: 1.25; }
.pl-sub { color: var(--ink2); font-size: .84rem; margin-top: 2px; }
.pl-stagebox { margin: 10px 0; }
.pl-stage { --c: var(--brand); border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: var(--bg); text-align: center; min-height: 280px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; justify-content: center; }
.pl-verse { font-size: calc(var(--arab-size) + 2px); line-height: 2.2; text-align: center; direction: rtl; font-family: "Amiri Quran", serif; }
.pl-hl { background: linear-gradient(transparent 22%, color-mix(in srgb, var(--c) 38%, transparent) 22% 88%, transparent 88%); color: var(--c); border-radius: .2em; padding: 0 .06em; animation: plHl 1.1s ease-in-out infinite alternate; }
@keyframes plHl { from { filter: none; } to { filter: drop-shadow(0 0 .35em var(--c)); } }
.pl-trans { color: var(--ink2); font-size: .88rem; }
.pl-anim { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 110px; padding: 6px; }
.pl-lab { font-weight: 650; color: var(--ink); } .pl-lab b { color: var(--c); font-size: 1.15em; } .pl-lab small { color: var(--ink2); font-weight: 500; }
.pl-chip { font-family: "Amiri Quran", serif; direction: rtl; font-size: 2rem; line-height: 1.9; min-width: 64px; padding: 0 16px; border-radius: 16px; background: color-mix(in srgb, var(--c) 14%, var(--card)); border: 2px solid color-mix(in srgb, var(--c) 55%, transparent); color: var(--ink); }
.pl-chip.big { font-size: 2.6rem; }
.pl-pair { display: flex; gap: 14px; align-items: center; justify-content: center; direction: ltr; position: relative; }
.pl-arab-title { font-size: 2rem; color: var(--brand); padding: 14px 0 4px; line-height: 1.8; }
.pl-huruf { font-size: 1.7rem; line-height: 2; background: var(--bg2); border-radius: 14px; padding: 6px 12px; }

/* kotak harakat */
.pl-beats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.pl-cell { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; border: 2px solid color-mix(in srgb, var(--c) 45%, transparent); color: var(--ink2); background: var(--card); transition: transform .12s, background .12s, color .12s; }
.pl-cell.ghost { border-style: dashed; opacity: .45; }
.pl-cell.on { background: var(--c); color: #fff; border-color: var(--c); transform: scale(1.14); }

/* mad: batang memanjang */
.pl-stretch { width: min(100%, 420px); height: 18px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, var(--card)); overflow: hidden; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.pl-stretch span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 60%, #fff)); border-radius: 99px; }
.go .pl-stretch span { width: 100%; transition: width calc(var(--beat) * var(--n)) linear; }

/* dengung */
.pl-rings { position: relative; width: 120px; height: 60px; display: grid; place-items: center; }
.pl-rings.sm { height: 44px; }
.pl-rings i { position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--c); opacity: 0; }
.go .pl-rings i { animation: ring calc(var(--beat) * 1) ease-out calc(var(--n) * 0s) infinite; }
.go .pl-rings i:nth-child(2) { animation-delay: calc(var(--beat) * .33); } .go .pl-rings i:nth-child(3) { animation-delay: calc(var(--beat) * .66); }
@keyframes ring { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(3.4); opacity: 0; } }

/* idgham: dua huruf melebur */
.pl-merge .a, .pl-merge .b { transition: transform calc(var(--beat) * 1.2) ease-in-out, opacity calc(var(--beat) * 1.2); }
.go .pl-merge .a { transform: translateX(46px); opacity: .25; } .go .pl-merge .b { transform: translateX(-46px) scale(1.12); }
.pl-pair.merge .a { order: 0; } .pl-pair.merge .b { order: 1; }
/* ikhfa: huruf pertama memudar (samar) */
.pl-chip.fade { transition: opacity calc(var(--beat) * 1.6); }
.go .pl-chip.fade { opacity: .3; filter: blur(1.5px); }
/* iqlab: nun -> mim */
.pl-pair.iq { gap: 8px; } .pl-pair.iq .m { opacity: 0; position: absolute; transform: translateX(-34px); } 
.pl-pair.iq .a { transition: opacity calc(var(--beat) * .9); } .pl-pair.iq .m { transition: opacity calc(var(--beat) * .9) calc(var(--beat) * .5), transform calc(var(--beat) * 1.4) ease-in-out calc(var(--beat) * .5); }
.go .pl-pair.iq .a { opacity: 0; } .go .pl-pair.iq .m { opacity: 1; transform: translateX(0); }
/* izhar: jelas */
.pl-chip.clear { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); position: relative; }
.go .pl-chip.clear { animation: clearPulse calc(var(--beat) * 1.2) ease-out; }
@keyframes clearPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent); } 100% { box-shadow: 0 0 0 26px transparent; } }
/* qalqalah */
.pl-ballwrap { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 52px; }
.pl-ball { position: absolute; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: 0 6px 10px -4px rgba(0,0,0,.4); }
.go .pl-ballwrap.big .pl-ball { animation: bounceBig calc(var(--beat) * .75) cubic-bezier(.3, 0, .6, 1) 2; }
.go .pl-ballwrap.small .pl-ball { animation: bounceSm calc(var(--beat) * .5) cubic-bezier(.3, 0, .6, 1) 2; }
@keyframes bounceBig { 0% { transform: translateY(-2px); } 50% { transform: translateY(40px) scaleY(.7); } 100% { transform: translateY(-2px); } }
@keyframes bounceSm { 0% { transform: translateY(14px); } 50% { transform: translateY(40px) scaleY(.8); } 100% { transform: translateY(14px); } }
/* tebal & tipis */
.pl-chip.thick { -webkit-text-stroke: 2px currentColor; transform: scale(1); transition: transform calc(var(--beat) * 1.2); }
.go .pl-chip.thick { transform: scale(1.3); }
.pl-chip.thin { opacity: .85; transition: transform calc(var(--beat) * 1.2), opacity calc(var(--beat) * 1.2); }
.go .pl-chip.thin { transform: scale(.82); opacity: .6; }
/* saktah */
.pl-pause { font-size: 3rem; opacity: .85; } .go .pl-pause { animation: pausePulse calc(var(--beat) * 2) ease-in-out; }
@keyframes pausePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25); } }

.pl-cap { display: grid; gap: 8px; background: var(--bg2); border-radius: 14px; padding: 10px 12px; margin-top: 4px; }
.pl-cap p { margin: 2px 0 0; font-size: .94rem; }
.pl-k { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--ink2); }

.pl-ctrl { border-top: 1px solid var(--line); padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--card); }
.pl-prog { height: 10px; background: var(--bg2); border-radius: 99px; cursor: pointer; overflow: hidden; }
.pl-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--brand)); transition: width .3s; }
.pl-row { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 2px; gap: 8px; }
.pl-count { font-size: .8rem; color: var(--ink2); font-weight: 650; }
.pl-btns { display: flex; gap: 8px; }
.pl-b { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg2); font-size: 1.1rem; }
.pl-b.main { width: 60px; height: 60px; background: var(--brand); color: var(--brand-ink); border: 0; font-size: 1.5rem; }
.pl-b:disabled { opacity: .35; }
.pl-opts { display: grid; gap: 0; margin-top: 4px; }
.pl-opts .chk { padding: 4px 0; font-size: .88rem; }
.pl-bpm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; font-weight: 650; }
.pl-bpm input { width: 140px; min-height: 28px; } .pl-bpm small { color: var(--ink2); font-weight: 500; }
.learn-hero { display: grid; gap: 8px; padding: 14px; margin-bottom: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--card)), var(--card)); }
.learn-hero b { font-size: 1.1rem; }
.play-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.pl-opts summary { cursor: pointer; font-weight: 700; font-size: .84rem; color: var(--ink2); padding: 4px 0; }
@media (max-height: 760px) { .pl-stage { min-height: 200px; } }


/* ---------- Pemutar qari ---------- */
.tc-player { position: fixed; z-index: 29; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom)); max-width: 860px; margin: 0 auto; padding: 0 8px; }
.tc-player[hidden] { display: none; }
.tcp-in { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 8px 10px; }
.tcp-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .92rem; }
.tcp-bar { display: flex; align-items: center; gap: 8px; }
.tcp-bar input { flex: 1; accent-color: var(--brand); }
.tcp-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: space-between; margin-top: 4px; }
.tcp-row .btn { min-height: 44px; }
#tcpSet { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 8px; max-height: 38vh; overflow: auto; }
#tcpSet[hidden] { display: none; }
.tcp-chk { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
body.has-player { padding-bottom: calc(72px + 150px + env(safe-area-inset-bottom)); }
body.has-player .toast { bottom: calc(230px + env(safe-area-inset-bottom)); }
.card.tc-playing { outline: 2px solid color-mix(in srgb, var(--gold) 70%, transparent); outline-offset: 1px; }
::highlight(tc-now) { background-color: var(--gold-soft); }
.insight { margin-bottom: 12px; }
@media (min-width: 720px) { .tc-player { bottom: 84px; left: 50%; right: auto; transform: translateX(-50%); width: 560px; padding: 0; } }
@media print { .tc-player { display: none !important; } }

/* ---------- Suara qari di Pandu ---------- */
.pl-qrow { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; padding: 2px 0 6px 32px; }
.pl-qrow select { min-height: 40px; }
.pl-hl.hear { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Pandu: menerus ayat & pilihan surah ---------- */
.pl-nav { padding: 8px 14px 6px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.pl-navrow { display: flex; gap: 8px; align-items: flex-end; }
.pl-navrow .fld { min-width: 0; } .pl-navrow .fld.grow { flex: 1 1 auto; }
.pl-navrow select { max-width: 100%; min-height: 40px; }
.pl-nb { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 1.5rem; line-height: 1; color: var(--ink); }
.pl-nb:disabled { opacity: .35; }
.pl-vprog { margin-top: 6px; font-size: .78rem; font-weight: 700; color: var(--ink2); display: flex; align-items: center; gap: 8px; }
.pl-vprog .bar { flex: 1; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.pl-vprog .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--brand)); transition: width .4s; }
.pl-vopts { display: grid; gap: 0; border-top: 1px dashed var(--line); margin: 6px 0; padding-top: 6px; }
.pl-qrow { display: flex; gap: 8px; margin-top: 6px; } .pl-qrow .fld { min-width: 0; }
@media (max-width: 480px) { .pl-navrow { flex-wrap: wrap; } .pl-navrow .fld.grow { flex: 1 1 100%; order: -1; } .pl-navrow .fld { flex: 1; } .pl-nb { height: 40px; } }
.pl-opts { max-height: 34dvh; overflow-y: auto; scrollbar-width: thin; }

/* ===== Pandu Tajwid — ayat tetap berwarna + kursor sorot kata yang dibaca ===== */
.pl-seg { display: flex; gap: 4px; margin-top: 8px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.pl-seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 7px 8px; font: inherit; font-size: .82rem; font-weight: 700; color: var(--ink2); cursor: pointer; }
.pl-seg button.on { background: var(--card); color: var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,.14); }

.pl-vwrap { position: sticky; top: -6px; z-index: 4; padding: 4px 0 6px; background: var(--bg); }
.pl-verse { position: relative; isolation: isolate; max-height: min(42dvh, 340px); overflow-y: auto; scrollbar-width: thin; padding: 10px 12px; line-height: 2.4; word-spacing: .08em;
  border-radius: 16px; border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold-soft) 38%, var(--card)), var(--card)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 18px -12px rgba(0,0,0,.35); }
.pl-w { cursor: pointer; border-radius: 8px; transition: opacity .35s; }
.pl-w:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.is-flow .pl-w.read, .flow .pl-w.read { opacity: .55; }
.pl-w.now { text-shadow: 0 0 .55em color-mix(in srgb, var(--c, var(--gold)) 55%, transparent); }
.pl-cursor { --c: var(--gold); position: absolute; left: 0; top: 0; z-index: -1; width: 0; height: 0; pointer-events: none; opacity: 0; border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 14%, transparent));
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c) 60%, transparent), 0 10px 26px -8px color-mix(in srgb, var(--c) 80%, transparent);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), width .3s cubic-bezier(.22, 1, .36, 1), height .3s, opacity .25s, background .3s, box-shadow .3s; }
.pl-cursor.on { opacity: 1; }
.pl-cursor::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 2px; height: 3px; border-radius: 3px; background: var(--c); opacity: .9; }
.is-playing .pl-cursor.on { animation: plBreath 1.3s ease-in-out infinite alternate; }
@keyframes plBreath { from { filter: brightness(1); } to { filter: brightness(1.18) saturate(1.2); } }
.tj.cur { background: color-mix(in srgb, var(--c) 20%, transparent); box-shadow: 0 0 0 .07em color-mix(in srgb, var(--c) 45%, transparent); animation: plHl 1.1s ease-in-out infinite alternate; }

.pl-stage.is-flow { min-height: 0; justify-content: flex-start; }
.pl-live { display: grid; gap: 8px; justify-items: center; min-height: 74px; padding: 4px 0; }
.pl-lchips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pl-chip2 { --c: var(--ink2); display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: .82rem; font-weight: 700; color: var(--ink);
  background: color-mix(in srgb, var(--c) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); animation: plPop .28s cubic-bezier(.3, 1.6, .5, 1); }
.pl-chip2 i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.pl-chip2.main { background: var(--c); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px var(--c); }
.pl-chip2.main i { background: #fff; }
.pl-chip2.none, .pl-chip2.more { font-weight: 600; color: var(--ink2); --c: var(--ink2); }
@keyframes plPop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.pl-lbeats { align-items: center; min-height: 44px; }
.pl-lbeats .pl-cell { width: 36px; height: 36px; border-radius: 10px; }
.pl-llab { font-size: .84rem; font-weight: 650; color: var(--ink2); margin-inline-start: 6px; }
@media (prefers-reduced-motion: reduce) { .pl-cursor { transition: none; } .is-playing .pl-cursor.on, .tj.cur, .pl-chip2 { animation: none; } }
