﻿/* Kosh: design language matched to ApexFocus Pro (deep navy glass, indigo/violet accent, iOS spring motion) */
:root {
  --bg0: #04050d; --bg1: #0b0e26; --fg: #eceeff; --muted: rgba(214, 219, 255, .66); --faint: rgba(214, 219, 255, .42);
  --glass: rgba(255, 255, 255, .045); --glass-hi: rgba(255, 255, 255, .085); --line: rgba(255, 255, 255, .09); --line-hi: rgba(255, 255, 255, .16);
  --sheet: #0c0e22; --scrim: rgba(2, 3, 10, .62); --shadow: 0 40px 90px -40px rgba(0, 0, 0, .9);
  --accent: #7c7cff; --accent2: #a855f7; --accent-soft: rgba(124, 124, 255, .16);
  --pos: #34d399; --neg: #fb7185; --warn: #fbbf24; --info: #38bdf8;
  --r-lg: 20px; --r-xl: 26px;
  --ios-ease: cubic-bezier(.32, .72, 0, 1);
  --ios-spring: linear(0, .0405, .1347, .2524, .3749, .491, .5949, .6841, .7583, .8185, .8663, .9034, .9317, .9529, .9684, .9796, .9875, .993, .9966, .9989, 1.0003, 1.0011, 1.0014, 1.0008, 1);
  --ios-bounce: linear(0, .0261, .0919, .1815, .2831, .3877, .4894, .584, .6692, .7437, .8072, .8601, .9032, .9374, .9638, .9837, .9981, 1.008, 1.0144, 1.0181, 1.0197, 1.0198, 1.0189, 1.0174, 1.0155, 1.0134, 1.0114, 1.0094, 1.0076, 1.006, 1.0046, 1.0024, 1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-w: 248px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg0: #f4f5fb; --bg1: #e8eafb; --fg: #12142b; --muted: rgba(30, 34, 70, .66); --faint: rgba(30, 34, 70, .45);
  --glass: rgba(255, 255, 255, .72); --glass-hi: rgba(255, 255, 255, .95); --line: rgba(20, 24, 60, .09); --line-hi: rgba(20, 24, 60, .16);
  --sheet: #ffffff; --scrim: rgba(20, 22, 50, .32); --shadow: 0 30px 70px -35px rgba(30, 30, 90, .35);
  --accent: #5b5bf0; --accent2: #9333ea; --accent-soft: rgba(91, 91, 240, .1);
  --pos: #059669; --neg: #e11d48; --warn: #d97706; --info: #0284c7;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--fg); background: var(--bg0); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num, .amt { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: -.01em; }
.i { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(1200px 700px at 85% -10%, var(--bg1), transparent 60%), var(--bg0); overflow: hidden; }
.aurora::before, .aurora::after { content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .32; will-change: transform; }
.aurora::before { background: radial-gradient(circle, #4f46e5, transparent 65%); top: -25vmax; left: -15vmax; animation: drift1 38s ease-in-out infinite alternate; }
.aurora::after { background: radial-gradient(circle, #9333ea, transparent 65%); bottom: -30vmax; right: -20vmax; opacity: .2; animation: drift2 46s ease-in-out infinite alternate; }
:root[data-theme="light"] .aurora::before { opacity: .16; } :root[data-theme="light"] .aurora::after { opacity: .1; }
@keyframes drift1 { to { transform: translate3d(14vmax, 10vmax, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(-12vmax, -8vmax, 0) scale(1.1); } }

/* Shell */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--nav-w) 1fr; height: 100dvh; }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 22px 14px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg0) 55%, transparent); backdrop-filter: blur(18px); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 8px 24px -8px var(--accent); }
.brand small { font-weight: 600; font-size: 10px; letter-spacing: .14em; color: var(--faint); margin-left: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 550; transition: color .2s var(--ios-ease), background .2s var(--ios-ease); }
.nav a:hover { color: var(--fg); background: var(--glass); }
.nav a.on { color: var(--fg); background: var(--glass-hi); }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(var(--accent), var(--accent2)); }
.nav .navsec { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 14px 12px 4px; }
.nav .spacer { flex: 1; min-height: 12px; }
.nav-add { margin: 0 2px 10px; }
.main { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.view { max-width: 1240px; margin: 0 auto; padding: 30px 34px 120px; animation: viewIn .42s var(--ios-ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.994); } to { opacity: 1; transform: none; } }
.topbar, .tabbar { display: none; }

.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
.ph p { margin: 4px 0 0; color: var(--muted); }
.ph .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .42s var(--ios-spring), border-color .25s var(--ios-ease), background .25s var(--ios-ease); }
.card.lift:hover { transform: translate3d(0, -2px, 0); border-color: var(--line-hi); }
.card h3 { margin: 0 0 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.card h3 .i { width: 15px; height: 15px; }
.card h3 .r { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; }
.stagger > * { animation: cardIn .5s var(--ios-ease) both; }
.stagger > *:nth-child(2) { animation-delay: 40ms; } .stagger > *:nth-child(3) { animation-delay: 80ms; } .stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; } .stagger > *:nth-child(6) { animation-delay: 200ms; } .stagger > *:nth-child(n+7) { animation-delay: 240ms; }
@keyframes cardIn { from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.985); } to { opacity: 1; transform: none; } }
.grid { display: grid; gap: 16px; }
.g-hero { grid-template-columns: 1.35fr 1fr 1fr 1fr; }
.g-2 { grid-template-columns: 1.4fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }

