:root{
  --safe-top:0px;--safe-bottom:0px;
  --bg1:#1d3350;--bg2:#2a6182;--bg3:#a9d3dc;
  --text:#fff;--muted:rgba(255,255,255,.68);
  --card:rgba(46,66,92,.92);--cardtxt:#fff;
  --light:#edf3fa;--lighttxt:#14202e;--lightmuted:#5b6b7d;
  --mint:#a8f0d4;--accent:#2a6182;--ink:#14202e;
  --pill:rgba(255,255,255,.14);
}
body[data-theme=light]{
  --bg1:#6fa3c4;--bg2:#a8d2de;--bg3:#e8f4f6;
  --text:#10243a;--muted:rgba(16,36,58,.62);
  --card:rgba(255,255,255,.72);--cardtxt:#10243a;
  --mint:#0f7f5a;--pill:rgba(16,36,58,.1);
}
*{box-sizing:border-box;margin:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--text);
  background:linear-gradient(180deg,var(--bg1) 0%,var(--bg2) 45%,var(--bg3) 100%) fixed;overflow-x:hidden}
#app{min-height:100%;padding:calc(var(--safe-top) + 10px) 16px calc(var(--safe-bottom) + 110px)}
[hidden]{display:none!important}
button{font:inherit;color:inherit;border:0;background:none;cursor:pointer}

.top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.profile{display:flex;align-items:center;gap:10px;min-width:0}
.avatar{width:46px;height:46px;border-radius:50%;background:var(--pill) center/cover;display:grid;place-items:center;font-weight:700;flex:none}
.pinfo{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.pinfo b{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pinfo span{font-size:12px;color:var(--muted)}
.wallet{background:var(--pill);padding:10px 14px;border-radius:999px;font-weight:600;font-size:13px;max-width:44%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.prefs{display:flex;justify-content:space-between;align-items:center;margin:14px 0 18px}
.seg{display:flex;background:var(--pill);border-radius:999px;padding:3px}
.seg button{padding:6px 14px;border-radius:999px;font-size:12px;font-weight:700;color:var(--muted)}
.seg button.on{background:#fff;color:var(--ink)}
.icon-btn{width:36px;height:36px;border-radius:50%;background:var(--pill);display:grid;place-items:center}
.icon-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2}

h1{font-size:34px;font-weight:800;letter-spacing:-.5px;margin:6px 0 12px}
h3{font-size:17px;font-weight:700}
.sub{color:var(--muted);margin-bottom:18px;line-height:1.4}
.muted{color:var(--lightmuted)}.small{font-size:12px}
.row{display:flex;align-items:center}.between{justify-content:space-between}

.card{border-radius:28px;padding:20px;margin-bottom:16px}
.card.balance{background:var(--card);color:var(--cardtxt);border:1px solid rgba(255,255,255,.08)}
.card.light{background:var(--light);color:var(--lighttxt)}
.badge{background:var(--pill);padding:7px 12px;border-radius:999px;font-size:12px}
.big{font-size:46px;font-weight:700;letter-spacing:-1px;margin:14px 0 4px;font-variant-numeric:tabular-nums}
.big small{font-size:.5em;opacity:.75;font-weight:600}
.big .u{font-size:15px;font-weight:700;letter-spacing:.5px;margin-left:6px;opacity:.75}
.income{text-align:center;margin:26px 0 18px}
.income .label{font-weight:700;letter-spacing:.6px;text-transform:uppercase;font-size:14px;color:var(--muted)}
.mint{color:var(--mint);font-size:40px}
.income .muted{color:var(--muted)}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}
.btn{height:54px;border-radius:999px;font-weight:700;font-size:16px}
.btn.ghost{background:rgba(255,255,255,.22);color:#fff}
body[data-theme=light] .btn.ghost{color:var(--ink);background:rgba(255,255,255,.7)}
.btn.ghost.dark{background:rgba(20,32,46,.08);color:var(--ink);width:100%;margin-top:10px}
.btn:disabled{opacity:.45}
.link{color:var(--accent);font-weight:700;font-size:14px}

.list>div{display:flex;justify-content:space-between;align-items:center;padding:14px 0;border-top:1px solid rgba(20,32,46,.08)}
.list>div:first-child{border-top:0}
.list b{display:block;font-size:15px}.list span{font-size:12px;color:var(--lightmuted)}
.list .r{text-align:right}.list .r b{font-variant-numeric:tabular-nums}
.plus{color:#0f7f5a}.minus{color:#b4403a}
.emptyl{padding:18px 0;text-align:center;color:var(--lightmuted)}
.empty{text-align:center;color:var(--lightmuted);padding:36px 20px}

.calc input[type=range]{width:100%;margin:14px 0;accent-color:#4a46e5;height:28px}
.tiers{display:flex;gap:6px;margin-bottom:14px}
.tiers span{flex:1;text-align:center;padding:8px 0;border-radius:999px;background:rgba(20,32,46,.07);font-size:12px;font-weight:700;color:var(--lightmuted)}
.tiers span.on{background:var(--ink);color:#fff}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid rgba(20,32,46,.08);padding-top:14px}
.grid3 div{text-align:center}.grid3 span{display:block;font-size:12px;margin-bottom:6px}
.grid3 b{font-size:16px;font-variant-numeric:tabular-nums}
.grid2.stats{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:18px}
.stats span{display:block;color:var(--muted);font-size:14px}.stats b{font-size:30px}
.chips{display:flex;background:rgba(20,32,46,.06);border-radius:999px;padding:4px;margin-bottom:8px;overflow-x:auto;scrollbar-width:none}
.chips button{flex:1 0 auto;padding:10px 14px;border-radius:999px;font-size:14px;font-weight:600;color:var(--lightmuted);white-space:nowrap}
.chips button.on{background:#fff;color:var(--ink);box-shadow:0 1px 4px rgba(0,0,0,.08)}

.nav{position:fixed;left:12px;right:12px;bottom:calc(var(--safe-bottom) + 12px);display:grid;grid-template-columns:repeat(4,1fr);
  background:var(--light);border-radius:34px;padding:8px;box-shadow:0 10px 30px rgba(10,30,50,.35)}
.nav button{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 0;border-radius:26px;color:var(--lightmuted);font-size:11px;font-weight:600}
.nav button.on{background:#cfe3ee;color:var(--ink)}
.nav svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--safe-bottom) + 110px);background:var(--ink);color:#fff;padding:12px 18px;border-radius:999px;font-size:14px;z-index:20;max-width:90%;text-align:center}
.blocked{position:fixed;inset:0;display:grid;place-items:center;text-align:center;padding:30px;background:#1d3350;z-index:30;font-size:18px;font-weight:600}
@media (prefers-reduced-motion:no-preference){.page:not([hidden]){animation:in .18s ease-out}@keyframes in{from{opacity:.4}}}
