/* ============ Fonts (lokal) ============ */
@font-face { font-family: 'Geist'; src: url('../fonts/geist-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist'; src: url('../fonts/geist-latin-ext-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; src: url('../fonts/geist-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

/* ============ Token ============ */
:root {
  color-scheme: light dark;
  --bg: #f6f6f7; --surface: #ffffff; --raised: #f0f0f2; --sunken: #ececef;
  --line: #e4e4e8; --line-2: #d3d3da;
  --fg: #0d0d11; --dim: #585863; --faint: #8a8a96;
  --accent: #d93a12; --accent-hi: #b92e0a; --on-accent: #ffffff; --accent-bg: rgba(217,58,18,.09); --accent-line: rgba(217,58,18,.3);
  --ok: #17874f; --ok-bg: rgba(23,135,79,.1);
  --err: #c4262e; --err-bg: rgba(196,38,46,.09);
  --code-bg: #f0f0f3; --code-fg: #1b1b22;
  --hl-kw: #b4306b; --hl-str: #17794a; --hl-num: #a45a00; --hl-com: #8a8a96; --hl-fn: #2858b8;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --cjk: 'Geist', 'Hiragino Sans', 'PingFang SC', 'Noto Sans CJK JP', 'Noto Sans CJK KR', 'Noto Sans CJK SC', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans SC', 'Malgun Gothic', 'Yu Gothic', 'Microsoft YaHei', 'Noto Naskh Arabic', 'Geeza Pro', 'Segoe UI', sans-serif;
  --r1: 10px; --r2: 14px; --r3: 22px;
  --ease: cubic-bezier(.2,.8,.2,1); --ease-in-out: cubic-bezier(.76,0,.24,1);
  --fast: .16s; --mid: .28s; --slow: .6s;
  --top: 0px; --bottom: 0px;
  --dock-h: 64px;
}
:root[data-theme='dark'] {
  --bg: #0a0a0d; --surface: #131317; --raised: #1a1a20; --sunken: #0f0f13;
  --line: #24242c; --line-2: #34343e;
  --fg: #f3f3f6; --dim: #a2a2ae; --faint: #70707c;
  --accent: #ff6236; --accent-hi: #ff7d55; --on-accent: #1a0803; --accent-bg: rgba(255,98,54,.12); --accent-line: rgba(255,98,54,.35);
  --ok: #3ccf86; --ok-bg: rgba(60,207,134,.12);
  --err: #ff6b72; --err-bg: rgba(255,107,114,.12);
  --code-bg: #0e0e12; --code-fg: #e8e8ee;
  --hl-kw: #ff8fb8; --hl-str: #7fe0ad; --hl-num: #ffbd6e; --hl-com: #70707c; --hl-fn: #8db4ff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a0a0d; --surface: #131317; --raised: #1a1a20; --sunken: #0f0f13;
    --line: #24242c; --line-2: #34343e;
    --fg: #f3f3f6; --dim: #a2a2ae; --faint: #70707c;
    --accent: #ff6236; --accent-hi: #ff7d55; --on-accent: #1a0803; --accent-bg: rgba(255,98,54,.12); --accent-line: rgba(255,98,54,.35);
    --ok: #3ccf86; --ok-bg: rgba(60,207,134,.12);
    --err: #ff6b72; --err-bg: rgba(255,107,114,.12);
    --code-bg: #0e0e12; --code-fg: #e8e8ee;
    --hl-kw: #ff8fb8; --hl-str: #7fe0ad; --hl-num: #ffbd6e; --hl-com: #70707c; --hl-fn: #8db4ff;
  }
}

/* ============ Dasar ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overscroll-behavior-y: none;
  min-height: 100dvh;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[lang='ja'], [lang='ko'], [lang='zh'], [lang='zh-CN'], [lang='ar'] { font-family: var(--cjk); }
[dir='rtl'] { text-align: right; }

/* ============ Kerangka ============ */
#app { max-width: 600px; margin: 0 auto; padding: calc(var(--top) + 8px) 16px calc(var(--dock-h) + var(--bottom) + 36px); }
.view { animation: view-in var(--mid) var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; gap: 8px; min-height: 48px; position: sticky; top: var(--top); z-index: 20; margin: 0 -16px 8px; padding: 6px 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.topbar .title { font-weight: 600; font-size: 15px; letter-spacing: -.01em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 36px; height: 36px; border-radius: var(--r1); display: grid; place-items: center; color: var(--dim); transition: background var(--fast), color var(--fast), transform .08s; }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) { .iconbtn:hover { background: var(--raised); color: var(--fg); } }
.scrollbar { position: fixed; top: 0; left: 0; height: 2px; background: var(--accent); width: 100%; transform-origin: 0 50%; transform: scaleX(0); z-index: 60; pointer-events: none; }

.eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.h-xl { font-size: clamp(30px, 8.4vw, 42px); line-height: 1.04; letter-spacing: -.035em; font-weight: 650; }
.h-lg { font-size: 24px; line-height: 1.15; letter-spacing: -.025em; font-weight: 650; }
.h-md { font-size: 17px; line-height: 1.3; letter-spacing: -.012em; font-weight: 600; }
.lead { color: var(--dim); font-size: 15px; max-width: 46ch; }
.small { font-size: 13px; color: var(--dim); }
.stack > * + * { margin-top: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }

/* ============ Kartu & tombol ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: 16px; }
:where(.card.tap) { display: block; width: 100%; text-align: left; }
.card.tap { transition: border-color var(--fast), transform .1s var(--ease), background var(--fast); }
.card.tap:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { .card.tap:hover { border-color: var(--line-2); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r2); font-weight: 600; font-size: 14.5px; letter-spacing: -.005em; transition: background var(--fast), transform .08s, border-color var(--fast), opacity var(--fast); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
@media (hover: hover) and (pointer: fine) { .btn-primary:hover { background: var(--accent-hi); } }
.btn-quiet { background: var(--surface); border: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) { .btn-quiet:hover { border-color: var(--line-2); } }
.btn-ghost { color: var(--dim); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--dim); background: var(--surface); white-space: nowrap; transition: all var(--fast); }
.chip[aria-pressed='true'] { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.chip.static { pointer-events: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.tag { font: 500 11px/1 var(--mono); letter-spacing: .04em; padding: 5px 7px; border-radius: 6px; background: var(--raised); color: var(--dim); }
.tag.lv { background: var(--accent-bg); color: var(--accent); }

/* ============ Beranda ============ */
.hero { padding: 20px 0 22px; }
.hero .h-xl { margin: 10px 0 12px; }
.resume { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; }
.resume .t { font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.ring { position: relative; width: var(--s, 52px); height: var(--s, 52px); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: var(--w, 5); }
.ring .bg { stroke: var(--raised); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring .n { position: absolute; inset: 0; display: grid; place-items: center; font: 600 12px/1 var(--mono); letter-spacing: -.02em; }

.cats { display: grid; gap: 12px; margin-top: 18px; }
.cat { position: relative; overflow: hidden; padding: 20px; min-height: 148px; display: flex; flex-direction: column; justify-content: space-between; }
.cat .mono-big { font: 600 40px/1 var(--mono); letter-spacing: -.06em; color: var(--accent); }
.cat[data-kind='language'] .mono-big { font-family: var(--cjk); letter-spacing: 0; font-weight: 500; }
.cat .foot { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 22px; }
.cat .arrow { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--dim); transition: all var(--mid) var(--ease); flex: none; }
.cat .arrow svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .cat:hover .arrow { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: translateX(3px); } }

/* ============ Daftar track ============ */
.track-item { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; padding: 16px; }
.mono-badge { width: 52px; height: 52px; border-radius: var(--r2); background: var(--raised); display: grid; place-items: center; font: 600 17px/1 var(--mono); letter-spacing: -.04em; overflow: hidden; }
[data-kind='language'] .mono-badge { font-family: var(--cjk); font-size: 22px; letter-spacing: 0; font-weight: 500; }
.track-item .t { font-weight: 600; font-size: 16px; letter-spacing: -.015em; }
.track-item .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12.5px; color: var(--faint); }
.pips { display: flex; gap: 4px; margin-top: 12px; }
.pips i { flex: 1; height: 4px; border-radius: 4px; background: var(--raised); position: relative; overflow: hidden; }
.pips i::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .9s var(--ease); }