.hero { padding: 22px; overflow: hidden; background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent2) 12%, transparent) 60%, transparent), var(--glass); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.hero::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent2) 40%, transparent), transparent 70%); filter: blur(10px); pointer-events: none; }
.big { font-size: 34px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.mid { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .mut { color: var(--muted); } .fnt { color: var(--faint); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--glass-hi); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; text-decoration: none; }
.chip.pos { color: var(--pos); background: color-mix(in srgb, var(--pos) 12%, transparent); border-color: transparent; }
.chip.neg { color: var(--neg); background: color-mix(in srgb, var(--neg) 12%, transparent); border-color: transparent; }
.chip .i { width: 13px; height: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); font-weight: 600; font-size: 13.5px; white-space: nowrap; text-decoration: none; color: var(--fg);
  transition: transform .3s var(--ios-spring), background .2s, border-color .2s, box-shadow .3s; }
.btn:hover { background: var(--glass-hi); border-color: var(--line-hi); }
.btn:active { transform: scale(.96); }
.btn.pri { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -12px var(--accent); }
.btn.pri:hover { box-shadow: 0 14px 34px -10px var(--accent); filter: brightness(1.06); }
.btn.danger { color: var(--neg); }
.btn.danger.solid { background: var(--neg); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 10px; }
.btn.icon { width: 38px; padding: 0; } .btn.sm.icon { width: 32px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span, .lbl { font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .02em; }
.field small { color: var(--faint); font-size: 12px; }
.in { height: 42px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg0) 40%, var(--glass)); outline: none; width: 100%; min-width: 0; transition: border-color .2s, box-shadow .2s; font-size: 14.5px; }
textarea.in { height: auto; padding: 10px 13px; resize: vertical; min-height: 70px; }
.in:focus { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px var(--accent-soft); }
select.in { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa0c8' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
select.in option { background: var(--sheet); color: var(--fg); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 13px; background: color-mix(in srgb, var(--bg0) 40%, var(--glass)); border: 1px solid var(--line); position: relative; }
.seg button { flex: 1; height: 34px; border: 0; background: transparent; border-radius: 9px; font-weight: 650; color: var(--muted); transition: color .2s, background .25s var(--ios-ease); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.seg button.on { background: var(--glass-hi); color: var(--fg); box-shadow: 0 2px 10px -4px rgba(0, 0, 0, .4); }
.seg button.on[data-v="expense"] { color: var(--neg); } .seg button.on[data-v="income"] { color: var(--pos); } .seg button.on[data-v="transfer"] { color: var(--info); }
.toggle { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.toggle input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-hi); transition: background .25s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .35s var(--ios-spring); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.toggle input:checked + span { background: var(--accent); } .toggle input:checked + span::after { transform: translateX(18px); }

.amount-wrap { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 14px 0 8px; }
.amount-wrap .cur { font-size: 30px; font-weight: 600; color: var(--faint); }
.amount-in { font-size: 44px; font-weight: 750; letter-spacing: -.03em; border: 0; background: transparent; outline: none; text-align: left; width: 2ch; min-width: 1.2ch; max-width: 100%; padding: 0; transition: width .18s var(--ios-ease); font-variant-numeric: tabular-nums; }
.amount-in::placeholder { color: var(--faint); }
.amount-in.expense { color: var(--neg); } .amount-in.income { color: var(--pos); } .amount-in.transfer { color: var(--info); }

.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 236px; overflow-y: auto; padding: 2px; }
.cat-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 13px; border: 1px solid var(--line); background: var(--glass); font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2; transition: transform .3s var(--ios-spring), border-color .2s, background .2s; }
.cat-pick button:hover { border-color: var(--line-hi); color: var(--fg); }
.cat-pick button:active { transform: scale(.95); }
.cat-pick button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--fg); }
.cat-pick .gl { grid-column: 1 / -1; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 6px 2px 0; }
.dot { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.dot .i { width: 17px; height: 17px; }
.dot.sm { width: 28px; height: 28px; border-radius: 9px; } .dot.sm .i { width: 15px; height: 15px; }
.dot.lg { width: 42px; height: 42px; border-radius: 13px; } .dot.lg .i { width: 20px; height: 20px; }

.day { margin-bottom: 6px; }
.day-h { display: flex; justify-content: space-between; padding: 14px 12px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.day + .day { border-top: 1px solid var(--line); }
.tx { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; cursor: pointer; transition: background .2s var(--ios-ease), transform .35s var(--ios-spring); }
.tx:hover { background: var(--glass); }
.tx:active { transform: scale(.99); }
.tx .mid-col { flex: 1; min-width: 0; }
.tx .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .t2 { font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.tx .amt { font-weight: 700; font-size: 15px; text-align: right; white-space: nowrap; }
.tx .amt.cr { color: var(--pos); } .tx .amt.tr { color: var(--muted); }
.tx .sel { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-hi); display: none; place-items: center; flex: none; }
.selecting .tx .sel { display: grid; }
.tx.picked { background: var(--accent-soft); } .tx.picked .sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.tx .sel .i { width: 13px; height: 13px; opacity: 0; } .tx.picked .sel .i { opacity: 1; }
.tag-mini { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: var(--glass-hi); color: var(--muted); font-weight: 600; }
.tag-mini.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 240px; }
.search .i { position: absolute; left: 12px; top: 12px; color: var(--faint); }
.search .in { padding-left: 38px; }
.filters { display: contents; }
.toolbar select.in { width: auto; height: 38px; font-size: 13px; flex: 0 1 auto; }
.sumbar { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.sumbar b { color: var(--fg); font-weight: 700; }
.bulk { position: sticky; bottom: 16px; z-index: 5; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--sheet); border: 1px solid var(--line-hi); box-shadow: var(--shadow); animation: cardIn .35s var(--ios-ease) both; margin-top: 12px; flex-wrap: wrap; }
.rangechip { margin: -4px 0 12px; } .rangechip .chip { padding: 4px 6px 4px 10px; } .rangechip button { border: 0; background: transparent; display: grid; place-items: center; padding: 2px; border-radius: 50%; color: inherit; }

.acc-card { display: flex; flex-direction: column; gap: 14px; cursor: pointer; overflow: hidden; }
.acc-card .top { display: flex; align-items: center; gap: 12px; }
.acc-card .name { font-weight: 650; }
.acc-card .meta { font-size: 12px; color: var(--faint); }
.acc-card .mv { display: flex; flex-direction: column; opacity: 0; transition: opacity .2s; }
.acc-card:hover .mv, .acc-card:focus-within .mv { opacity: 1; }
@media (hover: none) { .acc-card .mv { display: none; } }
.acc-card .bal { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.acc-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); opacity: .85; }
.acc-card .bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.acc-card .bar i { display: block; height: 100%; border-radius: 6px; background: var(--c); transform-origin: left; animation: grow .9s var(--ios-ease) both .15s; }
@keyframes grow { from { transform: scaleX(0); } }
.acc-mini { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.acc-mini:last-child { border-bottom: 0; }
.acc-mini .n { flex: 1; min-width: 0; font-weight: 600; }
.acc-mini .n small { display: block; font-weight: 500; color: var(--faint); font-size: 12px; }
.section-t { display: flex; align-items: center; gap: 10px; margin: 26px 2px 12px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.section-t .r { margin-left: auto; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 650; font-size: 14px; }
.archived { opacity: .55; }
.duebox { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.duebox .i { width: 15px; height: 15px; }

.cbar { display: grid; grid-template-columns: 30px 1fr auto; gap: 4px 12px; align-items: center; padding: 7px 0; cursor: pointer; }
.cbar .nm { font-weight: 600; font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; }
.cbar .track { grid-column: 2 / 4; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.cbar .track i { display: block; height: 100%; border-radius: 6px; background: var(--c); transform-origin: left; animation: grow .9s var(--ios-ease) both; }
.cbar .dot { grid-row: span 2; }

.grp { margin-bottom: 14px; padding: 6px; }
.grp-h { display: flex; align-items: center; gap: 12px; padding: 10px 10px; }
.grp-h .n { font-weight: 700; flex: 1; display: flex; align-items: center; gap: 10px; }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; transition: background .2s; }
.cat-row:hover { background: var(--glass); }
.cat-row .n { flex: 1; min-width: 0; font-weight: 550; }
.cat-row .n input { border: 0; background: transparent; outline: none; width: 100%; padding: 4px 6px; margin-left: -6px; border-radius: 8px; font-weight: 550; }
.cat-row .n input:focus { background: var(--glass-hi); box-shadow: 0 0 0 3px var(--accent-soft); }
.cat-row .cnt { font-size: 12px; color: var(--faint); min-width: 64px; text-align: right; }
.cat-row .acts { display: flex; gap: 2px; opacity: .35; transition: opacity .2s; }
.cat-row:hover .acts, .cat-row:focus-within .acts { opacity: 1; }
.typepill { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--glass-hi); color: var(--muted); }

.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fadeIn .25s var(--ios-ease) both; }
.sheet { width: 100%; max-width: 520px; max-height: calc(100dvh - 36px); display: flex; flex-direction: column; background: var(--sheet); border: 1px solid var(--line-hi); border-radius: var(--r-xl); box-shadow: var(--shadow); animation: sheetIn .48s var(--ios-spring) both; overflow: hidden; }
.sheet.wide { max-width: 680px; }
.sheet.xl { max-width: 1060px; }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.sheet-h h2 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; letter-spacing: -.01em; }
.sheet-b { padding: 10px 20px 8px; overflow-y: auto; }
.sheet-f { display: flex; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--line); align-items: center; }
.sheet-f .sp { flex: 1; }
.scrim.closing { animation: fadeOut .22s var(--ios-ease) both; }
.scrim.closing .sheet { animation: sheetOut .22s var(--ios-ease) both; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetIn { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.95); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes sheetOut { to { opacity: 0; transform: translate3d(0, 12px, 0) scale(.97); } }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; background: var(--c); transition: transform .3s var(--ios-spring); }
.swatches button.on { border-color: var(--fg); transform: scale(1.12); }
.icons-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; max-height: 150px; overflow-y: auto; }
.icons-pick button { height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); display: grid; place-items: center; color: var(--muted); }
.icons-pick button.on { border-color: var(--accent); color: var(--fg); background: var(--accent-soft); }
.quick-dates { display: flex; gap: 6px; margin-top: 6px; }
.note-box { padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--muted); font-size: 13px; margin-bottom: 14px; display: flex; gap: 10px; }
.note-box .i { color: var(--accent); margin-top: 1px; }
.note-box.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); } .note-box.warn .i { color: var(--warn); }

