:root {
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #edf0f6; --text: #141a2e; --muted: #5a6276;
  --line: #e1e5ee; --accent: #2a4a9b; --accent-soft: #e7edfb; --gold: #a57a24; --danger: #c0412f; --ok: #1d7a4a;
  --rubric: #9b2f45; --okbg: #e3f3ea; --nobg: #fbe7e3; --mark: #fde8a6; --paper: #ffffff;
  --c-new: #257de0; --c-lrn: #c0412f; --c-rev: #1d7a4a;
  /* grafik (palet tervalidasi, lihat docs) */
  --s1: #257de0; --s2: #f47230; --s3: #00b894; --grid: #e8ebf1; --axis: #c4cad6;
  --q1: #84b9f3; --q2: #519ced; --q3: #257de0; --q4: #1b64be; --q5: #0f4a96;
  --shadow: 0 1px 2px rgb(20 26 46 / .04), 0 8px 24px -12px rgb(20 26 46 / .12);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f19; --surface: #151b2a; --surface-2: #1c2436; --text: #e7eaf2; --muted: #9aa3b7;
    --line: #263049; --accent: #93abf6; --accent-soft: #1d294a; --gold: #d9b064; --danger: #ef7a6a; --ok: #5cc98b;
    --rubric: #f08a9c; --okbg: #15301f; --nobg: #3a1c1c; --mark: #4b3d12; --paper: #151b2a;
    --c-new: #6aabf1; --c-lrn: #ef7a6a; --c-rev: #5cc98b;
    --s1: #338ced; --s2: #e76624; --s3: #00a888; --grid: #222b40; --axis: #3a4560;
    --q1: #1757ac; --q2: #2370cd; --q3: #338ced; --q4: #6aabf1; --q5: #9dc8f7;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px -14px rgb(0 0 0 / .6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0b0f19; --surface: #151b2a; --surface-2: #1c2436; --text: #e7eaf2; --muted: #9aa3b7;
    --line: #263049; --accent: #93abf6; --accent-soft: #1d294a; --gold: #d9b064; --danger: #ef7a6a; --ok: #5cc98b;
    --rubric: #f08a9c; --okbg: #15301f; --nobg: #3a1c1c; --mark: #4b3d12; --paper: #151b2a;
    --c-new: #6aabf1; --c-lrn: #ef7a6a; --c-rev: #5cc98b;
    --s1: #338ced; --s2: #e76624; --s3: #00a888; --grid: #222b40; --axis: #3a4560;
    --q1: #1757ac; --q2: #2370cd; --q3: #338ced; --q4: #6aabf1; --q5: #9dc8f7;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px -14px rgb(0 0 0 / .6); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1 { font-size: 26px; margin: 24px 0 8px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 28px 0 10px; }

.ar { font-family: "Amiri Quran", "Scheherazade New", serif; direction: rtl; line-height: 2.1; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, calc((100vw - 960px) / 2 + 16px));
}
.brand { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand-ar { font-family: "Amiri Quran", serif; color: var(--accent); font-size: 22px; line-height: 1; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.nav a:hover { text-decoration: none; background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 720px) {
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; justify-content: space-around;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .nav a { padding: 8px 6px; font-size: 12.5px; }
}

.footer { color: var(--muted); font-size: 12px; padding-top: 32px; padding-bottom: 24px; }

/* cards & grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat .v { font-size: 26px; font-weight: 700; }
.stat .k { color: var(--muted); font-size: 13px; }

.hero { margin-top: 20px; display: grid; gap: 16px; grid-template-columns: 1.3fr 1fr; align-items: center; }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-size: 30px; margin-top: 0; }
.coverage-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.coverage-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; transition: width .4s; }

.curve { width: 100%; height: auto; }
.curve .ax { stroke: var(--line); }
.curve path { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.curve .area { fill: var(--accent-soft); stroke: none; }
.curve text { fill: var(--muted); font-size: 11px; }
.curve circle { fill: var(--gold); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0e1512; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0e1512; } }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* toolbar */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.toolbar input, .toolbar select {
  font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); min-width: 0;
}
.toolbar input[type=search] { flex: 1 1 220px; }
.toolbar label { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }

/* vocab list */
.vlist { display: grid; gap: 8px; }
.vitem {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px;
  color: var(--text);
}
.vitem:hover { border-color: var(--accent); text-decoration: none; }
.vitem .rank { justify-self: start; min-width: 40px; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.vitem .mean { font-weight: 500; }
.vitem .meta { color: var(--muted); font-size: 12px; }
.vitem .ar { font-size: 28px; line-height: 1.6; text-align: right; }
.vitem .ar-col { display: flex; align-items: center; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.dot.s1 { background: var(--gold); } .dot.s2 { background: var(--accent); } .dot.s3 { background: var(--ok); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* lemma detail */
.lemma-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; margin-top: 20px; }
.lemma-head .big { font-size: 64px; line-height: 1.5; }
@media (max-width: 560px) { .lemma-head { grid-template-columns: 1fr; } .lemma-head .big { text-align: center; } }
.meanings { font-size: 20px; font-weight: 600; margin: 4px 0 8px; }
.verse { padding: 14px 0; border-top: 1px solid var(--line); }
.verse .ar { font-size: 24px; text-align: right; }
.verse .ar mark { background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 0 3px; }
.verse .ref { font-size: 12px; color: var(--muted); font-weight: 600; }
.verse .tr { margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; color: var(--text); display: flex; gap: 8px; align-items: baseline; }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip .ar { font-size: 22px; line-height: 1.6; }

/* roots */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); }
.rcard:hover { border-color: var(--accent); text-decoration: none; }
.rcard .ar { font-size: 26px; line-height: 1.6; letter-spacing: .15em; }

/* surah */
.slist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.scard { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); }
.scard:hover { border-color: var(--accent); text-decoration: none; }
.scard .num { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); font-size: 12px; font-weight: 600; }
.scard .ar { font-size: 20px; line-height: 1.5; }