.soon { text-align: center; padding: 36px 20px; color: var(--dim); }
.soon .big { font: 600 28px/1 var(--mono); color: var(--faint); margin-bottom: 12px; }

/* ============ Track: tangga & roadmap ============ */
.th { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 6px 0 18px; }
.th .h-xl { font-size: clamp(30px, 8vw, 38px); }
.stairs { display: flex; align-items: end; gap: 6px; height: 96px; margin: 4px 0 6px; }
.stairs .s { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: end; gap: 7px; height: 100%; }
.stairs .bar { position: relative; border-radius: 6px 6px 3px 3px; background: var(--raised); overflow: hidden; height: var(--h); }
.stairs .bar::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform-origin: 50% 100%; transform: scaleY(var(--p, 0)); transition: transform 1s var(--ease) calc(var(--i, 0) * 70ms); }
.stairs .bar.full::after { background: var(--ok); }
.stairs .lb { font: 500 10.5px/1 var(--mono); color: var(--faint); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; margin: 14px 0; }
.stats > div { background: var(--surface); padding: 12px 14px; }
.stats b { display: block; font: 600 19px/1.2 var(--mono); letter-spacing: -.04em; }
.stats span { font-size: 12px; color: var(--faint); }

.goal { margin: 16px 0 4px; }
.goal .eyebrow { margin-bottom: 8px; display: block; }

