/* English ID — gaya tampilan
   Tema warna diatur lewat atribut data-theme, mode lewat data-mode (light/dark). */
:root {
  --brand: #112A49;
  --accent: #ECC15A;
  --on-brand: #FFFFFF;
  --on-accent: #112A49;

  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --surface-2: #F0EDE6;
  --ink: #14182B;
  --muted: #69708A;
  --line: #E4E0D6;
  --ok: #16915A;
  --ok-soft: #E2F4EA;
  --bad: #D2423F;
  --bad-soft: #FBE7E5;
  --btn: var(--brand);
  --btn-ink: var(--on-brand);
  --shadow: 0 1px 2px rgba(20, 24, 43, .06), 0 6px 18px rgba(20, 24, 43, .06);
  --radius: 20px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
[data-theme="merah"] { --brand: #B3202D; --accent: #FFD166; --on-accent: #4A1016; }
[data-theme="tosca"] { --brand: #0D5C63; --accent: #FFA45C; --on-accent: #3B1D05; }
[data-theme="ungu"]  { --brand: #3A2A6A; --accent: #FF8FA3; --on-accent: #3A0F1A; }

[data-mode="dark"] {
  --bg: #0D1422;
  --surface: #161F31;
  --surface-2: #1E2840;
  --ink: #EEF1F8;
  --muted: #9AA3BC;
  --line: #27324A;
  --ok: #3DCB86;
  --ok-soft: #12321F;
  --bad: #FF7A72;
  --bad-soft: #3A1A1C;
  --btn: var(--accent);
  --btn-ink: var(--on-accent);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; min-height: 100dvh; transition: background .25s; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.fine { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* ---------- Tombol ---------- */
.btn {
  display: block; width: 100%; border: 0; border-radius: 14px;
  padding: 14px 18px; font-weight: 700; font-size: 16px;
  transition: transform .08s, opacity .15s, background .2s;
}
.btn.big { padding: 16px 18px; font-size: 17px; }
.btn.sm { width: auto; padding: 8px 14px; font-size: 14px; }
.btn.primary { background: var(--btn); color: var(--btn-ink); }
.btn.accent { background: var(--accent); color: var(--on-accent); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.link { background: none; color: var(--muted); font-weight: 600; text-decoration: underline; width: auto; margin: 10px auto 0; padding: 6px; }
.danger-text { color: var(--bad) !important; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .38; }
.btn + .btn { margin-top: 10px; }

/* ---------- Avatar ---------- */
.avatar {
  display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  width: 44px; height: 44px; background: var(--accent); color: var(--on-accent); font-weight: 800;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.avatar.md { width: 52px; height: 52px; font-size: 18px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.avatar.xl { width: 120px; height: 120px; font-size: 40px; }
.photo-pick { position: relative; display: inline-block; cursor: pointer; }
.photo-pick .cam {
  position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--btn); color: var(--btn-ink); display: grid; place-items: center; font-size: 16px;
  border: 3px solid var(--bg);
}

/* ---------- Cover ---------- */
.cover {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 70% at 50% 30%, color-mix(in srgb, var(--brand) 82%, #fff) 0%, var(--brand) 55%, color-mix(in srgb, var(--brand) 70%, #000) 100%);
  color: #fff; padding: calc(28px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom));
  position: relative; overflow: hidden;
}
.cover-rays {
  position: absolute; inset: -40%; opacity: .12;
  background: repeating-conic-gradient(from 0deg at 50% 45%, var(--accent) 0deg 4deg, transparent 4deg 18deg);
  animation: spin 60s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cover-center { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.cover-logo { width: min(64vw, 260px); height: auto; border-radius: 50%; box-shadow: 0 0 0 6px rgba(255,255,255,.08), 0 20px 50px rgba(0,0,0,.35); animation: pop .7s cubic-bezier(.3,1.5,.6,1); }
.cover-tag { margin: 26px 0 18px; font-size: 17px; line-height: 1.5; opacity: .92; }
.cover-route { display: flex; align-items: center; gap: 6px; font-size: 24px; }
.cover-route i { width: 26px; border-top: 2px dashed color-mix(in srgb, var(--accent) 80%, transparent); }
.cover-bottom { position: relative; }
.cover-fine { text-align: center; font-size: 13px; opacity: .75; margin: 12px 0 0; }

/* ---------- Onboarding ---------- */
.onboard { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(14px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); }
.ob-top { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; margin-bottom: 26px; }
.ob-step { text-align: right; color: var(--muted); font-weight: 700; font-size: 14px; }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots i { width: 28px; height: 6px; border-radius: 6px; background: var(--line); }
.dots i.on { background: var(--accent); }
.ob-body { flex: 1; }
.ob-body h1 { font-size: 28px; font-weight: 800; }
.lead { color: var(--muted); margin: 8px 0 24px; }
.ob-body > .photo-pick { display: block; width: 120px; margin: 4px auto 0; }
.photo-hint { text-align: center; color: var(--muted); font-size: 14px; margin: 10px 0 18px; }
.photo-hint .btn.link { margin: 0 auto; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 17px; outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.counter { display: block; text-align: right; color: var(--muted); font-size: 13px; margin-top: 6px; }
.counter.over { color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.chip:active { background: var(--surface-2); }
.goal-list { display: grid; gap: 10px; }
.goal-opt {
  display: flex; justify-content: space-between; align-items: center; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px;
}
.goal-opt b { display: block; font-size: 17px; }
.goal-opt small { color: var(--muted); }
.goal-opt em { font-style: normal; font-weight: 800; color: var(--muted); }
.goal-opt.sel { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.goal-opt.sel em { color: var(--ink); }
.ob-foot { padding-top: 18px; }
.ob-foot .btn.link { display: block; }

/* ---------- Topbar & nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.brand img { width: 32px; height: 32px; border-radius: 50%; }
.brand b { color: var(--brand); }
[data-mode="dark"] .brand b { color: var(--accent); }
.stats { display: flex; gap: 6px; }
.pill { font-weight: 700; font-size: 14px; padding: 6px 11px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.pill.fire { color: #E8671A; }
.pill.xp { color: var(--ink); }

.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 10;
  display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav button { background: none; border: 0; padding: 9px 0 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
.bottomnav .ico { font-size: 22px; line-height: 24px; filter: grayscale(1); opacity: .6; }
.bottomnav button.active { color: var(--ink); }
.bottomnav button.active .ico { filter: none; opacity: 1; }
.bottomnav button.active .avatar { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- Beranda ---------- */
.home { padding: 6px 16px calc(96px + env(safe-area-inset-bottom)); }
.hello { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; }
.hello-avatar { background: none; border: 0; padding: 0; border-radius: 50%; }
.hello h2 { font-size: 22px; font-weight: 800; }
.motto { margin: 3px 0 0; font-style: italic; color: var(--muted); font-weight: 600; }
.motto.muted { font-style: normal; }

.today-card { background: var(--brand); color: var(--on-brand); border-radius: var(--radius); padding: 16px; position: relative; overflow: hidden; }
.today-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; border: 18px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.today-row { display: flex; justify-content: space-between; margin-bottom: 10px; position: relative; z-index: 1; }
.today-row span { font-weight: 700; opacity: .85; }
.today-sub { margin: 10px 0 0; font-size: 14px; opacity: .85; position: relative; z-index: 1; }
.bar { height: 10px; background: color-mix(in srgb, currentColor 18%, transparent); border-radius: 999px; overflow: hidden; position: relative; z-index: 1; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .45s ease; }

.koreksi {
  width: 100%; margin: 12px 0 0; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--surface); border: 1.5px dashed color-mix(in srgb, var(--accent) 70%, var(--line)); border-radius: var(--radius); padding: 14px;
}
.k-ico { width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.k-text { flex: 1; }
.k-text b { display: block; }
.k-text small { color: var(--muted); }
.k-go { background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 14px; padding: 7px 14px; border-radius: 999px; }
.koreksi.locked .k-go { background: var(--surface-2); }
.koreksi.locked { opacity: .75; }

.level-head { margin: 26px 0 12px; display: flex; flex-direction: column; gap: 2px; }
.lv { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lv-route { font-weight: 700; font-size: 15px; }

.city { margin-bottom: 8px; }
.city-head { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.city-emoji { width: 52px; height: 52px; border-radius: 16px; background: var(--brand); display: grid; place-items: center; font-size: 28px; flex-shrink: 0; }
.city-text { flex: 1; min-width: 0; }
.city-text small { font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.city-text h3 { font-size: 21px; font-weight: 800; }
.city-text p { margin: 1px 0 0; color: var(--muted); font-size: 14px; }
.city-count { font-weight: 800; font-size: 14px; background: var(--surface-2); padding: 5px 10px; border-radius: 10px; }

.route { list-style: none; margin: 0; padding: 14px 0 6px; position: relative; }
.route::before { content: ""; position: absolute; left: 21px; top: 6px; bottom: 0; border-left: 2.5px dashed var(--line); }
.stop { position: relative; display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.dot {
  position: relative; z-index: 1; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: var(--surface); border: 2.5px solid var(--line); color: var(--muted);
}
.stop.done .dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stop.open .dot { border-color: var(--brand); color: var(--brand); }
[data-mode="dark"] .stop.open .dot { border-color: var(--accent); color: var(--accent); }
.stop.current .dot { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); animation: ring 1.8s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 12%, transparent); } }
.stop-card {
  flex: 1; display: flex; align-items: center; gap: 12px; text-align: left; min-width: 0;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px;
}
.stop.current .stop-card { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.stop.locked .stop-card { background: transparent; border-style: dashed; }
.stop.locked .stop-emoji, .stop.locked .stop-text { opacity: .5; }
.stop-emoji { font-size: 26px; line-height: 1; }
.stop-text { flex: 1; min-width: 0; }
.stop-text b { display: block; font-size: 16px; }
.stop-text small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stars { color: var(--line); font-size: 14px; letter-spacing: 1px; white-space: nowrap; }
.stars .on, .result-stars .on { color: var(--accent); }
.here { font-size: 12px; font-weight: 800; color: var(--on-accent); background: var(--accent); padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.lock { font-size: 16px; opacity: .6; }
.travel { display: flex; justify-content: center; padding: 6px 0 14px; position: relative; }
.travel span { font-size: 13px; font-weight: 700; color: var(--muted); background: var(--bg); padding: 4px 12px; border: 1.5px dashed var(--line); border-radius: 999px; }

.all-done { background: var(--ok-soft); border-radius: var(--radius); padding: 14px 16px; font-weight: 700; margin: 8px 0; }
.up-title { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.upcoming { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.up-item { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.up-emoji { font-size: 24px; filter: grayscale(.6); opacity: .8; }
.up-item b { display: block; font-size: 14px; }
.up-item small { font-size: 12px; color: var(--muted); }

/* ---------- Sheet ---------- */
#overlay { display: none; }
#overlay.show { display: block; }
.scrim { position: fixed; inset: 0; background: rgba(8, 12, 24, .5); z-index: 40; animation: fade .2s; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto; z-index: 41;
  background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); animation: up .22s ease-out;
}
.grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 14px; }
@keyframes up { from { transform: translate(-50%, 40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-body h3 { font-size: 21px; font-weight: 800; }
.sheet-body > p { color: var(--muted); margin: 8px 0 18px; }
.sheet-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.sheet-head small { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; }
.scene { margin: 4px 0 0; color: var(--muted); }
.sheet-emoji { font-size: 44px; line-height: 1; }
.sheet-body.center .sheet-emoji { margin-bottom: 10px; }
.sheet-facts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.sheet-facts > span { background: var(--surface-2); padding: 6px 10px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.sheet-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sheet-body h4 { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.vlist { list-style: none; margin: 0 0 18px; padding: 0; }
.vlist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.vlist li b { min-width: 40%; }
.vlist li span { color: var(--muted); }
.vlist.sent li div { display: flex; flex-direction: column; }
.x { background: none; border: 0; font-size: 22px; color: var(--muted); padding: 6px 8px; font-weight: 700; }
.edit-photo { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0 16px; }
.edit-photo .btn.link { margin-top: 4px; }

/* ---------- Tombol suara ---------- */
.say {
  border: 0; background: color-mix(in srgb, var(--accent) 25%, var(--surface)); border-radius: 12px;
  width: 44px; height: 44px; font-size: 20px; flex-shrink: 0; display: inline-grid; place-items: center;
}
.say.sm { width: 30px; height: 30px; font-size: 14px; border-radius: 9px; }

/* ---------- Latihan ---------- */
.lesson { min-height: 100dvh; display: flex; flex-direction: column; }
.lesson-top { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 14px 4px; }
.lesson-top .count { font-weight: 700; font-size: 14px; color: var(--muted); min-width: 36px; text-align: right; }
.bar.thin { flex: 1; height: 8px; background: var(--line); color: inherit; }
.ex { flex: 1; padding: 16px 18px 24px; }
.ex-kind { margin: 0 0 4px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ex-kind.signature { color: var(--ink); background: color-mix(in srgb, var(--accent) 30%, transparent); display: inline-block; padding: 3px 8px; border-radius: 6px; }
.ex-title { font-size: 23px; font-weight: 800; margin-bottom: 18px; }
.prompt { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.prompt span { font-size: 24px; font-weight: 800; }
.prompt.id span { font-size: 20px; font-weight: 700; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts.stack { grid-template-columns: 1fr; }
.opt {
  display: flex; align-items: center; gap: 10px; text-align: left; min-height: 58px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; font-weight: 600; font-size: 16px;
  transition: border-color .15s, background .15s;
}
.letter {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--surface-2); font-size: 13px; font-weight: 800; color: var(--muted);
}
.opt.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.opt.sel .letter { background: var(--accent); color: var(--on-accent); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .letter { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .letter { background: var(--bad); color: #fff; }
.opt.dim { opacity: .45; }

.listen-pad { display: flex; justify-content: center; gap: 12px; margin: 4px 0 24px; }
.big-say, .slow-say { border: 0; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; font-size: 13px; }
.big-say { width: 120px; height: 120px; background: var(--brand); color: var(--on-brand); }
.big-say span { font-size: 42px; }
.slow-say { width: 84px; height: 120px; background: var(--surface); color: var(--muted); box-shadow: var(--shadow); }
.slow-say span { font-size: 30px; }
.big-say:active, .slow-say:active { transform: scale(.96); }

.answer-box {
  min-height: 96px; padding: 12px; margin-bottom: 18px; border-radius: var(--radius);
  border: 2px dashed var(--line); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px;
}
.answer-box.has { border-style: solid; background: var(--surface); }
.answer-box .hint { color: var(--muted); font-size: 14px; margin: auto; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile { background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 15px; font-weight: 700; font-size: 16px; box-shadow: var(--shadow); }
.tile.in { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: none; }
.tile.used { background: var(--surface-2); color: transparent; box-shadow: none; border-color: transparent; }

.context { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 15px; margin: -4px 0 14px; }
.paper {
  display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 22px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  border-left: 4px solid color-mix(in srgb, var(--bad) 55%, transparent);
}
.tok { background: none; border: 0; border-radius: 6px; padding: 4px 6px; font-size: 21px; font-weight: 700; position: relative; }
.tok.sel { background: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); }
.tok.is-wrong { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 2.5px; background: var(--bad-soft); }
.tok.picked-bad { outline: 2px dashed var(--muted); }
.spot-hint { color: var(--muted); font-size: 14px; margin-top: 12px; }

.checkbar { position: sticky; bottom: 0; padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 18px); }
.fb-card {
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; padding: 14px; border-radius: 18px;
  background: var(--surface); box-shadow: 0 10px 30px rgba(10, 14, 30, .14); border-left: 5px solid var(--ok);
  animation: up2 .2s ease-out;
}
.fb-card.bad { border-left-color: var(--bad); }
@keyframes up2 { from { transform: translateY(10px); opacity: 0; } }
.fb-ico { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 900; color: #fff; background: var(--ok); }
.fb-card.bad .fb-ico { background: var(--bad); }
.fb-card h4 { font-size: 18px; margin-bottom: 4px; }
.fb-card.ok h4 { color: var(--ok); }
.fb-card.bad h4 { color: var(--bad); }
.fb-card p { margin: 4px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.fb-card p.sub { color: var(--muted); font-size: 15px; }

/* ---------- Hasil ---------- */
.result { padding: calc(36px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); text-align: center; position: relative; overflow: hidden; min-height: 100dvh; }
.result-card { background: var(--brand); color: var(--on-brand); border-radius: 26px; padding: 26px 18px 18px; margin-bottom: 14px; position: relative; }
.result-emoji { font-size: 70px; line-height: 1; animation: pop .5s cubic-bezier(.3,1.6,.6,1); }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }
.result h1 { font-size: 27px; font-weight: 800; margin-top: 12px; color: var(--accent); }
.result-sub { margin: 4px 0 6px; opacity: .85; font-weight: 600; }
.result-stars { font-size: 36px; color: color-mix(in srgb, #fff 25%, transparent); letter-spacing: 2px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.result-grid div { background: color-mix(in srgb, #fff 10%, transparent); border-radius: 14px; padding: 10px 4px; }
.result-grid small { display: block; font-size: 12px; opacity: .8; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.result-grid b { font-size: 22px; }
.banner { background: var(--surface); box-shadow: var(--shadow); border-radius: 14px; padding: 12px 14px; font-weight: 700; margin-bottom: 8px; text-align: left; }
.result-motto { color: var(--muted); font-style: italic; margin: 14px 0 0; }
.result .btn { margin-top: 18px; }
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.confetti i {
  position: absolute; top: -20px; left: calc(var(--k) * 4.6%); width: 8px; height: 13px; border-radius: 2px;
  background: var(--accent); opacity: .9;
  animation: fall calc(1.7s + var(--k) * .05s) ease-in calc(var(--k) * .04s) forwards;
}
.confetti i:nth-child(3n) { background: #fff; }
.confetti i:nth-child(4n) { background: #E63946; }
@keyframes fall { to { transform: translateY(105vh) rotate(calc(var(--k) * 70deg)); opacity: .2; } }

/* ---------- Profil ---------- */
.profile { padding: 8px 16px calc(96px + env(safe-area-inset-bottom)); }
.me { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.me .cam { width: 28px; height: 28px; font-size: 13px; }
.me-text { flex: 1; min-width: 0; }
.me-text h2 { font-size: 20px; font-weight: 800; }
.me-text p { margin: 3px 0 0; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 21px; }
.stat small { color: var(--muted); font-weight: 600; }
.card { display: block; background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.card h3 { font-size: 17px; margin-bottom: 12px; }
.card p { margin: 0 0 12px; color: var(--muted); }
.card .label { margin: 12px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.card .label:first-of-type { margin-top: 0; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; }
.day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.day .col { width: 100%; max-width: 30px; height: 90px; background: var(--surface-2); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.day .col i { display: block; width: 100%; background: color-mix(in srgb, var(--accent) 50%, var(--surface-2)); border-radius: 8px; }
.day .col i.met { background: var(--accent); }
.day small { font-weight: 700; color: var(--muted); font-size: 12px; }
.day.today small { color: var(--ink); }
.card .fine { margin-top: 10px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch { background: none; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.swatch .sw { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 0 55%, var(--b) 55% 100%); box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.swatch small { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.2; }
.swatch.sel { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.swatch.sel small { color: var(--ink); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 14px; }
.seg button { background: none; border: 0; border-radius: 10px; padding: 9px 4px; font-weight: 700; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; align-items: center; }
.seg button small { font-weight: 600; font-size: 12px; }
.seg button.sel { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; font-weight: 600; }
.row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--brand); }
[data-mode="dark"] .row input[type="checkbox"] { accent-color: var(--accent); }
.card .btn.ghost { margin-top: 12px; }
.tiktok { display: flex; gap: 12px; align-items: center; }
.tiktok > span { font-size: 28px; }
.tiktok b { display: block; }
.tiktok small { color: var(--muted); }

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

/* ---------- v1.2 ---------- */
a.btn { text-align: center; text-decoration: none; }
.hello-text { min-width: 0; }
.rank-chip { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 28%, var(--surface)); color: var(--ink); }
.hello .rank-chip { margin: 2px 0 2px; }
.today-left { margin: 10px 0 0; font-size: 14px; font-weight: 700; position: relative; z-index: 1; color: var(--accent); }

.daily-card { width: 100%; margin: 12px 0 0; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--surface); border: 0; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.d-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--brand); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.d-count { font-weight: 800; font-size: 14px; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.d-count.all { background: var(--ok-soft); color: var(--ok); }

.practice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.practice .koreksi { margin: 0; flex-direction: column; align-items: flex-start; gap: 8px; position: relative; padding: 14px 12px; }
.practice .k-text small { display: block; font-size: 13px; line-height: 1.3; }
.koreksi.weak { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
[data-mode="dark"] .koreksi.weak { border-color: var(--line); }
.k-badge { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }

.result-note { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.banner.rank-up { background: var(--accent); color: var(--on-accent); }

/* Kata Hari Ini */
.daily { padding: 6px 16px calc(96px + env(safe-area-inset-bottom)); }
.daily-head { display: flex; gap: 14px; align-items: center; background: var(--brand); color: var(--on-brand); border-radius: var(--radius); padding: 16px; margin: 8px 0 14px; }
.dh-emoji { font-size: 34px; width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 25%, transparent); flex-shrink: 0; }
.daily-head small { opacity: .8; font-weight: 600; }
.daily-head h2 { font-size: 21px; font-weight: 800; margin: 2px 0 4px; }
.daily-head p { margin: 0; font-size: 13px; opacity: .85; }
.words { display: grid; gap: 10px; }
.word { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); border: 2px solid transparent; transition: border-color .2s; }
.word.known { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.word.again { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.w-head { display: flex; align-items: center; gap: 10px; }
.w-main { flex: 1; min-width: 0; }
.w-main h3 { font-size: 20px; font-weight: 800; }
.w-main p { margin: 2px 0 0; color: var(--muted); font-weight: 600; font-size: 14px; }
.w-tag { font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.w-tag.n { background: var(--bad-soft); color: var(--bad); }
.w-ex { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.w-ex div { display: flex; flex-direction: column; font-size: 14px; }
.w-ex b { font-weight: 700; }
.w-ex span { color: var(--muted); }
.w-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.wbtn { border: 1.5px solid var(--line); background: transparent; border-radius: 12px; padding: 10px 6px; font-weight: 700; font-size: 14px; }
.wbtn.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.wbtn.n.on { background: var(--bad); border-color: var(--bad); }
.tracker { margin-top: 14px; }
.tr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tr-num { font-size: 34px; font-weight: 800; line-height: 1; display: block; }
.tr-top small { color: var(--muted); font-weight: 600; }
.tracker .label { margin-top: 14px !important; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-h { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); }
.cal-cell { aspect-ratio: 1; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.cal-cell.empty { background: none; }
.cal-cell.some { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); color: var(--ink); }
.cal-cell.full { background: var(--ok); color: #fff; }
.cal-cell.today { box-shadow: 0 0 0 2px var(--ink) inset; }
.lgd { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; }
.lgd.some { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.lgd.full { background: var(--ok); }
.seg.two { grid-template-columns: 1fr 1fr; }

/* Profil: gelar */
.rank-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rank-row > div { flex: 1; }
.rank-row small { color: var(--muted); font-weight: 600; }
.rank-row h3 { margin: 0; font-size: 20px; }
.rank-big { font-size: 34px; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 25%, var(--surface)); }
.rank-card .bar { color: var(--ink); }
.rank-steps { display: flex; justify-content: space-between; margin-top: 12px; font-size: 22px; }
.rank-steps span { filter: grayscale(1); opacity: .35; }
.rank-steps span.on { filter: none; opacity: 1; }
.me-text .rank-chip { margin-top: 4px; }

.share-preview { display: block; width: 100%; max-width: 300px; margin: 6px auto 16px; border-radius: 16px; box-shadow: var(--shadow); }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 50;
  background: var(--ink); color: var(--bg); font-weight: 700; padding: 12px 18px; border-radius: 14px; transition: .25s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- v1.3 ---------- */
/* Misi Hari Ini */
.mission { margin-top: 12px; background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.mission.done { box-shadow: 0 0 0 2px var(--ok) inset, var(--shadow); }
.m-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.m-head span { font-size: 13px; font-weight: 800; color: var(--muted); }
.mission.done .m-head span { color: var(--ok); }
.m-row { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: none; border: 0; padding: 10px 0; border-top: 1px solid var(--line); position: relative; }
.m-row:first-of-type { border-top: 0; }
.m-check { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; background: var(--surface-2); }
.m-row.ok .m-check { background: var(--ok); color: #fff; font-weight: 800; }
.m-text { flex: 1; min-width: 0; }
.m-text b { display: block; font-size: 15px; }
.m-text small { color: var(--muted); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row.ok .m-text b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ok) 70%, transparent); color: var(--muted); }
.m-go { color: var(--muted); font-size: 22px; font-weight: 700; }
.m-row .k-badge { position: static; }
.koreksi.pass { border-style: solid; border-color: var(--line); }

/* Latihan Ucapkan */
.speak-kind { color: var(--brand) !important; }
[data-mode="dark"] .speak-kind { color: var(--accent) !important; }
.speak-card { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin: 14px 0; }
.sc-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sc-text b { font-size: 20px; line-height: 1.35; }
.sc-text small { color: var(--muted); font-weight: 600; }
.sc-text .hit { color: var(--ok); }
.sc-text .miss { color: var(--bad); text-decoration: underline wavy; text-underline-offset: 4px; }
.sc-btns { display: flex; flex-direction: column; gap: 8px; }
.mic { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; background: none; border: 0; padding: 10px 0; font-weight: 700; color: var(--muted); }
.mic-ico { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; background: var(--brand); box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); transition: transform .15s; }
[data-mode="dark"] .mic-ico { background: var(--accent); }
.mic.on .mic-ico { background: var(--bad); animation: pulse 1.1s infinite; }
.mic.on { color: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 45%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
.heard { text-align: center; color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.speak-err { text-align: center; color: var(--bad); font-size: 14px; font-weight: 600; margin: 6px 0 0; }
.ex .btn.link { display: block; margin: 14px auto 0; }

/* Catatan Singkat */
.note { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-radius: 16px; padding: 12px 14px; margin: 0 0 14px; }
.note summary { font-weight: 800; cursor: pointer; list-style: none; }
.note summary::-webkit-details-marker { display: none; }
.note summary::after { content: " ▾"; color: var(--muted); }
.note[open] summary::after { content: " ▴"; }
.note ul { margin: 10px 0 8px; padding-left: 18px; }
.note li { margin-bottom: 6px; font-size: 14px; }
.note-ex { display: grid; gap: 8px; }
.note-ex > div { display: flex; gap: 8px; align-items: center; background: var(--surface); border-radius: 12px; padding: 8px 10px; }
.note-ex p { margin: 0; display: flex; flex-direction: column; font-size: 14px; }
.note-ex span { color: var(--muted); }

/* Paspor */
.passport { padding: 6px 16px calc(96px + env(safe-area-inset-bottom)); }
.pp-top { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 12px; }
.pp-top h2 { font-size: 20px; }
.pp-cover { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: var(--on-brand); border-radius: var(--radius); padding: 18px; border: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.pp-cover small { letter-spacing: .12em; font-size: 10px; font-weight: 800; color: var(--accent); }
.pp-cover h3 { font-size: 21px; margin: 2px 0; }
.pp-cover p { margin: 0; font-size: 14px; opacity: .85; }
.pp-count { margin: 14px 2px 10px; color: var(--muted); font-weight: 600; }
.pp-count b { color: var(--ink); font-size: 18px; }
.stamps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stamp { aspect-ratio: 1; display: grid; place-items: center; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.st-ring { width: 84%; aspect-ratio: 1; border-radius: 50%; border: 3px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.st-ring b { font-size: 12px; line-height: 1.1; }
.st-ring small { font-size: 10px; font-weight: 700; }
.st-emoji { font-size: 26px; filter: grayscale(1); opacity: .4; }
.stamp.got .st-ring { border: 3px double var(--bad); color: var(--bad); transform: rotate(var(--r)); background: color-mix(in srgb, var(--bad) 6%, transparent); }
.stamp.got .st-emoji { filter: none; opacity: 1; }
.stamp.later { opacity: .55; }
button.banner { width: 100%; border: 0; font: inherit; color: inherit; cursor: pointer; }
.two-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-btn .btn + .btn { margin-top: 0; }
.file-btn { cursor: pointer; }
textarea { width: 100%; font: inherit; font-size: 14px; color: inherit; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; resize: vertical; }
