/* ===== Token warna & ukuran =====
   Terang: putih bersih. Gelap: abu arang dengan kartu timbul lembut (neumorphism).
   Semua warna aplikasi diambil dari sini. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --ink: #1f2125;
  --muted: #6f747c;
  --line: #e3e6ea;
  --primary: #23262b;
  --primary-ink: #ffffff;
  --primary-soft: #e9ebef;
  --accent: #2f6fe0;
  --good: #2f9e5b;
  --bad: #d64545;
  --warn: #b36b00;
  --shadow: -4px -4px 12px rgb(255 255 255 / 90%), 6px 6px 16px rgb(25 30 40 / 8%);
  --shadow-sm: -2px -2px 6px rgb(255 255 255 / 90%), 3px 3px 8px rgb(25 30 40 / 8%);
  --inset: inset 2px 2px 5px rgb(25 30 40 / 7%), inset -2px -2px 5px rgb(255 255 255 / 90%);
  --floor: rgb(25 30 40 / 12%);
  --pet-a: #ffb36b;
  --pet-b: #f0742a;
  --radius: 22px;
  --radius-sm: 14px;
  --nav-h: 68px;
  --font: "Century Gothic", "Futura", "Avenir Next", "Quicksand", ui-rounded, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f2125;
    --surface: #272a2f;
    --surface-2: #2e3137;
    --ink: #e6e8eb;
    --muted: #8d929b;
    --line: #363a41;
    --primary: #e9ebee;
    --primary-ink: #1c1e22;
    --primary-soft: #353941;
    --accent: #4c8dff;
    --good: #3fbf78;
    --bad: #f0605d;
    --warn: #e0a030;
    --shadow: -5px -5px 12px rgb(255 255 255 / 3.5%), 7px 7px 16px rgb(0 0 0 / 45%);
    --shadow-sm: -2px -2px 6px rgb(255 255 255 / 3%), 3px 3px 8px rgb(0 0 0 / 40%);
    --inset: inset 3px 3px 7px rgb(0 0 0 / 45%), inset -2px -2px 6px rgb(255 255 255 / 3%);
    --floor: rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1f2125;
  --surface: #272a2f;
  --surface-2: #2e3137;
  --ink: #e6e8eb;
  --muted: #8d929b;
  --line: #363a41;
  --primary: #e9ebee;
  --primary-ink: #1c1e22;
  --primary-soft: #353941;
  --accent: #4c8dff;
  --good: #3fbf78;
  --bad: #f0605d;
  --warn: #e0a030;
  --shadow: -5px -5px 12px rgb(255 255 255 / 3.5%), 7px 7px 16px rgb(0 0 0 / 45%);
  --shadow-sm: -2px -2px 6px rgb(255 255 255 / 3%), 3px 3px 8px rgb(0 0 0 / 40%);
  --inset: inset 3px 3px 7px rgb(0 0 0 / 45%), inset -2px -2px 6px rgb(255 255 255 / 3%);
  --floor: rgb(0 0 0 / 50%);
  color-scheme: dark;
}

/* ===== Dasar ===== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
h1, h2, p { margin: 0; }
h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

.view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  outline: none;
}
body.no-nav .view { padding-bottom: calc(env(safe-area-inset-bottom) + 32px); }
body.no-nav .bottom-nav { display: none; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.eyebrow { font-size: 0.8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.08em; }

/* ===== Header ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}
.icon-btn, .icon-btn-spacer {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  text-decoration: none;
}
.icon-btn { background: var(--surface); box-shadow: var(--shadow); }
.icon-btn:active { transform: scale(0.95); }

/* ===== Kartu ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section-title { font-size: 0.95rem; color: var(--muted); font-weight: 700; }

/* ===== Panggung karakter (sementara, sebelum model 3D) ===== */
.stage-card {
  position: relative;
  height: 280px;
  border-radius: 28px;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--primary-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.stage-floor {
  position: absolute;
  bottom: 54px;
  width: 140px; height: 22px;
  border-radius: 50%;
  background: var(--floor);
  filter: blur(2px);
  animation: shadow 3s ease-in-out infinite;
}
.placeholder-pet {
  width: 120px; height: 112px;
  border-radius: 50% 50% 46% 46%;
  background: linear-gradient(160deg, var(--pet-a), var(--pet-b));
  display: flex; align-items: center; justify-content: center; gap: 26px;
  padding-bottom: 8px;
  box-shadow: inset -10px -14px 0 rgb(0 0 0 / 8%);
  animation: float 3s ease-in-out infinite;
  margin-bottom: 30px;
}
.placeholder-pet .eye {
  width: 12px; height: 16px; border-radius: 50%;
  background: #2b211a;
  animation: blink 5s infinite;
}
.placeholder-pet.big { width: 140px; height: 130px; margin: 0; }
.stage-note {
  position: absolute; bottom: 16px;
  font-size: 0.8rem; color: var(--muted);
}
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes shadow { 50% { transform: scaleX(0.82); opacity: 0.7; } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
@media (prefers-reduced-motion: reduce) {
  .placeholder-pet, .stage-floor, .placeholder-pet .eye { animation: none; }
}

.sync-chip {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.75rem; font-weight: 600;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.sync-chip[data-state="ok"] { color: var(--good); }
.sync-chip[data-state="error"] { color: var(--bad); }
.sync-chip[data-state="syncing"] .icon { animation: spin 1s linear infinite; }
.sync-chip b {
  background: var(--primary); color: var(--primary-ink);
  border-radius: 999px; padding: 0 6px; font-size: 0.7rem;
}
@keyframes spin { to { transform: rotate(-360deg); } }

/* ===== Level ===== */
.level-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.level-num { font-size: 1.5rem; font-weight: 800; }
.stage-dots { display: flex; gap: 6px; }
.stage-dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.stage-dots span.on { background: var(--primary); }
.bar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width 0.6s ease; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { gap: 2px; }
.stat-num { font-size: 1.5rem; font-weight: 800; }

/* ===== Segera hadir ===== */
.soon { align-items: center; text-align: center; padding: 32px 22px; gap: 12px; }
.soon-icon {
  width: 72px; height: 72px; border-radius: 22px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.pill {
  font-size: 0.8rem; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}

/* ===== Form ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.field input, .field select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--bg);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; gap: 4px; }
.segmented button {
  border: 0; background: transparent; min-height: 40px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.form-msg { min-height: 1.4em; font-size: 0.9rem; color: var(--muted); }
.form-msg.good { color: var(--good); }
.form-msg.bad { color: var(--bad); }

/* ===== Tombol ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.link-danger { align-self: flex-start; background: none; border: 0; padding: 6px 0; color: var(--bad); font-weight: 600; cursor: pointer; }

.count-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.count-list li { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--muted); }
.count-list b { color: var(--ink); }

/* ===== Wizard ===== */
.setup { display: flex; flex-direction: column; gap: 16px; padding-top: 12px; }
.setup-hero { display: grid; place-items: center; padding: 24px 0 8px; }
.choice {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  padding: 16px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer;
}
.choice:hover, .choice:focus-visible { border-color: var(--primary); outline: none; }
.choice > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.choice-icon { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 0.92rem; }
.done-badge { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); }

/* ===== Navigasi bawah ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.nav-item {
  flex: 1; max-width: 112px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0;
  border-radius: 14px;
  font-size: 0.72rem; font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.nav-item[aria-current="page"] { color: var(--primary); }
.nav-item[aria-current="page"] .icon { background: var(--primary-soft); border-radius: 10px; }
.nav-item .icon { padding: 3px; width: 34px; height: 30px; }

/* ===== Toast & dialog ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink); color: var(--bg);
  font-size: 0.9rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 30;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: end center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: rgb(0 0 0 / 40%);
}
.modal {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Tahap 2: Kegiatan ===== */
.tabs { grid-template-columns: 1fr 1fr; }
.tabs a {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; border-radius: 9px;
  font-weight: 700; color: var(--muted); text-decoration: none;
}
.tabs a[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.today-count { font-size: 1rem; color: var(--muted); }
.today-count b { font-size: 1.9rem; color: var(--ink); }

.task-section { display: flex; flex-direction: column; gap: 8px; }
.task-section .section-title { display: flex; align-items: center; gap: 8px; padding: 6px 4px 0; }
.task-section .section-title span {
  font-size: 0.75rem; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); text-align: center;
}
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.task-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
  padding: 4px 0; border: 0; background: none; text-align: left; cursor: pointer;
}
.task-title { font-weight: 700; overflow-wrap: anywhere; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.check {
  flex: none;
  width: 32px; height: 32px; margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  color: transparent;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.check:active { transform: scale(0.9); }
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.check.play { border: 0; background: var(--primary-soft); color: var(--primary); }
.check.play .icon { fill: currentColor; }

.chip-sm {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 0.75rem; font-weight: 600;
  border: 0; font-family: inherit;
}
.chip-sm.warn { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
button.chip-sm { cursor: pointer; }
.chip-sm.money { color: var(--ink); }
.chip-sm.jenis-belanja, .chip-sm.jenis-tagihan, .chip-sm.jenis-olahraga { background: var(--primary-soft); color: var(--primary); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 24px; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }

.fab {
  position: fixed;
  right: max(16px, calc(50% - 280px + 16px));
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  width: 58px; height: 58px; border-radius: 20px;
  border: 0; background: var(--primary); color: var(--primary-ink);
  display: grid; place-items: center;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--primary) 40%, transparent);
  cursor: pointer; z-index: 10;
}
.fab:active { transform: scale(0.94); }
.view:has(.fab) { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 96px); }

/* Kalender */
.cal { gap: 6px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head h2 { text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-week span { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day {
  aspect-ratio: 1 / 1.05;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; border-radius: 12px; background: none; cursor: pointer;
  font-weight: 600; font-size: 0.95rem;
}
.cal-day.out { color: var(--muted); opacity: 0.45; }
.cal-day.today > span { color: var(--primary); font-weight: 800; }
.cal-day.sel { background: var(--primary); }
.cal-day.sel > span { color: var(--primary-ink); }
.dots { display: flex; gap: 3px; height: 5px; }
.dots b { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.dots.all b { background: var(--good); }
.cal-day.sel .dots b { background: var(--primary-ink); }
.link-btn { align-self: center; border: 0; background: none; color: var(--primary); font-weight: 700; padding: 8px; cursor: pointer; }
.pad { padding: 4px; }

/* Lembar bawah */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 35;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgb(0 0 0 / 0%);
  transition: background 0.2s;
}
.sheet-backdrop.open { background: rgb(0 0 0 / 40%); }
.sheet {
  width: 100%; max-width: 560px;
  max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  transition: transform 0.22s ease;
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 8px; }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(20px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.icon-btn.small { width: 38px; height: 38px; border: 0; cursor: pointer; color: inherit; }

.form { display: flex; flex-direction: column; gap: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field textarea {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface); resize: vertical; font: inherit; color: inherit;
}
.sheet .field input, .sheet .field select { background: var(--surface); }
.field textarea:focus { outline: none; border-color: var(--primary); }
.big-input { font-size: 1.6rem !important; font-weight: 800; }
.note { display: flex; gap: 8px; align-items: flex-start; font-size: 0.85rem; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.note .icon { flex: none; margin-top: 1px; }

.jenis-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.jenis-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface);
  font-size: 0.78rem; font-weight: 700; color: var(--muted); cursor: pointer;
}
.jenis-grid button[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 0.85rem; color: var(--muted); cursor: pointer;
}
.chip[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.step-edit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: step; }
.step-edit:empty { display: none; }
.step-edit li { display: flex; align-items: center; gap: 6px; counter-increment: step; }
.step-edit li::before { content: counter(step); width: 22px; text-align: center; font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.step-edit input {
  flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px;
  border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface);
}
.step-edit input:focus { outline: none; border-color: var(--primary); }
.btn-small { min-height: 40px; padding: 6px 14px; align-self: flex-start; font-size: 0.9rem; }

/* Detail */
.detail { display: flex; flex-direction: column; gap: 14px; }
.detail-title { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
.detail-title.done { text-decoration: line-through; color: var(--muted); }
.detail-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.92rem; }
.detail-meta li { display: flex; align-items: center; gap: 8px; }
.detail-meta .icon { flex: none; }
.detail-note { background: var(--surface); border-radius: var(--radius-sm); padding: 12px; white-space: pre-wrap; }
.steps-check { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border-radius: var(--radius); padding: 12px; }
.step-row { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.step-row input { width: 22px; height: 22px; accent-color: var(--good); flex: none; }
.step-row.on span { text-decoration: line-through; color: var(--muted); }
.btn-row.two { display: grid; grid-template-columns: 1fr 1fr; }
.danger-text { color: var(--bad); }
.modal-stack { display: flex; flex-direction: column; gap: 8px; }

/* Beranda: ringkasan kegiatan */
.tasks-card { flex-direction: row; align-items: center; gap: 14px; text-decoration: none; }
.tasks-card > div:nth-child(2) { flex: 1; }
.tasks-card > .icon { color: var(--muted); }
.tasks-ring {
  --p: 0;
  width: 56px; height: 56px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-items: center;
}
.tasks-ring span {
  width: 44px; height: 44px; border-radius: 50%; background: var(--surface);
  display: grid; place-items: center; font-weight: 800; font-size: 0.85rem;
}
.stats.three { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats.three .stat { padding: 14px; }
.stats.three .stat-num { font-size: 1.3rem; }
.streak-num { display: flex; align-items: center; gap: 4px; }
.streak-num .icon { color: var(--primary); }
.toast.celebrate { background: var(--primary); color: var(--primary-ink); font-size: 1rem; }

/* ===== Umum ===== */
[hidden] { display: none !important; }
.page { display: contents; }

/* ===== Tahap 3: Keuangan ===== */
/* Warna saku: palet kategori yang sudah divalidasi (terang/gelap). */
:root {
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  --c5: #e87ba4; --c6: #008300; --c7: #4a3aa7; --c8: #e34948;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
  }
}
:root[data-theme="dark"] {
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
  --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
}
.sw-c1 { --sw: var(--c1); } .sw-c2 { --sw: var(--c2); } .sw-c3 { --sw: var(--c3); } .sw-c4 { --sw: var(--c4); }
.sw-c5 { --sw: var(--c5); } .sw-c6 { --sw: var(--c6); } .sw-c7 { --sw: var(--c7); } .sw-c8 { --sw: var(--c8); }
.none { --sw: var(--muted); }

.pos { color: var(--good); }
.bad-text { color: var(--bad); }
.warn-text { color: var(--warn); }
.bad-text .icon, .warn-text .icon { vertical-align: -2px; margin-right: 4px; }

.tabs.three { grid-template-columns: repeat(3, 1fr); }
.segmented.two { grid-template-columns: 1fr 1fr; }

.balance-card { gap: 6px; }
.balance { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; overflow-wrap: anywhere; }
.balance.neg { color: var(--bad); }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.flow > span { display: inline-flex; align-items: center; gap: 4px; }
.flow i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.flow-in { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.flow-out { background: var(--surface-2); color: var(--ink); }

.month-nav { display: flex; align-items: center; justify-content: space-between; }
.month-nav h2 { text-transform: capitalize; }
.month-nav button:disabled { opacity: 0.3; }

.trx-day { display: flex; flex-direction: column; gap: 6px; }
.trx-day .section-title { display: flex; justify-content: space-between; padding: 4px 4px 0; }
.trx-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.trx-list li + li { border-top: 1px solid var(--line); }
.trx {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 0; background: none; text-align: left; cursor: pointer;
}
.trx-ico {
  width: 36px; height: 36px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--sw) 16%, transparent); color: var(--sw);
}
.trx-ico.in { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.trx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trx-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trx-amt { font-weight: 800; white-space: nowrap; }

.saku-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.saku-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer;
}
.saku-card.plain { cursor: default; }
.saku-card:focus-visible { outline: 2px solid var(--primary); }
.saku-head { display: flex; align-items: center; gap: 8px; }
.saku-head b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.saku-amt { font-weight: 800; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--sw); }
.saku-line { display: flex; align-items: baseline; gap: 2px; }
.saku-pct { margin-left: auto; font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.bar > span[class*="sw-"] { background: var(--sw); }
.bar.warn { outline: 2px solid color-mix(in srgb, var(--warn) 50%, transparent); outline-offset: 1px; }
.bar.over > span { background: var(--bad) !important; }
.saku-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn-row.center { justify-content: center; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); background: var(--sw); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2.5px var(--ink); }

.report-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.report-totals .wide { grid-column: 1 / -1; }
.report-totals .stat-num { font-size: min(1.25rem, 4.8vw); white-space: nowrap; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hbar-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hbar-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { position: relative; height: 12px; }
.hbar { display: block; height: 100%; min-width: 4px; border-radius: 0 4px 4px 0; background: var(--sw); }
.hbar-prev { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.legend { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.hbar-prev-key { display: inline-block; width: 2px; height: 14px; background: var(--ink); border-radius: 1px; }

.cash-ico { width: 56px; height: 56px; flex: none; border-radius: 18px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.cash { font-size: 1.25rem; }

/* ===== Tahap 4: Pencapaian ===== */
.link-card { text-decoration: none; }
.link-card:active { transform: scale(0.99); }
.level-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pill-icon { display: inline-flex; align-items: center; gap: 4px; }
.pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.evo { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.evo::before { content: ''; position: absolute; left: 10%; right: 10%; top: 15px; height: 2px; background: var(--line); }
.evo li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.evo-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: 0.85rem;
  border: 2px solid var(--surface);
}
.evo li.on .evo-dot { background: var(--primary); color: var(--primary-ink); }
.evo li.cur .evo-dot { box-shadow: 0 0 0 3px var(--primary-soft); }
.evo-lv { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
/* gambar wujud karakter per tahap evolusi */
.evo.has-pics::before { top: 75px; }
.evo-pic { width: 100%; max-width: 64px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px; }
.evo-pic img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.evo-pic.locked img { filter: brightness(0); opacity: 0.85; }
.evo li.cur .evo-pic { background: var(--primary-soft); }
.evo-pic.none img { display: none; }
.evo li.on .evo-lv { color: var(--ink); }

.badge-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 12px 4px; border: 0; border-radius: 16px; background: var(--surface-2); cursor: pointer;
}
.badge-ico {
  --p: 0;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--muted);
  background:
    radial-gradient(closest-side, var(--surface) 82%, transparent 84%),
    conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line) 0);
}
.badge.earned .badge-ico, .badge-ico.earned { color: var(--primary-ink); background: var(--primary); }
.badge-ico.big { width: 88px; height: 88px; }
.badge-name { font-size: 0.8rem; font-weight: 700; line-height: 1.2; }
.badge-sub { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.badge:not(.earned) .badge-name { color: var(--muted); }
.badge-detail { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 8px 0 12px; }
.bar.wide { width: 100%; }

.pbars { position: relative; display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 140px; padding-top: 18px; }
.pbars-max { position: absolute; top: 0; left: 0; }
.pcol { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; border: 0; background: none; padding: 0; cursor: pointer; min-width: 0; }
.pbar { width: 100%; max-width: 18px; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--primary) 55%, var(--surface)); }
.pcol.sel .pbar { background: var(--primary); }
.pday { font-size: 0.65rem; color: var(--muted); font-weight: 600; }
.pcol.sel .pday { color: var(--ink); }

.ph-day + .ph-day { border-top: 1px solid var(--line); padding-top: 10px; }
.ph-date { display: flex; justify-content: space-between; font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.ph-date b { color: var(--primary); }
.ph-list, .rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ph-list li, .rules li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.ph-list li > span, .rules li > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rules li > span { white-space: normal; }
.ph-list .icon, .rules .icon { color: var(--muted); flex: none; }
.ph-list b, .rules b { color: var(--good); }

/* ===== Tahap 5: Karakter 3D ===== */
.stage-card { touch-action: pan-y; }
.stage-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.stage-card.has-3d .stage-fallback { display: none; }
.stage3d { position: absolute; inset: 0 0 34px; }
.stage-canvas { width: 100%; height: 100%; display: block; }
.stage-note { left: 16px; right: 16px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.stage-note b { color: var(--ink); }
.mood-bubble {
  position: absolute; top: 14px; left: 14px;
  width: 52px; height: 52px; border-radius: 18px 18px 18px 4px;
  display: grid; place-items: center;
  font-size: 1.7rem; line-height: 1;
  border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
  animation: mood-pop 0.4s ease-out, mood-bob 3s ease-in-out 0.4s infinite;
}
@keyframes mood-pop { from { transform: scale(0.4); opacity: 0; } }
@keyframes mood-bob { 50% { transform: translateY(-4px); } }
.tilt-btn {
  position: absolute; bottom: 44px; left: 50%; transform: translateX(-50%);
  border: 0; border-radius: 999px; padding: 8px 14px;
  background: var(--primary); color: var(--primary-ink); font-weight: 700; font-size: 0.85rem; cursor: pointer;
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: reduce) { .mood-bubble { animation: none; } }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
.switch-row input {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background 0.2s;
}
.switch-row input::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform 0.2s;
}
.switch-row input:checked { background: var(--good); }
.switch-row input:checked::after { transform: translateX(20px); }
.switch-row input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== Tahap 6: Olahraga ===== */
.start-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.start-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 14px 12px; border: 0; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; text-align: left; cursor: pointer;
}
.start-tile .icon { color: var(--primary); background: var(--primary-soft); border-radius: 12px; padding: 6px; width: 42px; height: 42px; }
.start-tile b { font-size: 0.92rem; line-height: 1.2; }
.start-tile span { font-size: 0.75rem; color: var(--muted); line-height: 1.3; }
.start-tile:active { transform: scale(0.98); }

.link-banner { flex-direction: row; align-items: center; gap: 12px; background: var(--primary-soft); box-shadow: none; }
.link-banner > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.link-banner > span:first-child { color: var(--primary); display: grid; }

.live-card { flex-direction: row; align-items: center; gap: 12px; text-decoration: none; border: 2px solid var(--primary); }
.live-card > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.live-dot.running { background: var(--bad); animation: live 1.2s ease-in-out infinite; }
@keyframes live { 50% { opacity: 0.35; } }

.ola-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.ola-stats > div { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 12px; padding: 10px; }
.ola-stats b { font-size: 1.2rem; font-weight: 800; }
.ola-stats span { font-size: 0.75rem; color: var(--muted); font-weight: 600; }

.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 120px; margin-top: 6px; }
.wcol { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.wbar { width: 100%; max-width: 26px; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--primary) 60%, var(--surface)); }
.wcol.today .wbar { background: var(--primary); }
.wval { font-size: 0.68rem; color: var(--muted); font-weight: 700; }
.wday { font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.wcol.today .wday { color: var(--ink); }
.ink { color: var(--ink) !important; }
.trx-ico.ola { background: var(--primary-soft); color: var(--primary); }

.map-card { padding: 0; overflow: hidden; position: relative; isolation: isolate; }
.route-map { height: 220px; border-radius: 14px; overflow: hidden; background: var(--surface-2); position: relative; z-index: 0; isolation: isolate; }
.route-map.big { height: 300px; border-radius: 0; }
.map-center { position: absolute; right: 10px; bottom: 26px; z-index: 500; background: var(--surface); box-shadow: var(--shadow); }
.leaflet-container { font: inherit; background: var(--surface-2); }
.track-stats { align-items: stretch; }
.big-time { font-size: 3.2rem; font-weight: 800; text-align: center; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.btn-big { min-height: 56px; font-size: 1.05rem; }
.chip-row.center { justify-content: center; }
.gps-msg { text-align: center; color: var(--muted); min-height: 1.2em; }
.btn-row.two .link-danger { grid-column: 1 / -1; justify-self: center; }

.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.timer-card { align-items: center; }
.ring {
  --p: 0; --c: var(--primary);
  width: min(70vw, 260px); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-items: center; margin: 8px 0 12px;
}
.ring[data-phase="rest"] { --c: var(--good); }
.ring[data-phase="prep"] { --c: var(--warn); }
.ring[data-phase="done"] { --c: var(--good); }
.ring-in { width: 84%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring-phase { font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; color: var(--c); }
.ring-num { font-size: 3.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-round { font-size: 0.9rem; font-weight: 600; }
.timer-card .btn-row { width: 100%; }

/* ===== Tahap 7: Arena ===== */
.arena-hero { gap: 14px; }
.ticket-row { display: flex; align-items: center; gap: 14px; }
.ticket {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 10px 16px; border-radius: 16px;
  background: var(--primary); color: var(--primary-ink); font-size: 1.4rem;
}
.coin-pill { background: color-mix(in srgb, #f2b632 22%, transparent); color: var(--ink); }
.coin-pill .icon { color: #d99a00; }
.shop-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 8px; }
.shop-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; border-radius: 14px; border: 2px solid transparent;
  background: var(--surface-2); cursor: pointer;
}
.shop-item.on { border-color: var(--primary); }
.shop-sw { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgb(255 255 255 / 50%); }
.shop-name { font-weight: 700; font-size: 0.85rem; }
.shop-price { display: inline-flex; align-items: center; gap: 3px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.shop-item.on .shop-price { color: var(--primary); }

body.game-mode .bottom-nav { display: none; }
body.game-mode .view { padding: 0; max-width: none; }
.arena-wrap {
  position: fixed; inset: 0; z-index: 20; overflow: hidden;
  background: #111; touch-action: none; user-select: none; -webkit-user-select: none;
}
.arena-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud {
  position: absolute; left: 0; right: 0; top: 0; pointer-events: none;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 0;
  display: flex; flex-direction: column; gap: 6px; color: #fff;
  font-weight: 700; text-shadow: 0 1px 2px rgb(0 0 0 / 50%);
}
.hud-top { display: flex; align-items: center; gap: 10px; }
.hud-hp { flex: 1; position: relative; height: 22px; border-radius: 999px; background: rgb(0 0 0 / 45%); overflow: hidden; }
.hud-hp-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #e34948, #ff7a59); border-radius: 999px; transition: width 0.15s; }
.hud-hp b { position: relative; display: block; text-align: center; font-size: 0.78rem; line-height: 22px; }
.hud-btn {
  pointer-events: auto; width: 44px; height: 44px; border-radius: 14px; border: 0;
  background: rgb(0 0 0 / 45%); color: #fff; font-weight: 800; cursor: pointer;
}
.hud-row { display: flex; gap: 6px; }
.hud-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: rgb(0 0 0 / 40%); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.hud-xp { height: 6px; border-radius: 999px; background: rgb(0 0 0 / 40%); overflow: hidden; }
.hud-xp span { display: block; height: 100%; width: 0; background: #5ff0ff; transition: width 0.15s; }
.hud-boss { margin-top: 4px; text-align: center; font-size: 0.8rem; }
.hud-boss > div { height: 10px; border-radius: 999px; background: rgb(0 0 0 / 45%); overflow: hidden; margin-top: 3px; }
.hud-boss > div span { display: block; height: 100%; background: #b07bff; }
.hurt-flash { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px 30px rgb(227 73 72 / 70%); opacity: 0; }
.hurt-flash.on { animation: hurt 0.35s ease-out; }
@keyframes hurt { from { opacity: 1; } to { opacity: 0; } }
.arena-hint {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 40px); transform: translateX(-50%);
  padding: 8px 16px; border-radius: 999px; background: rgb(0 0 0 / 50%); color: #fff; font-weight: 700;
  pointer-events: none; transition: opacity 0.6s;
}
.arena-hint.gone { opacity: 0; }
.arena-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; background: #1f2125; }
.joy-base {
  position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 45%); background: rgb(0 0 0 / 18%); pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.joy-base.on { opacity: 1; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; border-radius: 50%; background: rgb(255 255 255 / 85%); transform: translate(-50%, -50%); }
.arena-modal {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
  padding: 16px; background: rgb(10 8 6 / 55%); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.arena-card {
  width: 100%; max-width: 420px; max-height: 90dvh; overflow-y: auto;
  background: var(--bg); color: var(--ink); border-radius: 24px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px; text-align: center;
}
.arena-card h2 { font-size: 1.5rem; }
.up-list { display: flex; flex-direction: column; gap: 8px; }
.up-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); cursor: pointer;
}
.up-card:hover, .up-card:focus-visible { border-color: var(--primary); outline: none; }
.up-ico { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.up-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.up-text small { color: var(--muted); }
.up-lv { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-weight: 800; font-size: 0.85rem; }
.coin-gain { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 1.3rem; font-weight: 800; }
.coin-gain .icon { color: #d99a00; }
.arena-card .pill { align-self: center; }
.card.switch-row { flex-direction: row; text-align: left; }
.arena-card .switch-row { text-align: left; }
.arena-hint { white-space: nowrap; }


/* ===== Gaya neumorphism (mengikuti referensi desain) ===== */
.field input, .field select, .field textarea, .step-edit input,
.sheet .field input, .sheet .field select {
  background: var(--bg);
  border: 1.5px solid transparent;
  box-shadow: var(--inset);
}
.field input:focus, .field select:focus, .field textarea:focus, .step-edit input:focus { border-color: var(--accent); }
.segmented { background: var(--bg); box-shadow: var(--inset); }
.segmented button[aria-checked="true"], .tabs a[aria-selected="true"] { background: var(--surface); box-shadow: var(--shadow-sm); }
.btn-ghost { background: var(--surface); box-shadow: var(--shadow-sm); }
.btn-primary { box-shadow: var(--shadow-sm); }
.icon-btn { box-shadow: var(--shadow-sm); }
.task, .trx-list, .saku-card, .start-tile, .stat, .card { box-shadow: var(--shadow); }
.chip, .shop-item, .badge, .jenis-grid button, .choice { background: var(--surface); border-color: transparent; box-shadow: var(--shadow-sm); }
.chip[aria-checked="true"], .jenis-grid button[aria-checked="true"] { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.chip-sm { background: var(--bg); }
.chip-sm.jenis-belanja, .chip-sm.jenis-tagihan, .chip-sm.jenis-olahraga { background: var(--primary-soft); color: var(--ink); }
.check { background: var(--bg); border-color: transparent; box-shadow: var(--inset); }
.check.play { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-sm); }
.ola-stats > div { background: var(--bg); box-shadow: var(--inset); }
.bar, .hbar-track, .xp-track { background: var(--bg); box-shadow: var(--inset); }
.bottom-nav { background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 0; box-shadow: 0 -6px 18px rgb(0 0 0 / 12%); }
.nav-item { position: relative; }
.nav-item[aria-current="page"] { color: var(--ink); }
.nav-item[aria-current="page"] .icon { background: none; }
.nav-item[aria-current="page"]::after {
  content: ''; position: absolute; bottom: 3px; width: 16px; height: 3px; border-radius: 3px; background: var(--ink);
}
.eyebrow { color: var(--muted); }
h1 { font-weight: 800; letter-spacing: -0.01em; }
.empty-icon, .soon-icon, .choice-icon, .up-ico, .cash-ico { background: var(--bg); color: var(--ink); box-shadow: var(--inset); }
.start-tile .icon { background: var(--bg); color: var(--ink); box-shadow: var(--inset); }
.link-banner { background: var(--surface); box-shadow: var(--shadow); }
.link-banner > span:first-child { color: var(--accent); }
.live-card { border-color: var(--accent); }
.fab { border-radius: 22px; box-shadow: var(--shadow); }
.trx-ico.ola, .trx-ico.in { box-shadow: none; }
.stage-card { background: radial-gradient(110% 80% at 50% 10%, var(--surface-2), transparent 70%), var(--surface); }
.cal-day.today > span { color: var(--accent); }
.cal-day.sel { background: var(--primary); box-shadow: var(--shadow-sm); }
.dots b { background: var(--accent); }
.ph-date b { color: var(--ink); }
.ticket { box-shadow: var(--shadow-sm); }
.ring { background: conic-gradient(var(--c, var(--accent)) calc(var(--p) * 1%), var(--bg) 0); box-shadow: var(--shadow); }
.ring[data-phase="work"] { --c: var(--accent); }
.done-badge { box-shadow: var(--shadow); }
.mood-bubble { box-shadow: var(--shadow-sm); }
.toast { box-shadow: var(--shadow-sm); }

/* ===== v0.8 ===== */
[data-content] { display: contents; }
.check.locked { color: var(--muted); cursor: default; }
.step-row input:disabled + span { color: var(--muted); }

/* Keuangan v0.8: akun, transfer, utang, grafik tahunan */
.tabs.four { grid-template-columns: repeat(4, 1fr); }
.tabs.four a { padding-left: 2px; padding-right: 2px; font-size: 0.85rem; }
.row-2.one { grid-template-columns: 1fr; }
.segmented button:disabled { opacity: 0.45; cursor: default; }
.chip:disabled { opacity: 0.5; cursor: default; }
.chip .icon { margin-right: 4px; vertical-align: -3px; }

.akun-row {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 10px; margin-top: 2px;
}
.akun-row::-webkit-scrollbar { display: none; }
.akun-chip {
  flex: none; display: flex; align-items: center; gap: 8px; min-width: 128px; max-width: 190px;
  padding: 8px 12px 8px 8px; border: 0; border-radius: 14px; cursor: pointer; text-align: left;
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm);
}
.akun-chip.on { box-shadow: var(--inset); outline: 2px solid var(--ink); outline-offset: -2px; }
.akun-chip.add { min-width: 0; padding: 8px 14px; color: var(--muted); font-weight: 700; font-size: 0.85rem; gap: 4px; }
.akun-ico {
  width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--sw) 18%, transparent); color: var(--sw);
}
.akun-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.akun-name { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.akun-txt b { font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.money-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
.money-actions .btn { min-width: 0; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
.money-actions .btn.icon-only { padding-left: 13px; padding-right: 13px; }

.filter-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.filter-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.filter-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.loan-card.done { opacity: 0.7; }
.loan-big { display: flex; flex-direction: column; gap: 6px; }
.note.bad-note { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }

.year-card { gap: 10px; }
.year-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.year-head .section-title span { display: inline-flex; align-items: center; gap: 6px; }
.year-nav { display: flex; align-items: center; gap: 4px; }
.year-nav b { min-width: 3.2em; text-align: center; }
.year-nav button:disabled { opacity: 0.3; }
.ychart {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; align-items: end;
  height: 160px; padding: 8px 2px 0; border-bottom: 1px solid var(--line);
}
.ycol {
  height: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  border: 0; background: none; padding: 0 1px; cursor: pointer; border-radius: 8px; color: var(--muted);
}
.ycol.on { background: var(--surface-2); color: var(--ink); }
.ycol.future { opacity: 0.4; }
.ybars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; min-height: 0; }
.ybar { display: block; width: 42%; max-width: 10px; border-radius: 4px 4px 1px 1px; min-height: 0; }
.ybar.in, .key.in { background: var(--good); }
.ybar.out, .key.out { background: var(--accent); }
.ylabel { font-size: 0.68rem; font-weight: 700; text-align: center; text-transform: uppercase; padding-bottom: 4px; }
.year-card .legend { gap: 16px; }
.year-card .legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.year-caption { min-height: 1.3em; }
.year-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.year-totals > div { min-width: 0; }
.year-totals b { display: block; font-size: min(0.98rem, 3.9vw); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.money-actions .btn .icon { flex: none; }
.akun-chip { flex: 1 1 auto; min-width: max-content; max-width: 100%; }
.akun-chip.add { flex: 0 0 auto; }
.akun-txt b { overflow: visible; text-overflow: clip; white-space: nowrap; }
.akun-name { max-width: 10em; }
.saku-line > .muted { margin-left: 4px; }
.year-totals { grid-template-columns: 1fr; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.year-totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.year-totals b { font-size: 1rem; overflow: visible; }

/* Olahraga v0.9: grafik progres per jenis */
.good-text { color: var(--good); }
.prog-card { gap: 10px; }
.scroll-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; margin: 0 -2px; }
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row .chip { flex: none; }
.prog-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.prog-summary > div { display: flex; flex-direction: column; min-width: 0; }
.prog-summary b { font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-chart { width: 100%; height: auto; display: block; overflow: visible; }
.prog-grid line { stroke: var(--line); stroke-width: 1; }
.prog-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.prog-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.prog-dot.best { fill: var(--good); }
.prog-dot.on { stroke: var(--ink); }
.prog-hit { fill: transparent; cursor: pointer; }
.prog-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.prog-axis text { fill: var(--muted); font-size: 10px; font-weight: 600; }
.prog-caption { min-height: 1.3em; }

/* Permainan v0.9 */
.arena-best { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.evo-skills { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.evo-skills li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--bg); }
.evo-skills li.on { box-shadow: var(--inset); outline: 2px solid var(--accent); outline-offset: -2px; }
.evo-skills li.locked { opacity: 0.55; }
.evo-num { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface); box-shadow: var(--shadow-sm); }
.evo-skills li.on .evo-num { background: var(--accent); color: #fff; }
.evo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.evo-text small { color: var(--muted); }
.evo-lv { flex: none; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.evo-skills li.done .evo-lv, .evo-skills li.on .evo-lv { color: var(--good); }
.tier-chip { font-weight: 700; }
.prog-pager { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.prog-pager .btn:disabled { opacity: 0.35; }
.prog-pager .muted { text-align: center; }
.hud-hp { position: relative; }
.hud-shield-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(127, 216, 255, 0.55); border-radius: inherit; pointer-events: none; transition: width 0.15s; }

/* v0.11: kotak gulir riwayat */
.scroll-box {
  max-height: 360px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 2px 6px 2px 2px; margin-right: -6px; display: flex; flex-direction: column; gap: 10px;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent);
}
.scroll-box:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.month-nav h3 { text-transform: capitalize; margin: 0; font-size: 1rem; }

/* v0.12: pengingat, riwayat transaksi */
.trx-scroll { max-height: 520px; }
.reminder-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; cursor: pointer; color: var(--ink); font: inherit; }
.reminder-ico { width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--bg); box-shadow: var(--inset); position: relative; }
.reminder-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 800; display: grid; place-items: center; }
.reminder-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reminder-main small { color: var(--muted); }
.rem-group { display: flex; flex-direction: column; gap: 6px; }
.rem-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); border: 0; width: 100%; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.rem-item .rem-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rem-item .rem-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rem-when { font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.rem-when.late { color: var(--bad); }
.rem-when.today { color: var(--accent); }
.rem-when.upcoming { color: var(--muted); }
.trx-scroll { padding: 4px 8px 14px; margin: 0 -8px; gap: 12px; }
.card.reminder-card { flex-direction: row; align-items: center; }

/* v0.13: pasang aplikasi & pilih karakter */
.install-top { display: flex; justify-content: flex-end; }
.install-top select { width: auto; min-height: 36px; padding: 4px 10px; border-radius: 999px; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font: inherit; font-size: 0.85rem; }
.app-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: var(--shadow); }
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: istep; }
.install-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); counter-increment: istep; font-size: 0.93rem; }
.istep-ico { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--bg); box-shadow: var(--inset); position: relative; }
.istep-ico::after { content: counter(istep); position: absolute; top: -6px; left: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-size: 0.7rem; font-weight: 800; display: grid; place-items: center; }
.char-stage { position: relative; height: 230px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--inset); display: grid; place-items: center; overflow: hidden; }
.char-stage .stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.char-stage.has-3d [data-fallback] { display: none; }
.char-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.char-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; color: var(--ink); font: inherit; }
.char-card[aria-checked="true"] { box-shadow: var(--inset); outline: 2px solid var(--accent); outline-offset: -2px; }
.char-pic { width: 64px; height: 64px; display: grid; place-items: center; position: relative; }
.char-pic img { width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 1; }
.char-pic img + .placeholder-pet { display: none; }
.placeholder-pet.mini { width: 52px; height: 48px; margin: 0; }
.char-label { font-size: 0.82rem; font-weight: 700; }
.placeholder-pet.mini { gap: 10px; padding-bottom: 4px; }

/* catatan kelebihan/risiko di pilihan tempat data */
.mode-notes { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.mode-note { display: flex; align-items: flex-start; gap: 6px; font-size: 0.8rem; line-height: 1.35; color: var(--muted); }
.mode-note svg { flex: none; margin-top: 2px; }
.mode-note.good svg { color: var(--good); }
.mode-note.warn svg { color: var(--warn, #c98a00); }
.modal-title { margin: 0 0 8px; font-size: 1.1rem; }
.modal p { margin: 0; }
.modal { max-height: calc(100dvh - 32px); overflow-y: auto; }
/* lisensi */
.license-terms { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.license-terms li { font-size: 0.85rem; color: var(--muted); }