.road { position: relative; margin-top: 18px; padding-left: 40px; }
.road::before { content: ''; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; background: var(--line); border-radius: 2px; }
.road::after { content: ''; position: absolute; left: 13px; top: 14px; width: 2px; height: var(--fill, 0px); background: var(--accent); border-radius: 2px; transition: height 1.1s var(--ease); }
.stage { position: relative; margin-bottom: 14px; }
.node { position: absolute; left: -40px; top: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); display: grid; place-items: center; font: 600 11px/1 var(--mono); color: var(--faint); z-index: 1; transition: all var(--mid) var(--ease); }
.stage[data-state='active'] .node { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 5px var(--accent-bg); }
.stage[data-state='done'] .node { background: var(--ok); border-color: var(--ok); color: #fff; }
.node svg { width: 14px; height: 14px; }
.stage-head { width: 100%; text-align: left; display: block; padding: 14px 16px; }
.stage-head .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage-head .t { font-weight: 600; font-size: 16px; letter-spacing: -.015em; }
.stage-head .g { color: var(--dim); font-size: 13.5px; margin-top: 8px; }
.stage-head .foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.bar-s { flex: 1; height: 4px; background: var(--raised); border-radius: 4px; overflow: hidden; position: relative; }
.bar-s::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .8s var(--ease); }
.stage[data-state='done'] .bar-s::after { background: var(--ok); }
.chev { width: 18px; height: 18px; color: var(--faint); transition: transform var(--mid) var(--ease); flex: none; }
.stage[data-open='true'] .chev { transform: rotate(180deg); }
.stage-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--mid) var(--ease); }
.stage[data-open='true'] .stage-body { grid-template-rows: 1fr; }
.stage-body > div { overflow: hidden; }
.outcomes { margin: 4px 0 0; padding: 12px 16px 4px; font-size: 13.5px; color: var(--dim); list-style: none; }
.outcomes li { position: relative; padding-left: 16px; margin-bottom: 6px; }
.outcomes li::before { content: ''; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.lessons { list-style: none; margin: 8px 0 0; padding: 0; }
.lesson { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 11px 16px; border-top: 1px solid var(--line); transition: background var(--fast), opacity var(--fast); }
.lesson:active { background: var(--raised); }
.lesson .t { font-weight: 500; font-size: 14.5px; letter-spacing: -.005em; line-height: 1.35; }
.lesson .m { font: 500 11.5px/1 var(--mono); color: var(--faint); }
.dim-out .lesson:not(.core) { opacity: .42; }
.lesson.core .t::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: middle; }
.chk { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; transition: all var(--fast); }
.chk svg { width: 13px; height: 13px; }
.chk.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk.pop { animation: pop .38s var(--ease); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.quiz-row { padding: 14px 16px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.quiz-row .t { font-weight: 600; font-size: 14.5px; }

/* ============ Pelajaran ============ */
.lh { padding: 8px 0 18px; }
.lh .h-lg { margin: 10px 0 10px; font-size: 26px; }
.sec { margin-top: 22px; }
.sec > .eyebrow { display: block; margin-bottom: 10px; }
.points { list-style: none; padding: 0; margin: 0; counter-reset: p; }
.points li { counter-increment: p; position: relative; padding: 0 0 12px 34px; font-size: 15px; }
.points li::before { content: counter(p); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 7px; background: var(--raised); display: grid; place-items: center; font: 600 11px/1 var(--mono); color: var(--dim); }
.points li code, .inl { font: 500 .88em var(--mono); background: var(--raised); padding: 2px 5px; border-radius: 5px; }

.code { border-radius: var(--r2); background: var(--code-bg); border: 1px solid var(--line); overflow: hidden; }
.code .bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.code .bar span { font: 500 11px/1 var(--mono); color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.code pre { margin: 0; padding: 14px; overflow-x: auto; font: 400 13px/1.65 var(--mono); color: var(--code-fg); tab-size: 2; }
.code .note { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--dim); }
.code .k { color: var(--hl-kw); } .code .s { color: var(--hl-str); } .code .n { color: var(--hl-num); } .code .c { color: var(--hl-com); font-style: italic; } .code .f { color: var(--hl-fn); }
.copy { height: 28px; padding: 0 10px; border-radius: 8px; font: 500 12px/1 var(--font); color: var(--dim); transition: background var(--fast), color var(--fast); }
@media (hover: hover) and (pointer: fine) { .copy:hover { background: var(--raised); color: var(--fg); } }

.callout { border-radius: var(--r2); padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); }
.callout.practice { border-color: var(--accent-line); background: var(--accent-bg); }
.callout .eyebrow { color: var(--accent); display: block; margin-bottom: 6px; }
.callout.tip .eyebrow { color: var(--faint); }

.phrases { display: grid; gap: 10px; }
.phrase { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: start; padding: 14px 16px; }
.phrase .t { font-size: 22px; line-height: 1.35; font-weight: 500; letter-spacing: -.01em; word-break: break-word; }
.phrase .r { font: 500 13.5px/1.4 var(--mono); color: var(--accent); margin-top: 4px; letter-spacing: -.01em; }
.phrase .id { color: var(--dim); font-size: 14px; margin-top: 6px; }
.phrase .nt { grid-column: 1 / -1; font-size: 12.5px; color: var(--faint); border-top: 1px dashed var(--line); padding-top: 8px; }
.speak { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--dim); transition: all var(--fast); flex: none; }
.speak svg { width: 18px; height: 18px; }
.speak.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) and (pointer: fine) { .speak:hover { border-color: var(--accent); color: var(--accent); } }
.phrase[dir='rtl'] .t { text-align: right; }
.phrase[dir='rtl'] { direction: ltr; }

