:root {
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #eef1f6; --text: #0f172a; --muted: #64748b; --line: rgba(15, 23, 42, .08);
  --pri: #059669; --pri-2: #0d9488; --pri-ink: #ffffff; --pri-soft: rgba(5, 150, 105, .1);
  --acc: #d97706; --vi: #7c3aed; --bl: #2563eb; --or: #ea580c;
  --ok: #16a34a; --mid: #d97706; --low: #ea580c; --bad: #dc2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 24px rgba(15, 23, 42, .06);
  --r: 20px; --r-sm: 12px;
  --font: 'Plus Jakarta Sans', 'Scheherazade New', 'Amiri Quran', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ar: 'Amiri Quran', 'Scheherazade New', 'Traditional Arabic', serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121a2b; --surface-2: #1a2438; --text: #e8edf6; --muted: #8e9ab0; --line: rgba(255, 255, 255, .07);
    --pri: #34d399; --pri-2: #2dd4bf; --pri-ink: #04281d; --pri-soft: rgba(52, 211, 153, .12);
    --acc: #fbbf24; --vi: #a78bfa; --bl: #60a5fa; --or: #fb923c;
    --ok: #4ade80; --mid: #fbbf24; --low: #fb923c; --bad: #f87171;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 30px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121a2b; --surface-2: #1a2438; --text: #e8edf6; --muted: #8e9ab0; --line: rgba(255, 255, 255, .07);
  --pri: #34d399; --pri-2: #2dd4bf; --pri-ink: #04281d; --pri-soft: rgba(52, 211, 153, .12);
  --acc: #fbbf24; --vi: #a78bfa; --bl: #60a5fa; --or: #fb923c;
  --ok: #4ade80; --mid: #fbbf24; --low: #fb923c; --bad: #f87171;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 30px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; border-radius: 8px; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }
.ic.lg { width: 28px; height: 28px; }
.ic.xl { width: 48px; height: 48px; color: var(--muted); }

/* ---------- layout ---------- */
#app { min-height: 100dvh; }
.view { max-width: 640px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.side { display: none; }
#app.bare .nav, #app.bare .side { display: none !important; }
#app.bare .view { padding-bottom: 32px; }

.nav { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 20px));
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, .18); }
.nav-i { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 16px; transition: color .2s; }
.nav-i.on { color: var(--pri); }
.nav-i.on .ic { transform: translateY(-1px); }
.nav-fab { justify-self: center; width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; color: var(--pri-ink);
  background: linear-gradient(135deg, var(--pri), var(--pri-2)); box-shadow: 0 8px 24px color-mix(in srgb, var(--pri) 45%, transparent); margin-top: -22px; transition: transform .15s; }
.nav-fab:active { transform: scale(.94); }
.nav-fab .ic { width: 24px; height: 24px; }