.toasts { position: fixed; z-index: 80; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 16px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--line-hi); box-shadow: var(--shadow); font-weight: 600; font-size: 13.5px; animation: toastIn .45s var(--ios-spring) both; max-width: calc(100vw - 32px); }
.toast.out { animation: fadeOut .2s both; }
.toast .i { color: var(--pos); } .toast.err .i { color: var(--neg); }
@keyframes toastIn { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.96); } }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .dot { margin: 0 auto 14px; width: 56px; height: 56px; border-radius: 18px; --c: var(--accent); }
.empty .dot .i { width: 26px; height: 26px; }
.empty h4 { margin: 0 0 6px; font-size: 16px; color: var(--fg); }
.empty p { margin: 0 auto 16px; max-width: 420px; }
.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist .it { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; transition: border-color .2s, transform .35s var(--ios-spring); }
.checklist .it:hover { border-color: var(--line-hi); transform: translate3d(2px, 0, 0); }
.checklist .it.done { opacity: .6; } .checklist .it.done .ck { background: var(--pos); border-color: var(--pos); color: #04050d; }
.checklist .ck { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-hi); display: grid; place-items: center; flex: none; }
.checklist .ck .i { width: 13px; height: 13px; }
.checklist .it .t { flex: 1; } .checklist .it .t b { display: block; font-weight: 650; } .checklist .it .t small { color: var(--faint); }
.set-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .t { flex: 1; } .set-row .t b { display: block; font-weight: 650; } .set-row .t small { color: var(--faint); }
.spark { width: 100%; height: 54px; display: block; margin-top: 10px; }
.spark path.l { fill: none; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.4s var(--ios-ease) forwards .2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.show-m { display: none; }

/* ===== Import ===== */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 34px 20px; border: 1.5px dashed var(--line-hi); cursor: pointer;
  background: radial-gradient(500px 200px at 50% 0%, var(--accent-soft), transparent 70%), var(--glass); transition: border-color .2s, transform .4s var(--ios-spring), background .2s; margin-bottom: 16px; }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop.over { transform: scale(1.01); }