.lnav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; }

/* ============ Kuis ============ */
.qprog { display: flex; gap: 4px; margin: 6px 0 22px; }
.qprog i { flex: 1; height: 4px; border-radius: 4px; background: var(--raised); transition: background var(--mid); }
.qprog i.on { background: var(--accent); } .qprog i.ok { background: var(--ok); } .qprog i.bad { background: var(--err); }
.q { font-size: 19px; line-height: 1.4; letter-spacing: -.015em; font-weight: 600; margin-bottom: 18px; }
.opts { display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; text-align: left; width: 100%; padding: 13px 14px; border-radius: var(--r2); border: 1px solid var(--line); background: var(--surface); transition: border-color var(--fast), background var(--fast), transform .08s; }
.opt:active { transform: scale(.985); }
.opt .l { width: 26px; height: 26px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; font: 600 12px/1 var(--mono); color: var(--dim); }
.opt .x { padding-top: 2px; font-size: 14.5px; }
@media (hover: hover) and (pointer: fine) { .opt:not([disabled]):hover { border-color: var(--line-2); } }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); } .opt.ok .l { background: var(--ok); color: #fff; }
.opt.bad { border-color: var(--err); background: var(--err-bg); } .opt.bad .l { background: var(--err); color: #fff; }
.opt[disabled] { pointer-events: none; }
.opt[disabled]:not(.ok):not(.bad) { opacity: .55; }
.why { margin-top: 14px; padding: 14px 16px; border-radius: var(--r2); font-size: 14px; animation: view-in var(--mid) var(--ease) both; }
.why.ok { background: var(--ok-bg); } .why.bad { background: var(--err-bg); }
.why b { display: block; margin-bottom: 4px; }
.result { text-align: center; padding: 28px 0 8px; }
.result .ring { --s: 132px; --w: 8px; margin: 0 auto 18px; }
.result .ring .n { font-size: 30px; letter-spacing: -.05em; }

/* ============ Progres ============ */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { padding: 14px; }
.kpi b { display: block; font: 600 26px/1.1 var(--mono); letter-spacing: -.05em; }
.kpi span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.3; color: var(--faint); }
.heat { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; grid-template-rows: repeat(7, 15px); gap: 4px; }
.heat i { border-radius: 4px; background: var(--raised); }
.heat i[data-l='1'] { background: color-mix(in srgb, var(--accent) 28%, var(--raised)); }
.heat i[data-l='2'] { background: color-mix(in srgb, var(--accent) 55%, var(--raised)); }
.heat i[data-l='3'] { background: var(--accent); }
.heat i.fut { background: transparent; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); margin-top: 10px; justify-content: flex-end; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.prow { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; padding: 14px 16px; }

/* ============ Dock, toast, skeleton ============ */
.dock { position: fixed; left: 50%; bottom: calc(var(--bottom) + 12px); transform: translateX(-50%); z-index: 40; display: flex; gap: 4px; padding: 5px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.dock button { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 99px; font-weight: 600; font-size: 14px; color: var(--dim); transition: all var(--mid) var(--ease); }
.dock button svg { width: 19px; height: 19px; }
.dock button[aria-current='page'] { background: var(--fg); color: var(--bg); }
.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + var(--bottom) + 28px); transform: translate(-50%, 16px); opacity: 0; z-index: 80; background: var(--fg); color: var(--bg); padding: 11px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 500; pointer-events: none; transition: all var(--mid) var(--ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.skel { border-radius: var(--r2); background: linear-gradient(100deg, var(--raised) 30%, var(--sunken) 50%, var(--raised) 70%); background-size: 220% 100%; animation: sh 1.4s linear infinite; }
@keyframes sh { to { background-position: -220% 0; } }
.err-box { text-align: center; padding: 40px 16px; }

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

/* ---- cincin: panjang lingkar dari --c, isi dari --p ---- */
.ring .fg { stroke-dasharray: var(--c); stroke-dashoffset: calc(var(--c) * (1 - var(--p, 0))); }
.back { margin-left: -8px; }
html.in-tg .topbar .back { display: none; }

/* ============ Latihan, banner, pengaturan ============ */
.dock button { padding: 0 14px; gap: 6px; }
.dock button span { display: none; }
.dock button[aria-current='page'] span { display: inline; }
.prow { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; }
.tier { padding: 16px; transition: border-color var(--fast); }
.tier.locked { background: var(--sunken); }
.tier.locked .h-md, .tier.locked .tag { opacity: .55; }
.tier-head { display: flex; align-items: center; gap: 12px; }
.tier-head .tag { min-width: 26px; text-align: center; }
.tier-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tier-actions .btn { flex: 1 1 0; min-width: 120px; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; min-width: 0; flex: 0 1 auto; }
.score { font: 600 13px/1 var(--mono); padding: 7px 10px; border-radius: 99px; background: var(--raised); color: var(--dim); }
.score.good { background: var(--ok-bg); color: var(--ok); }
.lockrow { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.lockico { width: 34px; height: 34px; border-radius: var(--r1); background: var(--raised); display: grid; place-items: center; color: var(--faint); flex: none; }
.lockico svg { width: 17px; height: 17px; }
.bar { height: 4px; border-radius: 4px; background: var(--raised); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); width: calc(var(--p, 0) * 100%); transition: width var(--slow) var(--ease); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: var(--r2); border: 1px solid var(--line); background: var(--surface); }
.banner b { display: block; font-size: 14px; margin-bottom: 2px; }
.banner .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); margin-top: 5px; flex: none; }
.banner.ok .dot { background: var(--ok); } .banner.warn { border-color: var(--accent-line); background: var(--accent-bg); } .banner.warn .dot { background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.pill { font: 600 11px/1 var(--mono); padding: 6px 9px; border-radius: 99px; background: var(--raised); color: var(--dim); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--accent-bg); color: var(--accent); } .pill.bad { background: var(--err-bg); color: var(--err); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; gap: 4px; border-radius: var(--r2); background: var(--raised); }
.seg button { height: 38px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--dim); transition: all var(--fast); }
.seg button[aria-checked='true'] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.switch { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r2); border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 44px; height: 26px; border-radius: 99px; background: var(--line-2); position: relative; transition: background var(--fast); flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--mid) var(--ease); }
.switch input:checked + .grow + i { background: var(--accent); } .switch input:checked + .grow + i::after { transform: translateX(18px); }
.switch input:focus-visible + .grow + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--dim); }
.form input, .form select { height: 44px; padding: 0 12px; border-radius: var(--r1); border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); font: 400 15px var(--font); min-width: 0; }
.form input:focus, .form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.agent .tier-actions .btn { flex: 0 1 auto; }
code { font: 500 .9em var(--mono); background: var(--raised); padding: 2px 5px; border-radius: 5px; }