@media (min-width: 960px) {
  #app { display: grid; grid-template-columns: 248px 1fr; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); }
  .nav { display: none; }
  .view { max-width: 980px; width: 100%; padding: 8px 32px 48px; }
  .brand { display: flex; gap: 10px; align-items: center; padding: 4px 10px 18px; }
  .brand small { display: block; color: var(--muted); font-size: 12px; }
  .side-i { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; }
  .side-i:hover { background: var(--surface-2); color: var(--text); }
  .side-i.on { background: var(--pri-soft); color: var(--pri); }
  .bento { grid-template-columns: 2fr 1fr 1fr !important; }
  .bento .hero { grid-column: auto; grid-row: span 2; }
  .bento { grid-template-columns: 1.6fr 1fr 1fr !important; }
  .grid-cards { grid-template-columns: 1fr 1fr !important; }
  .habits { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ---------- top ---------- */
.top { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 0 4px; position: sticky; top: 0; z-index: 10;
  background: linear-gradient(var(--bg) 70%, transparent); }
.top-t { flex: 1; min-width: 0; }
.top h1 { font-size: 1.3rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; flex: none;
  background: linear-gradient(135deg, var(--vi), var(--bl)); color: #fff; }
.avatar.sm { width: 36px; height: 36px; border-radius: 12px; font-size: 14px; }
.chip-student { display: flex; align-items: center; gap: 6px; max-width: 46%; padding: 8px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chip-student span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); flex: none; color: var(--text); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }

/* ---------- cards & basics ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: block; }
.card.flush { padding: 0; overflow: hidden; }
.pad { padding: 14px 16px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-between.wrap { flex-wrap: wrap; }
.link { color: var(--pri); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; }
.link .ic { width: 16px; height: 16px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--pri); text-transform: uppercase; letter-spacing: .06em; }
.eyebrow .ic { width: 14px; height: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--pri-soft); color: var(--pri); white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; }
.pill.big { font-size: 14px; padding: 8px 14px; margin-top: 8px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pri), var(--pri-2)); transition: width .6s cubic-bezier(.2, .8, .2, 1); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 14px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); transition: transform .12s, filter .2s; cursor: pointer; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--pri), var(--pri-2)); color: var(--pri-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 12px; }
.btn.sm .ic { width: 16px; height: 16px; }
.btn.ok { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); }
.btn.mid { background: color-mix(in srgb, var(--mid) 16%, var(--surface)); color: var(--mid); }
.btn.low { background: color-mix(in srgb, var(--low) 16%, var(--surface)); color: var(--low); }
.btn.bad { background: color-mix(in srgb, var(--bad) 16%, var(--surface)); color: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 10px; }
.lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
input:not([type=radio]):not([type=checkbox]):not([type=range]), select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); outline: none; transition: border-color .2s, background .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--pri); background: var(--surface); }
textarea { resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--muted); text-align: center; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--surface-2); border-radius: 14px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg.sm { display: inline-grid; grid-auto-flow: column; grid-auto-columns: auto; grid-template-columns: none; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border-radius: 11px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; text-align: center; transition: background .2s, color .2s; }
.seg.sm span { padding: 6px 12px; font-size: 12px; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.seg input:focus-visible + span { outline: 2px solid var(--pri); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--pri); margin-top: 1px; flex: none; }
.scores { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rng { display: grid; grid-template-columns: 90px 1fr 36px; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.rng input { accent-color: var(--pri); width: 100%; }
.rng output { text-align: right; font-weight: 800; color: var(--pri); font-variant-numeric: tabular-nums; }
.inline { display: flex; gap: 8px; margin-top: 8px; }
.inline-form { flex-direction: row; flex-wrap: wrap; }
.inline-form input { flex: 1 1 160px; }

/* ---------- onboarding ---------- */
.onb { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 32px 0; }
.onb-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.onb-hero h1 { font-size: 2.1rem; font-weight: 800; background: linear-gradient(135deg, var(--pri), var(--bl)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.onb-hero p { color: var(--muted); max-width: 32ch; }
.logo { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #10b981, #0d9488 50%, #4f46e5); flex: none; box-shadow: 0 6px 18px rgba(13, 148, 136, .35); }
.logo.big { width: 72px; height: 72px; border-radius: 22px; }
.logo.big .ic { width: 36px; height: 36px; }
.boot { min-height: 80dvh; display: grid; place-items: center; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .6; } }

/* ---------- home ---------- */
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero { grid-column: 1 / -1; color: #fff; border: 0; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(99, 102, 241, .55), transparent 60%), radial-gradient(80% 80% at 0% 100%, rgba(16, 185, 129, .5), transparent 60%), linear-gradient(135deg, #064e3b, #0f3b5a); }
.hero::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 14px 14px; mask-image: linear-gradient(120deg, transparent 30%, #000); pointer-events: none; }
.hero h2 { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
.hero h2 small { font-size: 1rem; font-weight: 600; opacity: .7; margin-left: 4px; }
.hero .muted { color: rgba(255, 255, 255, .75); }
.hero .pill { background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(6px); }
.hero .pill.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, .25); }
.hero .bar { background: rgba(255, 255, 255, .18); }
.hero .bar i { background: linear-gradient(90deg, #6ee7b7, #fde68a); }
.hero-top { display: flex; gap: 8px; }
.hero .tiny { opacity: .85; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 8px; }
.stat b small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.stat > small { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
.stat-ico .ic { width: 18px; height: 18px; }
.stat-ico.or { background: color-mix(in srgb, var(--or) 15%, transparent); color: var(--or); }
.stat-ico.vi { background: color-mix(in srgb, var(--vi) 15%, transparent); color: var(--vi); }
.stat-ico.gr { background: var(--pri-soft); color: var(--pri); }
.stat-ico.bl { background: color-mix(in srgb, var(--bl) 15%, transparent); color: var(--bl); }
.target { display: flex; align-items: center; gap: 12px; }
.target > div { flex: 1; min-width: 0; }
.target h3 { font-size: 1.15rem; margin: 4px 0 2px; }
.go { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--pri), var(--pri-2)); color: var(--pri-ink); flex: none; }
.habits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.habit { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid transparent; text-align: left; transition: background .2s, border-color .2s; }
.habit span { font-size: 13px; font-weight: 600; line-height: 1.3; }
.habit em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }
.habit.on { background: var(--pri-soft); border-color: color-mix(in srgb, var(--pri) 35%, transparent); }
.habit.on .ic, .habit.on em { color: var(--pri); }
.aot .ar { margin: 10px 0 8px; font-size: 1.6rem; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.q-i { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 11px; font-weight: 600; text-align: center; color: var(--muted); }
.q-i .ic { color: var(--pri); }
.install { display: flex; align-items: center; gap: 12px; }
.install small { display: block; color: var(--muted); font-size: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-top: 10px; }
.kpis > div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.kpis b { display: block; font-size: 1.4rem; font-weight: 800; }
.kpis b small { font-size: .85rem; color: var(--muted); }
.kpis > div > small { color: var(--muted); font-size: 12px; font-weight: 600; }
.card.kpis { margin-top: 0; }
.mini-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.mini { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 14px; text-align: left; width: 100%; }
.mini.on, .mini:hover { background: var(--surface-2); }
.mini small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 16px; }

/* ---------- tabs & lists ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.tabs a.on { background: var(--text); color: var(--bg); border-color: transparent; }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item.active { background: var(--pri-soft); }
.item b { display: block; font-weight: 700; font-size: 14px; }
.item small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .txt { text-align: left; }
.item .txt .bar { margin-top: 6px; height: 5px; }
.num { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; font-size: 13px; flex: none; color: var(--muted); }
.st { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; flex: none; transition: background .2s; }
.st .ic { width: 13px; height: 13px; stroke-width: 3; }
.st.s0 { background: var(--surface-2); color: var(--muted); }
.st.s1 { background: color-mix(in srgb, var(--mid) 16%, transparent); color: var(--mid); }
.st.s2 { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge { min-width: 42px; height: 34px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-2); flex: none; font-variant-numeric: tabular-nums; }
.badge.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge.mid { background: color-mix(in srgb, var(--mid) 16%, transparent); color: var(--mid); }
.badge.low { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.sum { display: flex; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid var(--line); }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--pri) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring > div { width: 68px; height: 68px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring b { font-size: 1.1rem; font-weight: 800; line-height: 1; }
.ring small { font-size: 10px; color: var(--muted); }

/* ---------- arabic ---------- */
.ar { font-family: var(--ar); direction: rtl; text-align: right; font-size: 1.55rem; line-height: 2.1; }
.ar.big { font-size: 1.85rem; line-height: 2.25; }
.ar.xl { font-size: 2.6rem; text-align: center; line-height: 1.6; }
.ar-sm { font-family: var(--ar); font-size: 1.3rem; color: var(--muted); direction: rtl; flex: none; }
.basmalah { text-align: center; font-size: 1.8rem; color: var(--pri); }
.lat { color: var(--pri); font-size: 14px; font-style: italic; margin-top: 4px; }
.arti { color: var(--muted); font-size: 14px; margin-top: 6px; }
.hide { display: none; }

/* ---------- materi ---------- */
.grid-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.sc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.sc b { display: block; font-size: 14px; }
.sc small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc > .ic { color: var(--muted); }
.kj { display: flex; flex-direction: column; gap: 8px; }
.kj b { font-size: 1.05rem; }
.tag { align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 8px; border-radius: 8px; background: color-mix(in srgb, var(--vi) 14%, transparent); color: var(--vi); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
.chip .ic { width: 14px; height: 14px; }
.chip.on { background: var(--pri-soft); color: var(--pri); border-color: color-mix(in srgb, var(--pri) 40%, transparent); }
.chips.sel { max-height: 260px; overflow-y: auto; margin-bottom: 12px; }
.toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.tg { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.tg .ic { width: 15px; height: 15px; }
.tg.on { background: var(--pri-soft); color: var(--pri); border-color: color-mix(in srgb, var(--pri) 35%, transparent); }
.parts { display: flex; flex-direction: column; gap: 12px; }
.part .ar { margin: 6px 0; }
.dalil { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.dalil .ic { width: 15px; height: 15px; margin-top: 2px; color: var(--pri); }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; background: color-mix(in srgb, var(--acc) 10%, var(--surface)); border-color: color-mix(in srgb, var(--acc) 30%, transparent); flex-direction: column; }
.note .ic { color: var(--acc); }
.refs { font-size: 13px; }
.refs a { color: var(--pri); font-weight: 600; }
.memorize .ar { filter: blur(7px); transition: filter .25s; cursor: pointer; user-select: none; }
.memorize .ar.shown { filter: none; }
.article { display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.7; }
.article h3 { margin-top: 6px; font-size: 1.05rem; }
blockquote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--pri); background: var(--pri-soft); border-radius: 0 14px 14px 0; font-weight: 500; }
blockquote cite { display: block; margin-top: 6px; font-size: 12px; font-style: normal; color: var(--muted); font-weight: 600; }
.bul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.tbl { display: flex; flex-direction: column; gap: 8px; }
.tbl > div { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; }
.tbl b { font-size: 14px; }
.tbl small { grid-row: 2; color: var(--muted); font-size: 12px; }
.tbl .ar-sm { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--pri); font-size: 1.25rem; max-width: 50vw; text-align: right; }

/* ---------- surah reader ---------- */
.surah-head { display: flex; flex-direction: column; gap: 12px; }
.ctrls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sel { display: inline-flex; align-items: center; gap: 6px; padding: 0 0 0 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.sel select { border: 0; background: transparent; padding: 10px 12px 10px 0; width: auto; max-width: 190px; }
.ayats { display: flex; flex-direction: column; gap: 10px; }
.ayat { display: flex; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, background .2s; scroll-margin: 90px; }
.ayat.playing { border-color: var(--pri); background: color-mix(in srgb, var(--pri) 6%, var(--surface)); }
.ay-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ay-n { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 4px; border-radius: 10px; font: 700 12px var(--font); background: var(--pri-soft); color: var(--pri); }
.ayat .icon-btn.sm .ic { width: 14px; height: 14px; }

/* ---------- ujian ---------- */
.qtypes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.qt { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); transition: transform .15s; }
.qt:first-child { grid-column: 1 / -1; background: linear-gradient(135deg, color-mix(in srgb, var(--vi) 18%, var(--surface)), color-mix(in srgb, var(--bl) 14%, var(--surface))); }
.qt:active { transform: scale(.98); }
.qt .ic { color: var(--vi); margin-bottom: 4px; }
.qt b { font-size: 14px; }
.qt small { font-size: 12px; color: var(--muted); }
.cta { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #064e3b, #0f3b5a); color: #fff; border: 0; }
.cta small { display: block; color: rgba(255, 255, 255, .75); font-size: 12px; }
.spark { width: 100%; height: 60px; display: block; padding: 0 16px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--pri); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.quiz-q { display: flex; flex-direction: column; gap: 6px; }
.quiz-q h3 { font-size: 1.2rem; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { width: 100%; text-align: left; padding: 12px 16px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); transition: border-color .2s, background .2s, transform .1s; }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt:disabled { opacity: 1; cursor: default; }
.opt.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.opt.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.opt.dim { opacity: .5; }
.opt-ar { font-size: 1.35rem; line-height: 2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.opt-ar.big { font-size: 1.7rem; -webkit-line-clamp: unset; display: block; }
.urut-picked { display: flex; flex-direction: column; gap: 8px; }
.up { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: var(--pri-soft); }
.up > span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); font-weight: 800; font-size: 12px; flex: none; }
.up .opt-ar { flex: 1; }
.up.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.up.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.feedback { position: sticky; bottom: calc(90px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 18px; font-weight: 700; box-shadow: var(--shadow); animation: up .25s ease-out; }
.feedback.ok { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); }
.feedback.bad { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--bad); }
.feedback .btn { flex: none; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }
.result { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-top: 40px; padding: 28px 18px; }
.result .ring { width: 140px; height: 140px; }
.result .ring > div { width: 116px; height: 116px; }
.result .ring b { font-size: 2.4rem; }
.result h2 { font-size: 1.3rem; margin-top: 8px; }
.result .two { width: 100%; margin-top: 10px; }
.key summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--pri); list-style: none; }
.key summary::-webkit-details-marker { display: none; }
.key .ar { margin-top: 8px; }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grade .btn { padding: 16px 10px; }

/* ---------- pembiasaan ---------- */
.hgrid { display: grid; grid-template-columns: minmax(84px, 1.4fr) repeat(7, minmax(30px, 1fr)); gap: 6px; margin-top: 14px; align-items: center; }
.hd { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.hd small { display: block; font-size: 13px; color: var(--text); }
.hd.today small { color: var(--pri); }
.hl { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1.2; }
.hl .ic { width: 16px; height: 16px; color: var(--pri); }
.hc { aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; transition: background .15s; }
.hc .ic { width: 16px; height: 16px; stroke-width: 3; }
.hc.on { background: var(--pri); color: var(--pri-ink); }
.hc.lv1 { background: color-mix(in srgb, var(--pri) 25%, var(--surface-2)); color: var(--text); }
.hc.lv2 { background: color-mix(in srgb, var(--pri) 45%, var(--surface-2)); color: var(--text); }
.hc.lv3 { background: color-mix(in srgb, var(--pri) 65%, var(--surface-2)); }
.hc.lv4 { background: color-mix(in srgb, var(--pri) 82%, var(--surface-2)); color: var(--pri-ink); }
.hc.lv5 { background: var(--pri); color: var(--pri-ink); }
@media (max-width: 380px) { .hl span { display: none; } .hgrid { grid-template-columns: 28px repeat(7, 1fr); } }

/* ---------- raport ---------- */
.raport { display: flex; flex-direction: column; gap: 10px; }
.raport header { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.raport header h2 { font-size: 1.15rem; }
.raport h3 { margin-top: 10px; font-size: .95rem; }
.raport h3 .muted { font-weight: 600; font-size: 12px; }
.idt { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; margin: 0; }
.idt dt { color: var(--muted); font-weight: 600; }
.idt dd { margin: 0; font-weight: 700; }
.levels { display: flex; flex-wrap: wrap; gap: 6px; }
.lv { padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid transparent; }
.lv.on { background: var(--pri); color: var(--pri-ink); }
.rl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rl li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.rl li b { flex: none; font-size: 12px; }
.rl b.s0 { color: var(--muted); } .rl b.s1 { color: var(--mid); } .rl b.s2 { color: var(--ok); }
.rl.cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.legend { margin-top: 6px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
  padding: 10px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; max-width: calc(100% - 32px); transition: opacity .25s, transform .25s; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { bottom: 24px; } .feedback { bottom: 16px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f4f6; --text: #000; --muted: #555; --line: #ddd; --shadow: none; color-scheme: light; }
  body { background: #fff; }
  .nav, .side, .top, .no-print, .actions, .toast { display: none !important; }
  #app { display: block; }
  .view { max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .rl.cols { grid-template-columns: 1fr 1fr 1fr; }
  .lv:not(.on) { display: none; }
  .lv.on { background: none; color: #000; padding: 0; font-size: 14px; font-weight: 700; }
  .raport h3 { break-after: avoid; }
}
.cta.slim { padding: 12px 16px; }

/* sifat shalat */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: st; display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.steps li::before { content: counter(st); flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--pri); color: var(--pri-ink); }
.steps b { display: block; font-size: 15px; }
.steps p { font-size: 14px; line-height: 1.6; margin-top: 2px; }
.steps cite { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 12px; font-style: normal; color: var(--muted); }
.steps cite .ic { width: 13px; height: 13px; margin-top: 2px; color: var(--pri); }
.src { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); padding-top: 12px; border-top: 1px dashed var(--line); }
.src .ic { width: 15px; height: 15px; color: var(--pri); margin-top: 2px; }
.books { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.book { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.book b { display: block; font-size: 14px; }
.book small { display: block; font-size: 12px; }
.book > .ic:first-child { color: var(--vi); }

/* auth & admin */
.pw { position: relative; }
.pw input { padding-right: 48px !important; }
.pw .icon-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; }
.form-err { color: var(--bad); font-size: 13px; font-weight: 600; min-height: 0; }
.form-err:empty { display: none; }
.linkbox { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.linkbox code { flex: 1 1 100%; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 12px; word-break: break-all; border: 1px dashed var(--line); }
.syncd { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ok); opacity: .8; transition: background .2s; }
.syncd.saving { background: var(--mid); animation: pulse 1s infinite; }
.syncd.offline { background: var(--bad); }
.badge.sm { min-width: 0; height: auto; padding: 1px 6px; font-size: 11px; display: inline-block; border-radius: 6px; }
.item.inactive { opacity: .55; }
.adm-act { display: flex; gap: 4px; flex: none; }
#kq { flex: 1 1 200px; }
