:root {
  --page: #e6e6e2;
  --bg: #f4f4f1;
  --surface: #ffffff;
  --ink: #0b0b0c;
  --ink-2: #3a3a3c;
  --muted: #8e8e8a;
  --hair: #e7e7e3;
  --mint: #d3eae4;
  --mint-ink: #2f5a50;
  --lav: #e9e0fb;
  --peach: #f7e6c4;
  --dark: #0b0b0c;
  --dark-2: #161618;
  --dark-3: #1f1f22;
  --dark-hair: #232326;
  --dark-muted: #7c7c80;
  --pos: #2e9e7c;
  --neg: #c94a3f;
  --r-lg: 28px;
  --r-md: 18px;
  --pad: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
ul { list-style: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

body {
  background: var(--page);
  font-family: Geist, Inter, system-ui, -apple-system, "Segoe UI", "Pyidaungsu", sans-serif;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
}

.app {
  position: relative;
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  background: var(--bg);
  padding: 12px var(--pad) 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 560px) {
  body { padding: 32px 0; align-items: flex-start; }
  .app {
    height: min(880px, calc(100dvh - 64px));
    min-height: 0;
    border-radius: 44px;
    overflow-y: auto;
    scrollbar-width: none;
    box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 40px 80px -30px rgba(0,0,0,.28);
  }
  .app::-webkit-scrollbar { display: none; }
}

/* ---------- type ---------- */
.eyebrow { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ink-soft { color: var(--mint-ink); opacity: .75; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }
.page-title { font-size: 34px; font-weight: 500; letter-spacing: -.035em; margin: 4px 0 24px; }
h3 { font-size: 15px; font-weight: 500; }
.cur { font-size: .38em; font-weight: 500; color: var(--muted); margin-left: .35em; letter-spacing: 0; vertical-align: .15em; }
.dec { color: var(--muted); }

/* ---------- screens ---------- */
.screen { display: none; flex: 1; padding-bottom: 28px; }
.screen.active { display: block; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.top { display: flex; align-items: center; justify-content: space-between; min-height: 56px; margin-bottom: 20px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--mint); color: var(--mint-ink);
  font-size: 16px; font-weight: 600; display: grid; place-items: center;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--hair);
}
/* brand */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-tile {
  --flag: #9fd8c8;
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; color: #fff; overflow: hidden;
  background: linear-gradient(150deg, #2c2c30 0%, #0b0b0c 62%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 8px 18px -8px rgba(0,0,0,.45);
}
/* soft mint glow behind the flag */
.brand-tile::before {
  content: ""; position: absolute; width: 70%; height: 70%; top: -30%; right: -30%;
  background: radial-gradient(circle, rgba(159,216,200,.35), transparent 70%);
}
.brand-mark { position: relative; fill: currentColor; stroke: none; width: 22px; height: 24px; margin: 1px 0 0 1px; }
.brand-text { display: grid; gap: 4px; min-width: 0; }
.brand-text b { font-size: 18px; font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.brand-text small {
  font-size: 8.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.greet { font-size: 14px; color: var(--ink-2); margin: -4px 0 26px; }

.about { display: grid; justify-items: center; gap: 6px; margin: 34px 0 4px; }
.about .brand-tile { width: 64px; height: 64px; border-radius: 20px; margin-bottom: 8px; }
.about .brand-mark { width: 32px; height: 34px; }
.about b { font-size: 17px; font-weight: 600; letter-spacing: -.035em; }
.about small { font-size: 9px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair);
  transition: transform .15s;
}
.icon-btn:active { transform: scale(.94); }
.icon-spacer { width: 44px; }

/* ---------- hero ---------- */
.hero { margin-bottom: 22px; }
.amount-xl { font-size: 48px; font-weight: 500; letter-spacing: -.045em; line-height: 1.05; margin-top: 8px; }
.hero-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; }
.delta {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 500;
}
.delta svg { width: 13px; height: 13px; stroke-width: 2; }
.delta.up { background: #f8e3e0; color: var(--neg); }
.delta.down { background: var(--mint); color: var(--mint-ink); }

.split { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); margin-bottom: 20px; }
.split.three { grid-template-columns: repeat(3, 1fr); }
.split > div { padding: 14px 0; }
.split > div + div { padding-left: 16px; border-left: 1px solid var(--hair); }
.split b { display: block; font-size: 17px; font-weight: 500; margin-top: 4px; letter-spacing: -.02em; }

/* ---------- actions ---------- */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.act {
  height: 60px; border-radius: 999px; display: flex; align-items: center; gap: 12px;
  padding: 0 20px 0 8px; font-size: 15px; font-weight: 500; transition: transform .15s var(--ease);
}
.act:active { transform: scale(.97); }
.act-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.act.dark { background: var(--ink); color: #fff; }
.act.dark .act-ico { background: var(--dark-3); }
.act.light { background: var(--surface); box-shadow: 0 0 0 1px var(--hair); }
.act.light .act-ico { background: var(--bg); }

/* ---------- cards ---------- */
.card { border-radius: var(--r-lg); margin-bottom: 14px; }
.card.mint { background: var(--mint); padding: 18px 18px 14px; }
.card.white { background: var(--surface); padding: 18px; box-shadow: 0 0 0 1px var(--hair); }
.card.white.flush { padding: 0 18px; }
.card.dark { background: var(--dark); color: #fff; padding: 6px 6px 10px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head.pad { padding: 14px 14px 0; margin-bottom: 4px; align-items: center; }
.text-btn { font-size: 13px; color: var(--dark-muted); padding: 4px 0; }
.card.white .text-btn, .panel .text-btn { color: var(--muted); }
.text-btn.danger { color: var(--neg); font-weight: 500; }

/* segmented */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.55); }
.seg button { height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.seg.sm button { height: 28px; padding: 0 11px; font-size: 12px; }
.seg.full { display: grid; grid-template-columns: 1fr 1fr; background: #eaeae6; width: 100%; }
.seg.full button { height: 38px; }

/* chart */
.chart-total { font-size: 24px; font-weight: 500; letter-spacing: -.03em; margin-top: 6px; }
.chart-total .cur { color: var(--mint-ink); opacity: .6; }
.chart-total .sub { display: block; font-size: 12px; color: var(--mint-ink); opacity: .7; margin-top: 4px; letter-spacing: 0; font-weight: 400; }
.plot {
  position: relative; height: 150px; display: flex; align-items: flex-end; gap: 10px;
  background-image: linear-gradient(to top, rgba(47,90,80,.12) 1px, transparent 1px);
  background-size: 100% 25%;
  background-position: bottom;
  border-bottom: 1px solid rgba(47,90,80,.22);
}
.col { position: relative; flex: 1; height: 100%; display: flex; justify-content: center; cursor: pointer; }
.ghost, .bar { position: absolute; bottom: 0; width: 100%; max-width: 30px; border-radius: 10px 10px 4px 4px; transition: height .5s var(--ease), background .2s, opacity .2s; }
.ghost { background: rgba(47,90,80,.13); }
.bar { background: var(--ink); }
.bar.zero { height: 3px !important; background: rgba(47,90,80,.3); border-radius: 3px; }
.plot.picking .col:not(.sel) .bar:not(.zero) { opacity: .28; }
.tip {
  position: absolute; transform: translate(-50%, -8px); white-space: nowrap;
  font-size: 11px; font-weight: 500; color: var(--ink); pointer-events: none;
}
.xlabels { display: flex; gap: 10px; padding-top: 8px; }
.xlabels span { flex: 1; text-align: center; font-size: 11px; color: var(--mint-ink); opacity: .7; }
.xlabels span.now { opacity: 1; font-weight: 600; }

/* ---------- transaction list (dark) ---------- */
.day { padding: 16px 14px 6px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--dark-muted); display: flex; justify-content: space-between; }
.tx {
  display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r-md);
  cursor: pointer; transition: background .15s;
}
.tx:hover { background: var(--dark-2); }
.tx-ico {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: var(--dark-3); color: #e8e8e8;
}
.tx-ico.in { background: #1b2b27; color: #9fd8c8; }
.tx-meta { flex: 1; min-width: 0; }
.tx-meta b { display: block; font-size: 15px; font-weight: 500; }
.tx-meta small { display: block; font-size: 12px; color: var(--dark-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amt { font-size: 15px; font-weight: 500; white-space: nowrap; }
.tx-amt.in { color: #8fd6c2; }
.empty { padding: 36px 20px 30px; text-align: center; color: var(--dark-muted); font-size: 14px; line-height: 1.5; }
.empty b { color: #fff; font-weight: 500; }

/* ---------- stats ---------- */
.month-switch {
  display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 4px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair); font-size: 14px; font-weight: 500;
}
.month-switch button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.month-switch button:disabled { opacity: .25; cursor: default; }
.month-switch .m-label {
  width: auto; height: 36px; border-radius: 999px; padding: 0 8px 0 12px;
  display: flex; align-items: center; gap: 4px; min-width: 96px; justify-content: center;
}
.month-switch .m-label:hover, .month-switch .m-label[aria-expanded="true"] { background: var(--bg); }
.month-switch .m-label svg { width: 14px; height: 14px; color: var(--muted); transition: transform .2s; }
.month-switch .m-label[aria-expanded="true"] svg { transform: rotate(180deg); }

/* month picker popover */
.top { position: relative; }
.mpick {
  position: absolute; top: 60px; right: 0; z-index: 10; width: 272px; padding: 14px;
  background: var(--surface); border-radius: 22px;
  box-shadow: 0 0 0 1px var(--hair), 0 24px 48px -18px rgba(0,0,0,.25);
  animation: pop .2s var(--ease); transform-origin: top right;
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.mpick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mpick-head .y-label { width: auto; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 15px; font-weight: 500; }
.mpick.days .mpick-head .y-label:hover { background: var(--bg); }
.mpick:not(.days) .mpick-head .y-label { cursor: default; }
.mpick-head button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.mpick-head button:hover:not(:disabled) { background: var(--bg); }
.mpick-head button:disabled { opacity: .25; cursor: default; }
.mpick-head svg { width: 16px; height: 16px; }
.mpick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mpick-grid button {
  position: relative; height: 42px; border-radius: 12px; font-size: 14px; color: var(--ink-2);
  transition: background .15s;
}
.mpick-grid button:hover:not(:disabled):not(.on) { background: var(--bg); }
.mpick-grid button.now { font-weight: 600; color: var(--ink); }
.mpick-grid button.on { background: var(--ink); color: #fff; }
.mpick-grid button:disabled { color: #cfcfca; cursor: default; }
.mpick-grid i { position: absolute; bottom: 6px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #6fb3a3; }
.mpick-grid button.on i { background: #9fd8c8; }
.mpick-foot { display: flex; gap: 6px; margin-top: 10px; }
.mpick.days .mpick-grid { grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mpick.days .mpick-grid button { height: 34px; border-radius: 10px; font-size: 13px; }
.mpick.days .mpick-grid i { bottom: 3px; }
.mpick-grid .wd { height: 24px; display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.mpick-now {
  flex: 1; height: 38px; border-radius: 12px; font-size: 13px; font-weight: 500;
  background: var(--bg); color: var(--ink-2);
}
.month-switch svg { width: 16px; height: 16px; }

.stack { display: flex; gap: 3px; height: 10px; margin-bottom: 18px; }
.stack i { border-radius: 3px; min-width: 4px; transition: flex-grow .5s var(--ease); }
.stack.none i { flex: 1; background: var(--hair); }
.breakdown li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--hair); font-size: 14px; }
.breakdown li:first-child { border-top: 0; }
.breakdown .dot { width: 8px; height: 8px; border-radius: 50%; }
.breakdown .lbl { flex: 1; display: flex; align-items: center; gap: 10px; }
.breakdown .lbl svg { color: var(--muted); width: 18px; height: 18px; }
.breakdown .pct { color: var(--muted); font-size: 13px; width: 40px; text-align: right; }
.breakdown .val { font-weight: 500; min-width: 84px; text-align: right; }
.breakdown .none { color: var(--muted); justify-content: center; padding: 6px 0 2px; }

/* ---------- budget ---------- */
.ring-wrap { position: relative; width: 240px; height: 240px; margin: 0 auto 22px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring-track { stroke: #e6e6e1; }
.ring-fill { stroke: var(--ink); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease), stroke .3s; }
.ring-fill.over { stroke: var(--neg); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; }
.ring-amount { font-size: 30px; font-weight: 500; letter-spacing: -.035em; }
.ring-amount .cur { font-size: 12px; vertical-align: .3em; }
.pill-btn {
  display: block; margin: 0 auto 26px; height: 44px; padding: 0 22px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair); font-size: 14px; font-weight: 500;
}
.pill-btn.primary { background: var(--ink); color: #fff; box-shadow: none; }

.rows li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid var(--hair); font-size: 15px; }
.rows li:first-child { border-top: 0; }
.card.white:not(.flush) .rows li:first-child { padding-top: 0; }
.card.white:not(.flush) .rows li:last-child { padding-bottom: 0; }
.rows li > span, .rows label { color: var(--ink-2); }
.rows b { font-weight: 500; }
.rows input { flex: 1; min-width: 0; border: 0; outline: none; background: none; text-align: right; font-size: 15px; color: var(--ink); }
.rows input::placeholder { color: #bdbdb8; }
.link-rows li { cursor: pointer; }
.link-rows li svg { color: #c2c2bd; width: 18px; height: 18px; }
.link-rows li.danger span { color: var(--neg); }
.group-label { font-size: 12px; color: var(--muted); margin: 0 4px 8px; }
.footnote { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.6; margin: 18px 0 8px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  height: 66px; padding: 0 10px; margin: 0 0 14px;
  background: var(--dark); border-radius: 999px;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.45);
}
.nav button { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #6e6e72; position: relative; transition: color .2s; }
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: #fff; }
.nav button.on::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: #fff; }
.nav .nav-add { width: 50px; height: 50px; background: #fff; color: var(--ink); transition: transform .15s var(--ease); }
.nav .nav-add:active { transform: scale(.92); }
.nav .nav-add svg { stroke-width: 2; }

/* ---------- sheet ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(11,11,12,.32); opacity: 0; pointer-events: none; transition: opacity .25s;
}
.sheet.open { opacity: 1; pointer-events: auto; }
.panel {
  width: 100%; max-width: 420px; max-height: 94dvh; overflow-y: auto; scrollbar-width: none;
  background: var(--bg); border-radius: 32px 32px 0 0;
  padding: 8px var(--pad) calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .4s var(--ease);
}
.sheet.open .panel { transform: none; }
@media (min-width: 560px) {
  .sheet { align-items: center; }
  .panel { border-radius: 32px; transform: translateY(24px) scale(.98); opacity: 0; transition: transform .35s var(--ease), opacity .25s; }
  .sheet.open .panel { opacity: 1; }
  .grabber { visibility: hidden; }
}
.grabber { width: 36px; height: 4px; border-radius: 4px; background: #d4d4cf; margin: 0 auto 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head b { font-size: 15px; font-weight: 500; }
.panel-head .text-btn { width: 44px; text-align: right; }

.amount-display { text-align: center; padding: 26px 0 22px; font-size: 52px; font-weight: 500; letter-spacing: -.045em; line-height: 1; white-space: nowrap; overflow: hidden; }
.amount-display small { font-size: 15px; color: var(--muted); margin-left: 8px; letter-spacing: 0; font-weight: 400; }
.amount-display .empty { color: #c9c9c4; padding: 0; font-size: inherit; }
.amount-display.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)) 14px; padding: 2px var(--pad); }
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 10px;
  border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair);
  font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background .15s, color .15s;
}
.cats button svg { width: 18px; height: 18px; }
.cats button.on { background: var(--ink); color: #fff; box-shadow: none; }

.fields { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 8px; margin-bottom: 12px; }
.fields input {
  height: 46px; border: 0; border-radius: 14px; padding: 0 14px; font-size: 14px; outline: none;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair); color: var(--ink);
}
.fields input:focus { box-shadow: 0 0 0 1.5px var(--ink); }
.fields input { width: 100%; min-width: 0; }
.fields input[type="date"] { padding: 0 10px; font-size: 13px; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.keypad button {
  height: 54px; border-radius: 16px; font-size: 22px; font-weight: 400; display: grid; place-items: center;
  transition: background .1s;
}
.keypad button:active { background: #e6e6e1; }
.keypad button[data-k="000"] { font-size: 17px; }
.keypad svg { width: 24px; height: 24px; stroke-width: 1.5; }

.save {
  width: 100%; height: 58px; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 500; transition: opacity .2s, transform .15s;
}
.save:active { transform: scale(.98); }
.save:disabled { opacity: .25; }

.toast {
  position: fixed; left: 50%; bottom: 104px; z-index: 30; transform: translate(-50%, 12px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.credit { text-align: center; font-size: 11px; color: var(--muted); margin: 14px 0 6px; letter-spacing: .01em; }
.credit a { color: var(--ink-2); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--hair); padding-bottom: 1px; transition: border-color .2s, color .2s; }
.credit a:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- boot / signed out ---------- */
body.booting .app, body.booting .auth { visibility: hidden; }
.auth { display: none; }
body.signed-out .app { display: none; }
body.signed-out .auth {
  display: flex; justify-content: center; align-items: flex-start;
  width: 100%; min-height: 100dvh; padding: 56px var(--pad) 32px; background: var(--bg);
}
@media (min-width: 560px) {
  body.signed-out { padding: 32px 0; }
  body.signed-out .auth {
    max-width: 420px; min-height: 0; height: min(880px, calc(100dvh - 64px)); overflow-y: auto;
    border-radius: 44px; box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 40px 80px -30px rgba(0,0,0,.28);
    align-items: center; padding-top: 32px;
  }
}
.auth-card { width: 100%; display: grid; gap: 14px; animation: rise .4s var(--ease); }
.brand-tile.lg { width: 64px; height: 64px; border-radius: 20px; }
.brand-tile.lg .brand-mark { width: 32px; height: 34px; }
.auth-brand { display: grid; gap: 4px; font-size: 17px; font-weight: 600; letter-spacing: -.035em; margin-top: -2px; }
.auth-brand small { font-size: 9px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.auth-card h1 { font-size: 30px; font-weight: 500; letter-spacing: -.035em; margin-top: 18px; }
.auth-sub { color: var(--muted); font-size: 14px; margin: -8px 0 10px; }
.auth-card label { display: grid; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.auth-card input {
  height: 52px; border: 0; border-radius: 16px; padding: 0 16px; font-size: 15px; outline: none;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hair); color: var(--ink); transition: box-shadow .15s;
}
.auth-card input:focus { box-shadow: 0 0 0 1.5px var(--ink); }
.auth-error { min-height: 18px; font-size: 13px; color: var(--neg); margin: -4px 2px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); }
.auth-switch button { color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hair); }
.auth .credit { margin-top: 18px; }

.save.loading { position: relative; color: transparent; }
.save.loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- upload banner (old device-only entries) ---------- */
.legacy {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; margin: -10px 0 22px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--hair);
}
.legacy-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--mint); color: var(--mint-ink); flex: none; }
.legacy div { flex: 1; min-width: 0; }
.legacy b { display: block; font-size: 14px; font-weight: 500; }
.legacy small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.legacy-btn { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; }
.legacy-btn:disabled { opacity: .6; }

/* settings account rows */
.link-rows li.static { cursor: default; }
.rows .email { font-weight: 400; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.footnote svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.install-hint { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin: -6px 6px 16px; }
.install-hint svg { width: 15px; height: 15px; vertical-align: -2px; }

/* iOS home-screen app: keep content clear of the notch */
@supports (padding: env(safe-area-inset-top)) {
  .app { padding-top: max(12px, env(safe-area-inset-top)); }
}

/* custom categories */
.cats .cat-add { color: var(--muted); box-shadow: 0 0 0 1px var(--hair) inset; background: transparent; border: 1px dashed #cfcfca; }
.cat-new { flex: none; display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 4px 0 14px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1.5px var(--ink); }
.cat-new input { width: 130px; border: 0; outline: none; background: none; font-size: 13px; color: var(--ink); }
.cat-new button { height: 32px; padding: 0 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; box-shadow: none; }
.cat-row { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink-2); }
.cat-row svg { width: 18px; height: 18px; color: var(--muted); }
.cat-row small { font-size: 11px; color: var(--muted); }
[data-screen="categories"] .text-btn { font-size: 13px; }
/* keep the last chip off the screen edge when scrolled to the end */
.cats .cat-add, .cat-new { margin-right: 0; }
[data-screen="categories"] .text-btn.armed { color: var(--neg); }
.row-end { display: flex; align-items: center; gap: 6px; }
.cat-form { display: grid; gap: 12px; margin-bottom: 22px; }
.cat-form-row { display: flex; gap: 8px; }
.cat-form-row input {
  flex: 1; min-width: 0; height: 44px; border: 0; border-radius: 14px; padding: 0 14px; font-size: 15px; outline: none;
  background: var(--bg); color: var(--ink);
}
.cat-form-row input:focus { box-shadow: 0 0 0 1.5px var(--ink); }
.cat-form-row .pill-btn { margin: 0; height: 44px; }