/* ============ Visualisasi pelajaran ============ */
.viz { margin: 10px 0 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 8px 24px -18px rgba(0,0,0,.25); }
.vhead { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.vdot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.vcap { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--dim); line-height: 1.55; }
.viz code { font-size: .88em; }

/* deretan */
.v-seq { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; }
.v-seq .cell { flex: 1 0 46px; max-width: 84px; text-align: center; }
.v-seq .ptr { height: 30px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; color: var(--accent); }
.v-seq .ptr span { font: 600 10.5px/1.2 var(--mono); white-space: nowrap; }
.v-seq .ptr i { display: block; width: 0; height: 0; margin: 3px 0 4px; border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0; }
.v-seq .val { height: 48px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--r1); background: var(--raised); font-size: 15px; font-weight: 600; padding: 0 4px; overflow: hidden; white-space: nowrap; }
.v-seq .mark .val { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent-line); }
.v-seq .ptd .val { border-color: var(--accent-line); }
.v-seq .idx { margin-top: 6px; font-size: 11px; color: var(--faint); }
.v-seq.wrap { flex-wrap: wrap; row-gap: 4px; overflow: visible; }
.v-seq.wrap .cell { flex: 0 0 auto; max-width: none; }
.v-seq.wrap .val { padding: 0 12px; }
.v-seq-legend { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 10.5px; color: var(--faint); }
.v-seq-legend span { padding: 2px 6px; border-radius: 5px; background: var(--raised); }