.drop b { font-size: 16px; } .drop .mut { font-size: 13px; max-width: 460px; }
.drop .fmts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.qitem { margin-bottom: 12px; display: flex; flex-direction: column; gap: 14px; }
.qitem .note-box { margin: 0; }
.qhead { display: flex; align-items: center; gap: 12px; }
.qn { flex: 1; min-width: 0; display: flex; flex-direction: column; } .qn b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .qn span { font-size: 12px; }
.pbar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 8px; }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent)); background-size: 200% 100%; border-radius: 6px; transition: width .35s var(--ios-ease); animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pwrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .pwrow .in { flex: 1 1 240px; } .pwrow > .i { color: var(--warn); }
.pwrow .rem { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.qsum { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; align-items: start; }
.qsum .lbl { display: block; margin-bottom: 4px; }
.vbadge { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--glass-hi); font-size: 13.5px; }
.vbadge span { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.vbadge.pos { background: color-mix(in srgb, var(--pos) 12%, transparent); } .vbadge.pos .i, .vbadge.pos b { color: var(--pos); }
.vbadge.neg { background: color-mix(in srgb, var(--warn) 13%, transparent); } .vbadge.neg .i, .vbadge.neg b { color: var(--warn); }
.qacts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .qacts .sp { flex: 1; }
.vpanel { padding: 14px 16px; border-radius: 16px; background: var(--glass-hi); margin-bottom: 14px; }
.vpanel .vh { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.vpanel.pos .vh { color: var(--pos); } .vpanel.neg .vh { color: var(--warn); }
.vpanel ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.vpanel li { display: flex; gap: 10px; font-size: 13px; } .vpanel li.pos > .i { color: var(--pos); } .vpanel li.neg > .i { color: var(--neg); }
.vpanel li .i { margin-top: 2px; width: 16px; height: 16px; }
.stmt { display: flex; gap: 22px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 14px; }
.stmt div { display: flex; flex-direction: column; gap: 2px; }
.rfilters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.rfilters .chip { cursor: pointer; border: 1px solid var(--line); } .rfilters .chip.on { background: var(--accent-soft); color: var(--fg); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.rlist { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.rrow { display: grid; grid-template-columns: 26px 62px minmax(0, 1fr) 200px 130px; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); transition: opacity .2s, background .2s; }
.rrow:last-child { border-bottom: 0; }
.rrow.off { opacity: .45; }
.rrow.flagged { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.rdate { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rmain { min-width: 0; }
.rpay { width: 100%; border: 0; background: transparent; font-weight: 650; padding: 3px 6px; margin-left: -6px; border-radius: 8px; outline: none; }
.rpay:focus { background: var(--glass-hi); box-shadow: 0 0 0 3px var(--accent-soft); }
.rraw { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rtags { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.rcat { height: 34px; font-size: 12.5px; border-left: 3px solid var(--c); }
.rcat.need { border-color: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 15%, transparent); }
.ramt { border: 0; background: transparent; text-align: right; font-weight: 700; font-size: 14px; padding: 6px 4px; border-radius: 8px; white-space: nowrap; }
.ramt:hover { background: var(--glass-hi); } .ramt.pos { color: var(--pos); }
.ck2 { position: relative; width: 20px; height: 20px; flex: none; }
.ck2 input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.ck2 span { position: absolute; inset: 0; border-radius: 6px; border: 1.5px solid var(--line-hi); display: grid; place-items: center; transition: background .2s, border-color .2s; }
.ck2 span .i { width: 13px; height: 13px; opacity: 0; color: #fff; }
.ck2 input:checked + span { background: var(--accent); border-color: var(--accent); } .ck2 input:checked + span .i { opacity: 1; }
.ck2 input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Reports, budgets, insights ===== */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 650; font-size: 13.5px; white-space: nowrap; transition: background .25s var(--ios-ease), color .2s; border: 0; background: transparent; }
.tabs a:hover, .tabs button:hover { color: var(--fg); }
.tabs a.on, .tabs button.on { background: var(--glass-hi); color: var(--fg); box-shadow: 0 4px 14px -6px rgba(0,0,0,.45); }
.tabs a.on .i, .tabs button.on .i { color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.kpis.k4 { grid-template-columns: repeat(4, 1fr); }
.kpi .lbl { display: block; margin-bottom: 6px; } .kpi .sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chart { width: 100%; min-height: 160px; position: relative; }
.skeleton { background: linear-gradient(90deg, var(--glass), var(--glass-hi), var(--glass)); background-size: 200% 100%; animation: shimmer 1.5s infinite linear; border-radius: 8px; }
.chart-loading::after { content: ""; position: absolute; inset: 10px; border-radius: 12px; background: linear-gradient(90deg, var(--line), var(--glass-hi), var(--line)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.legend { display: flex; gap: 10px; align-items: center; font-size: 11.5px; text-transform: none; letter-spacing: 0; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); display: inline-block; margin-right: -5px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .split > div { display: flex; flex-direction: column; gap: 2px; } .split .fnt { font-size: 12px; }
.splitbar { height: 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent2) 45%, transparent); overflow: hidden; margin: 14px 0; }
.splitbar i { display: block; height: 100%; background: var(--accent); border-radius: 10px; transform-origin: left; animation: grow .9s var(--ios-ease) both; }
.toplist { display: grid; gap: 2px; } .toplist a, .toprow { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 10px; color: inherit; text-decoration: none; transition: background .2s; }
.toplist a:hover, .toprow:hover { background: var(--glass-hi); } .toplist a span:nth-child(2), .toprow .n { flex: 1; min-width: 0; font-weight: 600; }
.toprow .n small { display: block; color: var(--faint); font-weight: 500; font-size: 12px; }
.tbl { display: flex; flex-direction: column; }
.tr { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 1.3fr 1fr 90px; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 12px; color: inherit; text-decoration: none; transition: background .2s; }
.tr.m4 { grid-template-columns: minmax(0, 2fr) 1fr .8fr 1fr; }
.tr.m5 { grid-template-columns: 70px 1fr 1fr 1fr 1fr 1.2fr; }
a.tr:hover, button.tr:hover { background: var(--glass-hi); }
button.tr { border: 0; background: transparent; text-align: left; width: 100%; font: inherit; cursor: pointer; }
.tr.th { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-top: 12px; }
.tr .nm { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.tr .b { font-weight: 700; }
.share { display: flex; align-items: center; gap: 8px; } .share i { display: block; height: 6px; border-radius: 6px; background: var(--c, var(--accent)); min-width: 3px; transform-origin: left; animation: grow .8s var(--ios-ease) both; }
.share em { font-style: normal; font-size: 12px; color: var(--faint); }
.cardrep { display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.cardrep::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); }
.cardrep .top { display: flex; gap: 12px; align-items: center; } .cardrep .top .n { flex: 1; display: flex; flex-direction: column; } .cardrep .top .r { text-align: right; }
.mini3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .mini3 div { display: flex; flex-direction: column; gap: 2px; }
.cardrep .bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; } .cardrep .bar i { display: block; height: 100%; background: var(--c); border-radius: 6px; }
.catlist { display: grid; gap: 2px; } .catlist a { display: grid; grid-template-columns: 28px minmax(0, 1fr) 70px auto; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 10px; color: inherit; text-decoration: none; }
.catlist a:hover { background: var(--glass-hi); } .catlist .n { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .catlist b { font-size: 13px; }
.cardrep > .btn { align-self: flex-start; }
.g-bud { grid-template-columns: 1.6fr 1fr 1fr; }
.budhero { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; position: relative; }
.ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 14; } .ring .trk { stroke: var(--line); }
.ring .val { stroke-linecap: round; stroke-dashoffset: var(--off); animation: ringIn 1.2s var(--ios-ease) both .1s; }
@keyframes ringIn { from { stroke-dashoffset: 440; } }
.ring .val.pos { stroke: var(--pos); } .ring .val.warn { stroke: var(--warn); } .ring .val.neg { stroke: var(--neg); }
.ring .pace { stroke: var(--fg); stroke-width: 3; stroke-linecap: round; opacity: .7; }
.ringtxt { position: absolute; left: 22px; top: 50%; width: 150px; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.ringtxt b { font-size: 28px; font-weight: 750; letter-spacing: -.02em; } .ringtxt span { font-size: 12px; color: var(--faint); }
.budnums { display: grid; gap: 10px; } .budnums div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; } .budnums .mid { font-size: 19px; }
.budlist { padding: 6px 10px; } .budrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid var(--line); } .budrow:last-child { border-bottom: 0; }
.budrow > .dot { margin-top: 2px; }
.bm { flex: 1; min-width: 0; } .bt { display: flex; align-items: center; gap: 8px; } .bt a { color: inherit; text-decoration: none; font-weight: 650; } .bt a:hover { color: var(--accent); } .bt .sp { flex: 1; }
.budin { width: 82px; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 3px 6px; text-align: right; color: var(--muted); font-weight: 600; transition: border-color .2s, background .2s; }
.budin:hover { border-color: var(--line); } .budin:focus { outline: none; border-color: var(--accent); background: var(--glass-hi); color: var(--fg); }
.btrack { position: relative; height: 8px; border-radius: 8px; background: var(--line); margin-top: 8px; overflow: visible; }
.btrack i { display: block; height: 100%; border-radius: 8px; transform-origin: left; animation: grow .9s var(--ios-ease) both; }
.btrack.pos i { background: var(--pos); } .btrack.warn i { background: var(--warn); } .btrack.neg i { background: var(--neg); } .btrack.acc i { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.btrack em { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--fg); opacity: .45; }
.bsub { font-size: 12px; margin-top: 5px; }
.suglist { display: grid; gap: 4px; } .sugrow { display: flex; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sugrow .n { flex: 1; display: flex; flex-direction: column; font-weight: 600; } .sugrow .n small { font-weight: 500; font-size: 12px; }
.budin2 { width: 110px; height: 36px; text-align: right; }
.hero-empty { padding: 50px 24px; background: radial-gradient(600px 240px at 50% 0%, var(--accent-soft), transparent 70%), var(--glass); }
.insgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.insgrid.compact { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ins { display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--tc); --tc: var(--info); }
.ins.pos { --tc: var(--pos); } .ins.warn { --tc: var(--warn); } .ins.neg { --tc: var(--neg); }
.ins .ih { display: flex; gap: 10px; align-items: center; } .ins .ih .dot { --c: var(--tc); width: 32px; height: 32px; border-radius: 10px; }
.ins .ih b { font-size: 14.5px; line-height: 1.3; } .ins p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; } .ins .btn { align-self: flex-start; margin-top: 2px; }
.insgrid.compact .ins p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.g-home { grid-template-columns: 1fr 2.4fr; align-items: stretch; }
.budmini, .loanmini { text-decoration: none; color: inherit; display: block; }
.wealth { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; background: linear-gradient(140deg, color-mix(in srgb, var(--pos) 10%, transparent), transparent 60%), var(--glass); }
.sl { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; } .sl > span { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); font-size: 13px; } .sl b { color: var(--fg); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--line-hi); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,.35); cursor: pointer; transition: transform .3s var(--ios-spring); }
input[type=range]::-webkit-slider-thumb:active { transform: scale(1.2); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); cursor: pointer; }
.wr .big { color: var(--pos); margin: 4px 0; }
.moregrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-bottom: 8px; }
.moregrid a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); color: var(--fg); text-decoration: none; font-weight: 600; font-size: 13px; transition: transform .3s var(--ios-spring); text-align: center; }
.moregrid a:active { transform: scale(.95); } .moregrid a .i { width: 22px; height: 22px; color: var(--accent); }

