:root {
  color-scheme: dark;
  --bg: #070d1c;
  --solid: #111a2e;
  --glass: linear-gradient(160deg, rgba(255,255,255,.065), rgba(255,255,255,.022));
  --edge: rgba(150,175,230,.14);
  --text: #edf2ff;
  --muted: #94a5c8;
  --blue: #6d8dff;
  --violet: #8b6dff;
  --in: #14b88c;
  --in-text: #4fe3b5;
  --out: #cc4572;
  --out-text: #ff8fb1;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 15px/1.5 "Segoe UI Variable Text", -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vw 50vh at 85% -5%, rgba(109,141,255,.24), transparent 70%),
    radial-gradient(50vw 45vh at 10% 105%, rgba(139,109,255,.17), transparent 70%),
    radial-gradient(35vw 35vh at 55% 60%, rgba(20,184,140,.07), transparent 70%); }
h1, h2, .big, strong { font-family: "Segoe UI Variable Display", -apple-system, "SF Pro Display", "Segoe UI", Roboto, sans-serif; }
h1 { margin: 0; font-size: 1.9rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
h2 { margin: 0 0 14px; font-size: 1.02rem; font-weight: 600; }
p { margin: 0; }
small, .muted { color: var(--muted); }
small { font-size: .82rem; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--in-text); }
.neg { color: var(--out-text); }
a { color: #a9bcff; }
:focus-visible { outline: 2px solid #9db4ff; outline-offset: 3px; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* menu */
nav { position: fixed; top: 14px; bottom: 14px; left: 14px; width: 224px; display: flex; flex-direction: column; gap: 26px; padding: 20px 14px; border-radius: 26px; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: blur(22px); z-index: 4; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; font-size: 1.02rem; }
.links { position: relative; display: flex; flex-direction: column; gap: 4px; }
.links a { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 999px; color: var(--muted); text-decoration: none; transition: color .25s; }
.links a:hover, .links a[aria-current] { color: #fff; }
#glide { position: absolute; top: 0; left: 0; border-radius: 999px; background: linear-gradient(120deg, var(--blue), var(--violet)); box-shadow: 0 8px 24px -8px rgba(109,141,255,.8); transition: transform .5s var(--ease), width .5s var(--ease); }
.device { margin-top: auto; padding: 0 8px; font-size: .78rem; color: var(--muted); }

.page { margin-left: 252px; padding: 28px clamp(14px, 2.2vw, 34px) 40px; }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.chip { display: inline-block; margin-left: 8px; padding: 1px 10px; border-radius: 999px; font-size: .75rem; color: var(--in-text); background: rgba(20,184,140,.14); }
.chip:empty { display: none; }
button.chip { border: 0; font-family: inherit; line-height: 1.6; cursor: pointer; }
.chip.bad, .alert { color: #ffd3df; background: rgba(204,69,114,.28); }
.alert { padding: 12px 16px; border-radius: 16px; margin-bottom: 16px; }
.actions, .row-buttons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-buttons.end { justify-content: flex-end; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 600; color: #fff; cursor: pointer; transition: transform .3s var(--ease), box-shadow .3s var(--ease), filter .2s, background .2s; }
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn:active, .round:active, .day:active { transform: scale(.95); transition-duration: .08s; }
.btn.income { background: linear-gradient(120deg, #0b8f72, #0d7f86); box-shadow: 0 10px 28px -12px rgba(20,184,140,.9); }
.btn.expense { background: linear-gradient(120deg, #c13d69, #9e3f8c); box-shadow: 0 10px 28px -12px rgba(204,69,114,.9); }
.btn.primary { background: linear-gradient(120deg, #4f6fe8, #7658e6); box-shadow: 0 10px 28px -12px rgba(109,141,255,.95); }
.btn.ghost { background: rgba(255,255,255,.06); border-color: var(--edge); }
.btn.small { min-height: 36px; padding: 0 15px; font-size: .86rem; }
.btn .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.round { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 1px solid var(--edge); background: rgba(255,255,255,.05); color: var(--text); cursor: pointer; transition: transform .3s var(--ease), background .2s; }
.round:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.round .icon { width: 17px; height: 17px; }

/* layout */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; }

/* computer dashboard */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.dash .hero { grid-column: 1 / 4; grid-row: 1; }
.dash .stats { grid-column: 4 / 13; grid-row: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.k-growth { grid-column: 1 / 9; grid-row: 2; }
.k-cal { grid-column: 9 / 13; grid-row: 2 / 4; }
.k-cats { grid-column: 1 / 4; grid-row: 3; }
.k-goals { grid-column: 4 / 6; grid-row: 3; }
.k-latest { grid-column: 6 / 9; grid-row: 3; }
.dash .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 12px 14px; border-radius: 20px; }
.dash h2 { margin-bottom: 6px; font-size: .94rem; }
.scroll { flex: 1; min-height: 0; overflow: hidden auto; scrollbar-width: thin; }
.dash .empty { flex: 1; min-height: 0; gap: 8px; padding: 4px; font-size: .86rem; }
.dash .hero { justify-content: center; gap: 0; }
.dash .quiet { display: none; }
.dash .fx strong { font-size: .95rem; }
.dash .fx small { font-size: .72rem; }
.dash .bank-line { flex-wrap: nowrap; gap: 8px; margin: 3px 0 0; padding: 2px 10px; font-size: .76rem; white-space: nowrap; overflow: hidden; }
.dash .big { font-size: clamp(1.5rem, 2.3vw, 2.5rem); }
.dash .hero-chips { flex-wrap: nowrap; gap: 8px; margin-top: 4px; }
.dash .hero-chip { min-width: 0; padding: 5px 9px; border-radius: 13px; }
.dash .hero-chip .badge { display: none; }
.dash .hero-chip div { font-size: .88rem; }
.dash .stat { justify-content: center; }
.dash .stat .badge { width: 30px; height: 30px; margin-bottom: 4px; border-radius: 10px; }
.dash .stat strong { font-size: clamp(1rem, 1.55vw, 1.7rem); }

.growth { display: flex; flex-direction: column; }
.growth .chart { position: relative; flex: 1; min-height: 240px; }
.growth .chart svg { position: absolute; inset: 0; }
.big-growth .chart { min-height: 340px; }
.headline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin-bottom: 8px; }
.headline strong { font-size: 1.05rem; font-weight: 650; }
.chart text.value { fill: var(--text); font-weight: 650; }
.partial { stroke: #dfe8ff; stroke-width: 1.5; stroke-dasharray: 4 3; }

.k-cats .donut { flex: 1; min-height: 0; flex-wrap: nowrap; gap: 12px; }
.k-cats .donut-ring { width: clamp(76px, 6.4vw, 130px); height: clamp(76px, 6.4vw, 130px); flex: none; }
.k-cats .donut-total { font-size: clamp(.62rem, .65vw, .85rem); }
.k-cats .donut-total small { display: none; }
.k-cats .donut ul { flex: 1; min-width: 0; max-height: 100%; overflow: hidden auto; scrollbar-width: thin; }
.k-cats .donut li { gap: 6px; padding: 2px 0; font-size: .78rem; }
.k-cats .donut li span:not(.num) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-line { display: flex; flex-direction: column; gap: 3px; padding: 5px 2px; color: var(--text); text-decoration: none; font-size: .82rem; }
.goal-top { display: flex; justify-content: space-between; gap: 8px; }
.goal-top b, .goal-line small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-line small { color: var(--muted); font-size: .72rem; }
.meter { display: block; height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--in); transition: width .6s var(--ease); }

.latest button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 5px 4px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .2s; }
.latest button:hover { background: rgba(255,255,255,.07); }
.latest .badge { width: 30px; height: 30px; border-radius: 10px; }
.latest .what { font-size: .84rem; line-height: 1.3; }
.latest .what b, .latest .what small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest .amount-cell { font-size: .84rem; }

.mini .month-bar { gap: 6px; }
.mini .month-bar h2 { min-width: 0; flex: 1; margin: 0; font-size: .95rem; white-space: nowrap; }
.mini .month-bar .round { width: 30px; height: 30px; }
.mini .month-bar .btn { margin: 0; min-height: 30px; padding: 0 11px; }
.mini .cal-summary { display: none; }
.mini .cal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 8px; }
.mini .cal-grid { flex: 1; min-height: 0; grid-template-rows: auto; grid-auto-rows: minmax(0, 1fr); gap: 4px; }
.mini .day { aspect-ratio: auto; min-height: 36px; padding: 4px 1px; border-radius: 11px; justify-content: space-evenly; overflow: hidden; }
.mini .day-no { font-size: .8rem; }
.mini .day-net { font-size: .68rem; line-height: 1; }

.card { min-width: 0; padding: 20px 22px; border-radius: 24px; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: blur(18px); box-shadow: 0 24px 50px -34px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05); transition: border-color .3s, transform .45s var(--ease); }
.card:hover { border-color: rgba(150,175,230,.28); }

.hero { display: flex; flex-direction: column; justify-content: center; gap: 4px; position: relative; overflow: hidden; background: linear-gradient(135deg, rgba(79,111,232,.5), rgba(118,88,230,.22) 55%, rgba(20,184,140,.16)); }
.hero small, .hero .muted { color: #cdd8f6; }
.hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -110px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.2), transparent 65%); }
.big { font-size: clamp(2.2rem, 4.2vw, 3.4rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.big .num, .hero-chip .num { color: #fff; }
.big .num.pos { color: #8bf5d1; }
.big .num.neg { color: #ffb0c8; }
.hero-chips { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.hero-chip { flex: 1; min-width: 150px; display: flex; gap: 11px; align-items: center; padding: 12px 14px; border-radius: 18px; background: rgba(7,13,28,.38); }
.hero-chip div { display: flex; flex-direction: column; font-size: 1.1rem; font-weight: 600; }

.badge { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 14px; background: rgba(109,141,255,.18); color: #b4c4ff; }
.badge.income { background: rgba(20,184,140,.18); color: var(--in-text); }
.badge.expense { background: rgba(204,69,114,.2); color: var(--out-text); }
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat .badge { margin-bottom: 8px; }
.stat strong { font-size: clamp(1.15rem, 2.1vw, 1.65rem); font-weight: 650; letter-spacing: -.015em; }
.stat:hover { transform: translateY(-3px); }

/* calendar */
.month-bar { display: flex; align-items: center; gap: 10px; }
.month-bar h2 { margin: 0; font-size: 1.3rem; min-width: 9.5em; text-align: center; }
.month-bar .btn { margin-left: auto; }
.calendar { overflow: hidden; }
.cal-summary { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: space-between; gap: 8px 14px; margin: 16px 0; padding: 12px 16px; border-radius: 18px; background: rgba(7,13,28,.4); }
.cal-summary div { display: flex; flex-direction: column; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekday { text-align: center; font-size: .75rem; color: var(--muted); padding-bottom: 4px; }
.day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-width: 0; aspect-ratio: 1 / .96; padding: 7px 2px; border-radius: 16px; border: 1px solid rgba(150,175,230,.09); background: rgba(255,255,255,.028); color: var(--text); font: inherit; cursor: pointer; transition: transform .3s var(--ease), border-color .2s, box-shadow .3s, background-color .2s; }
.day:hover { transform: translateY(-3px) scale(1.04); border-color: rgba(190,208,255,.55); z-index: 1; }
.day.pos { background: radial-gradient(circle at 50% 100%, rgba(33,224,170, var(--glow)), rgba(20,184,140, calc(var(--glow) * .45)) 70%); border-color: rgba(79,227,181,.3); box-shadow: 0 8px 22px -14px rgba(33,224,170,.9); }
.day.neg { background: radial-gradient(circle at 50% 100%, rgba(240,80,135, var(--glow)), rgba(204,69,114, calc(var(--glow) * .45)) 70%); border-color: rgba(255,143,177,.3); box-shadow: 0 8px 22px -14px rgba(240,80,135,.9); }
.day.active:not(.pos):not(.neg) { background: rgba(109,141,255,.16); }
.day.is-today { border: 2px solid #a9bcff; box-shadow: 0 0 0 4px rgba(109,141,255,.2), 0 0 22px rgba(109,141,255,.5); }
.day-no { font-size: .9rem; font-weight: 600; line-height: 1; }
.day:not(.active) .day-no { color: var(--muted); font-weight: 500; }
.day-net { font-size: .8rem; font-weight: 650; }
.day.pos .day-net { color: #c4ffe9; }
.day.neg .day-net { color: #ffd6e2; }
.flag { position: absolute; top: 4px; right: 4px; color: #ffd479; line-height: 0; }
.flag .icon { width: 12px; height: 12px; }
.large { padding: 26px; }
.large .day { aspect-ratio: 1 / .66; }
.large .day-net { font-size: 1rem; }

/* charts */
.chart { width: 100%; overflow: hidden; }
.chart svg { display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.grid { stroke: rgba(150,175,230,.13); stroke-dasharray: 2 5; }
.zero { stroke: rgba(150,175,230,.35); }
.stop-a { stop-color: #6d8dff; stop-opacity: .45; }
.stop-b { stop-color: #6d8dff; stop-opacity: .03; }
.area { fill: url(#fade); }
.trend { fill: none; stroke: #8fa9ff; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 7px rgba(109,141,255,.9)); }
.dot { fill: #fff; stroke: var(--blue); stroke-width: 2.5; }
.bar { transform-box: fill-box; }
.bar-in { fill: var(--in); transform-origin: bottom; filter: drop-shadow(0 0 5px rgba(20,184,140,.55)); }
.bar-out { fill: var(--out); transform-origin: top; filter: drop-shadow(0 0 5px rgba(204,69,114,.55)); }
.hit { fill: transparent; outline: none; }
.hit:hover, .hit:focus { fill: rgba(255,255,255,.07); }
#tip { position: fixed; z-index: 20; padding: 9px 13px; border-radius: 14px; background: rgba(22,33,60,.96); border: 1px solid var(--edge); font-size: .82rem; font-variant-numeric: tabular-nums; pointer-events: none; box-shadow: 0 14px 30px -12px #000; }
.legend { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; color: var(--muted); font-size: .8rem; }
.legend .key-out { margin-left: 12px; }
.key { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.key-in { background: var(--in); }
.key-out { background: var(--out); }
details { margin-top: 8px; font-size: .85rem; }
summary { cursor: pointer; color: #a9bcff; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--edge); }
th:first-child, td:first-child { text-align: left; }

.ring { display: block; width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 13; }
.ring-base { stroke: rgba(150,175,230,.12); }
.c0 { stroke: #338ced; background: #338ced; }
.c1 { stroke: #e76624; background: #e76624; }
.c2 { stroke: #00a888; background: #00a888; }
.c3 { stroke: #d28e05; background: #d28e05; }
.c4 { stroke: #e24d8b; background: #e24d8b; }
.c5 { stroke: #9887ef; background: #9887ef; }
.rest { stroke: #6b7a9c; background: #6b7a9c; }
.ring circle.c0, .ring circle.c1, .ring circle.c2, .ring circle.c3, .ring circle.c4, .ring circle.c5, .ring circle.rest { background: none; }
.done { stroke: var(--in); filter: drop-shadow(0 0 5px rgba(20,184,140,.8)); }
.donut { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut-ring { position: relative; width: 170px; height: 170px; margin: 0 auto; }
.donut-total { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 650; font-size: .95rem; }
ul { list-style: none; margin: 0; padding: 0; }
.donut ul { flex: 1; min-width: 190px; }
.donut li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.donut li .num { margin-left: auto; font-weight: 600; }

.goal { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 8px 0; }
.goal-ring { position: relative; width: 76px; height: 76px; }
.goal-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .85rem; }
.what { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.more { display: inline-block; margin-top: 8px; }

.entries li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 11px 8px; border-radius: 16px; transition: background .2s; }
.entries li:hover { background: rgba(255,255,255,.045); }
.entries .badge.income, .entries .badge.expense { grid-row: span 1; }
.amount-cell { font-weight: 650; }
.tools { display: flex; gap: 6px; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 120px; padding: 10px; text-align: center; color: var(--muted); }

/* pop-up form and day panel */
dialog { color: var(--text); border: 1px solid var(--edge); background: linear-gradient(170deg, #18233f, #0f172b); box-shadow: 0 40px 90px -30px #000; }
dialog::backdrop { background: rgba(3,7,18,.66); backdrop-filter: blur(7px); }
#dialog { width: min(470px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); border-radius: 28px; padding: 26px; }
#dialog[open] { animation: pop .42s var(--ease); }
#dialog h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
#fields, .group { display: flex; flex-direction: column; gap: 14px; }
.group { gap: 9px; }
#fields label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .85rem; }
input, select, textarea { width: 100%; min-width: 0; padding: 13px 16px; border-radius: 16px; border: 1px solid var(--edge); background: rgba(5,10,24,.65); color: var(--text); font: inherit; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(109,141,255,.25); }
select option { background: #131d36; color: var(--text); }
input.amount { font-size: 1.8rem; font-weight: 650; }
.preview { font-weight: 400; min-height: 1.2em; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--edge); background: rgba(255,255,255,.045); color: var(--text); font: inherit; font-size: .83rem; cursor: pointer; transition: background .2s, transform .25s var(--ease); }
.chips button:hover { transform: translateY(-2px); }
.chips button[aria-pressed="true"] { background: linear-gradient(120deg, var(--blue), var(--violet)); border-color: transparent; }
.chips .icon { width: 15px; height: 15px; }
#form-error { min-height: 1.5em; margin: 8px 0; color: var(--out-text); font-size: .85rem; }

#day { position: fixed; margin: 12px 12px 12px auto; width: min(450px, calc(100vw - 24px)); height: calc(100dvh - 24px); max-height: none; padding: 0; border-radius: 28px; }
#day[open] { animation: from-right .45s var(--ease); }
.drawer-body { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.drawer-head h2 { margin: 0; font-size: 1.25rem; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; padding: 11px 12px; border-radius: 16px; background: rgba(5,10,24,.55); font-weight: 650; font-size: .88rem; overflow: hidden; }
.drawer-body .row-buttons .btn { flex: 1; padding: 0 12px; }
.drawer-body .entries li { grid-template-columns: auto minmax(0, 1fr) auto; padding: 10px 0; }
.drawer-body .tools { grid-column: 2 / -1; justify-content: flex-end; }
.due { display: flex; align-items: center; gap: 8px; color: #ffd479; overflow-wrap: anywhere; }

#toast { position: fixed; right: 20px; bottom: 20px; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 10px 10px 20px; border-radius: 999px; background: #1d2a4b; border: 1px solid var(--edge); box-shadow: 0 20px 40px -18px #000; animation: rise .4s var(--ease); }

/* motion: only when arriving on a page */
.enter .card { animation: rise .65s var(--ease) both; }
.enter .stats .card:nth-child(2) { animation-delay: .07s; }
.enter .stats .card:nth-child(3), .enter .k-growth, .enter .k-cal { animation-delay: .13s; }
.enter .stats .card:nth-child(4), .enter .k-cats, .enter .k-goals, .enter .k-latest { animation-delay: .19s; }
.enter .trend { stroke-dasharray: 1; animation: draw 1.3s var(--ease) both; }
.enter .area, .enter .dot { animation: fade 1.4s ease both; }
.enter .bar { animation: grow .75s var(--ease) both; }
.enter .ring-part { animation: fade .9s ease both .2s; }
.slide-next { animation: slide-next .45s var(--ease); }
.slide-back { animation: slide-back .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes pop { from { opacity: 0; transform: translateY(26px) scale(.95); } }
@keyframes from-right { from { opacity: 0; transform: translateX(60px); } }
@keyframes from-bottom { from { transform: translateY(100%); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes slide-next { from { opacity: 0; transform: translateX(34px); } }
@keyframes slide-back { from { opacity: 0; transform: translateX(-34px); } }

.gap { margin-bottom: 16px; }
.note { margin-top: 14px; }
.file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file:focus-visible + label { outline: 2px solid #9db4ff; outline-offset: 3px; }

#gate { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; overflow: auto; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); background: radial-gradient(70vw 60vh at 50% 0, #1a2650, var(--bg) 70%); }
body.locked { overflow: hidden; }
body.locked nav, body.locked .page { visibility: hidden; }
.gate-card { display: flex; flex-direction: column; gap: 14px; width: min(400px, 100%); animation: rise .5s var(--ease); }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .85rem; }
.gate-links { justify-content: space-between; }
.link { padding: 4px 0; border: 0; background: none; color: #a9bcff; font: inherit; font-size: .88rem; text-decoration: underline; cursor: pointer; }
.gate-card .note { margin: 0; min-height: 1.4em; }

/* choosing a currency */
.welcome { display: flex; flex-direction: column; gap: 14px; width: min(520px, 100%); margin: auto; animation: rise .5s var(--ease); }
.welcome-brand { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.welcome h1 { text-align: center; text-wrap: balance; }
.preview { padding: 18px 16px; border-radius: 26px; text-align: center; background: linear-gradient(135deg, rgba(109,141,255,.22), rgba(20,184,140,.1)); border: 1px solid var(--edge); }
.sample { font-size: clamp(2.1rem, 9vw, 3rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile, .results .row { position: relative; border: 1px solid var(--edge); background: rgba(255,255,255,.04); cursor: pointer; transition: transform .3s var(--ease), background .2s, border-color .2s, box-shadow .3s; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 13px 6px 11px; border-radius: 20px; text-align: center; min-width: 0; }
.tile b { font-size: 1.5rem; line-height: 1.25; }
.tile span { font-weight: 600; font-size: .88rem; }
.tile small { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .72rem; }
.tile:hover { transform: translateY(-2px); background: rgba(255,255,255,.09); }
.tile input, .results input { position: absolute; opacity: 0; pointer-events: none; }
.tile:has(:checked), .results .row:has(:checked) { border-color: #9db4ff; background: linear-gradient(135deg, rgba(109,141,255,.38), rgba(139,109,255,.28)); box-shadow: 0 14px 30px -18px rgba(109,141,255,.95); }
.tile:has(:checked) small { color: var(--text); }
.tile:has(:focus-visible), .results .row:has(:focus-visible) { outline: 2px solid #9db4ff; outline-offset: 3px; }
.search { width: 100%; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--edge); background: rgba(255,255,255,.05); color: var(--text); font: inherit; }
.results { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow: auto; padding: 3px; }
.results .row { display: grid; grid-template-columns: 3.4em minmax(0, 1fr) auto; align-items: center; gap: 10px; flex: none; padding: 11px 16px; border-radius: 16px; }
.btn.start { min-height: 54px; font-size: 1.02rem; }
.small-print { text-align: center; font-size: .82rem; }
.welcome .note { margin: 0; min-height: 1.4em; text-align: center; }

/* dollar value and banks */
.fx { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.fx strong { font-size: 1.12rem; }
.bank-line { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--text); text-decoration: none; font-size: .88rem; }
.test-note { padding: 11px 16px; border-radius: 16px; background: rgba(240,180,80,.16); color: #ffe2ae; }
.accounts { list-style: none; margin: 0 0 14px; padding: 0; }
.accounts li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--edge); }
.accounts li > div { display: flex; flex-direction: column; min-width: 0; }
.accounts .amounts { align-items: flex-end; }
.accounts .amounts strong { font-size: 1.15rem; }
.row-buttons.between { justify-content: space-between; }

/* everything on one screen */
@media (min-width: 1200px) and (min-height: 600px) {
  nav { width: 188px; }
  .page { margin-left: 210px; padding: 14px 16px; }
  h1 { font-size: 1.5rem; }
  header { margin-bottom: 12px; }
  header .btn { min-height: 40px; }
  body[data-page="dashboard"] .page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  body[data-page="dashboard"] header h1 { font-size: 1.3rem; }
  body[data-page="dashboard"] main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .dash { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1.2fr) minmax(0, 1fr); }
  .dash .growth .chart, .dash .mini .day { min-height: 0; }
}
@media (min-width: 1200px) and (max-width: 1500px) {
  .dash .stat .badge { display: none; }
}
@media (min-width: 1200px) and (max-width: 1330px) {
  .k-cats .donut-ring, .latest .badge { display: none; }
  .latest button { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (min-width: 1200px) and (max-height: 700px) {
  .dash .card { padding: 9px 13px; }
  .dash .big { font-size: 1.6rem; line-height: 1.15; }
  .dash .hero-chip { padding: 2px 9px; }
  .dash .hero-chip div { font-size: .8rem; }
  .dash .headline small, .dash .fx small { display: none; }
  nav { gap: 16px; }
  .links a { padding: 9px 14px; }
  .dash h1, .dash h2 { margin-bottom: 4px; }
  .dash .headline { margin-bottom: 2px; }
  .dash .headline strong { font-size: .92rem; }
}
@media (min-width: 761px) { .phone-only { display: none !important; } }
@media (min-width: 761px) and (max-width: 1199px) {
  .dash > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .dash .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  nav { top: auto; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; padding: 6px; gap: 0; border-radius: 28px; background: rgba(17,26,46,.9); }
  .brand, .device { display: none; }
  .links { flex-direction: row; justify-content: space-between; }
  .links a { flex: 1; flex-direction: column; gap: 2px; padding: 7px 2px; font-size: .72rem; }
  .page { margin: 0; padding: calc(18px + env(safe-area-inset-top)) 10px calc(178px + env(safe-area-inset-bottom)); }
  body::after { content: ""; position: fixed; z-index: 4; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--bg); }
  h1 { font-size: 1.55rem; }
  header { margin-bottom: 14px; }
  .wide-only, header .actions { display: none !important; }
  header { flex-wrap: nowrap; }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 5px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); }
  .tabs button { min-height: 42px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; transition: background .25s, color .25s; }
  .tabs button[aria-selected="true"] { background: linear-gradient(120deg, var(--blue), var(--violet)); color: #fff; }
  #plus { position: fixed; z-index: 5; right: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); display: grid; place-items: center; width: 62px; height: 62px; border: 0; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--blue), var(--violet)); box-shadow: 0 16px 34px -10px rgba(109,141,255,.95); cursor: pointer; transition: transform .3s var(--ease); }
  #plus:active { transform: scale(.9); }
  #plus .icon { width: 28px; height: 28px; stroke-width: 2.4; }
  #add { width: 100vw; max-width: 100vw; margin: auto auto 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; }
  #add[open] { display: flex; flex-direction: column; gap: 10px; animation: from-bottom .4s var(--ease); }
  #add .btn { min-height: 54px; }
  .growth .chart { min-height: 230px; }
  .hero-chip { min-width: 0; padding: 10px 12px; }
  .hero-chip .badge { display: none; }
  .hero-chip div { font-size: 1rem; }
  .stack, .stats { gap: 10px; }
  .card { padding: 16px; border-radius: 22px; }
  .stats.three { grid-template-columns: 1fr; }
  .calendar { padding: 14px 8px; }
  .month-bar { gap: 6px; flex-wrap: wrap; justify-content: center; }
  .month-bar h2 { font-size: 1.08rem; min-width: 8.4em; }
  .month-bar .btn { margin: 0 0 0 4px; }
  .cal-summary { grid-template-columns: 1fr 1fr; margin: 12px 0; font-size: .9rem; }
  .cal-grid { gap: 3px; }
  .day, .large .day { aspect-ratio: auto; height: 54px; border-radius: 12px; padding: 6px 0; }
  .day-net, .large .day-net { font-size: .66rem; letter-spacing: -.02em; }
  .entries li { grid-template-columns: auto minmax(0, 1fr) auto; padding: 10px 0; }
  .entries .tools { grid-column: 2 / -1; justify-content: flex-end; }
  .goal { grid-template-columns: auto minmax(0, 1fr); }
  .goal .row-buttons { grid-column: 1 / -1; }
  #day { margin: auto 0 0; width: 100vw; max-width: 100vw; height: auto; max-height: 88dvh; border-radius: 28px 28px 0 0; }
  #day[open] { animation: from-bottom .45s var(--ease); }
  #dialog { margin: auto auto 0; width: 100vw; max-width: 100vw; max-height: 94dvh; border-radius: 28px 28px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
  #dialog[open] { animation: from-bottom .45s var(--ease); }
  #toast { left: 14px; right: 14px; bottom: calc(160px + env(safe-area-inset-bottom)); }
  #day { padding-bottom: env(safe-area-inset-bottom); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.legal { max-width: 640px; margin: 24px auto; display: flex; flex-direction: column; gap: 10px; }
.legal h2 { margin: 10px 0 0; }

/* money received from banks, and sales reports */
.links .count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #e0527a; color: #fff; font-size: .72rem; text-align: center; }
.arrivals { list-style: none; margin: 8px 0 12px; padding: 0; }
.arrivals li { display: flex; flex-direction: column; gap: 9px; padding: 13px 0; border-bottom: 1px solid var(--edge); }
.arrival-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.arrival-top .what { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.arrival-top strong { white-space: nowrap; }
.twin { padding: 8px 12px; border-radius: 12px; background: rgba(240,180,80,.16); color: #ffe2ae; font-size: .85rem; }
.mapping { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.field-title { margin: 16px 0 8px; font-weight: 600; font-size: .85rem; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--edge); cursor: pointer; }
.checks input { width: 18px; height: 18px; padding: 0; accent-color: var(--blue); }
.sums, .samples { list-style: none; margin: 0 0 14px; padding: 0; }
.sums li, .samples li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--edge); }
.samples li { font-size: .85rem; }
.samples li span { min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.samples li strong { white-space: nowrap; }
@media (max-width: 760px) { .links .count { position: absolute; top: 2px; right: 8px; margin: 0; } }

/* how the app is used */
.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.kind { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 22px; border: 1px solid var(--edge); background: rgba(255,255,255,.04); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform .3s var(--ease), background .2s, border-color .2s; }
.kind:hover { transform: translateY(-2px); background: rgba(255,255,255,.09); }
.kind b { font-size: 1.2rem; }
.kind[aria-pressed="true"] { border-color: #9db4ff; background: linear-gradient(135deg, rgba(109,141,255,.38), rgba(139,109,255,.28)); }
.kind[aria-pressed="true"] small { color: var(--text); }
.links a[hidden], #fields label[hidden] { display: none; }
.accounts.platforms li { flex-wrap: wrap; }
.accounts.platforms .row-buttons { flex: 0 0 auto; flex-direction: row; margin: 0; }
.row-buttons.center { justify-content: center; }
.periods { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); align-self: flex-start; }
.periods button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; transition: background .25s, color .25s; }
.periods button[aria-selected="true"] { background: linear-gradient(120deg, var(--blue), var(--violet)); color: #fff; }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .periods { align-self: stretch; justify-content: space-between; border-radius: 22px; } .periods button { flex: 1; padding: 0 6px; font-size: .8rem; } }

/* accounts and the support panel */
textarea { resize: vertical; }
.agree { display: flex; align-items: flex-start; gap: 10px; font-size: .85rem; }
.agree input { width: 20px; height: 20px; flex: none; padding: 0; margin-top: 1px; accent-color: var(--blue); }
.panel { max-width: 980px; margin: 0 auto; padding: 24px 14px 40px; }
.request { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--edge); overflow-wrap: anywhere; }
.said { white-space: pre-wrap; font-size: .9rem; }
.legal ul { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