/* alur */
.v-flow { list-style: none; margin: 0; padding: 0; display: grid; }
.v-flow li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding-bottom: 18px; position: relative; animation: vin var(--mid) var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.v-flow li:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent-line), var(--line-2)); }
.v-flow li:not(:last-child)::after { content: ''; position: absolute; left: 10.5px; bottom: 2px; border: 4.5px solid transparent; border-top: 6px solid var(--line-2); border-bottom: 0; }
.v-flow li:last-child { padding-bottom: 0; }
.v-flow .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-line); }
.v-flow li:last-child .n { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.v-flow .body { padding: 5px 0 0; min-width: 0; }
.v-flow b { display: block; font-size: 14.5px; line-height: 1.35; }
.v-flow span { display: block; font-size: 13px; color: var(--dim); margin-top: 3px; line-height: 1.5; }
@keyframes vin { from { opacity: 0; transform: translateY(4px); } }

/* tabel */
.v-table { overflow-x: auto; margin: -4px -16px; padding: 4px 16px; scrollbar-width: thin; }
.v-table table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; line-height: 1.45; }
.v-table thead th { text-align: left; font: 600 10.5px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--dim); padding: 9px 10px; background: var(--raised); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.v-table thead th:first-child { border-top-left-radius: 8px; } .v-table thead th:last-child { border-top-right-radius: 8px; }
.v-table td, .v-table tbody th { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; font-weight: 400; }
.v-table tbody tr:nth-child(even) td, .v-table tbody tr:nth-child(even) th { background: color-mix(in srgb, var(--raised) 45%, var(--surface)); }
.v-table tbody tr:last-child td, .v-table tbody tr:last-child th { border-bottom: 0; }
.v-table.fch tbody th { font-weight: 600; color: var(--fg); position: sticky; left: 0; background: var(--surface); box-shadow: 1px 0 0 var(--line); }