/* ===== Home loan & investments ===== */
.g-loan { grid-template-columns: 1.5fr 1fr 1fr; }
.loanhero .big { font-size: 38px; }
.lstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; } .lstats div { display: flex; flex-direction: column; gap: 2px; } .lstats b { font-size: 15px; }
.freedate { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.freedate.pos { color: var(--pos); }
.plan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 22px; }
.plan .ctl { display: flex; flex-direction: column; }
.numin { width: 120px; height: 32px; border-radius: 9px; text-align: right; font-weight: 700; font-size: 13.5px; padding: 0 10px; }
.oneoffs { display: grid; gap: 6px; margin-bottom: 12px; } .oneoff { display: flex; gap: 8px; align-items: center; } .oneoff .in { height: 34px; font-size: 13px; }
.result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.result > div { padding: 12px 14px; border-radius: 14px; background: var(--glass-hi); display: flex; flex-direction: column; gap: 2px; }
.result > div.win { background: color-mix(in srgb, var(--pos) 12%, transparent); } .result > div.win b { color: var(--pos); }
.result b { font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.goalopts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gopt { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); position: relative; transition: transform .35s var(--ios-spring), border-color .2s; }
.gopt:hover { transform: translate3d(0, -2px, 0); border-color: var(--line-hi); }
.gopt.best { border-color: color-mix(in srgb, var(--pos) 55%, transparent); background: color-mix(in srgb, var(--pos) 7%, var(--glass)); }
.gopt .t { font-weight: 650; font-size: 13px; color: var(--muted); } .gopt .v { font-size: 20px; font-weight: 750; letter-spacing: -.02em; } .gopt .s { font-size: 12px; color: var(--faint); }
.gopt .tagb { position: absolute; top: -9px; right: 12px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--pos); color: #04150e; }
.gopt .btn { margin-top: auto; align-self: flex-start; }
.ratechg { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); } .ratechg:last-child { border-bottom: 0; }
.yrs .tr.m5 .i { width: 14px; height: 14px; transition: transform .25s; } .yrs .open .i { transform: rotate(90deg); }
.mrows { padding: 0 0 6px 12px; } .mrows .tr { padding: 5px 10px; font-size: 12.5px; color: var(--muted); }
.invtbl .tr { grid-template-columns: minmax(0, 2fr) 1fr 1fr .7fr 1fr; }

