/* Tabungly — gaya prototipe "Aurora": krem hangat, tinta, serif Playfair Display */
:root {
  --bg: #fff3e0;
  --bg-outer: #ffe7c7;
  --ink: #1f1f1f;
  --ink-soft: #3a3a38;
  --muted: #7d6c57;
  --card: #ffffff;
  --line: #f5dfc4;
  --soft: #ffedd6;
  --dark: #1f1f1f;
  --olive: #ff6b00;
  --khaki: #ff9f1c;
  --sand: #ffd9ae;
  --pale: #ffe7c7;
  --green: #2f7d4f;
  --red: #b3261e;
  --red-soft: #fbf0ee;
  --radius: 20px;
  --shadow: 0 6px 18px rgba(23, 20, 10, .06);
  --serif: "Poppins", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg-outer);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.error { color: var(--red); font-size: .9rem; }
.success { color: var(--green); font-size: .9rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: .2rem 0 .6rem; }
a { color: var(--ink); font-weight: 500; }
strong { font-weight: 600; }

/* ---------- Kolom aplikasi (mobile-first, di web jadi bingkai tengah) ---------- */
#app {
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100dvh;
  position: relative;
}
.auth-wrap {
  background: var(--bg);
  min-height: 100dvh;
  position: relative;
  padding: 2.4rem 1.4rem 3rem;
}
@media (min-width: 768px) {
  body { background: radial-gradient(1200px 800px at 50% 30%, #fff8ee, var(--bg-outer)); }
  #app { box-shadow: 0 0 0 1px rgba(31,31,31,.05), 0 24px 60px rgba(31,31,31,.14); }
}

/* ---------- Auth ---------- */
.auth-shell { max-width: 430px; margin: 0 auto; }
.brand { text-align: center; margin-bottom: 1.6rem; }
.brand-logo {
  width: 66px; height: 66px; margin: 0 auto .8rem;
  background: #fff; color: var(--ink);
  font-family: var(--serif); font-weight: 600; font-size: 1.7rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px; box-shadow: 0 10px 24px rgba(31,31,31,.14);
  border: 1px solid var(--line);
}
.brand-logo img { width: 76%; height: 76%; display: block; }
.brand-mark { display: block; flex: none; }
.brand-mark.small { width: 32px; height: 32px; }
.wm-log { color: var(--olive); }
.brand-logo.small { width: 32px; height: 32px; font-size: .95rem; border-radius: 10px; margin: 0; box-shadow: none; }
.brand h1 { font-size: 2rem; margin-bottom: .2rem; font-weight: 700; }
.brand p { color: var(--muted); margin: .2rem 0 0; font-size: .95rem; }
.auth-visual-body, .auth-visual-note { display: none; }
.auth-card { margin-top: 1rem; }
.auth-card h2 { font-size: 1.55rem; margin-bottom: .3rem; }
.auth-sub { margin: 0 0 1.2rem; line-height: 1.5; font-size: .93rem; }
.auth-alt { text-align: center; margin: 1.15rem 0 0; color: var(--muted); font-size: .93rem; }
.auth-alt a { color: var(--ink); font-weight: 600; }
.auth-back { margin: 0 0 .6rem; font-size: .9rem; }
.auth-back a { color: var(--muted); text-decoration: none; }
.auth-back a:hover { color: var(--ink); }
.auth-row-right { text-align: right; margin: -.35rem 0 .2rem; font-size: .88rem; }
.auth-row-right a { color: var(--muted); text-decoration: none; font-weight: 500; }
.auth-row-right a:hover { color: var(--ink); }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1.1rem; background: var(--bg);
}
.topbar-brand { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.topbar-user {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--sand); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 1rem;
}
.content { padding: .4rem 1.1rem 110px; }
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 1.05rem 1.1rem; margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.22rem; }