/* hierarki */
.v-tree, .v-tree ul { list-style: none; margin: 0; padding: 0; }
.v-tree ul { margin-left: 14px; padding-left: 18px; position: relative; }
.v-tree ul > li { position: relative; padding-top: 10px; }
.v-tree ul > li::before { content: ''; position: absolute; left: -18px; top: 0; height: 27px; width: 14px; border-left: 1.5px solid var(--line-2); border-bottom: 1.5px solid var(--line-2); border-bottom-left-radius: 7px; }
.v-tree ul > li:not(:last-child)::after { content: ''; position: absolute; left: -18px; top: 0; bottom: 0; border-left: 1.5px solid var(--line-2); }
.v-tree .nd { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--raised); font: 500 13px/1.35 var(--mono); max-width: 100%; overflow-wrap: anywhere; }
.v-tree .br > .nd { background: var(--surface); font-weight: 600; }
.v-tree .nd.root { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.v-tree .nd.root code { background: rgba(255,255,255,.18); color: inherit; }

/* pemetaan kunci -> nilai */
.v-map { display: grid; gap: 8px; }
.v-map .kv { display: grid; grid-template-columns: minmax(0,1fr) 22px minmax(0,1fr); align-items: center; gap: 6px; }
.v-map .k, .v-map .v { padding: 9px 11px; border-radius: var(--r1); border: 1px solid var(--line-2); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; min-height: 40px; display: flex; align-items: center; }
.v-map .k { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); font-weight: 600; }
.v-map .v { background: var(--raised); }
.v-map .ar { display: grid; place-items: center; } .v-map .ar svg { width: 16px; height: 16px; color: var(--accent); opacity: .7; }