@media (max-width: 1100px) { .g-hero { grid-template-columns: 1fr 1fr; } .g-hero .hero { grid-column: 1 / -1; } .g-3 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); } .g-bud { grid-template-columns: 1fr 1fr; } .g-bud .budhero { grid-column: 1 / -1; } .g-home { grid-template-columns: 1fr; }
  .g-loan { grid-template-columns: 1fr 1fr; } .g-loan .loanhero { grid-column: 1 / -1; } .goalopts { grid-template-columns: 1fr 1fr; } .plan { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .nav { display: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 12px) 18px 10px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg0) 70%, transparent); backdrop-filter: blur(18px); }
  .topbar .brand { padding: 0; font-size: 16px; flex: 1; }
  .view { padding: 18px 16px calc(110px + env(safe-area-inset-bottom)); }
  .ph h1 { font-size: 24px; }
  .ph .acts { width: 100%; } .ph .acts > .btn, .ph .acts > select { flex: 1; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .g-hero { grid-template-columns: 1fr 1fr; gap: 10px; } .g-hero > :last-child { grid-column: 1 / -1; }
  .big { font-size: 30px; } .mid { font-size: 19px; }
  .card { padding: 15px; border-radius: 18px; }
  .tabbar { display: flex; position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 64px; padding: 6px; border-radius: 22px;
    background: color-mix(in srgb, var(--sheet) 82%, transparent); backdrop-filter: blur(22px); border: 1px solid var(--line-hi); box-shadow: var(--shadow); align-items: center; justify-content: space-around; }
  .tabbar a, .tabbar .more { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--faint); text-decoration: none; padding: 6px 0; border-radius: 14px; transition: color .2s; background: transparent; border: 0; }
  .tabbar a.on, .tabbar .more.on { color: var(--fg); }
  .tabbar a.on .i, .tabbar .more.on .i { color: var(--accent); }
  .tabbar .add { flex: none; width: 52px; height: 52px; border-radius: 17px; border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 10px 26px -8px var(--accent); display: grid; place-items: center; margin: 0 4px; transition: transform .35s var(--ios-bounce); }
  .tabbar .add:active { transform: scale(.9); }
  .tabbar .add .i { width: 24px; height: 24px; }
  .scrim { align-items: flex-end; padding: 0; }
  .sheet { max-width: none !important; border-radius: 26px 26px 0 0; max-height: 94dvh; animation: sheetUp .5s var(--ios-spring) both; padding-bottom: env(safe-area-inset-bottom); }
  .scrim.closing .sheet { animation: sheetDown .24s var(--ios-ease) both; }
  .sheet-h { position: relative; padding-top: 22px; }
  .sheet-h::before { content: ""; position: absolute; left: 50%; top: 7px; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line-hi); }
  .cat-row .acts { opacity: 1; } .cat-row [data-cm] { display: none; } .cat-row .cnt { min-width: 0; }
  .toasts { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .bulk { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .hide-m { display: none !important; } .show-m { display: inline; }
  .filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }
  .filters::-webkit-scrollbar { display: none; }
  .filters select.in { flex: none; }
  .acc-card { gap: 10px; } .acc-card .bal { font-size: 20px; }
  .qsum { grid-template-columns: 1fr 1fr; } .qsum > :first-child { grid-column: 1 / -1; }
  .rrow { grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "ck main amt" "ck cat cat"; row-gap: 8px; }
  .rrow .ck2 { grid-area: ck; align-self: start; margin-top: 4px; } .rrow .rmain { grid-area: main; } .rrow .ramt { grid-area: amt; align-self: start; } .rrow .rcat { grid-area: cat; }
  .rrow .rdate { display: none; }
  .kpis, .kpis.k4 { grid-template-columns: 1fr 1fr; gap: 10px; } .kpis > :first-child { grid-column: 1 / -1; }
  .tr { grid-template-columns: minmax(0, 1fr) auto 76px; } .tr.m4 { grid-template-columns: minmax(0, 1fr) auto 60px; }
  .tr.m5 { grid-template-columns: 56px 1fr 1fr 1fr; } .invtbl .tr { grid-template-columns: minmax(0, 1fr) auto 60px; }
  .budhero { grid-template-columns: 120px 1fr; gap: 14px; } .ring { width: 120px; height: 120px; } .ringtxt { width: 120px; left: 15px; } .ringtxt b { font-size: 22px; }
  .wealth { grid-template-columns: 1fr; }
  .insgrid, .insgrid.compact { grid-template-columns: 1fr; }
  .tabs a, .tabs button { padding: 8px 12px; font-size: 13px; }
  .catlist a { grid-template-columns: 28px minmax(0, 1fr) auto; } .catlist .share { display: none; }
  .budin { width: 70px; }
  .g-loan { grid-template-columns: 1fr; } .lstats { grid-template-columns: 1fr 1fr; } .result { grid-template-columns: 1fr 1fr; } .result > :first-child { grid-column: 1 / -1; }
  .goalopts { grid-template-columns: 1fr; } .loanhero .big { font-size: 32px; } .numin { width: 104px; }
}
@keyframes sheetUp { from { transform: translate3d(0, 100%, 0); } to { transform: none; } }
@keyframes sheetDown { to { transform: translate3d(0, 100%, 0); } }
@media (max-width: 420px) { .row3 { grid-template-columns: 1fr 1fr; } .amount-in { font-size: 38px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; } .aurora::before, .aurora::after { animation: none; } }