.ayah { padding: 16px 0; border-bottom: 1px solid var(--line); }
.words { display: flex; flex-wrap: wrap; direction: rtl; gap: 14px 6px; align-items: flex-start; }
.words .word { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px 6px; border-radius: 10px; cursor: pointer; color: var(--text); min-width: 52px; max-width: 132px; }
.words .word:hover { background: var(--surface-2); text-decoration: none; }
/* ruang di bawah tulisan Arab agar kasrah/tanwin kasrah tidak menimpa arti */
.words .word .ar { display: block; font-size: 28px; line-height: 1.6; padding: 0.15em 0 0.45em; }
.words .word .m { display: block; font-size: 12px; color: var(--muted); direction: ltr; text-align: center; max-width: 116px; line-height: 1.35; overflow-wrap: anywhere; hyphens: auto; }
.words .word .t { display: block; font-size: 11px; color: var(--gold); direction: ltr; font-style: italic; text-align: center; max-width: 116px; overflow-wrap: anywhere; }
.word.known .ar { color: var(--ok); }
.ayah .num { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.ayah .tr { margin-top: 8px; }
.hide-m .word .m, .hide-t .word .t { display: none; }

.empty { text-align: center; padding: 40px 16px; }

/* ---------- latihan (SRS) ---------- */
.study-head { margin-top: 16px; display: grid; gap: 10px; }
.sh-top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between; }
.sh-top h1 { margin: 0; }
.cnt { display: flex; gap: 18px; }
.cnt div { text-align: right; }
.cnt b { display: block; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cnt span { font-size: 12px; color: var(--muted); }
.c-new { color: var(--c-new); } .c-lrn { color: var(--c-lrn); } .c-rev { color: var(--c-rev); } .c-stk { color: var(--gold); }
.goal { display: grid; gap: 4px; }
.study-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; margin-top: 14px; }
@media (max-width: 860px) { .study-wrap { grid-template-columns: minmax(0, 1fr); } }
.mcard { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 22px 22px 18px; box-shadow: 0 2px 0 var(--line); }
.mcard::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--line); border-radius: 4px; pointer-events: none; }
.mcard > * { position: relative; }
.q { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.q .lab { color: var(--rubric); font-weight: 600; }
.tag { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; font-weight: 600; color: #fff; margin-left: 4px; }
.tag.n { background: var(--c-new); } .tag.l { background: var(--c-lrn); } .tag.r { background: var(--c-rev); } .tag.x { background: var(--surface-2); color: var(--text); }
.mcard .word { text-align: center; font-size: clamp(54px, 13vw, 84px); line-height: 1.8; margin: 4px 0 0; overflow-wrap: anywhere; }
.mcard .hint { text-align: center; color: var(--muted); margin: 0; }
@media (prefers-reduced-motion: no-preference) { .mcard.in { animation: rise .25s ease-out; } @keyframes rise { from { transform: translateY(6px); opacity: .4; } to { transform: none; opacity: 1; } } }
.opts { display: grid; gap: 8px; margin-top: 12px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.opt:hover:not([disabled]) { border-color: var(--accent); }
.opt:focus-visible, .rate button:focus-visible, .seg button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 13px; }
.opt.ok { border-color: var(--ok); background: var(--okbg); } .opt.ok .k { background: var(--ok); color: #fff; }
.opt.no { border-color: var(--danger); background: var(--nobg); } .opt.no .k { background: var(--danger); color: #fff; }
.opt[disabled] { cursor: default; }
.idk { margin-top: 6px; background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; min-height: 40px; padding: 0 4px; }
.res { margin-top: 12px; padding: 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.verdict { font-weight: 700; margin: 0 0 8px; } .verdict.ok { color: var(--ok); } .verdict.no { color: var(--danger); }
.rate { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rate button { min-height: 56px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 15px Inter, sans-serif; cursor: pointer; display: grid; place-items: center; line-height: 1.2; padding: 6px 4px; }
.rate button small { font-weight: 400; font-size: 12px; color: var(--muted); }
.rate button[data-r="1"] { border-color: var(--danger); }
.rate button[data-r="3"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.rate button[data-r="3"] small { color: inherit; opacity: .8; }
:root[data-theme="dark"] .rate button[data-r="3"] { color: #0e1512; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rate button[data-r="3"] { color: #0e1512; } }
@media (max-width: 520px) { .rate { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mcard { padding: 18px 16px 16px; } .cnt { gap: 12px; } .cnt b { font-size: 20px; } }
.next { width: 100%; margin-bottom: 12px; }
.det { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.det dt { color: var(--muted); } .det dd { margin: 0; }
.det .dar { font-size: 24px; line-height: 1.6; }
.blk { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.cxnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.blk .verse { border-top: 0; padding-top: 6px; }
.blk .verse mark { background: var(--mark); color: inherit; }
.done { text-align: center; padding: 30px 18px; }
.done h2 { margin: 6px 0; }
.done-ic { font-size: 40px; }
.side { display: grid; gap: 10px; }
.side h3 { margin: 6px 0 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--rubric); }
.side select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); width: 100%; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .seg button.on { color: #0e1512; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { color: #0e1512; } }
details.how summary { cursor: pointer; font-weight: 600; }
details.how ul { padding-left: 18px; margin: 6px 0; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; transition: .3s; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 50; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* statistik */
.chart { width: 100%; height: auto; }
.chart .ax { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .b-rev { fill: var(--accent-soft); stroke: var(--accent); stroke-width: .5; }
.chart .b-new { fill: var(--c-new); }
.leg { display: flex; gap: 16px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw.rev { background: var(--accent-soft); border: 1px solid var(--accent); } .sw.new { background: var(--c-new); }
.juzgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.jz { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); }
.jz:hover { border-color: var(--accent); text-decoration: none; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { display: grid; gap: 2px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.badge.on { border: 1px solid var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); color: var(--text); }
.medal { font-size: 20px; }
.homo { margin-top: 4px; color: var(--gold); }

/* tulisan mushaf */
.rasm { text-align: center; margin: 2px 0 0; font-size: 11px; opacity: .6; }
.rasm .ar { font-size: 17px; line-height: 1.6; }
.pill.khas { background: none; padding: 0 4px; border: 1px solid currentColor; color: var(--gold); font-size: 10px; font-weight: 600; }
.ar-stack { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.rasm-sm { font-size: 12px; color: var(--muted); opacity: .65; line-height: 1.3; }
.big-wrap { display: grid; justify-items: center; }
.big-wrap .rasm .ar { font-size: 19px; }
.rasm-dd { opacity: .6; font-size: 11px; }
.rasm-dd .ar { font-size: 17px; line-height: 1.6; }
.rankpill { font-weight: 700; color: var(--text); }
.vitem .ar.rasm-sm { font-size: 15px; line-height: 1.3; }

/* info sharaf */
.sharaf { margin: 10px 0 4px; }
.sharaf .dar, .det .jm .dar { font-size: 22px; line-height: 1.6; }
.jm { display: inline-flex; align-items: baseline; gap: 6px; margin-right: 14px; flex-wrap: wrap; }
.wz { font-size: 20px; color: var(--accent); }
.sharaf dd { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; }
@media (max-width: 420px) { .vitem { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; padding: 8px 10px; } .vitem .rank { min-width: 0; padding: 3px 4px; font-size: 13px; } }
.pill.jenis .ar { font-size: 15px; line-height: 1; }
.seg button .ar { font-size: 15px; line-height: 1; margin-left: 2px; }

/* ---------- tampilan elegan: header, judul, kartu ---------- */
h1, h2, h3 { letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-weight: 700; }
.topbar { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.brand-ar { color: var(--gold); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.card, .dcard, .mcard, .res, .vitem, .rcard, .scard, .jz, .chip { box-shadow: var(--shadow); border-color: var(--line); }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.pill { background: var(--surface-2); }

/* ---------- beranda ---------- */
.intro { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: stretch; margin-top: 26px; }
@media (max-width: 760px) { .intro { grid-template-columns: minmax(0, 1fr); } }
.eyebrow { margin: 0 0 6px; color: var(--gold); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.eyebrow .ar { text-transform: none; font-size: 17px; letter-spacing: 0; }
.intro h1 { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.12; margin: 0 0 10px; }
.lead { color: var(--muted); font-size: 16px; max-width: 34em; margin: 0 0 18px; }
.me { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: grid; gap: 6px; align-content: start; }
.me-h { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 600; font-size: 13px; }
.me-v { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.me-k { color: var(--muted); font-size: 14px; }
.meter { height: 8px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.meter > div { height: 100%; background: var(--accent); border-radius: 99px; }
.me-s { font-size: 12.5px; color: var(--muted); }
.sect-h { margin: 34px 0 14px; }
.sect-h h2 { margin: 0 0 4px; font-size: 22px; }
.sect-h p { margin: 0; font-size: 14px; }

/* ---------- dashboard ---------- */
/* peta target hafalan */
.target { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 16px; margin-bottom: 16px; box-shadow: var(--shadow);
  background-image: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--gold) 14%, transparent) 0%, transparent 55%), radial-gradient(90% 80% at 0% 100%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 60%); }
.target-h { display: flex; gap: 18px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.target-h > div { flex: 1 1 420px; min-width: 0; }
.target-h h3 { margin: 0 0 8px; font-size: clamp(21px, 3vw, 27px); line-height: 1.2; letter-spacing: -0.01em; }
.target-h h3 b { color: var(--accent); }
.target-sub { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; max-width: 46em; }
.target-sub b { color: var(--text); }
.tsteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; position: relative; }
.tsteps::before { content: ""; position: absolute; left: 10%; right: 10%; top: 17px; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 11px); }
.tstep { position: relative; display: grid; grid-template-rows: auto 1fr; justify-items: center; text-align: center; gap: 10px; min-width: 0; }
.tdot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--surface); border: 2px solid var(--line); color: var(--muted); }
.tbody { width: 100%; align-content: start; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px 10px; display: grid; gap: 3px; transition: transform .2s; }
.tstep:hover .tbody { transform: translateY(-2px); }
.tname { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tn { font-size: 13.5px; color: var(--muted); } .tn b { color: var(--text); font-size: 17px; }
.tp { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.tc { font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: -2px; }
.tt { justify-self: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); margin: 2px 0 4px; }
.tm { height: 5px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; }
.tm > div { height: 100%; background: var(--accent); border-radius: 99px; }
.tg { font-size: 11.5px; color: var(--muted); }
.tstep.main .tdot { background: var(--gold); border-color: var(--gold); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 22%, transparent); }
.tstep.main .tbody { border: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 7%, var(--surface)); }
.tstep.main .tname { color: var(--gold); }
.tstep.main .tm > div { background: var(--gold); }
.tstep.tok .tdot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tstep.tok .tg { color: var(--ok); font-weight: 600; }
.target-note { margin: 14px 0 0; }
@media (max-width: 860px) {
  .tsteps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tsteps::before { left: 17px; right: auto; top: 18px; bottom: 18px; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--line) 0 6px, transparent 6px 11px); }
  .tstep { grid-template-rows: auto; grid-template-columns: 36px minmax(0, 1fr); justify-items: stretch; text-align: left; align-items: start; gap: 12px; }
  .tbody { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 10px 12px; }
  .tname, .tn, .tm, .tg { grid-column: 1; }
  .tp { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 28px; }
  .tc { grid-column: 2; grid-row: 3; text-align: right; max-width: 8em; font-size: 11px; justify-self: end; margin: 0; }
  .tname, .tn, .tg { white-space: nowrap; }
  .tbody { column-gap: 8px; }
  .tt { grid-column: 2; grid-row: 4; align-self: start; justify-self: end; }
}
.dhead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .dhead { grid-template-columns: minmax(0, 1fr); } }
.dhero { background: linear-gradient(160deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, #0b0f19) 100%); color: #fff; border-radius: var(--radius); padding: 22px 22px 20px; display: grid; gap: 6px; align-content: center; box-shadow: var(--shadow); }
:root[data-theme="dark"] .dhero { color: #0b0f19; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dhero { color: #0b0f19; } }
.dhero-fig { font-size: 64px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.dhero-txt { font-size: 15px; line-height: 1.5; opacity: .95; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-k { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi-v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0; }
.kpi-s { color: var(--muted); font-size: 12px; }
.dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 860px) { .dgrid { grid-template-columns: minmax(0, 1fr); } }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 12px; min-width: 0; }
.dcard.wide { grid-column: 1 / -1; }
.dcard h3 { margin: 0 0 4px; font-size: 16.5px; }
.dsub { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 70em; }
.dsub b { color: var(--text); }
.dchart { width: 100%; height: auto; display: block; overflow: visible; }
.dchart .grid { stroke: var(--grid); stroke-width: 1; }
.dchart .axis { stroke: var(--axis); stroke-width: 1; }
.dchart .tick { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.dchart .val { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.dchart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dchart .line.s1 { stroke: var(--s1); }
.dchart .area.s1 { fill: var(--s1); opacity: .1; }
.dchart .dot { stroke: var(--surface); stroke-width: 2; }
.dchart .dot.s1 { fill: var(--s1); }
.dchart .xhair { stroke: var(--axis); stroke-width: 1; }
.dchart .hit { fill: transparent; cursor: crosshair; }
.dchart .col .hit { cursor: default; }
.dchart .col:hover .bar, .dchart .col:focus .bar { filter: brightness(1.12); }
.dchart .col:focus { outline: none; }
.dchart .col:focus .hit { stroke: var(--accent); stroke-width: 1; }
.dchart .bar.s1 { fill: var(--s1); } .dchart .bar.s2 { fill: var(--s2); } .dchart .bar.s3 { fill: var(--s3); }
.dchart .bar.q1 { fill: var(--q1); } .dchart .bar.q2 { fill: var(--q2); } .dchart .bar.q3 { fill: var(--q3); }
.dchart .bar.q4 { fill: var(--q4); } .dchart .bar.q5 { fill: var(--q5); }
.twin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 640px) { .twin { grid-template-columns: minmax(0, 1fr); } }
.twin-h, .seg-h { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
/* batang horizontal */
.hbars { display: grid; gap: 7px; }
.hb-row { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 10px; align-items: center; }
.hb-l { display: flex; gap: 8px; align-items: baseline; min-width: 0; font-size: 13px; }
.hb-l .ar { font-size: 19px; line-height: 1.4; flex: none; }
.hb-t { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-labels .hb-l { flex-direction: row; }
.hb-track { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); padding: 3px 0; border-radius: 6px; }
.hb-track:hover, .hb-track:focus { text-decoration: none; background: var(--surface-2); outline: none; }
.hb-bar { height: 12px; border-radius: 0 4px 4px 0; flex: none; }
.hb-bar.s1 { background: var(--s1); } .hb-bar.s2 { background: var(--s2); }
.hb-v { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* batang tersegmen */
.segs { display: grid; gap: 8px; }
.sbar { display: flex; gap: 2px; height: 28px; margin-bottom: 6px; }
.sb { min-width: 3px; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; color: #fff; font-size: 12px; font-weight: 600; cursor: default; }
.sb:hover, .sb:focus { filter: brightness(1.1); outline: none; }
.sb.s1 { background: var(--s1); } .sb.s2 { background: var(--s2); } .sb.s3 { background: var(--s3); }
.dleg { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.dleg .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); }
/* tooltip */
.dtip { position: fixed; z-index: 60; display: none; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 10px 30px -10px rgb(0 0 0 / .35); max-width: 280px; }
.dtip-t { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.dtip-r b { font-size: 14px; }
.dtip-r span { color: var(--muted); }
.dtip-k { display: inline-block; width: 10px; height: 2px; margin-right: 6px; vertical-align: 4px; }
/* tabel data */
.dtable { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.dtable summary { cursor: pointer; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.dscroll { overflow-x: auto; margin-top: 8px; }
.dtbl { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.dtbl th, .dtbl td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtbl th { color: var(--muted); font-weight: 600; }

.hb-l.stack { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.hb-main { font-size: 13px; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hb-sub { font-size: 13px; line-height: 1.35; color: var(--muted); }

/* ---------- akun / login ---------- */
.nav { margin-left: auto; }
.acct { display: flex; align-items: center; min-width: 0; }
.acct:empty { display: none; }
.acct-menu { position: relative; }
.acct-menu > summary { list-style: none; cursor: pointer; }
.acct-menu > summary::-webkit-details-marker { display: none; }
.acct-btn { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.acct-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.acct-dot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); background: var(--muted); }
.acct-dot.ok { background: var(--ok); } .acct-dot.wait { background: var(--gold); } .acct-dot.err { background: var(--danger); }
.acct-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(280px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 8px; }
.acct-name { font-weight: 700; overflow-wrap: anywhere; }
.acct-mail { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; margin-top: -6px; }
.acct-st { font-size: 12.5px; color: var(--muted); padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.acct-st.ok { color: var(--ok); } .acct-st.err { color: var(--danger); } .acct-st.wait { color: var(--gold); }
.acct-st.ok::before { content: "✓ "; }
dialog.login { width: min(400px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px 18px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .25); text-align: center; }
dialog.login::backdrop { background: rgba(11, 15, 25, .5); backdrop-filter: blur(3px); }
dialog.login h2 { margin: 4px 0 6px; font-size: 21px; }
dialog.login > p { margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.login-x { position: absolute; right: 12px; top: 12px; margin: 0; }
.login-x .btn { border: 0; background: none; color: var(--muted); }
.login-ar { font-size: 34px; color: var(--gold); line-height: 1.3; }
.login-g { width: 100%; justify-content: center; gap: 10px; padding: 11px 14px; font-weight: 600; display: flex; align-items: center; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 16px 0 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-f { display: grid; gap: 8px; margin: 0; text-align: left; }
.login-f p { margin: 0 0 2px; }
.login-f input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; box-sizing: border-box; }
.login-f input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-sent { display: grid; gap: 6px; justify-items: center; padding: 6px 0; }
.login-sent p { margin: 0; line-height: 1.5; }
.login-sent-ic { font-size: 34px; }
.login-msg { min-height: 1.2em; margin: 10px 0 4px; color: var(--ok); }
.login-msg.err { color: var(--danger); }

/* jalur belajar & level */
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 8px; }
.path { display: grid; gap: 6px; align-content: start; color: inherit; text-decoration: none; position: relative; transition: border-color .15s, transform .15s; }
.path:hover { border-color: var(--accent); transform: translateY(-1px); }
.path > b { font-size: 20px; }
.path-k { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--rubric); font-weight: 600; }
.path-on { display: none; justify-self: start; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 20px; padding: 2px 10px; }
.path.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.path.on .path-on { display: inline-block; }
.lvls { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; padding-right: 2px; }
.lvls[hidden] { display: none; }
.lvtab { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.lv { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 3px; background: var(--surface); }
.lv .lv-h { font-size: 14px; }
.lv .lv-h b { color: var(--rubric); margin-right: 2px; }
.progress { height: 8px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; }
.lv .progress { height: 6px; background: var(--surface-2); }
.lv.on { border-color: var(--accent); background: var(--accent-soft); }
.lv.ok .lv-h b, .lv-ok { color: var(--ok); }
.lv-tot { font-weight: 600; }
.tgel { font-size: 12.5px; color: var(--rubric); font-weight: 600; }
.lv-g { font-size: 12px; color: var(--rubric); font-weight: 600; }
.target-moti { display: flex; gap: 14px; align-items: flex-start; margin: 18px 0 0; padding: 16px 18px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); }
.tmo-ic { font-size: 28px; line-height: 1; }
.tmo-b p { margin: 0 0 8px; } .tmo-b p:last-child { margin: 0; }
.tmo-h { font-size: 18px; font-weight: 700; color: var(--gold); }
.tmo-q { display: grid; gap: 4px; padding-left: 12px; border-left: 3px solid var(--gold); color: var(--muted); font-size: 14px; }
.tmo-q .ar { font-size: 22px; color: var(--text); line-height: 1.8; }
@media (max-width: 560px) { .target-moti { padding: 14px; gap: 10px; } .tmo-ic { font-size: 22px; } }

/* Mushaf: latihan mandiri per ayat */
.mk-new { color: var(--danger); font-weight: 700; }
.mnav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 16px; }
.mpage { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px 12px; margin: 0 auto 18px; max-width: 860px; scroll-margin-top: 80px; }
.mpage-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pill.mnew { background: var(--nobg); color: var(--danger); }
.msurah { display: grid; justify-items: center; gap: 2px; margin: 14px 0 4px; padding: 8px; border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--gold) 7%, var(--surface)); }
.msurah .ar { font-size: 26px; color: var(--gold); line-height: 1.6; }
.mbas { text-align: center; font-size: 28px; line-height: 2; margin: 4px 0 0; }
.mayah { padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.mtext { display: flex; flex-wrap: wrap; direction: rtl; align-items: baseline; gap: 0 .16em; font-size: clamp(24px, 6.2vw, 31px); line-height: 2.1; }
.mw { cursor: pointer; color: var(--text); border-radius: 6px; padding: 0 .02em; outline: none; }
.mw:hover, .mw:focus-visible { background: var(--surface-2); }
.mw.new { color: var(--danger); }
.mnum { color: var(--gold); font-size: .8em; }
.mtr summary { cursor: pointer; font-size: 13px; color: var(--accent); width: fit-content; }
.mtr p { margin: 6px 0 2px; font-size: 15px; }
.mlist { margin-top: 10px; } .mlist summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.mlist .chips { margin-top: 8px; }
.mpop { position: fixed; z-index: 60; display: none; max-width: 280px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px -10px rgb(0 0 0 / .35); padding: 10px 12px; font-size: 14px; }
.mpop .mp-ar { font-size: 26px; line-height: 1.6; text-align: right; }
.mpop .mp-m { font-weight: 600; margin-bottom: 4px; }
.mpop .mp-l { margin-top: 2px; } .mpop .mp-l .ar { font-size: 18px; margin-right: 4px; }
.mpop .mp-go { margin-top: 8px; width: 100%; justify-content: center; }
.mpick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.mpick select, .mpick input { font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.mpick input { width: 76px; margin-left: 4px; }
.mnav { justify-content: space-between; max-width: 860px; margin: 10px auto; }
.mnav-mid { font-size: 14px; color: var(--muted); }
.mnav [aria-disabled="true"] { opacity: .4; pointer-events: none; }

/* =========================================================================
   Penyegaran desain: hangat & elegan (krem gading, biru tua, emas),
   judul serif, ornamen geometris tipis. Hanya mengganti token & tampilan.
   ========================================================================= */
:root {
  --bg: #f6f2ea; --surface: #fffdf9; --surface-2: #f1ebdf; --text: #1b2030; --muted: #666b78;
  --line: #e6dfd1; --accent: #1f3d7a; --accent-soft: #e9eef8; --gold: #a47a2c; --paper: #fffdf8;
  --rubric: #8f2f45; --okbg: #e6f2ea; --nobg: #f9e7e2;
  --shadow: 0 1px 2px rgb(60 45 20 / .05), 0 14px 32px -18px rgb(60 45 20 / .22);
  --radius: 20px;
  --on-accent: #fff;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --orn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23a47a2c' stroke-width='.8'%3E%3Cpath d='M28 6l6.4 15.6L50 28l-15.6 6.4L28 50l-6.4-15.6L6 28l15.6-6.4z'/%3E%3Crect x='17' y='17' width='22' height='22' transform='rotate(45 28 28)'/%3E%3Crect x='17' y='17' width='22' height='22'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d111b; --surface: #151b29; --surface-2: #1c2435; --text: #ebe7df; --muted: #a2a8b6;
    --line: #283147; --accent: #9fb5f3; --accent-soft: #1d2a4c; --gold: #d9b46c; --paper: #151b29; --on-accent: #0d111b;
    --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 16px 34px -18px rgb(0 0 0 / .7);
  }
}
:root[data-theme="dark"] {
  --bg: #0d111b; --surface: #151b29; --surface-2: #1c2435; --text: #ebe7df; --muted: #a2a8b6;
  --line: #283147; --accent: #9fb5f3; --accent-soft: #1d2a4c; --gold: #d9b46c; --paper: #151b29; --on-accent: #0d111b;
  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 16px 34px -18px rgb(0 0 0 / .7);
}
body { background: var(--bg); }
h1, .sect-h h2, .target-h h3, .dcard h3, .intro h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 32px; }
.dhero-fig, .me-v, .kpi-v, .tp, .stat .v, .cnt b { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; }

/* bilah atas */
.topbar { background: color-mix(in srgb, var(--surface) 78%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--gold) 22%, var(--line)); }
.brand { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand-ar { font-size: 25px; }
.nav a { font-weight: 500; transition: background .15s, color .15s; }
.nav a.active { background: var(--accent); color: var(--on-accent); }
/* di HP menu ada di bawah layar: blur pada bilah atas akan menjadikannya acuan posisi menu, jadi dimatikan */
@media (max-width: 720px) {
  .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
  .nav { background: var(--surface); box-shadow: 0 -8px 24px -16px rgb(0 0 0 / .25); border-top: 1px solid color-mix(in srgb, var(--gold) 22%, var(--line)); }
}

/* tombol */
.btn { border-radius: 999px; padding: 9px 18px; font-weight: 600; transition: transform .15s, box-shadow .15s, background .15s; }
.btn.sm { padding: 6px 13px; }
.btn.primary { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 88%, #fff) 0%, var(--accent) 55%, color-mix(in srgb, var(--accent) 80%, #000) 100%); border-color: transparent; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent); color: var(--on-accent); }
.btn.primary:hover { transform: translateY(-1px); filter: none; box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.seg button { transition: background .15s, border-color .15s; }

/* kartu umum */
.card, .dcard, .kpi, .me, .target, .lv, .path, .mpage, .jz, .vitem, .rcard, .scard { border-radius: var(--radius); border-color: var(--line); }
.dcard { box-shadow: var(--shadow); padding: 20px 20px 14px; }
.dcard h3 { font-size: 19px; }
.sect-h h2 { font-size: 26px; display: flex; align-items: center; gap: 10px; }
.sect-h h2::before { content: ""; width: 18px; height: 18px; flex: none; background: var(--orn) center / 30px no-repeat; opacity: .9; }

/* pembuka beranda: panel dengan ornamen */
.intro { position: relative; padding: 30px 30px 26px; border-radius: 28px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--gold) 10%, var(--surface)) 0%, var(--surface) 55%); box-shadow: var(--shadow); }
.intro::after { content: ""; position: absolute; inset: 0; background: var(--orn) 0 0 / 56px 56px repeat; opacity: .07; pointer-events: none;
  -webkit-mask-image: linear-gradient(110deg, transparent 35%, #000 100%); mask-image: linear-gradient(110deg, transparent 35%, #000 100%); }
.intro > * { position: relative; z-index: 1; }
.intro h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; }
.intro .lead { font-size: 16px; color: var(--muted); max-width: 34em; }
.me { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.me-v { font-size: 46px; color: var(--accent); }
.meter { background: var(--surface-2); } .meter > div { background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 60%, var(--accent))); }
@media (max-width: 720px) { .intro { padding: 22px 18px; border-radius: 22px; } }

/* jalur belajar */
.path { padding: 20px; background: var(--surface); }
.path > b { font-family: var(--serif); font-weight: 600; font-size: 22px; }
.path.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.path-on { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); color: var(--gold); }

/* target hafalan */
.target { border-radius: 26px; border-color: color-mix(in srgb, var(--gold) 26%, var(--line)); }
.target::after { content: ""; position: absolute; right: -40px; top: -40px; width: 260px; height: 260px; background: var(--orn) center / 56px repeat; opacity: .06; border-radius: 50%; pointer-events: none; }
.target-h h3 { font-size: clamp(24px, 3.2vw, 31px); }
.tstep .tbody { border-radius: 18px; }
.tp { font-size: 30px; }
.target-moti { border-radius: 18px; }
.tmo-h { font-family: var(--serif); font-size: 21px; }
.dhero { border-radius: 24px; position: relative; overflow: hidden; background: linear-gradient(150deg, #24468a 0%, #1f3d7a 45%, #142a57 100%); }
.dhero::after { content: ""; position: absolute; inset: 0; background: var(--orn) 0 0 / 56px repeat; opacity: .12; filter: brightness(2.2); pointer-events: none; }
.dhero > * { position: relative; }
.dhero-fig { font-size: 72px; color: #f3d9a0; }
.kpi { box-shadow: var(--shadow); }

/* latihan: kartu kata berbingkai */
.mcard { border-radius: 22px; padding: 26px 24px 20px; border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); background: var(--paper); box-shadow: var(--shadow); }
.mcard::before { inset: 8px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent); }
.mcard .word { color: var(--text); }
.opt { border-radius: 16px; min-height: 56px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.opt:hover:not([disabled]) { transform: translateY(-1px); box-shadow: var(--shadow); }
.opt .k { background: var(--accent-soft); color: var(--accent); }
.side { border-radius: var(--radius); }
.lv.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.progress > div { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--gold))); }

/* mushaf */
.mpage { background: var(--paper); border-color: color-mix(in srgb, var(--gold) 26%, var(--line)); }
.msurah { border-radius: 16px; background: color-mix(in srgb, var(--gold) 8%, var(--surface)), var(--orn); }

/* kaki */
.footer { border-top: 1px solid color-mix(in srgb, var(--gold) 20%, var(--line)); margin-top: 28px; }
/* logo: tulisan Arab bergaya kufi */
.brand-ar { font-family: "Reem Kufi", "Amiri Quran", serif; font-weight: 600; font-size: 19px; line-height: 1; letter-spacing: 0; color: var(--gold); direction: rtl; padding-top: 2px; }
@media (max-width: 400px) { .brand-ar { font-size: 16px; } }
/* masuk: email + PIN */
.login-ar { font-family: "Reem Kufi", "Amiri Quran", serif; font-weight: 600; font-size: 26px; direction: rtl; }
.login-l { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.login-pin { letter-spacing: .5em; font-size: 20px !important; text-align: center; }
.login-f .btn.primary { margin-top: 6px; justify-content: center; }
.login-new { display: grid; gap: 8px; padding: 4px 0; } .login-new p { margin: 0; }
dialog.login { border-radius: 22px; border-color: color-mix(in srgb, var(--gold) 28%, var(--line)); }
dialog.login h2 { font-family: var(--serif); font-weight: 600; }
/* latihan: batas tanpa masuk */
.lock-note { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); font-size: 13.5px; }
.lock-note b { color: var(--gold); }
.lock-note .btn { justify-self: start; }
.lv.lock { opacity: .62; }
.lv-lock { float: right; font-size: 13px; }
.gate { max-width: 520px; margin: 40px auto; text-align: center; display: grid; gap: 10px; justify-items: center; }
.gate-ic { font-size: 40px; } .gate h1 { margin: 0; }