/* relasi dua kolom */
.v-rel { display: grid; grid-template-columns: minmax(0,1fr) 64px minmax(0,1fr); row-gap: 8px; align-items: start; }
.v-rel .mh { font: 600 10.5px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--dim); padding: 0 2px; }
.v-rel .mh:nth-child(3) { text-align: right; }
.v-rel .mcol { display: grid; gap: 10px; }
.v-rel .mi { display: flex; align-items: center; padding: 0 11px; border-radius: var(--r1); border: 1px solid var(--line-2); background: var(--raised); font: 500 13px/1.25 var(--mono); overflow: hidden; }
.v-rel .l .mi { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.v-rel .r .mi { justify-content: flex-end; text-align: right; }
.v-rel .mi.off { opacity: .6; border-style: dashed; background: transparent; color: var(--dim); }
.v-rel svg { display: block; overflow: visible; }
.v-rel svg path { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: .75; stroke-dasharray: 200; stroke-dashoffset: 200; animation: vdraw .8s var(--ease) forwards; }
.v-rel svg circle { fill: var(--accent); }
@keyframes vdraw { to { stroke-dashoffset: 0; } }

/* jejak eksekusi */
.v-trace { outline: none; }
.v-trace:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: var(--r1); }
.v-trace .tbar { height: 3px; border-radius: 3px; background: var(--raised); overflow: hidden; margin-bottom: 12px; }
.v-trace .tbar i { display: block; height: 100%; width: calc(var(--k, 1) / var(--n) * 100%); background: var(--accent); border-radius: 3px; transition: width var(--mid) var(--ease); }
.v-trace .tcode { margin: 0; padding: 10px 0; border-radius: var(--r1); max-height: 320px; overflow: auto; font: 400 13px/1.75 var(--mono); }
.v-trace .ln { display: block; padding: 0 12px 0 0; white-space: pre; border-left: 3px solid transparent; transition: background var(--fast); }
.v-trace .ln > i { display: inline-block; width: 30px; text-align: right; margin-right: 12px; color: var(--faint); font-style: normal; user-select: none; }
.v-trace .ln.on { background: var(--accent-bg); border-left-color: var(--accent); }
.v-trace .ln.on > i { color: var(--accent); font-weight: 700; }
.v-trace .tstep { margin: 10px 0 12px; color: var(--dim); }
.v-trace .tstep b { color: var(--fg); }
.v-trace .tgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.v-trace .tpanel { border: 1px solid var(--line); border-radius: var(--r1); padding: 10px; background: var(--surface); min-width: 0; }
.v-trace .th { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.v-trace .tvars { display: flex; flex-wrap: wrap; gap: 6px; }
.v-trace .tv { display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--raised); font-size: 13px; transition: opacity var(--fast); }
.v-trace .tv span { color: var(--dim); } .v-trace .tv b { font-weight: 700; }
.v-trace .tv.gone { opacity: .4; }
.v-trace .tv.chg { animation: vchg 1s var(--ease); border-color: var(--accent); }
.v-trace .tv.chg b { color: var(--accent); }
@keyframes vchg { 0% { background: var(--accent-bg); transform: scale(1.06); } 100% { transform: none; } }
.v-trace .term { background: var(--code-bg); }
.v-trace .tout { margin: 0; min-height: 20px; font-size: 13px; line-height: 1.6; color: var(--ok); white-space: pre-wrap; }
.v-trace .tout.empty { color: var(--faint); font-style: italic; }
.v-trace .tout.new { animation: vin var(--mid) var(--ease); }
.v-trace .tctl { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.v-trace .tctl [data-pos] { flex: 1; text-align: center; color: var(--dim); }
.v-trace .tctl .btn svg { width: 16px; height: 16px; }
.v-trace .tctl .btn-quiet { padding-left: 10px; padding-right: 10px; }
@media (prefers-reduced-motion: reduce) { .v-flow li, .v-rel svg path, .v-trace .tv.chg, .v-trace .tout.new { animation: none; stroke-dashoffset: 0; } }

/* ============ Jalankan contoh, cek pemahaman, kecepatan suara ============ */
.code .bar .row { align-items: center; }
.code .copy.run { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 600; }
.code .copy.run svg { width: 12px; height: 12px; }
.code .copy[disabled] { opacity: .5; }
.runout { border-top: 1px solid var(--line); background: var(--surface); }
.runout .rh { padding: 8px 14px 0; font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.runout pre { margin: 0; padding: 6px 14px 12px; font-size: 13px; line-height: 1.6; color: var(--ok); white-space: pre-wrap; overflow-wrap: anywhere; animation: view-in var(--mid) var(--ease) both; }
.runout pre.err { color: var(--err); }
.checkq .cq { font-weight: 600; font-size: 15px; line-height: 1.45; }
.checkq .opts { display: grid; gap: 8px; }
.checksum { margin-top: 12px; padding: 14px 16px; border-radius: var(--r2); font-size: 14px; line-height: 1.5; animation: view-in var(--mid) var(--ease) both; }
.checksum.ok { background: var(--ok-bg); border: 1px solid var(--ok); }
.checksum.bad { background: var(--err-bg); border: 1px solid var(--err); }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--dim); background: var(--surface); }
.chip-btn svg { width: 14px; height: 14px; }
.chip-btn.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-bg); }
#donebtn.nudge { animation: nudge 1.4s var(--ease) 2; box-shadow: 0 0 0 4px var(--accent-bg); }
@keyframes nudge { 0%, 100% { transform: none; } 30% { transform: scale(1.04); } 60% { transform: scale(.99); } }
@media (prefers-reduced-motion: reduce) { #donebtn.nudge { animation: none; } }
.tag.feat { margin-left: 6px; vertical-align: 2px; font-size: 10.5px; }

/* ============ VPS ============ */
.vsteps { display: grid; gap: 4px; margin-top: 8px; }
.vstep { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.vstep:last-child { border-bottom: 0; }
.vno { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 13px/1 var(--mono); background: var(--raised); color: var(--dim); border: 1px solid var(--line-2); }
.vno svg { width: 15px; height: 15px; }
.vstep.done .vno { background: var(--ok); color: #fff; border-color: var(--ok); }
.vlive { border-color: var(--ok); background: var(--ok-bg); margin-top: 6px; }
.vwarn { border-color: var(--accent-line); background: var(--accent-bg); margin-bottom: 10px; }
.vlog { margin: 10px 0 0; padding: 12px 14px; max-height: 340px; overflow: auto; border-radius: var(--r2); background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--line); font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.form textarea { padding: 10px 12px; border-radius: var(--r1); border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); font: 400 12.5px/1.5 var(--mono); resize: vertical; min-width: 0; }
.seg.seg2 { grid-template-columns: 1fr 1fr; }
.voice-note { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px; color: var(--faint); font-size: 12px; }
.voice-note svg { width: 13px; height: 13px; flex: none; }