/* Offline Banner Notification */
.offline-banner {
  position: fixed;
  top: 0;
  left: var(--nav-w);
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--sheet) 88%, var(--warn));
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: bannerSlideDown 0.25s var(--ios-spring) both;
}
.offline-banner b {
  color: var(--warn);
}
@media (max-width: 860px) {
  .offline-banner {
    left: 0;
    top: calc(env(safe-area-inset-top) + 52px);
    font-size: 11.5px;
    padding: 6px 12px;
  }
}
@keyframes bannerSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* =====================================================================
   Dedicated Full-Screen Login Gate
   ===================================================================== */
html.needs-login .app { display: none !important; }
#login-gate { display: none; }
html.needs-login #login-gate {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + 20px);
  overflow-y: auto;
  min-height: 100dvh;
  box-sizing: border-box;
}

.login-container {
  width: 100%;
  max-width: 440px;
  margin: auto;
  animation: loginFadeIn 0.5s var(--ios-spring) both;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: none; }
}

.login-card {
  position: relative;
  background: color-mix(in srgb, var(--sheet) 88%, transparent);
  border: 1px solid var(--line-hi);
  border-radius: 28px;
  padding: 34px 28px;
  box-shadow: 0 40px 100px -25px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.login-brand {
  text-align: center;
  margin-bottom: 22px;
}

.login-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 12px 36px -8px var(--accent);
}

