:root {
  --bg: #060708;
  --text: #f3f4f6;
  --muted: rgba(243, 244, 246, 0.58);
  --faint: rgba(243, 244, 246, 0.34);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-2: rgba(255, 255, 255, 0.16);
  --white: #f4f5f6;
  --ink: #0b0c0d;
  --warn: #ffc9a6;
  --danger: #ff9a92;
  --blur: saturate(160%) blur(22px);
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Inter, system-ui, sans-serif;
  color-scheme: dark;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    /* pegas lembut dengan sedikit overshoot */
    --spring: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
  }
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); overflow: hidden; overscroll-behavior: none; }
body { -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; font-size: 16px; letter-spacing: -0.011em; -webkit-text-size-adjust: 100%; }
input, textarea, select { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
svg { flex: none; }
::-webkit-scrollbar { display: none; }
:focus { outline: none; }
:focus-visible { outline: 1.5px solid rgba(255, 255, 255, 0.35); outline-offset: 2px; }

/* ---------- background ---------- */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(120% 60% at 72% -4%, #212327 0%, #0a0b0c 55%, #050506 100%); }
.bg-img { position: absolute; inset: -5%; background-size: cover; background-position: center; opacity: 0; transition: opacity 2s ease; animation: drift 42s ease-in-out infinite alternate; will-change: transform; }
.bg-img.ready { opacity: 1; }
.bg-glow { position: absolute; inset: 0; background: radial-gradient(55% 32% at 74% -4%, rgba(255, 255, 255, 0.13), transparent 70%); animation: glow 14s ease-in-out infinite alternate; }
.bg-grain { position: absolute; inset: -50%; opacity: 0.07; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
#bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 6, 7, 0.1) 0%, rgba(5, 6, 7, 0.35) 45%, rgba(5, 6, 7, 0.72) 100%); }
@keyframes drift { from { transform: scale(1.02) translate3d(0, 0, 0); } to { transform: scale(1.1) translate3d(-1.5%, -1.2%, 0); } }
@keyframes glow { from { opacity: 0.7; transform: translateX(0); } to { opacity: 1; transform: translateX(-4%); } }

/* ---------- shell ---------- */
#app {
  position: fixed; inset: 0; z-index: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 14px) 20px calc(var(--safe-b) + 140px);
  transform-origin: 50% 40%;
  transition: transform 0.7s var(--spring), filter 0.5s ease, border-radius 0.7s var(--spring), opacity 0.4s;
}
#app.full { padding-bottom: calc(var(--safe-b) + 20px); }
body.sheet-open #app { transform: scale(0.93) translateY(10px); filter: brightness(0.55); border-radius: 34px; overflow: hidden; }
#dock-root { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-b) + 14px); display: flex; justify-content: center; z-index: 5; pointer-events: none; transition: opacity 0.35s ease, transform 0.7s var(--spring); }
#dock-root::before { content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--safe-b) + 150px); background: linear-gradient(180deg, rgba(5, 6, 7, 0), rgba(5, 6, 7, 0.82) 65%); pointer-events: none; z-index: -1; }
#dock-root:empty::before { display: none; }
body.sheet-open #dock-root { opacity: 0; transform: translateY(40px) scale(0.9); }

.view { max-width: 520px; margin: 0 auto; }

/* ---------- motion ---------- */
.entering .rise, .dock-enter { animation: rise 1s var(--spring) both; animation-delay: calc(var(--i, 0) * 60ms); }
.dock-enter { animation-delay: 260ms; }
@keyframes rise { from { opacity: 0; transform: translateY(22px) scale(0.98); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
.pressable { transition: transform 0.55s var(--spring), background-color 0.3s, opacity 0.3s, color 0.3s; }
.pressable:active { transform: scale(0.94); transition-duration: 0.12s; }
.shake { animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- glass primitives ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 20px 40px -22px rgba(0, 0, 0, 0.7);
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--stroke-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.tag svg { width: 16px; height: 16px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.danger { color: var(--danger); }
.icon-spacer { width: 44px; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; gap: 10px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.sync-pill { height: 36px; padding: 0 14px 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sync-pill i { width: 7px; height: 7px; border-radius: 50%; background: #9ff0bf; box-shadow: 0 0 10px #9ff0bf; }
.sync-pill.wait i { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.sync-pill.err i { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.sync-pill.busy i { background: #fff; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.6); } }

/* ---------- hero ---------- */
.hero { position: relative; display: flex; align-items: stretch; gap: 16px; margin-top: 44px; min-height: 150px; }
.hero-text { flex: 1; min-width: 0; padding-top: 8px; }
.hero-label { font-size: 15px; color: var(--muted); }
.hero-amount { font-size: clamp(38px, 11.5vw, 50px); font-weight: 500; letter-spacing: -0.04em; line-height: 1.08; margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-amount.long { font-size: clamp(32px, 9.4vw, 42px); }
.hero-sub { font-size: 15px; color: var(--faint); margin-top: 12px; letter-spacing: 0.01em; }
.rail { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail-line { position: relative; flex: 1; width: 2px; margin-right: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); }
.rail-line i { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--p) * 1%); border-radius: 2px; background: var(--white); box-shadow: 0 0 12px rgba(255, 255, 255, 0.5); }
.entering .rail-line i { animation: grow 1.4s var(--spring) both 0.3s; }
@keyframes grow { from { height: 0; } }

/* ---------- limit pills (gaya slider referensi) ---------- */
.cards { display: grid; gap: 12px; margin-top: 34px; }
.limit-pill {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 68px; padding: 0 24px; border-radius: 999px; overflow: hidden; text-align: left;
  background: linear-gradient(180deg, rgba(40, 42, 46, 0.55), rgba(24, 25, 28, 0.55));
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 40px -24px rgba(0, 0, 0, 0.8);
}
.lp-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p) * 1%); min-width: 68px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 8px 0 24px -8px rgba(0, 0, 0, 0.5);
  animation: fill 1.3s var(--spring) both 0.15s;
}
.lp-fill.tick::after { content: ''; position: absolute; right: 26px; top: 50%; width: 2px; height: 22px; margin-top: -11px; border-radius: 2px; background: var(--white); box-shadow: 0 0 10px rgba(255, 255, 255, 0.6); }
@keyframes fill { from { width: calc(var(--from) * 1%); } }
.lp-name, .lp-dots, .lp-value { position: relative; z-index: 1; }
.lp-name { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%; }
.lp-dots { flex: 1; display: flex; justify-content: space-evenly; min-width: 20px; }
.lp-dots i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
.lp-value { font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; }
.lp-value small { font-size: 12px; color: var(--muted); }
.limit-pill.low .lp-value { color: var(--warn); }
.limit-pill.over .lp-value { color: var(--danger); }
.limit-pill.nolimit .lp-name { color: var(--muted); }
.empty-pill { justify-content: space-between; color: var(--muted); }

/* ---------- transactions ---------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 34px 6px 12px; font-size: 15px; color: var(--muted); }
.section-head button { font-size: 14px; color: var(--muted); }
.tx-list { border-radius: 30px; padding: 6px; }
.tx { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 14px; border-radius: 24px; text-align: left; transition: background-color 0.25s; }
.tx:active { background: rgba(255, 255, 255, 0.07); }
.tx + .tx::before { content: ''; position: absolute; top: 0; left: 36px; right: 14px; height: 1px; background: rgba(255, 255, 255, 0.06); }
.tx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); flex: none; opacity: 0.9; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tx-note { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.tx-amt { font-size: 16px; font-variant-numeric: tabular-nums; }
.tx-date { font-size: 12px; color: var(--faint); }
.empty { padding: 30px 20px; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* ---------- dock ---------- */
.dock {
  pointer-events: auto; display: flex; align-items: center; padding: 7px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(44, 46, 50, 0.6), rgba(22, 23, 26, 0.7));
  border: 1px solid var(--stroke-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 24px 50px -12px rgba(0, 0, 0, 0.8);
}
.dock-btn {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.dock-main {
  width: 72px; height: 72px; margin: -12px 6px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); position: relative; z-index: 1;
  background: radial-gradient(circle at 50% 28%, #ffffff, #e6e7e9 70%);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.05), 0 14px 34px -6px rgba(255, 255, 255, 0.28), inset 0 -2px 6px rgba(0, 0, 0, 0.08);
}
.dock-main svg { width: 26px; height: 26px; }

/* ---------- forms ---------- */
.field {
  display: block; width: 100%; height: 56px; padding: 0 22px; border-radius: 999px; outline: none; font-size: 16px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--stroke);
  transition: border-color 0.3s, background-color 0.3s;
}
.field::placeholder { color: var(--faint); }
.field:focus { border-color: rgba(255, 255, 255, 0.32); background: rgba(255, 255, 255, 0.09); }
.field.sm { height: 46px; padding: 0 18px; }
.field.area { height: auto; min-height: 104px; padding: 16px 20px; border-radius: 26px; resize: none; line-height: 1.45; }
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 60px; border-radius: 999px; font-size: 17px; font-weight: 600; color: var(--ink);
  background: radial-gradient(120% 140% at 50% 0%, #ffffff, #e4e5e7);
  box-shadow: 0 12px 30px -10px rgba(255, 255, 255, 0.35), inset 0 -2px 6px rgba(0, 0, 0, 0.06);
}
.btn-primary svg { width: 20px; height: 20px; }
.btn-primary.sm { width: auto; height: 46px; padding: 0 24px; font-size: 16px; }
.btn-primary[disabled] { opacity: 0.4; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px; scroll-padding: 20px; }
.chip {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; font-size: 15px; white-space: nowrap; color: var(--text);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--stroke);
  transition: background-color 0.35s, color 0.35s, border-color 0.35s, transform 0.55s var(--spring);
}
.chip svg { width: 18px; height: 18px; opacity: 0.8; }
.chip.on { background: var(--white); color: var(--ink); border-color: transparent; }
.chip.sm { height: 40px; padding: 0 14px; font-size: 14px; }
.date-chip input[type='date'] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; -webkit-appearance: none; appearance: none; }
.select-chip { padding: 0; }
.select-chip select {
  -webkit-appearance: none; appearance: none; height: 100%; width: 100%; padding: 0 38px 0 18px; border: 0; outline: 0; border-radius: 999px; font-size: 16px; background: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23ffffff' stroke-opacity='.6' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.select-chip.sm select { padding: 0 32px 0 14px; background-position: right 12px center; font-size: 16px; }
.select-chip select option { color: #000; }
.row2 { display: flex; gap: 8px; }
.row2 .select-chip { flex: 1; min-width: 0; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--stroke); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.seg button { height: 42px; padding: 0 20px; border-radius: 999px; font-size: 15px; color: var(--muted); transition: background-color 0.4s var(--spring), color 0.3s; }
.seg button.on { background: var(--white); color: var(--ink); }
.seg.sm button { height: 34px; padding: 0 14px; font-size: 14px; }
.hint { font-size: 13px; color: var(--faint); line-height: 1.5; padding: 4px 6px; }
.hint a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.hint.err { color: var(--danger); }
.badge { flex: none; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.badge.warn { background: rgba(255, 201, 166, 0.16); color: var(--warn); }

/* ---------- sheet ---------- */
#sheet-root { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.sheet-wrap { position: absolute; inset: 0; pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 0.5s ease; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: calc(100% - var(--safe-t) - 28px); overflow-y: auto; overscroll-behavior: contain;
  max-width: 560px; margin: 0 auto; overflow-x: hidden;
  padding: 0 20px calc(var(--safe-b) + 18px); border-radius: 38px;
  background: linear-gradient(180deg, rgba(46, 48, 52, 0.72), rgba(20, 21, 24, 0.86));
  border: 1px solid var(--stroke-2);
  -webkit-backdrop-filter: saturate(170%) blur(34px); backdrop-filter: saturate(170%) blur(34px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 -10px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(calc(100% + 20px));
  transition: transform 0.75s var(--spring);
}
.sheet-wrap.open .sheet { transform: translateY(0); }
.sheet-wrap.closing .sheet { transition: transform 0.45s cubic-bezier(0.5, 0, 0.75, 0); }
.sheet.dragging { transition: none; }
.sheet-wrap.tall .sheet { min-height: 60%; }
.sheet-grab { position: relative; height: 28px; margin: 0 -20px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grab i { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.24); }
.sheet-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sheet-body > * { min-width: 0; }
.sheet-body > * { animation: rise 0.9s var(--spring) both; }
.sheet-body > *:nth-child(1) { animation-delay: 0.08s; }
.sheet-body > *:nth-child(2) { animation-delay: 0.12s; }
.sheet-body > *:nth-child(3) { animation-delay: 0.16s; }
.sheet-body > *:nth-child(4) { animation-delay: 0.2s; }
.sheet-body > *:nth-child(5) { animation-delay: 0.24s; }
.sheet-body > *:nth-child(6) { animation-delay: 0.28s; }
.sheet-body > *:nth-child(n + 7) { animation-delay: 0.32s; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.sheet-title { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.2; margin: 2px 2px 0; }
.amount-field { display: flex; align-items: baseline; gap: 10px; padding: 10px 2px 4px; }
.amount-field .cur { font-size: 22px; color: var(--muted); }
.amount-field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 50px; font-weight: 500; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; caret-color: var(--white); }
.amount-field input::placeholder { color: rgba(255, 255, 255, 0.18); }
.zeros { height: 38px; padding: 0 14px; border-radius: 999px; font-size: 15px; color: var(--muted); background: rgba(255, 255, 255, 0.07); border: 1px solid var(--stroke); align-self: center; }

/* AI */
.ai-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; }
.thumbs:empty { display: none; }
.thumb { position: relative; flex: none; width: 72px; height: 96px; border-radius: 18px; overflow: hidden; border: 1px solid var(--stroke-2); animation: rise 0.7s var(--spring) both; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.6); }
.thumb button svg { width: 12px; height: 12px; }
#ai-out:empty { display: none; }
#ai-out { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pv-list > *, .pv > * { min-width: 0; }
.ai-loading { display: flex; align-items: center; justify-content: center; gap: 6px; height: 64px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--stroke); font-size: 15px; }
.ai-loading span { background: linear-gradient(90deg, var(--faint) 0%, #fff 50%, var(--faint) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
.ai-loading i { width: 5px; height: 5px; border-radius: 50%; background: var(--white); animation: dot 1.2s ease-in-out infinite; }
.ai-loading i:nth-of-type(2) { animation-delay: 0.15s; }
.ai-loading i:nth-of-type(3) { animation-delay: 0.3s; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes dot { 0%, 100% { opacity: 0.2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
.pv-head { font-size: 14px; color: var(--muted); padding: 6px 4px 0; }
.pv-list { display: grid; gap: 10px; }
.pv { border-radius: 28px; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; transition: opacity 0.35s; animation: rise 0.8s var(--spring) both; animation-delay: calc(var(--i) * 70ms); }
.pv.off { opacity: 0.45; }
.pv-top { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.pv-check { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid rgba(255, 255, 255, 0.3); color: transparent; transition: all 0.4s var(--spring); flex: none; }
.pv-check svg { width: 16px; height: 16px; }
.pv-check.on { background: var(--white); border-color: var(--white); color: var(--ink); }
.pv-rp { color: var(--muted); font-size: 15px; margin-left: 4px; }
.pv-amt { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 24px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.pv-top .date-chip { flex: none; }
.pv-dup { justify-self: start; margin-left: 4px; }
.pv-row .select-chip select { text-overflow: ellipsis; }

/* card sheet */
.stack { display: grid; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lbl { display: grid; gap: 8px; font-size: 13px; color: var(--muted); padding-left: 4px; }
.lbl .field, .lbl .field-like { margin-left: -4px; width: calc(100% + 4px); color: var(--text); }
.field-like { height: 56px; width: 100%; }
.amount-inline { position: relative; display: block; }
.amount-inline > span { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; z-index: 1; }
.amount-inline .field { padding-left: 54px; }
.card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-stats > div { border-radius: 24px; padding: 14px 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--stroke); display: grid; gap: 4px; }
.card-stats span { font-size: 12px; color: var(--muted); }
.card-stats strong { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.card-stats .hint { grid-column: 1 / -1; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; height: 56px; padding: 0 10px 0 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--stroke); font-size: 16px; }
.toggle-row i { position: relative; width: 52px; height: 32px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); transition: background-color 0.35s; }
.toggle-row i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform 0.55s var(--spring); }
.toggle-row.on i { background: rgba(255, 255, 255, 0.85); }
.toggle-row.on i::after { transform: translateX(20px); background: var(--ink); }

/* ---------- history ---------- */
.search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px; border-radius: 999px; margin: 22px 0 12px; color: var(--muted); }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 16px; color: var(--text); -webkit-appearance: none; }
.search input::placeholder { color: var(--faint); }
.history .chip-row { margin-bottom: 4px; }
.month-head { display: flex; justify-content: space-between; padding: 24px 8px 10px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.month-head span:first-child { color: var(--text); font-weight: 500; }

/* ---------- settings ---------- */
.group-title { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.09em; color: var(--faint); margin: 30px 10px 10px; }
.settings .top + .group-title { margin-top: 26px; }
.group { border-radius: 28px; padding: 4px; }
.row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 58px; padding: 10px 16px; border-radius: 24px; text-align: left; font-size: 16px; cursor: pointer; transition: background-color 0.25s; }
.row:active { background: rgba(255, 255, 255, 0.06); }
.row + .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 16px; height: 1px; background: rgba(255, 255, 255, 0.06); }
.row > svg { width: 18px; height: 18px; color: var(--faint); }
.row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.row-main > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main em { font-style: normal; color: var(--faint); font-size: 14px; }
.row .meta { font-size: 13px; color: var(--muted); }
.row.add { justify-content: flex-start; color: var(--muted); }
.row.add svg { width: 18px; height: 18px; color: var(--muted); }
.row.danger { color: var(--danger); }
.row.armed, .icon-btn.armed { color: var(--danger); font-weight: 600; }
.icon-btn.armed { width: auto; padding: 0 16px; border-radius: 999px; font-size: 14px; }
.row.loading { opacity: 0.5; pointer-events: none; }
.field-row { cursor: text; }
.field-row > span { flex: none; color: var(--text); }
.field-row input { flex: 1; min-width: 0; text-align: right; background: none; border: 0; outline: 0; font-size: 16px; color: var(--muted); }
.field-row input:focus { color: var(--text); }
.group .hint { padding: 6px 16px 12px; }
.ver { text-align: center; font-size: 12px; color: var(--faint); margin: 34px 0 10px; }

/* ---------- welcome & PIN ---------- */
.welcome { min-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 40px); max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; padding-bottom: 8px; }
.welcome > :first-child { flex: 1; }
.welcome h1 { font-size: clamp(40px, 12vw, 54px); font-weight: 500; letter-spacing: -0.045em; line-height: 1.02; }
.welcome .sub { font-size: 17px; color: var(--muted); margin-top: 16px; line-height: 1.45; max-width: 330px; }
.pin-screen { min-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 40px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; text-align: center; }
.pin-head h1 { font-size: 30px; font-weight: 500; letter-spacing: -0.03em; margin-top: 24px; }
.pin-head p { font-size: 15px; color: var(--muted); margin-top: 8px; }
.pin-dots { display: flex; gap: 18px; height: 14px; align-items: center; }
.pin-dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.45); transition: background-color 0.25s, border-color 0.25s, transform 0.5s var(--spring); animation: rise 0.5s var(--spring) both; }
.pin-dots i.on { background: var(--white); border-color: var(--white); transform: scale(1.18); box-shadow: 0 0 14px rgba(255, 255, 255, 0.6); }
.keypad { display: grid; grid-template-columns: repeat(3, 78px); gap: 18px 28px; }
.key {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 400; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.5s var(--spring), background-color 0.25s;
}
.key:active { transform: scale(0.88); background: rgba(255, 255, 255, 0.22); transition-duration: 0.1s; }
.key.ghost { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; font-size: 16px; color: var(--muted); }
.key.ghost svg { width: 26px; height: 26px; }
.key[disabled] { opacity: 0.3; }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 10px); display: flex; justify-content: center; z-index: 50; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; min-height: 48px; max-width: 100%; padding: 8px 22px; border-radius: 999px; font-size: 15px;
  background: linear-gradient(180deg, rgba(52, 54, 58, 0.82), rgba(28, 29, 32, 0.88));
  border: 1px solid var(--stroke-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 20px 40px -10px rgba(0, 0, 0, 0.7);
  transform: translateY(-160%) scale(0.85); opacity: 0; filter: blur(6px);
  transition: transform 0.8s var(--spring), opacity 0.4s ease, filter 0.4s ease;
}
.toast.in { transform: none; opacity: 1; filter: blur(0); }
.toast.has-action { padding-right: 8px; }
.toast button { flex: none; height: 34px; padding: 0 16px; border-radius: 999px; background: var(--white); color: var(--ink); font-size: 14px; font-weight: 600; }

#haptic { position: fixed; left: -100px; top: 0; opacity: 0; pointer-events: none; width: 1px; height: 1px; overflow: hidden; }