/* ---------- Beranda ---------- */
.home-head { display: flex; align-items: center; gap: .8rem; padding: .6rem .1rem 1rem; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--sand); display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; font-size: 1.15rem;
}
.home-head p { margin: 0; }
.home-head strong { font-size: 1.05rem; }
.wallet-hero {
  background: var(--dark); color: #fff; border-radius: 22px;
  padding: 1.1rem 1.2rem; margin-bottom: 1.1rem;
  box-shadow: 0 14px 30px rgba(31,31,31,.22);
  cursor: pointer;
}
.wallet-hero .wh-top { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; font-weight: 600; }
.wallet-hero .wh-tag { color: var(--khaki); font-size: .68rem; letter-spacing: .12em; font-weight: 700; }
.wallet-hero .wh-chip { width: 32px; height: 23px; border-radius: 5px; background: var(--khaki); margin: .9rem 0 .7rem; }
.wallet-hero .wh-num { color: rgba(255,255,255,.75); font-size: .85rem; letter-spacing: .08em; }
.wallet-hero .wh-bal { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; margin-top: .25rem; }
.hero { text-align: center; padding: .4rem 0 1.1rem; }
.hero p { margin: 0; }
.serif-big { font-family: var(--serif); font-weight: 600; font-size: 2.45rem; line-height: 1.1; margin: .25rem 0; }
.hero-row { display: flex; justify-content: space-around; gap: 1rem; margin-top: .9rem; text-align: center; font-size: .9rem; color: var(--muted); }
.hero-row strong { display: block; color: var(--ink); font-size: 1.02rem; margin-top: .15rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot.in { background: var(--green); }
.dot.out { background: var(--red); }
.quick-actions { display: flex; justify-content: space-between; gap: .4rem; margin: 0 .1rem 1.1rem; }
.qa {
  flex: 1; background: none; border: 0; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: .45rem;
  font-family: var(--sans); font-size: .72rem; color: var(--muted); font-weight: 500;
}
.qa-ic {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 600; color: var(--ink);
  box-shadow: var(--shadow);
}
.qa-ic.ai-ic { font-size: .82rem; font-weight: 700; letter-spacing: .03em; }
.qa:active .qa-ic { background: var(--soft); }

/* ---------- Formulir & tombol ---------- */
label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: .85rem; color: var(--ink-soft); }
input, select {
  width: 100%; margin-top: .35rem; padding: .78rem .85rem;
  border: 0; border-radius: 12px; font-size: 1rem; background: var(--soft);
  font-family: var(--sans); color: var(--ink);
}
input:focus, select:focus { outline: 2px solid rgba(255,107,0,.5); }
.card input, .card select { background: var(--soft); }
.btn {
  display: block; width: 100%; padding: .85rem 1rem; margin-top: .6rem;
  border: 0; background: var(--card); color: var(--ink);
  border-radius: 999px; font-size: 1rem; font-family: var(--sans); cursor: pointer;
  box-shadow: var(--shadow);
}
.btn.primary { background: var(--dark); color: #fff; font-weight: 600; }
.btn.primary:active { background: #000; }
.btn.primary:disabled { opacity: .55; }
.btn.big { font-size: 1.05rem; padding: 1rem; margin-bottom: 1rem; }
.btn.danger { background: var(--red-soft); color: var(--red); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.seg { display: flex; background: var(--soft); border-radius: 999px; padding: 4px; margin-bottom: 1rem; }
.seg-btn {
  flex: 1; padding: .6rem; border: 0; border-radius: 999px; background: transparent;
  font-size: .95rem; font-family: var(--sans); cursor: pointer; color: var(--muted);
}
.seg-btn.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(31,31,31,.12); }
.filter-row { display: flex; gap: .6rem; }
.filter-row select { flex: 1; }

/* ---------- Daftar transaksi ---------- */
.tx-item {
  display: flex; align-items: center; gap: .8rem;
  padding: .6rem 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.tx-item:last-child { border-bottom: 0; }
.tx-ava .material-symbols-outlined { font-size: 20px; }
.tx-ava {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; color: var(--ink);
}
.t0 { background: var(--sand); } .t1 { background: var(--pale); }
.t2 { background: #ffc98f; } .t3 { background: #ffe0b8; } .t4 { background: #ffedd2; }
.tx-main { flex: 1; min-width: 0; }
.tx-item .note { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-item .meta { color: var(--muted); font-size: .8rem; }
.tx-amount { font-weight: 600; white-space: nowrap; font-size: .95rem; }
.tx-amount.income { color: var(--green); }
.tx-amount.expense { color: var(--ink); }
.tx-date-group { font-size: .82rem; color: var(--muted); margin: 1rem 0 .3rem; font-weight: 600; }

/* ---------- Grafik ---------- */
.bar-row { margin-bottom: .75rem; }
.bar-row .bar-head { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: .3rem; }
.bar { height: 9px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.bar > div { height: 100%; background: var(--olive); border-radius: 6px; }
.week-bars { display: flex; align-items: flex-end; gap: .8rem; height: 120px; padding-top: .4rem; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .45rem; height: 100%; justify-content: flex-end; }
.week-bar { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--sand); }
.week-col.max .week-bar { background: var(--olive); }
.week-col.mid .week-bar { background: var(--khaki); }
.week-lab { font-size: .72rem; color: var(--muted); }
.donut-wrap { display: flex; align-items: center; gap: 1.1rem; }
.donut-legend { flex: 1; }
.legend-row { display: flex; align-items: baseline; gap: .5rem; padding: .28rem 0; font-size: .88rem; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; position: relative; top: -1px; }
.legend-name { flex: 1; }
.legend-pct { font-weight: 600; }
.legend-amt { display: block; color: var(--muted); font-size: .76rem; }

/* ---------- Dompet ---------- */
.wallet-item { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .75rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.wallet-item:last-child { border-bottom: 0; }
.wallet-item .w-name { font-weight: 600; }
.wallet-item .w-bal { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; white-space: nowrap; }
.total-wallet { text-align: center; padding: .6rem 0 .2rem; }
.total-wallet .serif-big { font-size: 2.1rem; }

/* ---------- Kategori & menu ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--soft); border-radius: 999px;
  padding: .38rem .75rem; margin: 0 .4rem .45rem 0; font-size: .88rem;
}
.chip button { border: 0; background: none; color: var(--red); cursor: pointer; font-size: 1rem; padding: 0; }
.menu { padding: .35rem 1.1rem; }
.menu-item {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--line); padding: .95rem 0; font-size: .98rem;
  font-family: var(--sans); cursor: pointer; color: var(--ink);
}
.menu-item::after { content: "›"; color: var(--muted); font-size: 1.25rem; }
.menu-item:last-child { border-bottom: 0; }
.menu-item:last-child::after { content: ""; }
.danger-text { color: var(--red); }
.profile-head { display: flex; align-items: center; gap: .9rem; }
.profile-head h3 { margin: 0 0 .15rem; font-size: 1.3rem; }
.profile-head p { margin: 0; }

/* ---------- AI ---------- */
.ai-dark { background: var(--dark); color: #fff6ea; }
.ai-dark h3 { color: #fff; }
.ai-dark .muted { color: rgba(255,255,255,.6); }
.ai-banner { background: var(--dark); color: #fff6ea; cursor: pointer; }
.ai-banner .ab-tag { color: var(--khaki); font-size: .68rem; letter-spacing: .12em; font-weight: 700; }
.ai-banner h3 { color: #fff; margin: .35rem 0 .3rem; }
.ai-banner p { margin: 0; color: rgba(255,255,255,.72); font-size: .88rem; line-height: 1.45; }
#ai-result ul { margin: .2rem 0 .2rem 1.1rem; padding: 0; line-height: 1.5; }
#ai-result li { margin-bottom: .3rem; }

/* ---------- Navbar bawah ---------- */
.bottomnav {
  position: fixed; bottom: 0; z-index: 10;
  left: 50%; transform: translateX(-50%);
  width: min(430px, 100%);
  display: flex; align-items: flex-start;
  background: var(--card); border-top: 1px solid var(--line);
  padding: .45rem .3rem calc(.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 18px rgba(31,31,31,.05);
}
.nav-btn {
  flex: 1; background: none; border: 0; padding: .3rem 0 .1rem;
  color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-family: var(--sans);
}
.nav-btn svg { width: 23px; height: 23px; }
.nav-btn span { font-size: .66rem; font-weight: 500; }
.nav-btn.active { color: var(--ink); }
.nav-btn.active span { font-weight: 700; }
.nav-btn.add { margin-top: -22px; }
.nav-btn.add .add-circle {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--dark); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px rgba(31,31,31,.3);
}
.nav-btn.add .add-circle svg { width: 24px; height: 24px; }
.nav-btn.add span:last-child { color: var(--muted); font-size: .66rem; }

/* ---------- Komponen stage8: toast, modal, spinner, status kosong ---------- */
.btn:disabled { opacity: .55; cursor: wait; }
.toast {
  position: fixed; left: 50%; z-index: 60;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(14px);
  background: var(--dark); color: #fff;
  padding: .78rem 1.25rem; border-radius: 999px;
  font-size: .92rem; font-weight: 500; text-align: center;
  max-width: min(92vw, 480px);
  box-shadow: 0 14px 34px rgba(31,31,31,.3);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(31,31,31,.48);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-card {
  background: var(--card); border-radius: 20px;
  padding: 1.4rem 1.4rem 1.2rem; width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(31,31,31,.3);
}
.modal-card h3 { margin-top: 0; }
.modal-card p { margin: .2rem 0 0; line-height: 1.5; }
.modal-actions { display: flex; gap: .6rem; margin-top: 1.1rem; }
.modal-actions .btn { margin-top: 0; }
.btn.danger-solid { background: var(--red); color: #fff; font-weight: 600; box-shadow: none; }
.spinner {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border: 2px solid var(--sand); border-top-color: var(--olive);
  border-radius: 50%; vertical-align: -2px;
  animation: ml-spin .7s linear infinite;
}
@keyframes ml-spin { to { transform: rotate(360deg); } }
.loading-card { color: var(--muted); }
.empty { text-align: center; padding: 2rem 1.2rem; }
.empty-ic {
  width: 56px; height: 56px; margin: 0 auto .7rem;
  border-radius: 50%; background: var(--soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; color: var(--muted);
}
.empty p { margin: .25rem 0; }
.month-nav { display: flex; align-items: center; gap: .6rem; }
.month-label { flex: 1; margin: 0; }
.month-btn {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  font-size: 1.35rem; line-height: 1; color: var(--ink); cursor: pointer;
}
.month-btn:active { background: var(--soft); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid rgba(255,107,0,.65); outline-offset: 2px;
}

/* ---------- Sidebar (hanya web lebar) ---------- */
.sidebar { display: none; }
.side-brand { display: flex; align-items: center; gap: .6rem; font-family: var(--serif); font-weight: 600; font-size: 1.3rem; margin-bottom: 1.3rem; }
.side-add { margin: 0 0 1.3rem; }
.side-nav { display: flex; flex-direction: column; gap: .25rem; }
.side-btn {
  display: flex; align-items: center; gap: .7rem;
  padding: .68rem .8rem; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink-soft);
  font-family: var(--sans); font-size: .95rem; text-align: left; cursor: pointer;
}
.side-btn svg { width: 20px; height: 20px; flex: none; }
.side-btn:hover { background: rgba(255,255,255,.7); }
.side-btn.active { background: var(--dark); color: #fff; font-weight: 600; }
.side-user { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; align-items: center; gap: .7rem; }
.side-user .avatar { width: 40px; height: 40px; font-size: 1rem; }
.side-user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.side-user-meta strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-meta span { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-logout { border: 0; background: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; padding: .3rem; }
.side-logout:hover { color: var(--red); }

/* ---------- Tata letak web (desktop) ---------- */
@media (min-width: 1024px) {
  #app { max-width: none; margin: 0; box-shadow: none; }

  /* Auth: panel belah seperti referensi — visual kiri, formulir kanan */
  .auth-wrap {
    max-width: none; padding: 2.5rem 1.5rem;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
  }
  .auth-shell {
    display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    width: min(1060px, 100%); max-width: none; min-height: 660px;
    background: var(--card); border-radius: 30px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(31,31,31,.18), 0 0 0 1px rgba(31,31,31,.05);
  }
  .auth-visual {
    position: relative; overflow: hidden;
    background:
      radial-gradient(560px 380px at 85% -10%, rgba(255,159,28,.5), transparent 60%),
      radial-gradient(640px 520px at -20% 110%, rgba(255,107,0,.55), transparent 60%),
      linear-gradient(160deg, #2a2a2a, var(--dark) 55%, #131313);
    color: #fff6ea;
    padding: 2.6rem 2.4rem;
    display: flex; flex-direction: column;
  }
  .auth-visual .brand { margin-bottom: 0; }
  .auth-visual .brand-logo {
    width: 84px; height: 84px; font-size: 2.1rem; border-radius: 24px;
    background: #fff3e0; border: 1px solid rgba(255,255,255,.22);
    box-shadow: 0 14px 30px rgba(0,0,0,.3);
  }
  .auth-visual .wm-log { color: var(--khaki); }
  .auth-visual .brand h1 { color: #fff; font-size: 1.65rem; margin-top: .4rem; }
  .auth-visual .brand p { color: rgba(255,255,255,.65); font-size: .9rem; max-width: 300px; margin-left: auto; margin-right: auto; }
  .auth-visual-body { display: block; margin-top: auto; }
  .auth-visual-title { font-size: 1.9rem; line-height: 1.2; color: #fff; margin: 0 0 1.3rem; }
  .auth-feats { display: flex; flex-direction: column; gap: 1rem; list-style: none; margin: 0; padding: 0; }
  .auth-feats li { display: flex; gap: .8rem; align-items: flex-start; }
  .af-ic {
    width: 34px; height: 34px; flex: none; border-radius: 10px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem; color: var(--khaki);
  }
  .auth-feats strong { display: block; font-size: .95rem; color: #fff; }
  .auth-feats li div span { font-size: .83rem; color: rgba(255,255,255,.62); line-height: 1.45; }
  .auth-visual-note { display: block; margin: 1.6rem 0 0; font-size: .78rem; letter-spacing: .04em; color: rgba(255,255,255,.45); }
  .auth-main { display: flex; align-items: center; padding: 2.8rem 3.1rem; min-width: 0; }
  .auth-main .auth-card { margin: 0; padding: 0; background: transparent; box-shadow: none; width: 100%; }
  .auth-main .auth-card h2 { font-size: 2rem; }
  .auth-main input { background: #fff; border: 1.5px solid #f0d9b5; border-radius: 999px; padding: .85rem 1.15rem; }
  .auth-main input:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 4px rgba(255,107,0,.15); }
  .auth-main input[readonly] { background: var(--soft); color: var(--muted); }
  .auth-main .pw-eye { background: transparent; }
  .auth-main .btn.primary { padding: 1rem; font-size: 1.02rem; }
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 20;
    width: 268px; padding: 1.5rem 1.15rem 1.2rem;
    background: var(--bg); border-right: 1px solid var(--line);
  }
  .topbar, .bottomnav { display: none; }
  .content { margin-left: 268px; padding: 2.2rem 2.6rem 3rem; }
  .content .view { max-width: 1120px; margin: 0 auto; }
  .toast { bottom: 28px; }

  /* Beranda: dua kolom */
  #view-home { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 1.2rem; align-items: start; }
  #view-home .card { margin-bottom: 0; }
  #view-home .home-head { grid-column: 1 / -1; padding-bottom: .2rem; }
  #view-home .hero { grid-column: 1; grid-row: 2; text-align: left; padding: .5rem .2rem 0; }
  #view-home .hero .serif-big { font-size: 3.1rem; }
  #home-wallet { grid-column: 2; grid-row: 2; }
  #home-wallet .wallet-hero { margin-bottom: 0; }
  #home-quick-card { grid-column: 1; grid-row: 3; }
  #view-home .quick-actions {
    grid-column: 2; grid-row: 3; margin: 0;
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.05rem .6rem;
  }
  #home-cats-card { grid-column: 2; grid-row: 4; }
  #home-recent-card { grid-column: 1; grid-row: 4; }

  /* Dompet: daftar + formulir berdampingan */
  #view-wallets { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 1.2rem; align-items: start; }
  #wallet-form-card { position: sticky; top: 2rem; margin-bottom: 0; }

  /* Laporan: ringkasan penuh, grafik berdampingan */
  #view-report { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
  #view-report .card { margin-bottom: 0; }
  #report-summary-card { grid-column: 1 / -1; }
  #view-report .ai-banner { grid-column: 1 / -1; }
  #report-export { grid-column: 1 / -1; justify-self: start; width: auto; padding-left: 1.7rem; padding-right: 1.7rem; margin-top: 0; }
  #view-report > .btn.ghost { grid-column: 1 / -1; justify-self: start; width: auto; margin-top: 0; }

  /* Formulir & halaman tunggal: kolom tengah yang lega */
  #view-tx-form .card,
  #view-categories .card { max-width: 680px; margin-left: auto; margin-right: auto; }
  #view-categories > .btn.ghost { max-width: 680px; margin-left: auto; margin-right: auto; }

  /* Profil & Analisis AI: dua kolom lega (dulu kolom sempit 680px di tengah) */
  #view-profile { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
  #view-profile .card { margin-bottom: 0; }
  #view-profile .span2 { grid-column: 1 / -1; }
  #view-ai { display: grid; gap: 1.2rem; }
  #view-ai .card { margin-bottom: 0; }
  #view-ai > .btn.ghost { justify-self: start; width: auto; margin-top: 0; }
  .ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
  .ai-grid .span2 { grid-column: 1 / -1; }
  .ai-grid .card { margin-bottom: 0; }

  /* Transaksi: daftar lebar dengan efek hover */
  #tx-search { max-width: 430px; }
  #tx-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .3rem 1.1rem 0.6rem; }
  #tx-list .card { background: transparent; box-shadow: none; }
  .tx-item { padding-left: .5rem; padding-right: .5rem; border-radius: 10px; }
  .tx-item:hover { background: var(--soft); }
  .wallet-item:hover { background: var(--soft); }
  .qa:hover .qa-ic { border-color: var(--khaki); }
  .btn.primary:hover { background: #000; }
}

/* ================= Stage 9: referensi dashboard web + perbaikan HP + animasi ================= */
.desktop-only { display: none; }
.desk-head { display: none; }
#app, .auth-wrap { overflow-x: clip; }
.btn { transition: background .15s ease, transform .1s ease, opacity .15s ease; }
.btn:active { transform: scale(.99); }
.side-btn { transition: background .15s ease, color .15s ease; }

/* Perbaikan HP: baris filter boleh membungkus, bulan baris sendiri di layar sempit */
.filter-row { flex-wrap: wrap; }
.filter-row select { flex: 1 1 120px; }
#tx-filter-month { flex: 1 1 150px; }
@media (max-width: 560px) {
  #tx-filter-month { flex-basis: 100%; }
  .month-btn { width: 40px; height: 40px; }
}
.tx-item .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .serif-big { font-size: clamp(2rem, 11vw, 2.45rem); }
.donut-wrap { flex-wrap: wrap; justify-content: center; }
.wallet-hero .wh-bal { overflow-wrap: anywhere; }

/* Animasi */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.enter { animation: fadeUp .3s ease both; }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.flow-bar, .mini-bar, .week-bar { transform-origin: bottom; animation: growY .55s ease both; }
@keyframes popIn { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card { animation: popIn .18s ease both; }

/* Sidebar: pencarian + label seksi */
.side-search { position: relative; margin-bottom: 1rem; }
.side-search svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.side-search input { margin-top: 0; padding-left: 2.2rem; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.side-label { font-size: .7rem; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 1.05rem 0 .45rem; }

/* Kartu statistik + grafik mini */
.stat-card { padding: 1.1rem 1.2rem; }
.stat-label { color: var(--muted); font-size: .85rem; margin: 0 0 .3rem; font-weight: 500; }
.stat-value { font-family: var(--serif); font-weight: 600; font-size: 1.65rem; line-height: 1.15; }
.stat-sub { font-size: .8rem; margin: .2rem 0 0; }
.mini-bars { display: flex; align-items: flex-end; gap: 5px; height: 44px; margin-top: .75rem; max-width: 170px; }
.mini-col { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.mini-bar { width: 100%; border-radius: 4px 4px 2px 2px; }
.mini-bar.mb-in { background: var(--olive); }
.mini-bar.mb-out { background: var(--khaki); }
.mini-bar.mb-sand { background: var(--sand); }

/* Grafik arus kas gabungan */
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.panel-head h3 { margin-top: 0; }
.legend { font-size: .82rem; }
.dot.in { background: var(--olive); }
.dot.out { background: var(--khaki); }
.flow-chart { display: flex; align-items: flex-end; gap: 1rem; height: 175px; padding-top: .5rem; }
.flow-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .45rem; height: 100%; justify-content: flex-end; }
.flow-pair { display: flex; align-items: flex-end; justify-content: center; gap: 5px; height: calc(100% - 22px); width: 100%; }
.flow-bar { width: 16px; border-radius: 5px 5px 2px 2px; }
.flow-bar.in { background: var(--olive); }
.flow-bar.out { background: var(--khaki); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font-family: var(--sans); font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.link-btn:hover { color: var(--ink); }

@media (min-width: 1024px) {
  .desktop-only { display: block; }
  .stats-row.desktop-only { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
  .desk-head {
    display: flex; justify-content: space-between; align-items: center;
    max-width: 1120px; margin: 0 auto 1.5rem;
  }
  .crumb p { margin: 0; }
  .crumb-path { font-size: 1.02rem; color: var(--muted); }
  .crumb-path span { margin: 0 .3rem; }
  .crumb-path strong { color: var(--ink); font-weight: 600; }
  .crumb-date { color: var(--muted); font-size: .83rem; margin-top: .15rem !important; }
  .desk-head-user { display: flex; align-items: center; gap: .7rem; }
  .desk-head-user .avatar { width: 40px; height: 40px; font-size: 1rem; }
  .dhu-meta { display: flex; flex-direction: column; }
  .dhu-meta strong { font-size: .93rem; }
  .dhu-meta span { font-size: .76rem; color: var(--muted); }

  /* Beranda gaya panel referensi */
  #view-home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #view-home .home-head, #view-home .hero, #view-home .quick-actions { display: none; }
  #view-home .stats-row { grid-column: 1 / -1; grid-row: 1; }
  #home-quick-card { grid-column: 1 / -1; grid-row: 2; }
  #home-quick-card #form-quick { display: flex; gap: .8rem; align-items: flex-start; }
  #home-quick-card #form-quick input { flex: 1; margin-top: 0; }
  #home-quick-card #form-quick .btn { width: auto; margin-top: 0; padding-left: 1.6rem; padding-right: 1.6rem; }
  #home-flow-card { grid-column: 1 / 3; grid-row: 3; }
  #home-wallet { grid-column: 3; grid-row: 3; }
  #home-wallet .wallet-hero { height: 100%; margin-bottom: 0; }
  #home-cats-card { grid-column: 1; grid-row: 4; }
  #home-cats-card .donut-wrap { flex-direction: column; gap: .5rem; }
  #home-recent-card { grid-column: 2; grid-row: 4; }
  #home-ai-panel { grid-column: 3; grid-row: 4; }
  #view-home .card, #view-report .card { transition: box-shadow .2s ease, transform .2s ease; }
  #view-home .card:hover, #view-report .card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31,31,31,.09); }
}

/* ================= Stage 10: profil rinci, states, komponen pola ================= */
.avatar { overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 76px; height: 76px; font-size: 1.7rem; }
.profile-head { display: flex; align-items: center; gap: 1.1rem; }
.ph-meta h3 { margin: 0 0 .15rem; }
.ph-meta p { margin: 0; }
.small { font-size: .8rem; }

.clickable { cursor: pointer; }
.stat-card[data-nav], .desk-head-user, .topbar-user, .side-user-main { cursor: pointer; }
.side-user-main { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 0; border-radius: 12px; }
.side-user-main:hover .side-user-meta strong { text-decoration: underline; }
.legend-row.clickable { border-radius: 8px; padding: .15rem .3rem; margin: 0 -.3rem; }
.legend-row.clickable:hover { background: var(--soft); }
.chip.clickable:hover { border-color: #ff6b00; }

:focus-visible { outline: 2px solid #ff6b00; outline-offset: 2px; }
button:active, .btn:active { transform: scale(.985); }

/* Isian kata sandi dengan tombol Lihat */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 4.4rem; }
.pw-eye {
  position: absolute; right: .45rem; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--soft); color: var(--muted);
  font-size: .76rem; font-weight: 600; padding: .32rem .6rem; border-radius: 999px; cursor: pointer;
}
.pw-eye:hover { color: var(--ink, #1f1f1f); }

/* Baris tombol sejajar */
.row-btns { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .4rem; }
.row-btns .btn { width: auto; flex: 1 1 150px; }
.file-btn { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-align: center; }

/* Chip contoh catat cepat */
.quick-try { margin: .6rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.try-chip {
  border: 1px solid var(--line); background: var(--soft); color: inherit;
  border-radius: 999px; padding: .28rem .7rem; font-size: .8rem; cursor: pointer;
}
.try-chip:hover { border-color: #ff6b00; background: #fff; }

/* Chip filter aktif di daftar transaksi */
.chip-x {
  border: 1px solid var(--line); background: var(--soft); border-radius: 999px;
  padding: .2rem .6rem; font-size: .78rem; cursor: pointer; margin-left: .4rem;
}
.chip-x:hover { border-color: #b3543f; color: #b3543f; }

/* Snackbar beraksi */
.toast { display: flex; align-items: center; gap: .9rem; }
.toast-action {
  border: 0; background: none; color: #ffb25e; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; font-size: .8rem;
  cursor: pointer; padding: .3rem .2rem; white-space: nowrap;
}
.toast-action:hover { text-decoration: underline; }

/* Zona berbahaya & bantuan */
.danger-zone { border: 1px solid #dcb7a6; background: #fbf3ec; }
details { border-top: 1px solid var(--line); padding: .55rem 0; }
details:first-of-type { border-top: 0; }
details summary { cursor: pointer; font-weight: 600; padding: .2rem 0; }
details p { margin: .35rem 0 .2rem; line-height: 1.55; }

/* Rincian dompet */
.wh-month { font-size: .8rem; opacity: .85; margin-top: .4rem; }
.wh-tx {
  margin-top: .65rem; background: rgba(255,255,255,.13); color: #fff;
  border: 1px solid rgba(255,255,255,.35); padding: .38rem .85rem;
  border-radius: 999px; cursor: pointer; font-size: .82rem;
}
.wh-tx:hover { background: rgba(255,255,255,.22); }
.w-tx-link { background: none; border: 0; color: #ff6b00; cursor: pointer; font-size: .8rem; font-weight: 600; padding: .2rem 0 0; }
.w-tx-link:hover { text-decoration: underline; }

/* Hasil Analisis AI */
.ai-grid { display: grid; gap: 1.2rem; }
.ai-grid .card { margin-bottom: 0; }
.ai-ringkasan { font-size: 1.03rem; line-height: 1.6; margin: 0; }
.ai-list { margin: .2rem 0 0 1.15rem; padding: 0; line-height: 1.55; }
.ai-list li { margin-bottom: .4rem; }
.anomali-warn { border: 1px solid #ff9f1c; background: #fff4e0; }

/* Sortir sejajar filter lain */
.filter-row #tx-sort { flex: 1 1 140px; }

/* Perbaikan stage 10: snackbar yang tampil harus bisa menerima klik (tombol Urungkan) */
.toast.show { pointer-events: auto; }

/* ================= Stage 11: paket animasi + pengerasan ================= */
/* Masuk bertahap: anak-anak tampilan muncul satu per satu */
.view.enter > *, .auth-card.enter {
  animation: fadeUp .45s cubic-bezier(.22, .8, .32, 1) both;
}
.view.enter > *:nth-child(2) { animation-delay: .05s; }
.view.enter > *:nth-child(3) { animation-delay: .1s; }
.view.enter > *:nth-child(4) { animation-delay: .15s; }
.view.enter > *:nth-child(5) { animation-delay: .2s; }
.view.enter > *:nth-child(6) { animation-delay: .25s; }
.view.enter > *:nth-child(n+7) { animation-delay: .3s; }

/* Batang grafik tumbuh dari nol */
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar > div { transform-origin: left; animation: growX .7s cubic-bezier(.22, .8, .32, 1) both; }
.donut-wrap { animation: popIn .35s ease both; }

/* Daftar transaksi masuk berjenjang */
#tx-list .tx-item { animation: fadeUp .3s ease both; }
#tx-list .tx-item:nth-child(2) { animation-delay: .03s; }
#tx-list .tx-item:nth-child(3) { animation-delay: .06s; }
#tx-list .tx-item:nth-child(4) { animation-delay: .09s; }
#tx-list .tx-item:nth-child(5) { animation-delay: .12s; }
#tx-list .tx-item:nth-child(n+6) { animation-delay: .15s; }

/* Modal: latar memudar */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay { animation: fadeIn .18s ease both; }

/* Kartu dompet melayang halus */
.wallet-hero { transition: transform .2s ease, box-shadow .2s ease; }
.wallet-hero:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(31,31,31,.26); }

/* Tombol catat di navbar: memantul saat ditekan */
.nav-btn .add-circle { transition: transform .15s ease; }
.nav-btn:active .add-circle { transform: scale(.9); }

/* Kartu statistik & panel bisa diklik: terangkat saat kursor di atasnya (web) */
@media (min-width: 1024px) {
  .stat-card { transition: transform .2s ease, box-shadow .2s ease; }
  .stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31,31,31,.09); }
  .ai-banner { transition: transform .2s ease; }
  .ai-banner:hover { transform: translateY(-2px); }
}

/* Logo melayang pelan di panel visual auth */
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.auth-visual .brand-logo { animation: floatY 7s ease-in-out infinite; }

/* Keadaan memuat: denyut lembut */
@keyframes pulseSoft { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.loading-card { animation: pulseSoft 1.1s ease-in-out infinite; }

/* Pengerasan avatar: gambar tidak akan pernah keluar dari lingkaran */
.avatar { position: relative; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* Hormati pengguna yang mengurangi gerak */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Perbaikan stage 11: avatar di topbar HP — wadah bukan .avatar, gambar harus terkunci 38px */
.topbar-user { overflow: hidden; position: relative; flex: none; }
.topbar-user img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* ===== Fitur publik: target, berulang, tagihan, verifikasi, split bill ===== */
.hp { display: none !important; }
.bill-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .65rem 0; border-bottom: 1px dashed var(--line);
}
.bill-row:last-child { border-bottom: none; }
.bill-row p { margin: .1rem 0 0; }
.bill-row .in { color: var(--green); }
.bill-row .out { color: var(--red); }
.verify-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-color: var(--khaki); background: #fff8ec; }
.verify-banner p { margin: 0; }
.goal-item { padding: .8rem 0; border-bottom: 1px dashed var(--line); }
.goal-item:last-child { border-bottom: none; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; }
.goal-item .bar { margin-bottom: .35rem; }
.rec-actions { text-align: right; }
.rec-actions .row-btns { justify-content: flex-end; margin-top: .2rem; }
#view-goals textarea, #view-recurring textarea, #split-card textarea, #form-feedback textarea {
  width: 100%; padding: .8rem 1rem; border: 1.5px solid var(--line); border-radius: 14px;
  font: inherit; background: #fff; resize: vertical;
}
#split-result { margin-top: .8rem; }
a.menu-item { display: block; text-decoration: none; color: inherit; }

/* ================= Stage 12: sistem desain — token, kontras, hierarki, kerangka ================= */
/* Prinsip (lihat DESIGN.md): aksen oranye hanya di momen kunci; bayangan kuat hanya
   untuk elemen yang memang terangkat (hero, modal, toast); kartu polos rata bergaris tepi. */
:root {
  --radius-sm: 12px;
  --radius-lg: 28px;
  --shadow-flat: 0 1px 3px rgba(31,31,31,.05);
  --ring: 0 0 0 4px rgba(255,107,0,.16);
}
::selection { background: rgba(255,159,28,.45); }
* { -webkit-tap-highlight-color: transparent; }

/* Angka uang selalu tabular: digit sejajar antarbaris, daftar mudah dipindai */
.tx-amount, .w-bal, .wh-bal, .serif-big, .stat-value, .legend-amt, .bill-row strong, .goal-head strong {
  font-variant-numeric: tabular-nums;
}

/* Kartu polos: rata dengan garis tepi, tidak lagi melayang semua */
.card { border: 1px solid var(--line); box-shadow: var(--shadow-flat); }

/* Fokus yang konsisten: cincin lembut oranye di semua isian */
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--ring); }

/* Nav bawah: status aktif ditandai bentuk (batang di sisi atas), bukan warna saja */
.bottomnav .nav-btn { position: relative; min-height: 52px; justify-content: center; }
.bottomnav .nav-btn.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--olive);
}

/* Target sentuh yang cukup untuk jempol */
.side-logout { min-width: 40px; min-height: 40px; }
@media (max-width: 560px) { .month-btn { width: 44px; height: 44px; } }

/* Kerangka pemuatan: menunjukkan bentuk konten yang sedang dimuat */
.skl-row { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; }
.skl {
  border-radius: 8px;
  background: linear-gradient(100deg, var(--soft) 40%, #ffe3c2 50%, var(--soft) 60%);
  background-size: 200% 100%;
  animation: skl-shimmer 1.2s ease-in-out infinite;
}
.skl-ava { width: 42px; height: 42px; border-radius: 50%; flex: none; }
.skl-line { flex: 1; height: 14px; }
.skl-amt { width: 74px; height: 14px; flex: none; }
@keyframes skl-shimmer { from { background-position: 120% 0; } to { background-position: -80% 0; } }

/* Umpan balik kursor untuk tombol (perangkat dengan penunjuk presisi) */
@media (hover: hover) {
  .btn:hover { box-shadow: 0 8px 20px rgba(31,31,31,.10); }
  .btn.danger:hover, .btn.ghost:hover { box-shadow: none; }
}

/* ================= Stage 13: liquid glass, carousel dompet, panel fitur, profil baru ================= */
/* Carousel dompet: geser mulus dengan snap; kartu kaca bergradasi oranye di atas tinta */
.wallet-carousel {
  display: flex; gap: .8rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: .15rem .1rem .45rem; scrollbar-width: none;
}
.wallet-carousel::-webkit-scrollbar { display: none; }
.wallet-carousel .wallet-hero { flex: 0 0 86%; scroll-snap-align: start; margin-bottom: 0; }
.wallet-hero.glass {
  background:
    radial-gradient(420px 200px at 85% -20%, rgba(255,159,28,.5), transparent 60%),
    radial-gradient(380px 240px at -10% 115%, rgba(255,107,0,.45), transparent 60%),
    linear-gradient(150deg, #2b2b2b, #1f1f1f 55%, #141414);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 14px 30px rgba(31,31,31,.22);
}
.wallet-add {
  flex: 0 0 42%; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  border: 1.5px dashed #e3c9a4; border-radius: 22px; background: rgba(255,255,255,.45);
  color: var(--muted); font-family: var(--sans); font-size: .9rem; font-weight: 600; cursor: pointer;
  min-height: 158px;
}
.wallet-add .wa-plus { font-size: 1.5rem; color: var(--olive); }
.wh-dots { display: flex; gap: 6px; justify-content: center; margin: .35rem 0 .95rem; }
.wh-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--sand); transition: all .2s ease; }
.wh-dot.active { width: 20px; background: var(--olive); }

/* Nav bawah: pil kaca melayang */
.bottomnav {
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(430px, calc(100% - 20px));
  border: 1px solid rgba(255,255,255,.65); border-radius: 28px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 18px 40px rgba(31,31,31,.18);
}
@media (max-width: 1023px) {
  .toast { bottom: calc(118px + env(safe-area-inset-bottom)); }
}

/* Panel Semua Fitur */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 65; background: rgba(31,31,31,.48);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s ease both;
}
.sheet {
  background: var(--bg); width: min(430px, 100%);
  border-radius: 26px 26px 0 0; padding: 1.1rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom));
  animation: sheetUp .25s cubic-bezier(.22,.8,.32,1) both;
  max-height: 82dvh; overflow: auto;
}
@keyframes sheetUp { from { transform: translateY(26px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
.sheet-head h3 { margin: 0; }
.sheet-x { border: 0; background: var(--soft); width: 38px; height: 38px; border-radius: 50%; font-size: 1rem; cursor: pointer; color: var(--ink); }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem .4rem; }
@media (min-width: 1024px) {
  .sheet-overlay { align-items: center; }
  .sheet { border-radius: 26px; width: min(520px, 94vw); }
}

/* Grafik garis arus kas + sparkline kartu statistik */
.flow-line { width: 100%; height: auto; display: block; }
.flow-line polyline { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.fl-in { stroke: #ff6b00; }
.fl-out { stroke: #ff9f1c; }
.fl-dots-in circle { fill: #ff6b00; stroke: #fff; stroke-width: 1.6; }
.fl-dots-out circle { fill: #ff9f1c; stroke: #fff; stroke-width: 1.6; }
.flow-labels { display: flex; justify-content: space-between; padding: 0 14px; margin-top: .3rem; }
.flow-labels span { font-size: .72rem; color: var(--muted); }
.mini-bars:has(.spark) { display: block; height: 42px; max-width: none; }
.spark { width: 100%; height: 100%; display: block; }

/* Profil: lencana verifikasi, ringkasan keuangan, tombol edit */
.verified-badge {
  background: #e7f4ec; color: var(--green); font-size: .68rem; font-weight: 700;
  padding: .14rem .5rem; border-radius: 999px; vertical-align: 2px; white-space: nowrap;
}
.pf-sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.pf-sum-grid p { margin: 0 0 .15rem; }
.pf-sum-grid strong { font-size: 1.12rem; font-variant-numeric: tabular-nums; }
@media (min-width: 1024px) { .pf-sum-grid { grid-template-columns: repeat(4, 1fr); } }
.pf-edit-btn { margin-left: auto; margin-top: 0; width: auto; padding: .55rem 1.05rem; flex: none; }

/* ================= Stage 14: implementasi desain Stitch ================= */
/* Kepala tampilan generik */
.view-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.view-head h2 { margin: 0; font-size: 1.3rem; }
.small-btn { width: auto; margin-top: 0; padding: .55rem 1rem; }
.section-title { margin: 1.2rem 0 .6rem; font-size: 1.02rem; }
.center-note { text-align: center; margin-top: .8rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }

/* Hero Sisa Bulan Ini + chip status */
.hero-sisa { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 1.2rem 1.25rem; margin-bottom: 1.1rem; box-shadow: var(--shadow-flat); }
.hs-top { display: flex; justify-content: space-between; align-items: center; }
.hs-label { margin: 0; color: var(--muted); font-weight: 600; }
.hero-sisa .serif-big { font-size: 2.1rem; margin: .25rem 0 .15rem; }
.hs-perday { margin: 0 0 .35rem; color: var(--muted); }
.hs-io { margin: 0; }
.hs-io strong { color: var(--ink); }
.status-chip { font-size: .74rem; font-weight: 700; padding: .28rem .7rem; border-radius: 999px; }
.status-chip.ok { background: #e6f4ec; color: var(--green); }
.status-chip.warn { background: #ffedd6; color: #9a6206; }
.status-chip.bad { background: #ffedea; color: var(--red); }

/* Catat Cepat */
.qc-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .8rem; }
.qc-head h3 { margin: 0; }
.qc-head p { margin: 0; }
.qc-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
#form-quick { display: flex; gap: .6rem; align-items: flex-start; }
#form-quick input { flex: 1; }
#form-quick .btn { width: auto; margin-top: 0; white-space: nowrap; }
#form-quick .error { flex-basis: 100%; }
#form-quick { flex-wrap: wrap; }
/* Baris chip hasil uraian (desain Quick Capture) */
.parse-chips { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-top: .8rem; }
.parse-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .42rem .8rem; font-family: var(--sans); font-size: .88rem; font-weight: 600; color: var(--ink); cursor: pointer; min-height: 40px; }
.parse-chip.static { cursor: default; }
.parse-note { font-size: .82rem; color: #9a6206; width: 100%; margin: .1rem 0 0; }
.parse-ok { font-size: .82rem; color: var(--muted); width: 100%; margin: .1rem 0 0; }

/* Baris dompet mini (Beranda & Dompet) */
.wallet-mini { display: flex; align-items: center; gap: .85rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: .95rem 1.05rem; margin-bottom: .7rem; cursor: pointer; text-align: left; width: 100%; font-family: var(--sans); }
.wallet-mini:hover { border-color: var(--sand); }
.wm-ic { width: 46px; height: 46px; flex: none; border-radius: 14px; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.wm-meta { flex: 1; min-width: 0; }
.wm-meta strong { display: block; font-size: 1rem; }
.wm-meta span { color: var(--muted); font-size: .8rem; }
.wm-right { text-align: right; }
.wm-right strong { display: block; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.wm-right span { color: var(--muted); font-size: .76rem; }
.wm-chev { color: var(--muted); font-size: 1.2rem; }
.wallet-tag { font-size: .68rem; font-weight: 700; letter-spacing: .06em; color: var(--olive); text-transform: uppercase; }
.add-row-btn { width: 100%; padding: .95rem; border: 1.5px dashed #e3c9a4; border-radius: 18px; background: rgba(255,255,255,.45); color: var(--ink); font-family: var(--sans); font-weight: 700; font-size: .95rem; cursor: pointer; min-height: 52px; }
.total-card h2 { margin: .2rem 0; font-size: 1.7rem; }
.total-card p { margin: 0; }

/* Tagihan mendatang: blok tanggal */
.count-badge { background: var(--olive); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .12rem .55rem; vertical-align: 3px; }
.bill-date { flex: none; width: 48px; text-align: center; background: var(--soft); border-radius: 12px; padding: .35rem 0; }
.bill-date small { display: block; font-size: .62rem; font-weight: 700; letter-spacing: .08em; color: var(--olive); }
.bill-date strong { font-size: 1.05rem; }
.bill-row { align-items: center; }

/* Rekap Minggu Ini */
.rekap-total { font-family: var(--display); font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.trend-chip { font-size: .76rem; font-weight: 700; padding: .3rem .7rem; border-radius: 999px; background: #ffedea; color: var(--red); white-space: nowrap; }
.trend-chip.down { background: #e6f4ec; color: var(--green); }
.trend-chip.flat { background: var(--soft); color: var(--muted); }
.rekap-card-main { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.rekap-head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.rekap-days { display: flex; gap: .45rem; align-items: flex-end; height: 120px; margin-top: .6rem; }
.rekap-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; }
.rekap-day .rd-bar { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--accent), var(--olive)); border-radius: 7px 7px 3px 3px; min-height: 4px; }
.rekap-day .rd-val { font-size: .6rem; color: var(--muted); text-align: center; line-height: 1.15; }
.rekap-day .rd-lab { font-size: .72rem; font-weight: 600; color: var(--muted); }
.rekap-day.today .rd-lab { color: var(--olive); }
.rekap-insight p { margin: 0; line-height: 1.55; }

/* Target: batang progres */
.goal-bar { height: 10px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: .5rem 0; }
.goal-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--olive)); border-radius: 99px; transition: width .5s ease; }
.gd-progress { text-align: center; }
.gd-pct { font-family: var(--display); font-size: 2.2rem; font-weight: 700; color: var(--olive); }
.quick-amounts { display: flex; gap: .5rem; margin: .2rem 0 .8rem; }
.chip-btn { border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: .45rem .85rem; font-family: var(--sans); font-weight: 600; font-size: .85rem; cursor: pointer; min-height: 40px; color: var(--ink); }

/* Filter transaksi + grup hari */
.tx-filters { padding: 1rem; }
.tx-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .6rem; }
.tx-filter-row select, .tx-filter-row input { margin: 0; }
.tx-chips { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.tx-chips:empty { margin-top: 0; }
.filter-chip { display: inline-flex; align-items: center; gap: .45rem; background: var(--soft); border-radius: 999px; padding: .35rem .4rem .35rem .8rem; font-size: .84rem; font-weight: 600; }
.filter-chip button { border: 0; background: rgba(31,31,31,.08); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: .72rem; }
.day-group-head { display: flex; justify-content: space-between; align-items: baseline; margin: 1.1rem .2rem .5rem; }
.day-group-head strong { font-size: .92rem; }
.day-group-head span { color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.day-group { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: .3rem 1rem; }
.day-group .tx-item:last-child { border-bottom: none; }

/* Formulir transaksi: nominal besar + keypad + chip kategori */
.amount-display { display: flex; align-items: center; gap: .4rem; border: 1.5px solid var(--line); border-radius: 14px; padding: .35rem .9rem; background: #fff; margin-top: .35rem; }
.amount-display:focus-within { border-color: var(--olive); box-shadow: 0 0 0 3px rgba(255,107,0,.18); }
.amount-display .rp-prefix { font-family: var(--display); font-weight: 700; color: var(--muted); }
.amount-display input { border: 0 !important; box-shadow: none !important; margin: 0 !important; padding: .45rem 0 !important; font-family: var(--display); font-size: 1.45rem; font-weight: 700; background: transparent; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .7rem 0 .4rem; }
.keypad button { border: 1px solid var(--line); background: #fff; border-radius: 14px; min-height: 52px; font-family: var(--display); font-size: 1.15rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.keypad button:active { background: var(--soft); }
@media (min-width: 1024px) { .keypad { max-width: 340px; } }
.cat-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .35rem 0 .8rem; }
.cat-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .5rem .95rem; font-family: var(--sans); font-size: .9rem; font-weight: 600; color: var(--ink); cursor: pointer; min-height: 44px; }
.cat-chip.active { background: var(--olive); border-color: var(--olive); color: #fff; }
.tx-parse-banner { display: flex; justify-content: space-between; align-items: center; gap: .8rem; background: var(--soft); border-radius: 12px; padding: .6rem .9rem; margin-bottom: .9rem; font-size: .9rem; }

/* Detail dompet */
.wd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: 1rem; }
.wd-stats .card { margin-bottom: 0; padding: .9rem; }
.wd-stats strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.wd-stats .in { color: var(--green); }
.wd-hero { margin-bottom: 1rem; }

/* Laporan */
.report-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.report-stats .card { min-width: 0; }
.report-stats .card { margin-bottom: 0; }
.big-num { font-family: var(--display); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.big-num.in, strong.in { color: var(--green); }
.cmp-row { display: flex; justify-content: space-between; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.cmp-row:last-child { border-bottom: none; }
.cmp-delta { text-align: right; }
.cmp-pct { font-size: .74rem; font-weight: 700; padding: .16rem .55rem; border-radius: 999px; background: var(--soft); color: var(--muted); margin-left: .45rem; }
.cmp-pct.up-bad { background: #ffedea; color: var(--red); }
.cmp-pct.up-good { background: #e6f4ec; color: var(--green); }

/* Pengaturan */
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.setting-row:last-of-type { border-bottom: none; }
.setting-row p { margin: .15rem 0 0; }
.setting-value { font-weight: 700; white-space: nowrap; }
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #e8d9c3; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 2px 6px rgba(31,31,31,.2); }
.switch input:checked + span { background: var(--olive); }
.switch input:checked + span::before { transform: translateX(22px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.menu-sub { margin-left: auto; color: var(--muted); font-size: .78rem; font-weight: 400; text-align: right; }
.tf-secret { font-family: ui-monospace, monospace; font-size: 1.05rem; letter-spacing: .12em; background: var(--soft); border-radius: 12px; padding: .8rem 1rem; word-break: break-all; text-align: center; font-weight: 700; }
.tf-url { word-break: break-all; font-size: .78rem; }
.tf-codes { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .9rem; font-family: ui-monospace, monospace; font-weight: 700; background: var(--soft); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .8rem; }
.ai-data-list { margin: .4rem 0 1rem; padding-left: 1.2rem; color: var(--muted); line-height: 1.6; }
.ai-disclaimer { margin-top: 1rem; }
.session-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.session-row:last-child { border-bottom: none; }
.session-badge { font-size: .7rem; font-weight: 700; background: #e6f4ec; color: var(--green); border-radius: 999px; padding: .14rem .55rem; margin-left: .5rem; }

/* Lonceng pengingat */
.topbar-actions { display: flex; align-items: center; gap: .6rem; }
.bell-btn { position: relative; border: 1px solid var(--line); background: var(--card); width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.bell-btn svg { width: 21px; height: 21px; }
.bell-badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: .66rem; font-weight: 700; min-width: 19px; height: 19px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.bell-panel { position: fixed; top: calc(60px + env(safe-area-inset-top)); right: 12px; z-index: 60; width: min(350px, calc(100vw - 24px)); background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 44px rgba(31,31,31,.2); padding: 1rem 1.05rem; }
.bp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }

/* Onboarding */
.onboarding { position: fixed; inset: 0; z-index: 80; background: var(--bg); overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; }
.ob-card { width: min(480px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 1.8rem 1.5rem; position: relative; }
.ob-visual { text-align: center; margin-bottom: 1.2rem; }
.ob-bubble { display: inline-block; background: #ffedd6; border-radius: 16px; padding: .7rem 1.1rem; font-weight: 600; }
.ob-arrow { font-size: 1.3rem; color: var(--olive); margin: .4rem 0; }
.ob-tx { display: flex; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; }
.ob-skip { position: absolute; top: 1.1rem; right: 1.2rem; }
.ob-wallet-row { display: flex; align-items: center; gap: .8rem; border: 1px solid var(--line); border-radius: 16px; padding: .8rem .95rem; margin-bottom: .7rem; }
.ob-wallet-row .wm-ic { width: 42px; height: 42px; }
.ob-wallet-row input[type="text"] { max-width: 130px; margin: 0; }
.ob-wallet-row.off { opacity: .45; }
.ob-chips { display: flex; gap: .5rem; margin: .7rem 0; }
.ob-done-ic { font-size: 2.4rem; text-align: center; }
#ob-done { text-align: center; }
#ob-done .btn { margin-top: .8rem; }

/* Kunci PIN */
.pin-overlay { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.pin-card { width: min(340px, 100%); text-align: center; }
.pin-card .brand-mark { width: 54px; height: 54px; margin: 0 auto .6rem; }
.pin-dots { display: flex; gap: .55rem; justify-content: center; margin: 1rem 0; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--sand); background: transparent; }
.pin-dots span.on { background: var(--olive); border-color: var(--olive); }
.pin-pad { max-width: 280px; margin: 0 auto; }

/* Sheet generik: samakan perilaku semua sheet */
.sheet-overlay .sheet { max-height: 88dvh; overflow: auto; }

/* Kisi Beranda web dengan kartu baru */
@media (min-width: 1024px) {
  #view-home {
    grid-template-areas:
      "stats stats stats"
      "quick quick wallet"
      "flow flow ai"
      "bills rekap goal"
      "cats recent recent";
  }
  .hero-sisa { display: none; }
  #home-bills-card { grid-area: bills; }
  #home-rekap-card { grid-area: rekap; }
  #home-goal-card { grid-area: goal; }
  .tx-filter-row { grid-template-columns: repeat(4, 1fr); }
}

/* ================================================================
   STAGE 15 — Web "Warm Ledger" (desain Stitch Sir, khusus ≥1024px)
   Token: primary #BF4800, aksen #FF9F1C, canvas #FAF3E8, kartu
   #FFFBF5, garis #F1DDBE, tinta #261813, muted #6D5A53.
   Font: Mulish (judul/angka) + Instrument Sans (antarmuka).
   Mobile (<1024px) tetap sistem Stage 14.
   ================================================================ */
@media (min-width: 1024px) {
  :root {
    --bg: #faf3e8;
    --bg-outer: #faf3e8;
    --ink: #261813;
    --ink-soft: #4a3a34;
    --muted: #6d5a53;
    --card: #fffbf5;
    --line: #f1ddbe;
    --soft: #ffead1;
    --dark: #261813;
    --olive: #bf4800;
    --khaki: #ff9f1c;
    --sand: #f1ddbe;
    --pale: #fbf2e3;
    --green: #166534;
    --red: #ba1a1a;
    --red-soft: #ffede7;
    --radius: 16px;
    --shadow: 0 0 0 rgba(0, 0, 0, 0);
    --serif: "Mulish", "Poppins", system-ui, sans-serif;
    --sans: "Instrument Sans", "Inter", system-ui, sans-serif;
  }
  body { background: var(--bg); }
  .btn { border-radius: 12px; }
  .btn.primary { background: var(--olive); }
  /* QA-08: hero + Catat Cepat versi web — baris fleksibel seperti desain. */
  .hero-sisa article { display: flex; flex-direction: column; gap: .8rem; }
  .hero-sisa article > div:first-child { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
  .hero-sisa article > div:first-child > div { display: flex; flex-direction: column; gap: .3rem; }
  #home-quick-card article { display: flex; flex-direction: column; gap: .8rem; }
  .qc-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
  .qc-head > div { display: flex; align-items: center; gap: .55rem; }
  #form-quick { display: flex; align-items: center; gap: .6rem; }
  #form-quick input { flex: 1; }
  /* QA-09: tombol Catat di kepala Transaksi web ganda dengan topbar. */
  #view-tx .view-head .btn.primary { display: none; }
  input, select, textarea { border-radius: 12px; }
  .card { border: 1px solid var(--line); box-shadow: none; border-radius: 16px; }

  /* --- Kerangka: sidebar 240 + topbar --- */
  .sidebar { width: 240px; background: var(--card); border-right: 1px solid var(--line); box-shadow: none; }
  .content { margin-left: 240px; padding: 0 24px 40px; max-width: none; }
  .side-search, .side-add { display: none; }
  .side-label { text-transform: uppercase; letter-spacing: .4px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .side-btn { border-radius: 12px; }
  .side-btn.active { background: var(--soft); color: var(--ink); }
  .side-user { border-top: 1px solid var(--line); }
  .desk-head {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 0; margin: 0 0 20px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .crumb { white-space: nowrap; }
  .crumb-path { margin: 0; font-size: 14px; }
  .desk-head-user { display: none; }
  .desk-head-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
  .crumb-date { margin: 0; white-space: nowrap; color: var(--muted); font-size: 13px; }
  .cmdk-trigger {
    flex: 1 1 auto; max-width: 520px; margin: 0 auto;
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--pale); color: var(--muted);
    font: 500 14px var(--sans); cursor: pointer; text-align: left;
  }
  .cmdk-trigger svg { width: 18px; height: 18px; flex: none; }
  .cmdk-trigger span { flex: 1; }
  .cmdk-trigger kbd, .cmdk-box kbd, .cmdk-action kbd {
    font-family: "Source Code Pro", monospace; font-size: 11px;
    background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px;
    border-radius: 6px; padding: 1px 6px; color: var(--muted);
  }
  #btn-catat-desk { white-space: nowrap; }

  /* --- Beranda web: kolom utama + rel 300px --- */
  #view-home {
    display: grid; gap: 20px;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
      "head head"
      "hero wallets"
      "quick wallets"
      "stats cats"
      "flow cats"
      "flow ai"
      "bills ai"
      "rekap goal"
      "recent recent";
  }
  #view-home .home-head { grid-area: head; display: flex; }
  #view-home .verify-banner { grid-column: 1 / -1; }
  /* Stage 14 menyembunyikan hero sisa di web; desain web Sir memakainya. */
  #view-home .hero-sisa { grid-area: hero; margin: 0; display: block; }
  /* Rel dompet di Beranda: baris ringkas nama + saldo, tanpa sub panjang. */
  #view-home #home-wallet .wallet-mini { gap: .6rem; padding: .8rem .85rem; border-radius: 14px; }
  #view-home #home-wallet .wm-ic { width: 38px; height: 38px; font-size: 1.05rem; border-radius: 11px; }
  #view-home #home-wallet .wm-meta span { display: none; }
  #view-home #home-wallet .wm-right { flex: none; }
  #view-home #home-wallet .wm-right strong { font-size: .95rem; white-space: nowrap; }
  #view-home .stats-row { grid-area: stats; margin: 0; }
  #view-home #home-quick-card { grid-area: quick; margin: 0; }
  #view-home #home-wallet { grid-area: wallets; }
  #view-home .quick-actions { display: none; }
  #view-home #home-bills-card { grid-area: bills; margin: 0; }
  #view-home #home-rekap-card { grid-area: rekap; margin: 0; }
  #view-home #home-goal-card { grid-area: goal; margin: 0; }
  #view-home #home-flow-card { grid-area: flow; margin: 0; }
  #view-home #home-cats-card { grid-area: cats; margin: 0; }
  #view-home #home-recent-card { grid-area: recent; margin: 0; }
  #view-home #home-ai-panel { grid-area: ai; margin: 0; }
  .flow-toggle { display: inline-flex; background: var(--pale); border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; }
  .flow-toggle button { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; font: 600 12.5px var(--sans); color: var(--muted); cursor: pointer; }
  .flow-toggle button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(38, 24, 19, .10); }
  .flow-bars { display: flex; align-items: flex-end; gap: 14px; height: 170px; padding-top: 8px; }
  .flow-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
  .flow-pair { display: flex; align-items: flex-end; gap: 4px; height: 130px; }
  .flow-bar { width: 14px; border-radius: 5px 5px 0 0; min-height: 3px; }
  .flow-bar.in { background: var(--olive); }
  .flow-bar.out { background: var(--khaki); }
  .flow-col span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
  .donut-wrap { display: flex; gap: 16px; align-items: center; }
  .donut-legend { flex: 1; display: grid; gap: 6px; font-size: 13px; }
  .donut-legend .dl-row { display: flex; justify-content: space-between; gap: 8px; }
  .recent-table, .tx-table { width: 100%; border-collapse: collapse; font-size: 14px; }
  .recent-table th, .tx-table th { text-align: left; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
  .recent-table td, .tx-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .recent-table tr:last-child td, .tx-table tr:last-child td { border-bottom: 0; }

  /* --- Tabel transaksi web --- */
  .tx-table th { position: sticky; top: 0; background: var(--pale); z-index: 1; }
  /* Baris tabel memakai kelas .tx-item (untuk klik edit) yang bergaya flex
     di daftar mobile — di tabel harus kembali table-row agar kolom sejajar. */
  .tx-table tr.tx-item { display: table-row; }
  .tx-table tbody tr.tx-row { cursor: pointer; }
  .tx-table tbody tr.tx-row:hover td { background: #fff7ea; }
  .tx-table .tx-day-row td { background: var(--pale); font-weight: 700; font-size: 13px; }
  .tx-table .tx-day-row .day-total { float: right; font-variant-numeric: tabular-nums; }
  .tx-table td.num, .tx-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .tx-pager { display: flex; align-items: center; gap: 16px; padding: 12px 4px; }
  .tx-pager .tx-pager-btns { margin-left: auto; display: flex; gap: 8px; }
  .tx-bulk {
    position: sticky; bottom: 16px; z-index: 20;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    background: var(--dark); color: #fff7ea; border-radius: 14px;
    padding: 12px 16px; box-shadow: 0 10px 30px rgba(38, 24, 19, .25);
  }
  .tx-bulk .btn.ghost { color: #fff7ea; border-color: rgba(255, 247, 234, .4); background: transparent; }
  .tx-bulk .link-btn { color: var(--khaki); }
  .tx-bulk-actions, .tx-bulk-target { display: inline-flex; gap: 8px; align-items: center; }

  /* --- Dompet web --- */
  .compo-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin-top: 14px; background: var(--pale); }
  .compo-bar i { display: block; height: 100%; }
  #wallet-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  #wallet-list .wallet-mini {
    flex-direction: column; align-items: flex-start; gap: 10px;
    min-height: 150px; padding: 20px; border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 251, 245, .92), rgba(255, 234, 209, .75));
    backdrop-filter: blur(8px);
  }
  #wallet-list .wallet-mini .wm-right { font-size: 20px; }
  #view-wallets .add-row-btn { width: 100%; min-height: 64px; margin-top: 20px; }

  /* --- Panel & modal melayang (desktop) --- */
  .panel-backdrop { position: fixed; inset: 0; background: rgba(38, 24, 19, .42); z-index: 55; }
  #view-wallet-detail.panel-view, #view-goal-detail.panel-view {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 56;
    width: 430px; max-width: 94vw; overflow-y: auto;
    background: var(--bg); padding: 20px; box-shadow: -16px 0 40px rgba(38, 24, 19, .18);
    animation: panel-in .2s cubic-bezier(.2, 0, 0, 1);
  }
  #view-tx-form.panel-view {
    position: fixed; inset: 0; z-index: 56; display: flex;
    align-items: flex-start; justify-content: center; overflow-y: auto;
    padding: 6vh 16px 40px; background: transparent;
  }
  #view-tx-form.panel-view > .card { width: 560px; max-width: 94vw; animation: panel-in .2s cubic-bezier(.2, 0, 0, 1); }
  @keyframes panel-in { from { transform: translateY(8px); opacity: .4; } to { transform: none; opacity: 1; } }
  .sheet-overlay { align-items: center; }
  .sheet-card { border-radius: 16px; max-width: 480px; }

  /* --- Berulang web: rel kalender --- */
  #view-recurring { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
  #view-recurring > .view-head, #view-recurring > .seg-view-tabs { grid-column: 1 / -1; }
  #view-recurring > .card, #view-recurring > .section-title, #view-recurring > #rec-list { grid-column: 1; }
  #view-recurring > .rec-side { grid-column: 2; grid-row: 3 / span 3; display: grid; gap: 20px; }

  /* --- Pengaturan: sub-nav --- */
  .settings-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

  /* --- Analisis AI: riwayat --- */
  #view-ai { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
  #view-ai > .view-head, #view-ai > .month-nav, #view-ai > .ai-disclaimer { grid-column: 1 / -1; }
  #view-ai > #ai-history-card { grid-column: 2; grid-row: 3 / span 3; margin: 0; }
}

/* Sub-nav pengaturan (semua lebar; di HP tampil sebagai pil gulir) */
.settings-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.settings-nav button {
  flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font: 600 13px var(--sans); cursor: pointer;
}
.settings-nav button.active { background: var(--soft); border-color: var(--khaki); }

/* Kalender berulang */
.rec-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12.5px; }
.rec-cal .rc-dow { color: var(--muted); font-weight: 700; padding: 4px 0; }
.rec-cal .rc-day { padding: 6px 0; border-radius: 8px; position: relative; }
.rec-cal .rc-day.dim { color: var(--muted); opacity: .45; }
.rec-cal .rc-day.today { background: var(--soft); font-weight: 700; }
.rec-cal .rc-day.due::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--olive);
}
.rec-up-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rec-up-row:last-child { border-bottom: 0; }

/* Baris kategori (halaman Kategori, semua lebar) */
.cat-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-row .cat-name { font-weight: 600; }
.cat-row .cat-total { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-badge { font-size: 11px; font-weight: 700; letter-spacing: .3px; background: var(--pale); border: 1px solid var(--line); color: var(--muted); padding: 2px 8px; border-radius: 999px; }
.cat-row .icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 15px; padding: 6px; border-radius: 8px; }
.cat-row .icon-btn:hover { background: var(--pale); }
.cat-row.is-hidden-cat .cat-name, .cat-row.is-hidden-cat .cat-total { opacity: .45; }

/* Riwayat analisis */
.ai-hist-row { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 11px 4px; font: 600 14px var(--sans); color: var(--ink); cursor: pointer; text-align: left; }
.ai-hist-row:last-child { border-bottom: 0; }
.ai-hist-row.active { color: var(--olive); }

/* Tab Target/Berulang */
.seg-view-tabs { display: inline-flex; background: var(--pale); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: 16px; }
.seg-view-tabs button { border: 0; background: transparent; padding: 7px 18px; border-radius: 999px; font: 600 13.5px var(--sans); color: var(--muted); cursor: pointer; }
.seg-view-tabs button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(38, 24, 19, .10); }

/* Kartu contoh di panel auth */
.auth-mock-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 18px 0 6px; max-width: 340px; }
.auth-mock-card .amc-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.auth-mock-card .amc-label { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.auth-mock-card .amc-balance { margin: 2px 0 8px; font: 800 24px var(--serif); }
.auth-mock-card .amc-parse { margin: 0; font-size: 13px; background: var(--pale); border-radius: 10px; padding: 8px 10px; }
.auth-mock-card .amc-parse span { font-weight: 700; }
.auth-visual-desc { color: var(--ink-soft); max-width: 360px; }
.pw-hint { margin: -6px 0 10px; }

/* Command bar (Ctrl K) */
.cmdk-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(38, 24, 19, .45); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 14px 20px; }
.cmdk-box { width: 620px; max-width: 94vw; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(38, 24, 19, .30); padding: 14px; animation: panel-in .18s cubic-bezier(.2, 0, 0, 1); }
.cmdk-input-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.cmdk-input-row input { flex: 1; border: 0; background: transparent; font: 500 16px var(--sans); color: var(--ink); outline: none; }
.cmdk-bolt { font-size: 17px; }
.cmdk-box kbd { font-family: "Source Code Pro", monospace; font-size: 11px; background: var(--pale); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.cmdk-draft { margin-top: 12px; background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.cmdk-hint { margin: 8px 2px 0; }
.cmdk-section { margin-top: 14px; }
.cmdk-label { font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.cmdk-freq { display: flex; flex-wrap: wrap; gap: 8px; }
.cmdk-action { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; background: transparent; padding: 10px 8px; border-radius: 10px; font: 600 14px var(--sans); color: var(--ink); cursor: pointer; text-align: left; }
.cmdk-action:hover { background: var(--pale); }

/* ================= Stage 16: Figma + PRD Alur ================= */
/* Bar pemakaian pada kartu Sisa (anggaran bila uang bulanan terisi). */
.hs-bar { height: 8px; border-radius: 999px; background: rgba(31,31,31,.10); overflow: hidden; margin-top: 10px; }
.hs-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--khaki), var(--olive)); transition: width .5s ease; }
.hs-bar-fill.over { background: linear-gradient(90deg, #E05252, #B3261E); }
.hs-streak { margin-top: 8px; font-size: 13px; font-weight: 600; color: #9A5B00; }
/* Checklist Mulai cepat */
.check-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.check-item .check-box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; flex: none; }
.check-item.done .check-box { background: var(--olive); border-color: var(--olive); }
.check-item.done .check-box::after { content: '✓'; }
.check-item.done span { color: var(--muted); text-decoration: line-through; }
.check-item .btn { margin-left: auto; }
/* Kepala sheet Catat */
.txform-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.txform-stats > div { background: var(--pale, #FFF6EA); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.txform-stats small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.txform-stats strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.txform-freq { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; align-items: center; }
/* Rel dompet Beranda web */
.rail-wallet .rw-card { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 16px; cursor: pointer; display: block; }
.rail-wallet .rw-top { display: flex; align-items: center; gap: 8px; }
.rail-wallet .rw-top .muted { margin-left: auto; }
.rail-wallet .rw-bal { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 8px 0 2px; }
.rail-wallet .rw-pager { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
/* Kategori dua kolom di web */
@media (min-width: 1024px) {
  .cats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
}
/* Filter tanggal + ringkasan periode Transaksi web */
.tx-daterange { display: inline-flex; gap: 6px; align-items: center; }
.tx-daterange input { max-width: 150px; }
#tx-summary-panel .tx-sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
#tx-summary-panel .tx-sum-grid small { display: block; color: var(--muted); font-weight: 600; font-size: 11.5px; }
#tx-summary-panel .tx-sum-grid strong { font-size: 16px; font-variant-numeric: tabular-nums; }
@media (max-width: 1023.98px) { #tx-summary-panel { display: none; } }
#tx-page-nums { display: inline-flex; gap: 6px; }
.tx-table th.sortable { cursor: pointer; user-select: none; }
.tx-menu-cell { position: relative; width: 44px; }
.tx-menu-btn { border: 0; background: transparent; font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px; color: var(--muted); }
.tx-menu-btn:hover { background: var(--pale, #FFF6EA); }
.tx-menu { position: absolute; right: 8px; top: 34px; z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(31,31,31,.14); display: flex; flex-direction: column; min-width: 120px; padding: 4px; }
.tx-menu button { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 8px; font: 600 13.5px var(--sans); color: var(--ink); cursor: pointer; }
.tx-menu button:hover { background: var(--pale, #FFF6EA); }
/* Pengaturan web: rel navigasi kiri + isi kanan */
@media (min-width: 1024px) {
  #view-settings-preferences, #view-settings-notifications, #view-settings-ai, #view-settings-security { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
  #view-settings-preferences > .settings-nav, #view-settings-notifications > .settings-nav, #view-settings-ai > .settings-nav, #view-settings-security > .settings-nav { grid-row: 1 / span 24; flex-direction: column; align-items: stretch; }
  #view-settings-preferences > *:not(.settings-nav), #view-settings-notifications > *:not(.settings-nav), #view-settings-ai > *:not(.settings-nav), #view-settings-security > *:not(.settings-nav) { grid-column: 2; }
}
@media (min-width: 1024px) {
}

/* ===== Stage 17: persis Stitch — carousel dompet HP, rel web kaca gelap ===== */
.home-head .bell-btn { margin-left: auto; }
@media (min-width: 1024px) { .home-head .bell-btn { display: none; } }
.wallet-carousel { display: flex; gap: .8rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .15rem .1rem .55rem; scrollbar-width: none; }
.wallet-carousel::-webkit-scrollbar { display: none; }
.wallet-glass { flex: 0 0 78%; scroll-snap-align: start; text-align: left; border: none; cursor: pointer; border-radius: 22px; padding: 1.05rem 1.1rem; color: #FFF7EC; background: linear-gradient(135deg, #3B2517 0%, #251610 55%, #1D130E 100%); box-shadow: 0 14px 30px rgba(59, 37, 23, .28); font-family: var(--sans); position: relative; overflow: hidden; display: block; }
.wallet-glass::after { content: ''; position: absolute; top: -45%; right: -25%; width: 65%; height: 110%; background: radial-gradient(closest-side, rgba(255, 159, 28, .35), transparent); pointer-events: none; }
.wallet-glass .wg-top { display: flex; justify-content: space-between; align-items: flex-start; }
.wallet-glass .wg-ic { width: 42px; height: 42px; border-radius: 13px; background: rgba(255, 255, 255, .12); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.wallet-glass .wg-chip { background: rgba(255, 159, 28, .22); color: #FFC98F; border: 1px solid rgba(255, 159, 28, .35); font-size: .66rem; font-weight: 700; padding: .22rem .55rem; border-radius: 999px; }
.wallet-glass .wg-name { display: block; font-size: 1.05rem; font-weight: 700; margin-top: .7rem; }
.wallet-glass .wg-sub { display: block; color: #D8C3AC; font-size: .78rem; margin-top: .1rem; }
.wallet-glass .wg-bal { display: block; font-size: 1.45rem; font-weight: 800; margin-top: .55rem; font-variant-numeric: tabular-nums; }
.wallet-glass .wg-month { display: block; color: #C9AE93; font-size: .72rem; margin-top: .3rem; }
.wg-add { flex: 0 0 58%; scroll-snap-align: start; border: 1.5px dashed var(--sand); background: transparent; border-radius: 22px; color: var(--olive); font-weight: 700; font-size: 1rem; cursor: pointer; padding: 1.05rem; font-family: var(--sans); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; }
.wg-add small { color: var(--muted); font-weight: 400; font-size: .74rem; }
.wg-add .wg-add-plus { font-size: 1.3rem; }
.wc-dots { display: flex; gap: .35rem; justify-content: center; margin: .05rem 0 .95rem; }
.wc-dots span { width: 7px; height: 7px; border-radius: 99px; background: var(--sand); transition: all .2s; }
.wc-dots span.on { width: 20px; background: var(--olive); }
.goal-done-badge { background: #DCFCE7; color: #166534; font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.legend-row.clickable { cursor: pointer; }
@media (min-width: 1024px) {
  .rail-wallet .rw-card { background: linear-gradient(135deg, #3B2517 0%, #251610 55%, #1D130E 100%); color: #FFF7EC; border: none; border-radius: 20px; box-shadow: 0 14px 30px rgba(59, 37, 23, .28); }
  .rail-wallet .rw-top .muted, .rail-wallet .rw-sub { color: #C9AE93 !important; }
  .rail-wallet .wm-ic { background: rgba(255, 255, 255, .12); }
}

/* ===== Stage 18: pendamping port Stitch (hanya <1024px) ===== */
@media (max-width: 1023.98px) {
  #view-home { margin-left: -1.1rem; margin-right: -1.1rem; }
  #view-home > .hero-sisa, #home-quick-card, #home-bills-card, #home-rekap-card,
  #home-goal-card, #home-cats-card, #home-recent-card {
    background: transparent; border: none; box-shadow: none; border-radius: 0; padding: 0;
  }
  #view-home .stats-row, #view-home #home-flow-card { margin-left: 1.1rem; margin-right: 1.1rem; }
  .hero-sisa .hs-bar { margin: 0; }
  .qc-send-text { display: none; }
  #form-quick .btn.primary { padding: 0; }
  .bottomnav {
    left: 1rem; right: 1rem; bottom: 1rem; transform: none;
    width: auto; max-width: 358px; margin: 0 auto; display: block;
  }
  .bottomnav .nav-btn .nav-bar { visibility: hidden; }
  .bottomnav .nav-btn.active { color: #1F1F1F; }
  .bottomnav .nav-btn.active .nav-bar { visibility: visible; }
  .bottomnav .nav-btn.active .nav-ic { color: #FF6B00; font-variation-settings: 'FILL' 1; }
  .bottomnav .nav-btn.add { color: #1F1F1F; }
  #home-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 9999px; }
}

/* ===== Stage 18b: pendamping port Profil ===== */
@media (max-width: 1023.98px) {
  #view-profile { margin-left: -1.1rem; margin-right: -1.1rem; }
  #view-profile .settings-nav { display: none; }
  #view-profile > .profile-head, #view-profile > #profile-summary,
  #view-profile > #pf-wallets-card, #view-profile .danger-zone {
    background: transparent; border: none; box-shadow: none; border-radius: 0; padding: 0;
  }
  #view-profile > #verify-card, #view-profile > #form-profile,
  #view-profile > #form-password, #view-profile > #form-feedback {
    margin-left: 1rem; margin-right: 1rem;
  }
  #profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 9999px; }
  .menu-item { text-align: left; }
}
@media (min-width: 1024px) {
  .profile-h1 { display: none; }
}

/* ===== Stage 18 fix: specificity untuk elemen Stitch ===== */
@media (max-width: 1023.98px) {
  .hero-sisa .hs-bar-fill { background-image: none; }
  #form-quick .btn.primary { background: #FF6B00; color: #1F1F1F; border-color: transparent; box-shadow: none; }
  /* QA-04: tombol aksi utama selalu oranye merek (token desain), bukan hitam. */
  .btn.primary { background: #FF6B00; color: #1F1F1F; border-color: transparent; }
  .btn.primary:active { background: #E05D00; }
  /* QA-10/14: filter transaksi HP — kisi rapi, semua kontrol terbaca. */
  .tx-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
  .tx-filter-row select, .tx-filter-row input { min-width: 0; width: 100%; }
  .tx-filter-row .tx-daterange { grid-column: 1 / -1; }
  #tx-count { white-space: nowrap; }
  .report-stats .card { padding: .8rem .65rem; }
  .report-stats .big-num { font-size: .82rem; letter-spacing: -.01em; white-space: nowrap; }
  .bottomnav .nav-btn.add { background: #FF6B00; color: #1F1F1F; }
  #view-profile .menu-item::after { content: none; }
  .quick-actions { display: block; }
}

/* ===== Stage 18b: sheet Catat + ritme spasi ===== */
.sheet-handle { display: none; }
@media (max-width: 1023.98px) {
  #view-tx-form.panel-view { position: fixed; inset: auto 0 0 0; z-index: 70; padding: 0; max-height: 94dvh; }
  #view-tx-form.panel-view > .card { margin: 0; border: none; border-radius: 22px 22px 0 0; max-height: 94dvh; overflow-y: auto; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -14px 44px rgba(31, 31, 31, .28); animation: sheet-up .24s cubic-bezier(.2, 0, 0, 1); }
  @keyframes sheet-up { from { transform: translateY(26px); opacity: .4; } to { transform: none; opacity: 1; } }
  .sheet-handle { display: flex; justify-content: center; padding: 2px 0 8px; }
  .sheet-handle span { width: 40px; height: 4px; border-radius: 999px; background: #F1DDBE; }
  #tx-close { background: transparent; }
  #form-tx { display: flex; flex-direction: column; gap: 14px; }
  #form-tx .seg { margin: 0; }
  #form-tx .seg-btn { background: transparent; color: #561F00; }
  #form-tx .seg-btn.active { background: #FF6B00; color: #1F1F1F; }
  #form-tx .amount-display { display: inline-flex; align-items: baseline; gap: 2px; }
  #form-tx .amount-display .rp-prefix { font-size: 20px; font-weight: 600; color: #7D6C57; }
  #form-tx .amount-display input { width: 9ch; text-align: center; font-size: 28px; font-weight: 700; background: transparent; border: none; padding: 0; }
  #form-tx .btn.primary { background: #FF6B00; color: #1F1F1F; border-color: transparent; box-shadow: none; }
  #form-tx .btn.ghost { display: none; }
  #tx-cats .cat-chip, #tx-wallets .cat-chip { border: none; box-shadow: none; }
  #home-bills-card #bills-count { background: none; color: #7D6C57; padding: 0; }
  #view-home { display: flex; flex-direction: column; gap: 24px; }
  #view-home > * { margin-top: 0; margin-bottom: 0; }
  #view-home > .home-head { margin-bottom: -12px; }
  #view-profile { display: flex; flex-direction: column; gap: 20px; }
  #view-profile > * { margin-top: 0; margin-bottom: 0; }
}

/* ===== Stage 18c: amount polos + kontras sheet ===== */
@media (max-width: 1023.98px) {
  #form-tx .amount-display { background: transparent; border: none; padding: 0; box-shadow: none; }
  #view-tx-form.panel-view > .card { background: rgba(255, 255, 255, .97); }
}

/* ===== Stage 18d: backdrop + nav bersih di HP ===== */
@media (max-width: 1023.98px) {
  .panel-backdrop { position: fixed; inset: 0; background: rgba(31, 31, 31, .45); z-index: 80; }
  #view-tx-form.panel-view { z-index: 90; }
  .bottomnav .nav-btn { background: transparent; }
}
@media (max-width: 1023.98px) {
  .bottomnav .nav-btn span.nav-ic { font-size: 20px; }
  .bottomnav .nav-btn span.nav-label { font-size: 12px; }
}
