:root {
  color-scheme: light;
  --ink: #271747;
  --soft: #655975;
  --purple: #6740bb;
  --line: #e8dff3;
  --paper: #fff;
  --bg: #f5f1fc;
  font-family: "Avenir Next", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at 86% 0, #eadcff, transparent 47rem), var(--bg); }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #845bd9; outline-offset: 3px; }
svg { width: 23px; height: 23px; flex: none; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3,strong { font-weight: 720; }
.shell { width: min(100%, 1120px); margin-inline: auto; padding: 0 max(16px, env(safe-area-inset-right)) calc(88px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: calc(.65rem + env(safe-area-inset-top)) 0 .7rem; }
.brand { display: inline-flex; align-items: center; gap: .45rem; font-size: .99rem; font-weight: 750; line-height: 1.12; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; color: white; background: #6942bd; font-size: 1.5rem; flex: none; }
.demo { min-height: 40px; border: 0; padding: .35rem .65rem; border-radius: 100px; background: #ede3fb; color: #543295; font-weight: 700; font-size: .75rem; white-space: nowrap; }
.hero { color: #fff; border-radius: 24px; min-height: 133px; padding: 1rem 1.05rem 1.15rem; display: flex; align-items: end;
  background: linear-gradient(90deg, #281345f2, #38205cbe 55%, #3c21671a), url('/hero.jpg') right 56% / cover, linear-gradient(125deg,#2c164e,#7949c7);
  box-shadow: 0 12px 24px #53348c26; overflow: hidden; }
.eyebrow { display: block; color: #eee2ff; font-size: .73rem; font-weight: 650; margin-bottom: .38rem; }
.hero h1 { font-size: 1.05rem; font-weight: 620; }
.hero p { font-size: clamp(2rem,7.6vw,3.55rem); letter-spacing: -.06em; line-height: 1.14; font-weight: 750; margin-top: .18rem; overflow-wrap: anywhere; }
.summary { margin-top: .9rem; }
.month { display: inline-flex; position: relative; align-items: center; gap: .35rem; padding: .42rem .73rem; min-height: 39px; color: #573992; background: #eee5fb; border-radius: 10px; font-size: .86rem; font-weight: 675; text-transform: capitalize; }
.month::after { content: '⌄'; font-size: 1rem; }
.month input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; }
.month:focus-within { outline: 2px solid #845bd9; }
.month input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.summary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; margin-top: .48rem; }
.metric { border: 0; border-radius: 17px; padding: .7rem .75rem; text-align: left; min-width: 0; }
.metric small, .metric strong { display: block; }
.metric small { font-size: .84rem; font-weight: 650; }
.metric strong { margin-top: .25rem; font-size: clamp(1.09rem, 5vw, 1.42rem); letter-spacing: -.025em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lilac { background: #eee4fd; color: #6540a9; }
.rose { background: #fbe4f3; color: #922569; }
.mint { background: #e1f4ec; color: #246653; }
.blue { background: #e5efff; color: #305c9e; }
.peach { background: #ffe8d9; color: #934a23; }
.plain { background: #f1ecf6; color: #635472; }
.section { border: 1px solid #fff; border-radius: 22px; background: #ffffffea; padding: .85rem; margin-top: .85rem; box-shadow: 0 4px 18px #41205f09; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: .55rem; min-height: 34px; }
.section-head h2 { font-size: 1.08rem; letter-spacing: -.012em; }
.text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border: 0; background: transparent; padding: .3rem .28rem; color: #6336aa; font-size: .82rem; font-weight: 700; text-align: center; }
.hint, .empty, .onboarding p { color: var(--soft); font-size: .86rem; line-height: 1.45; }
.hint { margin: .27rem 0 .55rem; }
.empty { padding-block: .8rem; }
.onboarding { padding: .7rem .25rem; }
.onboarding p { margin-block: .3rem .8rem; }
.account-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .42rem; }
.account-tile { min-width: 0; min-height: 90px; border: 1px solid #efe8f8; border-radius: 15px; background: #faf8fd; padding: .45rem .38rem; display: grid; justify-items: start; gap: .23rem; text-align: left; }
.account-tile[aria-pressed=true] { border-color: #9c74dc; background: #f1e7ff; box-shadow: 0 0 0 1px #9c74dc; }
.account-tile .tile-icon { touch-action: none; cursor: grab; }
.account-tile strong, .account-tile small { max-width: 100%; overflow-wrap: anywhere; }
.account-tile strong { font-size: .77rem; line-height: 1.17; }
.account-tile small { font-size: .72rem; color: var(--soft); }
.tile-icon { display: inline-grid; flex: none; place-items: center; width: 38px; height: 38px; border-radius: 13px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tile-icon svg { width: 21px; height: 21px; pointer-events: none; }
.account-tile .tile-icon { width: 31px; height: 31px; border-radius: 10px; }
.account-tile .tile-icon svg { width: 18px; height: 18px; }
.category-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .2rem; margin-top: .55rem; }
.category-tile { min-height: 62px; display: flex; align-items: center; flex-direction: column; justify-content: start; gap: .27rem; padding: .25rem .02rem; border: 1px solid transparent; border-radius: 12px; background: transparent; font-size: .71rem; font-weight: 650; line-height: 1.15; overflow-wrap: anywhere; }
.category-tile span { max-width: 100%; }
.category-tile.drag-over { border: 1px dashed #7b45ce; background: #f4eaff; }
.reminders { display: grid; gap: .45rem; margin-bottom: .65rem; }
.reminder { display: flex; align-items: center; gap: .48rem; background: #ffefe3; border: 1px solid #ffd9bf; border-radius: 16px; padding: .42rem .5rem; }
.reminder .row-text { flex: 1; }
.reminder .row-text small { font-size: .73rem; color: #74442d; }
.reminder .row-text strong { font-size: .9rem; }
.reminder-action { min-height: 44px; border: 0; border-radius: 11px; background: #fff9f3; color: #74442d; padding: .3rem .48rem; font-size: .77rem; font-weight: 740; }
.list { display: grid; }
.list-row { width: 100%; display: flex; align-items: center; gap: .58rem; min-height: 57px; padding: .44rem .1rem; border: 0; background: transparent; text-align: left; color: inherit; }
.list-row + .list-row, .management-row + .management-row { border-top: 1px solid #f0ebf5; }
.row-text { min-width: 0; display: grid; gap: .16rem; flex: 1; overflow-wrap: anywhere; }
.row-text strong { font-size: .92rem; }
.row-text small { color: var(--soft); font-size: .79rem; }
.row-value { font-size: .91rem; text-align: end; font-variant-numeric: tabular-nums; max-width: 38%; overflow-wrap: anywhere; }
.outflow { color: #a82662; }
.inflow { color: #20694f; }
.progress { display: block; height: 6px; border-radius: 10px; width: 100%; }
.progress i { display: block; background: currentColor; border-radius: inherit; height: 100%; }
.goal-progress { margin: 0 0 .5rem; grid-column: 1/-1; }
.page-title { letter-spacing: -.055em; font-size: 2rem; margin: .28rem 0 .55rem; }
.filters { margin-top: .55rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.filters select { flex: 1 1 135px; min-width: 0; }
.management-row { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) auto; gap: .28rem; }
.management-row .list-row > svg { width: 16px; color: #785e97; }
.secondary-action { justify-self: end; }
.nav { position: fixed; z-index: 4; left: 50%; transform: translateX(-50%); bottom: 0; width: min(100%, 540px); background: #fff; border: 1px solid #ede4f6; border-radius: 24px 24px 0 0; box-shadow: 0 -7px 32px #49326a14; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: center; padding: .38rem max(.37rem,env(safe-area-inset-right)) calc(.35rem + env(safe-area-inset-bottom)) max(.37rem,env(safe-area-inset-left)); }
.nav a { min-height: 47px; display: grid; justify-items: center; align-content: center; gap: .1rem; color: #72627e; border-radius: 14px; font-size: .65rem; font-weight: 660; }
.nav [aria-current] { color: #5e30a4; background: #f4ebff; }
.add-tab { width: 47px; height: 47px; justify-self: center; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg,#9a5be2,#6236ae); border: 0; border-radius: 16px; box-shadow: 0 5px 12px #7341bd55; }
.add-tab svg { width: 29px; height: 29px; }
dialog { width: min(100% - 1rem, 510px); max-height: calc(100dvh - .7rem); border: 1px solid #f1eaf9; border-radius: 23px; color: var(--ink); margin: auto auto max(.25rem, env(safe-area-inset-bottom)); padding: .85rem; box-shadow: 0 20px 70px #2c144e52; }
dialog::backdrop { background: #28134082; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .46rem; }
.sheet-head h2 { font-size: 1.22rem; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 14px; background: #f3edfa; font-size: 1.5rem; }
#fields { display: grid; gap: .52rem; }
#fields p { line-height: 1.47; }
.field { display: grid; min-width: 0; gap: .2rem; }
.field > span { font-size: .86rem; font-weight: 655; }
.field input, .field select, .filters select { min-width: 0; min-height: 44px; font-size: 1rem; padding: .43rem .62rem; border: 1px solid #ded2eb; border-radius: 11px; background: #fbf8fd; color: var(--ink); }
.field input[type=date] { width: 100%; appearance: none; }
.money-field input { font-size: 1.7rem; font-weight: 720; padding: .5rem .65rem; }
.segmented { display: flex; padding: .2rem; border-radius: 13px; background: #f1eaf8; gap: .2rem; }
.segmented button { flex: 1; min-height: 41px; border: 0; border-radius: 10px; background: transparent; font-size: .86rem; padding: .2rem .35rem; }
.segmented .selected { color: #582ea2; background: #fff; font-weight: 720; box-shadow: 0 2px 6px #57348814; }
.sheet-actions { position: sticky; bottom: -.85rem; display: flex; justify-content: flex-end; gap: .42rem; padding: .55rem 0 .2rem; background: #fff; }
.primary,.danger { border: 0; border-radius: 13px; min-height: 45px; font-weight: 720; padding: .48rem .85rem; }
.primary { color: #fff; background: #6939ba; }
.primary:disabled { opacity: .48; }
.danger { background: #fcedf2; color: #a12456; margin-right: auto; }
.error { color: #a12456; font-size: .85rem; margin-top: .42rem; }
.toast,.drag-ghost { position: fixed; z-index: 8; border-radius: 13px; color: #fff; background: #3a2265; box-shadow: 0 6px 24px #29143c55; padding: .69rem .9rem; font-weight: 670; }
.toast { bottom: calc(74px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: 95vw; }
.drag-ghost { pointer-events: none; transform: translate(-50%, calc(-100% - 12px)); }
@media (min-width: 680px) {
  .shell { padding-inline: 1.5rem; }
  .top { padding-block: 1.1rem; }
  .hero { min-height: 215px; padding: 1.5rem 1.8rem; background-position: center, right 49%, center; }
  .brand { font-size: 1.12rem; }
  .demo { font-size: .85rem; }
  .section { padding: 1.05rem; }
  .section-head h2 { font-size: 1.2rem; }
  .account-grid { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
  .account-tile { padding: .65rem .7rem; }
  .account-tile strong { font-size: .9rem; }
  .account-tile small,.category-tile { font-size: .82rem; }
  .category-grid { grid-template-columns: repeat(7,minmax(0,1fr)); }
  .home-bottom { display: grid; gap: .85rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
  dialog { margin: auto; }
}