.login-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.login-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg);
}

.login-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 7px;
  border-radius: 6px;
}

.login-subtitle {
  margin: 0 auto;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 320px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.login-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 15px;
  background: var(--glass);
  border: 1px solid var(--line);
  transition: transform 0.25s var(--ios-spring), background 0.2s;
}

.login-feature-item:hover {
  background: var(--glass-hi);
  transform: translateY(-1px);
}

.login-feature-icon {
  flex: none;
  margin-top: 2px;
}

.login-feature-text b {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--fg);
  margin-bottom: 2px;
}

.login-feature-text span {
  display: block;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #ffffff;
  color: #1f1f1f;
  font-weight: 650;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s var(--ios-spring), filter 0.2s, box-shadow 0.2s;
}

.login-btn-google:hover {
  filter: brightness(1.03);
  box-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.45);
}

.login-btn-google:active {
  transform: scale(0.98);
}

.login-btn-google[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 4px 0;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--line);
}

.login-divider span {
  padding: 0 12px;
}

.login-btn-offline {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 13.5px;
  background: var(--glass-hi);
  border: 1px solid var(--line-hi);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.25s var(--ios-spring), background 0.2s;
}

.login-btn-offline:hover {
  background: color-mix(in srgb, var(--glass-hi) 150%, transparent);
}

.login-btn-offline:active {
  transform: scale(0.98);
}

.login-offline-hint {
  margin: 4px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--faint);
  line-height: 1.35;
}

@media (max-width: 860px) {
  .login-card {
    padding: 26px 18px;
    border-radius: 22px;
  }
}

