:root {
  --cream: #fffaf2;
  --paper: #f4f8f7;
  --surface: #fffefd;
  --ink: #3d4b52;
  --muted: #738087;
  --line: #d8e3e5;
  --grape: #6598b2;
  --grape-deep: #406a7e;
  --lavender: #cbe7ef;
  --lavender-soft: #e9f5f7;
  --peach: #ff9d8e;
  --peach-soft: #ffe8e2;
  --mint: #82cfbe;
  --mint-soft: #dff6ef;
  --butter: #ffd875;
  --blue: #86b9e9;
  --shadow: 0 7px 0 rgba(63, 96, 108, .1), 0 18px 45px rgba(47, 72, 80, .08);
  --radius: 26px;
  --bounce: cubic-bezier(.2, 1.45, .45, 1);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(#cfdddf 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: "Arial Rounded MT Bold", "Thonburi", "Noto Sans Thai", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
.ambient-shape { position: fixed; z-index: -1; border-radius: 45% 55% 60% 40%; filter: blur(1px); pointer-events: none; }
.ambient-one { width: 390px; height: 390px; right: -180px; top: 18%; background: rgba(134, 185, 233, .18); animation: ambientFloat 13s ease-in-out infinite; }
.ambient-two { width: 300px; height: 300px; left: 10%; bottom: -180px; background: rgba(130, 207, 190, .18); animation: ambientFloat 16s ease-in-out -4s infinite reverse; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; z-index: 5; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 22px; background: rgba(255, 250, 242, .9); border-right: 2px solid rgba(232, 223, 240, .8); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; color: var(--ink); text-decoration: none; }
.brand-mark { position: relative; width: 46px; height: 42px; display: grid; place-items: center; border: 3px solid #3d4b52; border-radius: 4px; color: #fff; background: #8e999f; box-shadow: 5px 5px 0 #c2cdd0; font-family: monospace; font-size: 22px; transform: rotate(-2deg); transition: transform .3s var(--bounce); }
.brand:hover .brand-mark { transform: rotate(8deg) scale(1.08); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.03em; }
.brand small { margin-top: 2px; color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 10px; }
.nav-list { display: grid; gap: 9px; margin-top: 42px; }
.nav-item { position: relative; border: 0; display: flex; align-items: center; gap: 13px; padding: 13px 14px; border-radius: 17px; color: #697a81; background: transparent; cursor: pointer; text-align: left; font-size: 13px; transition: transform .22s var(--bounce), background .18s ease, color .18s ease; }
.nav-item:hover { color: var(--grape-deep); background: #eaf4f5; transform: translateX(4px) rotate(-.4deg); }
.nav-item:active { transform: translateX(4px) scale(.96); }
.nav-item.active { color: var(--grape-deep); background: var(--lavender-soft); font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--lavender), 0 4px 0 #cfe3e8; }
.nav-item.active::after { content: ""; position: absolute; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--peach); animation: softPulse 2s ease-in-out infinite; }
.nav-icon { width: 25px; font-size: 20px; text-align: center; transition: transform .3s var(--bounce); }
.nav-item:hover .nav-icon { transform: rotate(12deg) scale(1.15); }
.sidebar-note { margin-top: auto; display: flex; gap: 11px; padding: 16px 13px; border: 1.5px dashed #bfd1d5; border-radius: 18px; background: rgba(255,255,255,.65); }
.privacy-dot { width: 10px; height: 10px; flex: none; margin-top: 4px; border: 2px solid white; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 11px; }
.sidebar-note small { margin-top: 3px; color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 9px; line-height: 1.5; }
.main-content { min-width: 0; width: 100%; max-width: 1500px; margin: 0 auto; padding: 31px 40px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 25px; }
.eyebrow, .section-label { margin: 0 0 6px; color: var(--grape); font-family: "Thonburi", sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.topbar h1 { margin: 0; font-size: clamp(23px, 2.5vw, 34px); line-height: 1.25; letter-spacing: -.045em; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.month-picker { min-width: 158px; display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1.5px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.85); box-shadow: 0 3px 0 #dce7e9; transition: transform .2s var(--bounce); }
.month-picker:hover { transform: translateY(-2px) rotate(-.4deg); }
.month-picker span { color: var(--muted); font-size: 10px; }
.month-picker input { min-width: 105px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.primary-button, .secondary-button, .danger-button { border: 0; padding: 11px 17px; border-radius: 15px; font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap; transition: transform .22s var(--bounce), box-shadow .22s ease, background .15s ease; }
.primary-button { color: #fff; background: var(--grape); box-shadow: 0 5px 0 var(--grape-deep), 0 10px 20px rgba(64, 106, 126, .16); }
.primary-button:hover { background: #72a7c0; transform: translateY(-3px) rotate(-1deg); box-shadow: 0 7px 0 var(--grape-deep), 0 14px 24px rgba(64, 106, 126, .2); }
.primary-button:active { transform: translateY(3px) scale(.96); box-shadow: 0 2px 0 var(--grape-deep); }
.salary-button { display: flex; align-items: center; gap: 7px; border: 1.5px solid #9fbec8; padding: 9px 13px; border-radius: 14px; color: #406a7e; background: #e9f5f7; box-shadow: 0 4px 0 #c5dce1; font-size: 11px; font-weight: 800; cursor: pointer; transition: transform .22s var(--bounce), box-shadow .2s ease; }
.salary-button:hover { transform: translateY(-3px) rotate(.5deg); box-shadow: 0 7px 0 #c5dce1; }
.salary-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #c5dce1; }
.pixel-wallet { width: 22px; height: 19px; display: grid; place-items: center; border: 2px solid #406a7e; color: #406a7e; background: #ffd875; box-shadow: 2px 2px 0 rgba(64,106,126,.2); font-family: monospace; font-size: 10px; }
.sync-button { display: flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); padding: 9px 12px; border-radius: 14px; color: var(--muted); background: rgba(255,255,255,.8); box-shadow: 0 4px 0 #dce7e9; font-size: 10px; font-weight: 800; cursor: pointer; transition: transform .22s var(--bounce), color .2s ease; }
.sync-button:hover { color: var(--grape-deep); transform: translateY(-2px); }.sync-button.connected { color: #347d6e; background: var(--mint-soft); border-color: #a9d7cc; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #aeb9bd; box-shadow: 0 0 0 4px #edf1f2; }.sync-button.connected .sync-dot { background: var(--mint); box-shadow: 0 0 0 4px rgba(130,207,190,.2); animation: softPulse 2s infinite; }.sync-button.syncing .sync-dot { background: var(--butter); animation: softPulse .8s infinite; }.sync-button.error .sync-dot { background: var(--peach); }
.secondary-button { color: var(--grape-deep); background: var(--lavender-soft); box-shadow: 0 4px 0 #cddfe3; }
.secondary-button:hover { transform: translateY(-2px); }
.danger-button { color: #b95762; background: var(--peach-soft); box-shadow: 0 4px 0 #f3d0cb; }
.view { display: none; }
.view.active-view { display: block; animation: pageIn .52s var(--bounce) both; }
.active-view .balance-board, .active-view .list-page-head, .active-view .commitment-intro { animation: stageUp .48s var(--bounce) both; }
.active-view .stats-row, .active-view .transaction-table, .active-view .commitment-grid { animation: stageUp .5s .08s var(--bounce) both; }
.active-view .dashboard-grid, .active-view .backup-panel { animation: stageUp .52s .16s var(--bounce) both; }

.balance-board { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(300px, 1.1fr) 190px minmax(240px, .8fr); align-items: center; min-height: 270px; padding: 30px 34px; border: 3px solid #79aabd; border-radius: 24px 24px 24px 7px; color: var(--ink); background-color: #cfe9ef; background-image: linear-gradient(rgba(255,255,255,.18) 2px, transparent 2px), linear-gradient(90deg, rgba(255,255,255,.18) 2px, transparent 2px); background-size: 16px 16px; box-shadow: 8px 8px 0 #a9cdd6, 0 26px 60px rgba(54, 94, 108, .13); }
.balance-board::before { content: ""; position: absolute; width: 320px; height: 320px; left: -80px; bottom: -235px; border-radius: 50%; background: rgba(255,255,255,.28); }
.balance-board::after { content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -120px; border: 38px solid rgba(255,255,255,.18); border-radius: 50%; }
.balance-copy, .balance-side, .cat-zone { position: relative; z-index: 2; }
.balance-copy { align-self: center; }
.balance-kicker { display: inline-block; padding: 5px 10px; border-radius: 4px; color: #446675; background: rgba(255,255,255,.48); font-family: "Thonburi", sans-serif; font-size: 11px; font-weight: 800; box-shadow: 3px 3px 0 rgba(64,106,126,.16); }
.balance-number { margin: 12px 0 5px; color: #354c56; font-family: "SF Mono", "Menlo", monospace; font-size: clamp(44px, 5vw, 72px); line-height: 1; letter-spacing: -.065em; font-weight: 900; font-variant-numeric: tabular-nums; animation: numberArrive .65s var(--bounce) both; }
.balance-copy p { max-width: 410px; margin: 10px 0 0; color: #526b75; font-family: "Thonburi", sans-serif; font-size: 12px; line-height: 1.55; }
.hero-sparkle { position: absolute; z-index: 3; color: #fff; pointer-events: none; }
.sparkle-one { left: 47%; top: 22px; font-size: 18px; animation: sparkle 2.8s ease-in-out infinite; }
.sparkle-two { right: 27%; bottom: 20px; color: #ffb09f; font-size: 14px; animation: sparkle 3.4s ease-in-out -1s infinite; }
.cat-zone { height: 205px; align-self: end; }
.speech-bubble { position: absolute; z-index: 5; left: 50%; top: 2px; width: 150px; padding: 9px 10px; border: 3px solid #41535b; border-radius: 2px; color: #41535b; background: #fffefb; box-shadow: 5px 5px 0 rgba(65,83,91,.22); font-family: "SF Mono", "Thonburi", monospace; font-size: 9px; line-height: 1.4; text-align: center; transform: translateX(-50%); animation: bubbleIn .45s steps(4, end) both, bubbleBreathe 4s 1s steps(2, end) infinite; }
.cat { position: absolute; left: 50%; bottom: 6px; width: 112px; height: 118px; image-rendering: pixelated; transform: translateX(-50%); animation: catBob 2.4s steps(2, end) infinite; transform-origin: 50% 100%; }
.cat-shadow { position: absolute; left: 50%; bottom: 0; width: 112px; height: 12px; border-radius: 0; background: rgba(46, 61, 67, .2); box-shadow: 8px 4px 0 rgba(46,61,67,.1); transform: translateX(-50%); animation: shadowBreathe 2.4s steps(2, end) infinite; }
.cat-body { position: absolute; left: 24px; bottom: 4px; width: 68px; height: 66px; border: 4px solid #3f484d; border-radius: 0; background: #929ca1; box-shadow: inset -11px -10px 0 #758087, 6px 6px 0 rgba(63,72,77,.14); }
.cat-head { position: absolute; z-index: 3; left: 12px; top: 7px; width: 88px; height: 68px; border: 4px solid #3f484d; border-radius: 0; background: #a4adb1; box-shadow: inset -10px -9px 0 #838d92; }
.cat-ear { position: absolute; z-index: -1; top: -18px; width: 29px; height: 29px; border: 4px solid #3f484d; border-radius: 0; background: #929ca1; transform: rotate(45deg); }
.cat-ear::after { content: ""; position: absolute; width: 10px; height: 10px; left: 6px; top: 6px; border-radius: 0; background: #e69b91; }
.cat-ear.left { left: 1px; border-radius: 0; }.cat-ear.right { right: 1px; border-radius: 0; }
.cat-eye { position: absolute; top: 28px; width: 8px; height: 10px; border-radius: 0; background: #26343a; box-shadow: inset 0 3px 0 #d7f3ef; animation: blink 4.6s steps(1, end) infinite; transform-origin: center; }
.cat-eye.left { left: 22px; }.cat-eye.right { right: 22px; }
.cat-nose { position: absolute; left: 50%; top: 42px; width: 8px; height: 6px; border-radius: 0; background: #e17f7c; transform: translateX(-50%); }
.cat-mouth { position: absolute; left: 50%; top: 50px; width: 16px; height: 7px; border-right: 3px solid #3f484d; border-bottom: 3px solid #3f484d; border-left: 3px solid #3f484d; border-radius: 0; transform: translateX(-50%); }
.cat-cheek { position: absolute; top: 44px; width: 12px; height: 6px; border-radius: 0; background: #e6a09a; opacity: .65; }.cat-cheek.left { left: 5px; }.cat-cheek.right { right: 5px; }
.cat-paw { position: absolute; z-index: 4; bottom: 0; width: 28px; height: 20px; border: 4px solid #3f484d; border-radius: 0; background: #bcc3c6; }.cat-paw.left { left: 19px; }.cat-paw.right { right: 16px; }
.cat-tail { position: absolute; z-index: -1; right: -3px; bottom: 25px; width: 17px; height: 17px; border: 3px solid #3f484d; border-radius: 0; background: #818b90; box-shadow: 14px 0 0 #818b90, 14px -14px 0 #818b90, 14px -28px 0 #818b90; transform-origin: left bottom; animation: tailWag 1.8s steps(3, end) infinite; }
.tiny-coin { position: absolute; z-index: 5; width: 25px; height: 25px; display: grid; place-items: center; border: 3px solid #8b6c25; border-radius: 0; color: #765918; background: var(--butter); box-shadow: 4px 4px 0 #d1a944; font-family: monospace; font-size: 10px; font-weight: 900; }
.coin-one { left: 8px; bottom: 43px; animation: coinFloat 2.2s steps(3, end) infinite; }.coin-two { right: 5px; bottom: 78px; animation: coinFloat 2.6s .5s steps(3, end) infinite reverse; }
.cat[data-mood="careful"] .cat-mouth { height: 5px; border-top: 3px solid #3f484d; border-bottom: 0; }
.cat[data-mood="happy"] .cat-eye { height: 6px; background: transparent; border-top: 3px solid #26343a; box-shadow: none; }
.cat.celebrate { animation: catCelebrate .65s var(--bounce) both; }
.balance-side { padding-left: 26px; border-left: 2px dashed rgba(64, 106, 126, .28); }
.daily-budget span, .daily-budget small, .daily-budget strong { display: block; }
.daily-budget span, .settled-summary > span { color: #526b75; font-family: "Thonburi", sans-serif; font-size: 10px; }
.daily-budget strong { margin: 3px 0; font-size: 28px; font-variant-numeric: tabular-nums; }
.daily-budget small { color: #526b75; font-family: "Thonburi", sans-serif; font-size: 9px; }
.settled-summary { margin-top: 18px; }
.settled-summary > span, .settled-summary > strong { display: block; }
.settled-summary > strong { margin-top: 3px; font-size: 10px; }
.settled-summary > div { height: 7px; overflow: hidden; margin-top: 7px; border: 1px solid rgba(64,106,126,.18); border-radius: 99px; background: rgba(255,255,255,.42); }
.settled-summary i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--mint); transition: width .65s var(--bounce); }
.month-progress { margin-top: 19px; }
.progress-head { display: flex; justify-content: space-between; color: #526b75; font-family: "Thonburi", sans-serif; font-size: 9px; }
.progress-head strong { color: var(--ink); }
.day-track { display: grid; grid-template-columns: repeat(31, 1fr); gap: 3px; margin-top: 8px; }
.day-tick { height: 20px; border-radius: 99px; background: rgba(255,255,255,.45); transform-origin: bottom; animation: tickIn .35s var(--bounce) both; }
.day-tick.passed { background: rgba(64,106,126,.4); }
.day-tick.today { background: var(--butter); box-shadow: 0 0 0 2px rgba(255,216,117,.35); animation: todayBounce 2s ease-in-out infinite; }

.stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1.2fr; gap: 12px; margin: 21px 0; }
.stat-block { min-height: 88px; display: flex; align-items: center; gap: 13px; padding: 15px 20px; border: 1.5px solid var(--line); border-radius: 21px; background: rgba(255,254,253,.9); box-shadow: 0 5px 0 rgba(63,96,108,.08); transition: transform .25s var(--bounce), box-shadow .25s ease; }
.stat-block:hover { transform: translateY(-4px) rotate(.5deg); box-shadow: 0 8px 0 rgba(63,96,108,.1); }
.stat-block:nth-child(2):hover { transform: translateY(-4px) rotate(-.5deg); }
.stat-block small, .stat-block strong { display: block; }
.stat-block small { color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 10px; }
.stat-block strong { margin-top: 3px; font-size: 19px; font-variant-numeric: tabular-nums; }
.stat-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1.5px solid currentColor; border-radius: 15px 15px 15px 5px; font-size: 19px; }
.income-stat .stat-icon { color: #469b88; background: var(--mint-soft); }
.expense-stat .stat-icon { color: #d66f66; background: var(--peach-soft); }
.saving-stat .stat-icon { color: #4b8ca5; background: #e1f2f6; }
.ratio-stat { display: grid; grid-template-columns: 1fr 1.2fr; }
.ratio-bar { height: 10px; overflow: hidden; border: 1px solid #d7e2e4; border-radius: 99px; background: #edf3f4; }
.ratio-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--grape); transition: width .7s var(--bounce); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .72fr); gap: 18px; }
.panel { border: 1.5px solid var(--line); border-radius: var(--radius); background: rgba(255,254,253,.94); box-shadow: var(--shadow); }
.cashflow-panel { padding: 24px 26px 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-head h2, .list-page-head h2, .commitment-intro h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.text-button { border: 0; padding: 7px 9px; border-radius: 10px; color: var(--grape-deep); background: var(--lavender-soft); font-size: 10px; font-weight: 800; cursor: pointer; transition: transform .2s var(--bounce); }
.text-button:hover { transform: translateX(3px); }
.flow-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.flow-title { display: flex; justify-content: space-between; padding: 0 3px 10px; border-bottom: 1.5px dashed var(--line); font-size: 11px; font-weight: 800; }
.flow-title strong { color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 9px; }
.income-color { color: #3e9d89; }.expense-color { color: #d76d65; }
.saving-color { color: #4b8ca5; }
.flow-list { display: grid; }
.flow-item { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 11px 5px; border: 0; border-bottom: 1px solid #e4ecee; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; transition: transform .22s var(--bounce), background .18s ease; }
.flow-item:hover { z-index: 2; background: #f1f8f9; transform: translateX(6px) rotate(-.25deg); }
.category-icon { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid rgba(61,75,82,.1); border-radius: 12px 12px 12px 4px; background: #edf4f5; font-size: 15px; transition: transform .25s var(--bounce); }
.flow-item:hover .category-icon { transform: rotate(-10deg) scale(1.08); }
.category-icon.settled { color: #fff !important; background: var(--mint); }
.category-icon.settled::after { content: "✓"; position: absolute; right: -4px; bottom: -4px; width: 14px; height: 14px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: white; background: #3e9d89; font-size: 7px; }
.flow-name strong, .flow-name small { display: block; }
.flow-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.flow-name small { margin-top: 3px; color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 8px; }
.flow-amount { font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.empty-list { margin: 18px 0; color: var(--muted); font-size: 10px; }
.insight-panel { position: relative; overflow: hidden; padding: 24px; background: #fffdf6; }
.insight-panel::after { content: "♡"; position: absolute; right: -5px; top: 2px; color: rgba(255,157,142,.16); font-size: 85px; transform: rotate(18deg); }
.donut-wrap { display: grid; place-items: center; margin: 22px 0 18px; }
.donut { position: relative; width: 134px; height: 134px; display: grid; place-items: center; border-radius: 46% 54% 49% 51%; background: conic-gradient(var(--peach) 0deg, var(--peach) 0deg, #e9f0f1 0deg); transition: background .65s ease; animation: donutWobble 7s ease-in-out infinite; }
.donut::before { content: ""; grid-area: 1 / 1; width: 91px; height: 91px; border-radius: 50%; background: #fffdf6; }
.donut > div { z-index: 1; grid-area: 1 / 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 21px; }.donut span { color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 8px; }
.top-expenses { display: grid; gap: 9px; }
.top-expense-row { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; font-size: 9px; }
.top-expense-row i { width: 8px; height: 8px; border-radius: 50%; }.top-expense-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.top-expense-row strong { font-size: 9px; }
.insight-note { margin: 17px 0 0; padding: 13px; border: 1px dashed #d3e0e2; border-radius: 14px 14px 14px 5px; color: #65777e; background: #f1f8f9; font-family: "Thonburi", sans-serif; font-size: 9px; line-height: 1.65; }

.list-page-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; }
.segmented { display: flex; gap: 4px; padding: 4px; border: 1.5px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.8); }
.segmented button { border: 0; padding: 7px 13px; border-radius: 11px; color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; transition: .2s var(--bounce); }
.segmented button:hover { transform: translateY(-2px); }.segmented button.active { color: var(--grape-deep); background: var(--lavender-soft); font-weight: 800; box-shadow: 0 3px 0 #cfe1e5; }
.transaction-table { overflow: hidden; border: 1.5px solid var(--line); border-radius: var(--radius); background: rgba(255,254,253,.94); box-shadow: var(--shadow); }
.transaction-row { display: grid; grid-template-columns: 36px 1.5fr 1fr 110px 42px; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px dashed #dfe8e9; transition: background .18s ease, transform .2s var(--bounce); }
.transaction-row:last-child { border: 0; }.transaction-row:hover { z-index: 2; background: #f1f8f9; transform: scale(1.006); }
.transaction-row .type-tag { justify-self: start; padding: 4px 8px; border-radius: 99px; font-size: 8px; font-weight: 800; }.type-tag.income { color: #298675; background: var(--mint-soft); }.type-tag.expense { color: #bd5d55; background: var(--peach-soft); }
.transaction-row .amount { font-size: 11px; font-weight: 800; text-align: right; }.transaction-row .edit-row { border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 18px; }
.status-toggle { width: 27px; height: 27px; display: grid; place-items: center; border: 1.5px solid #cbd8da; border-radius: 10px 10px 10px 4px; color: transparent; background: #fff; cursor: pointer; font-size: 11px; font-weight: 900; transition: transform .25s var(--bounce), background .18s ease; }.status-toggle:hover { border-color: var(--mint); transform: rotate(-9deg) scale(1.08); }.status-toggle.settled { border-color: var(--mint); color: #fff; background: var(--mint); animation: checkedPop .35s var(--bounce); }
.transaction-name strong, .transaction-name small { display: block; }.transaction-name strong { font-size: 11px; }.transaction-name small, .transaction-category { color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 9px; }

.commitment-intro { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 29px 31px; border: 2px solid #e5a99e; border-radius: 28px 28px 28px 10px; color: var(--ink); background: var(--peach-soft); box-shadow: 0 7px 0 #f2d0ca; }
.commitment-intro::after { content: "✿"; position: absolute; right: 28%; top: -30px; color: rgba(255,157,142,.28); font-size: 100px; }.commitment-intro p { max-width: 540px; margin: 8px 0 0; color: #6b797e; font-family: "Thonburi", sans-serif; font-size: 11px; }.commitment-total { position: relative; z-index: 1; text-align: right; }.commitment-total span, .commitment-total strong { display: block; }.commitment-total span { color: #748187; font-size: 9px; }.commitment-total strong { font-size: 27px; }
.commitment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }.commitment-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 18px; border: 1.5px solid var(--line); border-radius: 20px 20px 20px 7px; background: rgba(255,254,253,.94); box-shadow: 0 4px 0 rgba(63,96,108,.08); cursor: pointer; text-align: left; transition: transform .25s var(--bounce), box-shadow .2s ease; }.commitment-card:hover { border-color: #b7d1d7; transform: translateY(-5px) rotate(-.5deg); box-shadow: 0 8px 0 rgba(63,96,108,.1); }.commitment-card:nth-child(even):hover { transform: translateY(-5px) rotate(.5deg); }.commitment-card .category-icon { width: 42px; height: 42px; }.commitment-card strong, .commitment-card small { display: block; }.commitment-card strong { font-size: 11px; }.commitment-card small { margin-top: 3px; color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 8px; }.commitment-card b { font-size: 11px; }
.backup-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 20px; padding: 23px 26px; border: 1.5px dashed #bad0d5; border-radius: 22px; background: rgba(255,255,255,.58); }.backup-panel h2 { margin: 0; font-size: 17px; }.backup-panel p { margin: 5px 0 0; color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 9px; }.backup-actions { display: flex; gap: 8px; }

.item-dialog { width: min(520px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 2px solid #b9d0d5; border-radius: 27px 27px 27px 10px; color: var(--ink); background: var(--cream); box-shadow: 0 12px 0 rgba(55,88,99,.16), 0 35px 90px rgba(42,67,76,.24); }.item-dialog[open] { animation: dialogPop .42s var(--bounce) both; }.item-dialog::backdrop { background: rgba(47, 63, 69, .36); backdrop-filter: blur(6px); animation: fadeIn .25s ease both; }.item-dialog form { padding: 26px; }.dialog-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 22px; }.dialog-head h2 { margin: 0; font-size: 22px; }.icon-button { width: 35px; height: 35px; border: 0; border-radius: 13px 13px 13px 5px; color: var(--grape-deep); background: var(--lavender-soft); cursor: pointer; font-size: 23px; transition: transform .2s var(--bounce); }.icon-button:hover { transform: rotate(10deg) scale(1.08); }
.salary-dialog { width: min(560px, calc(100% - 28px)); }
.sync-dialog { width: min(540px, calc(100% - 28px)); }
.sync-illustration { display: flex; align-items: center; justify-content: center; gap: 12px; margin: -4px 0 17px; color: #406a7e; font-family: "SF Mono", monospace; }.sync-illustration span { width: 50px; height: 43px; display: grid; place-items: center; border: 3px solid #3f484d; background: #cfe9ef; box-shadow: 5px 5px 0 #a9cdd6; font-size: 20px; }.sync-illustration i { color: var(--mint); font-style: normal; letter-spacing: 5px; animation: loadingDot 1.3s steps(3,end) infinite; }
.sync-code-field input { font-family: "SF Mono", monospace; font-size: 16px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.generate-code { width: 100%; margin-top: -5px; }
.sync-warning { display: grid; gap: 3px; margin-top: 15px; padding: 12px 13px; border: 1.5px dashed #d7b867; border-radius: 13px; background: #fff8df; font-family: "Thonburi", sans-serif; }.sync-warning strong { font-size: 9px; }.sync-warning span { color: #7c7767; font-size: 8px; line-height: 1.5; }
.sync-connect-actions { grid-template-columns: 1fr auto auto; }
.sync-state-card { display: flex; align-items: center; gap: 13px; padding: 16px; border: 1.5px solid #a9d7cc; border-radius: 16px; background: var(--mint-soft); }.sync-big-dot { width: 18px; height: 18px; border: 4px solid white; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(74,150,133,.18); animation: softPulse 2.2s infinite; }.sync-state-card strong, .sync-state-card small { display: block; }.sync-state-card strong { font-size: 12px; }.sync-state-card small { margin-top: 3px; color: #5f7771; font-family: "Thonburi", sans-serif; font-size: 8px; }
.sync-state-card + .field { margin-top: 18px; }.copy-code-row { display: flex; }.copy-code-row input { border-radius: 13px 0 0 13px; }.copy-code-row button { border: 0; padding: 0 13px; border-radius: 0 13px 13px 0; color: white; background: var(--grape); font-size: 9px; font-weight: 800; cursor: pointer; }.sync-device-help { margin: 3px 0 17px; color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 9px; line-height: 1.6; }.sync-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.salary-cat-line { height: 42px; display: flex; align-items: center; gap: 6px; margin: -7px 0 15px; font-family: "SF Mono", monospace; }
.salary-cat-line > span { width: 34px; height: 30px; display: grid; place-items: center; border: 3px solid #3f484d; color: white; background: #929ca1; box-shadow: 4px 4px 0 #c2cdd0; font-size: 18px; animation: pixelNod 1.8s steps(2,end) infinite; }
.salary-cat-line i { width: 7px; height: 7px; background: #82cfbe; animation: loadingDot 1.2s steps(2,end) infinite; }.salary-cat-line i:nth-of-type(2) { animation-delay: .2s; }.salary-cat-line i:nth-of-type(3) { animation-delay: .4s; }
.salary-cat-line strong { margin-left: 3px; color: #406a7e; font-size: 10px; letter-spacing: .08em; }
.setup-copy { margin: 0 0 19px; color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 11px; line-height: 1.65; }
.salary-amount > div { display: flex; align-items: center; border: 2px solid #9fbec8; border-radius: 14px; padding-left: 14px; background: white; box-shadow: 0 4px 0 #d6e5e8; }
.salary-amount > div:focus-within { border-color: var(--grape); box-shadow: 0 4px 0 #b9d3d9, 0 0 0 4px var(--lavender-soft); }
.salary-amount b { color: #406a7e; font-family: "SF Mono", monospace; font-size: 20px; }
.salary-amount input { border: 0; box-shadow: none !important; font-family: "SF Mono", monospace; font-size: 21px; font-weight: 800; transform: none !important; }
.replace-sample { display: flex; gap: 10px; align-items: start; margin-top: 3px; padding: 13px; border: 1.5px dashed #d7b867; border-radius: 14px; background: #fff8df; cursor: pointer; }
.replace-sample input { margin-top: 3px; accent-color: #6598b2; }.replace-sample strong, .replace-sample small { display: block; }.replace-sample strong { font-size: 10px; }.replace-sample small { margin-top: 3px; color: #7c7767; font-family: "Thonburi", sans-serif; font-size: 8px; line-height: 1.5; }
.setup-note { display: grid; gap: 2px; margin-top: 12px; padding-left: 12px; border-left: 3px solid var(--mint); font-family: "Thonburi", sans-serif; }.setup-note strong { font-size: 9px; }.setup-note span { color: var(--muted); font-size: 8px; }
.salary-actions { grid-template-columns: auto 1fr auto; }
.type-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 18px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: #edf4f5; }.type-switch legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }.type-switch label input { position: absolute; opacity: 0; }.type-switch span { display: block; padding: 9px; border-radius: 11px; color: var(--muted); text-align: center; font-size: 11px; font-weight: 700; cursor: pointer; transition: .22s var(--bounce); }.type-switch input:checked + span { color: var(--grape-deep); background: #fff; box-shadow: 0 4px 0 #cbdde1; transform: translateY(-1px); }
.provider-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; margin: 2px 0 16px; border: 1.5px dashed #9fc5d1; border-radius: 15px; background: #eef8fa; animation: providerIn .28s var(--bounce) both; }
.provider-group .field { margin: 0; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }.field > span { font-size: 10px; font-weight: 800; }.field input, .field select { width: 100%; border: 1.5px solid var(--line); border-radius: 13px; padding: 11px 12px; outline: 0; color: var(--ink); background: #fff; transition: border .18s ease, box-shadow .18s ease, transform .2s var(--bounce); }.field input:focus, .field select:focus { border-color: var(--grape); box-shadow: 0 0 0 4px var(--lavender-soft); transform: translateY(-1px); }.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.amount-field div { display: flex; align-items: center; padding-left: 12px; border: 1.5px solid var(--line); border-radius: 13px; background: white; }.amount-field div:focus-within { border-color: var(--grape); box-shadow: 0 0 0 4px var(--lavender-soft); }.amount-field div input { border: 0; box-shadow: none !important; transform: none !important; }
.recurring-check { display: flex; gap: 10px; align-items: start; padding: 13px; border: 1px dashed #ccdcdf; border-radius: 14px; background: #f1f8f9; cursor: pointer; transition: transform .2s var(--bounce); }.recurring-check:hover { transform: translateX(3px); }.recurring-check input { margin-top: 3px; accent-color: var(--grape); }.recurring-check strong, .recurring-check small { display: block; }.recurring-check strong { font-size: 10px; }.recurring-check small { margin-top: 2px; color: var(--muted); font-family: "Thonburi", sans-serif; font-size: 8px; }.completion-check { margin-top: 8px; border-color: #bfe4da; background: var(--mint-soft); }.dialog-actions { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; margin-top: 22px; }
.hidden { display: none !important; }.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; padding: 11px 18px; border: 1.5px solid var(--grape-deep); border-radius: 16px 16px 16px 5px; color: #fff; background: var(--grape); box-shadow: 0 6px 0 var(--grape-deep), 0 18px 35px rgba(47,75,86,.2); font-size: 11px; opacity: 0; transform: translate(-50%, 30px) scale(.85); pointer-events: none; transition: .32s var(--bounce); }.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; font-size: 11px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(101,152,178,.35); outline-offset: 3px; }

@keyframes pageIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes stageUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes numberArrive { from { opacity: 0; transform: translateY(18px) scale(.86) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes bubbleIn { from { opacity: 0; transform: translateX(-50%) translateY(15px) scale(.7) rotate(-6deg); } to { opacity: 1; transform: translateX(-50%) rotate(-2deg); } }
@keyframes bubbleBreathe { 0%,100% { transform: translateX(-50%) rotate(-2deg) translateY(0); } 50% { transform: translateX(-50%) rotate(1deg) translateY(-3px); } }
@keyframes catBob { 0%,100% { transform: translateX(-50%) translateY(0) rotate(-1deg); } 50% { transform: translateX(-50%) translateY(-5px) rotate(1deg); } }
@keyframes catCelebrate { 0% { transform: translateX(-50%) translateY(0) rotate(0); } 35% { transform: translateX(-50%) translateY(-22px) rotate(-8deg) scale(1.07); } 62% { transform: translateX(-50%) translateY(-6px) rotate(6deg) scale(.98); } 100% { transform: translateX(-50%) translateY(0); } }
@keyframes shadowBreathe { 0%,100% { transform: translateX(-50%) scaleX(1); opacity: .75; } 50% { transform: translateX(-50%) scaleX(.88); opacity: .48; } }
@keyframes tailWag { 0%,100% { transform: rotate(8deg); } 50% { transform: rotate(-14deg); } }
@keyframes blink { 0%,45%,49%,100% { transform: scaleY(1); } 47% { transform: scaleY(.08); } }
@keyframes coinFloat { 0%,100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-10px) rotate(10deg); } }
@keyframes sparkle { 0%,100% { opacity: .45; transform: scale(.75) rotate(0); } 50% { opacity: 1; transform: scale(1.25) rotate(45deg); } }
@keyframes softPulse { 0%,100% { transform: scale(.8); box-shadow: 0 0 0 0 rgba(255,157,142,.35); } 50% { transform: scale(1); box-shadow: 0 0 0 5px rgba(255,157,142,0); } }
@keyframes tickIn { from { opacity: 0; transform: scaleY(.2); } to { opacity: 1; transform: scaleY(1); } }
@keyframes todayBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes donutWobble { 0%,100% { border-radius: 46% 54% 49% 51%; transform: rotate(0); } 50% { border-radius: 53% 47% 56% 44%; transform: rotate(4deg); } }
@keyframes checkedPop { 0% { transform: scale(.6) rotate(-18deg); } 70% { transform: scale(1.13) rotate(4deg); } 100% { transform: none; } }
@keyframes dialogPop { from { opacity: 0; transform: translateY(24px) scale(.88) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ambientFloat { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(-35px,20px) rotate(12deg); } }
@keyframes pixelNod { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@keyframes loadingDot { 0%,35% { opacity: .25; transform: translateY(0); } 50%,100% { opacity: 1; transform: translateY(-3px); } }
@keyframes providerIn { from { opacity: 0; transform: translateY(-7px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 88px 1fr; }.sidebar { padding-inline: 14px; }.brand { justify-content: center; padding: 0; }.brand > span:last-child, .sidebar-note { display: none; }.nav-item { justify-content: center; padding: 13px; font-size: 0; }.nav-icon { font-size: 20px; }.nav-item.active::after { right: 7px; }.main-content { padding-inline: 28px; }.balance-board { grid-template-columns: minmax(280px,1fr) 160px minmax(210px,.75fr); padding-inline: 27px; }.cat { transform: translateX(-50%) scale(.9); }.commitment-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1250px) and (min-width: 701px) { .stats-row { grid-template-columns: 1fr 1fr; }.flow-columns { grid-template-columns: 1fr 1fr; }.flow-columns > div:last-child { grid-column: 1 / -1; } }
@media (max-width: 880px) {
  .balance-board { grid-template-columns: 1fr 170px; }.cat-zone { grid-column: 2; grid-row: 1; }.balance-side { grid-column: 1 / -1; display: grid; grid-template-columns: .7fr 1fr 1fr; gap: 20px; margin-top: 15px; padding: 17px 0 0; border-left: 0; border-top: 2px dashed rgba(64,106,126,.28); }.settled-summary, .month-progress { margin-top: 0; align-self: end; }.dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .app-shell { display: block; }.sidebar { position: fixed; z-index: 10; inset: auto 0 0; width: 100%; height: 70px; display: block; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); border: 0; border-top: 1.5px solid var(--line); }.brand, .sidebar-note { display: none; }.nav-list { grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 0; }.nav-item { display: flex; flex-direction: column; gap: 1px; padding: 6px; font-size: 9px; }.nav-icon { font-size: 17px; }.nav-item.active::after { right: 15%; top: 9px; }.main-content { padding: 21px 15px 98px; }.topbar { align-items: start; }.topbar h1 { font-size: 23px; }.month-picker { min-width: 0; }.month-picker span { display: none; }.month-picker input { min-width: 112px; }.primary-button span { display: none; }#openAddButton { position: fixed; z-index: 9; right: 17px; bottom: 84px; border-radius: 18px 18px 18px 7px; }.balance-board { grid-template-columns: 1fr 132px; min-height: 0; padding: 25px 20px; border-radius: 28px 28px 28px 10px; }.cat-zone { height: 185px; transform: scale(.84); transform-origin: center bottom; }.balance-number { font-size: 43px; }.balance-side { grid-template-columns: 1fr; }.settled-summary, .month-progress { margin-top: 5px; }.day-track { gap: 2px; }.stats-row { grid-template-columns: 1fr 1fr; }.ratio-stat { grid-column: 1 / -1; }.stat-block { padding: 13px; }.flow-columns { grid-template-columns: 1fr; }.transaction-row { grid-template-columns: 34px 1fr auto 32px; padding-inline: 13px; }.transaction-category { display: none; }.commitment-intro { display: block; }.commitment-total { margin-top: 24px; text-align: left; }.commitment-grid { grid-template-columns: 1fr; }.backup-panel { display: block; }.backup-actions { margin-top: 16px; }
}
@media (max-width: 480px) {
  .topbar { display: block; }.top-actions { margin-top: 14px; }.balance-board { display: block; }.cat-zone { height: 175px; margin-top: 7px; transform: scale(.94); }.balance-side { display: grid; }.balance-number { font-size: 45px; }.stats-row { grid-template-columns: 1fr; }.ratio-stat { grid-column: auto; }.field-row { grid-template-columns: 1fr; }.dialog-actions { grid-template-columns: 1fr 1fr; }.dialog-actions span { display: none; }.dialog-actions .danger-button { grid-column: 1 / -1; order: 3; }.backup-actions { display: grid; }.list-page-head { display: block; }.segmented { margin-top: 14px; }
  .salary-button { flex: 1; justify-content: center; }.salary-actions { grid-template-columns: 1fr 1fr; }.provider-group { grid-template-columns: 1fr; }.sync-connect-actions { grid-template-columns: 1fr 1fr; }.sync-connect-actions > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
