/* Inter (SIL Open Font License, fonts/OFL.txt), stored with the app so nothing waits for Google. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --geo-ring: rgba(255, 200, 61, .55);
  --geo-t2: rgba(14, 108, 102, .2);
  --geo-g2: rgba(22, 184, 122, .25);
  --geo-y2: rgba(255, 200, 61, .35);
  --geo-t: rgba(14, 108, 102, .5);
  --geo-g: rgba(22, 184, 122, .6);
  --geo-y: rgba(255, 200, 61, .8);
  --bg: #F5F1E6;
  --card: #FFFFFF;
  --elev: #FFFFFF;
  --seg-on: #FFFFFF;
  --fill: rgba(90, 70, 30, .08);
  --fill-2: rgba(90, 70, 30, .05);
  --text: #1D1B16;
  --text-2: rgba(29, 27, 22, .6);
  --text-3: rgba(29, 27, 22, .3);
  --sep: rgba(29, 27, 22, .12);
  --accent: #0F9D66;
  --accent-soft: rgba(22, 184, 122, .15);
  --in: #1BAF7A;           /* chart: money in  (validated pair) */
  --out: #EB6834;          /* chart: money out */
  --in-text: #13805A;      /* readable green for +amounts */
  --danger: #FF3B30;
  --good: #0CA30C;
  --warn: #C98500;
  --grid: #ECE6D8;
  --axis: #D2CBBB;
  --muted: #8E887A;
  --bar: #FFFDF8; /* solid bars: a live blur behind them made scrolling stutter on phones */
  --overlay: rgba(0, 0, 0, .32);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --r: 16px;
  --font: "Inter", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --geo-ring: rgba(255, 200, 61, .38);
    --geo-t2: rgba(26, 156, 146, .22);
    --geo-g2: rgba(22, 184, 122, .18);
    --geo-y2: rgba(255, 200, 61, .18);
    --geo-t: rgba(26, 156, 146, .5);
    --geo-g: rgba(22, 184, 122, .45);
    --geo-y: rgba(255, 200, 61, .5);
    --bg: #13120F;
    --card: #1F1D18;
    --elev: #2A2721;
    --seg-on: #4A463D;
    --fill: rgba(255, 240, 210, .09);
    --fill-2: rgba(255, 240, 210, .05);
    --text: #F5F0E4;
    --text-2: rgba(245, 240, 228, .62);
    --text-3: rgba(245, 240, 228, .3);
    --sep: rgba(255, 240, 210, .12);
    --accent: #2FBF84;
    --accent-soft: rgba(47, 191, 132, .18);
    --in: #199E70;
    --out: #D95926;
    --in-text: #30D158;
    --danger: #FF453A;
    --warn: #FFB340;
    --grid: #2A2721;
    --axis: #3A362E;
    --bar: rgb(31, 29, 24);
    --overlay: rgba(0, 0, 0, .55);
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --geo-ring: rgba(255, 200, 61, .38);
  --geo-t2: rgba(26, 156, 146, .22);
  --geo-g2: rgba(22, 184, 122, .18);
  --geo-y2: rgba(255, 200, 61, .18);
  --geo-t: rgba(26, 156, 146, .5);
  --geo-g: rgba(22, 184, 122, .45);
  --geo-y: rgba(255, 200, 61, .5);
  --bg: #13120F;
  --card: #1F1D18;
  --elev: #2A2721;
  --seg-on: #4A463D;
  --fill: rgba(255, 240, 210, .09);
  --fill-2: rgba(255, 240, 210, .05);
  --text: #F5F0E4;
  --text-2: rgba(245, 240, 228, .62);
  --text-3: rgba(245, 240, 228, .3);
  --sep: rgba(255, 240, 210, .12);
  --accent: #2FBF84;
  --accent-soft: rgba(47, 191, 132, .18);
  --in: #199E70;
  --out: #D95926;
  --in-text: #30D158;
  --danger: #FF453A;
  --warn: #FFB340;
  --grid: #2A2721;
  --axis: #3A362E;
  --bar: rgb(31, 29, 24);
  --overlay: rgba(0, 0, 0, .55);
  --shadow: none;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.35 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  min-height: 100vh;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; }

.view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 118px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Compact top bar (appears on scroll) ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: calc(env(safe-area-inset-top) + 44px);
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px;
  background: var(--bar);
  border-bottom: .5px solid var(--sep);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.topbar.show { opacity: 1; }

/* ---------- Large title header ---------- */
.lt { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 16px; min-height: 52px; }
.lt h1 { margin: 0; font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 3px; }
.lt-right { display: flex; align-items: center; gap: 10px; padding-bottom: 3px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fill); color: var(--accent);
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.solid { background: var(--accent); color: #fff; }
.icon-btn:active { opacity: .6; }

/* ---------- Segmented control ---------- */
.seg { position: relative; display: flex; background: var(--fill); border-radius: 10px; padding: 2px; isolation: isolate; }
.seg button {
  flex: 1; padding: 6px 12px; border-radius: 7px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background .2s, box-shadow .2s;
}
.seg button { position: relative; z-index: 1; transition: color .2s, opacity .2s; }
.seg button:active { opacity: .6; }
.seg-thumb {
  position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px;
  width: calc((100% - 4px) / var(--n)); border-radius: 8px;
  background: var(--seg-on); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
  transform: translateX(calc(var(--i) * 100%));
  animation: seg-slide .38s cubic-bezier(.3, .8, .25, 1);
}
@keyframes seg-slide { from { transform: translateX(calc(var(--from) * 100%)); } }
/* Press and slide along a segmented control too */
.seg { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.seg-thumb { transition: transform .32s cubic-bezier(.3, 1.2, .5, 1), box-shadow .2s; }
.seg.sliding .seg-thumb { transition: box-shadow .2s; box-shadow: 0 5px 14px rgba(0, 0, 0, .16), 0 3px 1px rgba(0, 0, 0, .04); }
.seg.seg-lg button { padding: 8px 12px; font-size: 14px; }
.seg.sm button { padding: 5px 10px; font-size: 12px; }
.seg.full { width: 100%; }

/* ---------- Cards & sections ---------- */
.card { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.view > .card + .card { margin-top: 12px; }
.stack > * + * { margin-top: 12px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 10px; }
.sec-head h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.015em; }
.link { color: var(--accent); font-size: 15px; font-weight: 500; }
.link:active { opacity: .5; }
.card-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 2px; }
.card-sub { font-size: 13px; color: var(--text-2); }
.muted { color: var(--text-2); }

/* ---------- Balance card ---------- */
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hero { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 6px; word-break: break-word; }
.hero small { font-size: 20px; font-weight: 600; color: var(--text-2); letter-spacing: -.01em; margin-left: 7px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.hero-meta b { color: var(--text); font-weight: 600; }
.hero-meta .apart-note { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta .apart-note .gl { width: 14px; height: 14px; flex-shrink: 0; }
.chart { position: relative; margin: 14px -4px 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg text { font: 500 11px var(--font); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart svg text.cur { fill: var(--text); font-weight: 700; }
.ranges { margin-top: 10px; }
.tip {
  position: absolute; top: -6px; z-index: 2; pointer-events: none;
  background: var(--elev); color: var(--text);
  border-radius: 10px; padding: 7px 10px;
  font-size: 12px; line-height: 1.35; white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .14), 0 0 0 .5px var(--sep);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tip.show { opacity: 1; transform: none; }
.tip .t-date { color: var(--text-2); font-weight: 500; }
.tip .t-row { display: flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.key { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.key.in { background: var(--in); }
.key.out { background: var(--out); }
.key.line { width: 12px; height: 2px; border-radius: 1px; background: var(--accent); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); font-weight: 500; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Stat tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile-stat { padding: 14px; }
.ts-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ts-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.ts-ic svg { width: 15px; height: 15px; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ts-ic.in { background: color-mix(in srgb, var(--in) 16%, transparent); }
.ts-ic.in svg { stroke: var(--in-text); }
.ts-ic.out { background: color-mix(in srgb, var(--out) 16%, transparent); }
.ts-ic.out svg { stroke: var(--out); }
.ts-val { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 10px 0 2px; }
.ts-val span, .ts-val small { white-space: nowrap; }
.ts-val small { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.tiles > .card { margin-top: 0; }
.sec-head + .tiles { margin-top: 0; }
.ts-sub { font-size: 12px; color: var(--text-2); }

/* ---------- Lists ---------- */
.group { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px; position: relative; width: 100%; text-align: left; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: .5px; background: var(--sep); }
.group.plain .row + .row::before { left: 16px; }
button.row:active, .row.tap:active { background: var(--fill-2); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row-amt { font-size: 16px; font-weight: 600; white-space: nowrap; text-align: right; }
.row-amt.in { color: var(--in-text); }
.row-amt.neutral { color: var(--text-2); font-weight: 500; }
.row-amt small { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); }
.chev { width: 14px; height: 14px; fill: none; stroke: var(--text-3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* Icon tiles: white line icon on a softly graded colour square (iOS Settings style) */
.ic {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c, #8E8E93) 70%, #fff), var(--c, #8E8E93));
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .06), 0 1px 2px color-mix(in srgb, var(--c, #8E8E93) 30%, transparent);
  color: #fff;
}
.ic svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic svg .f { fill: #fff; stroke: none; }
.ic.xs { width: 24px; height: 24px; border-radius: 7px; }
.ic.xs svg { width: 15px; height: 15px; stroke-width: 2.3; }
.ic.sm { width: 32px; height: 32px; border-radius: 9px; }
.ic.sm svg { width: 19px; height: 19px; }
.ic.lg { width: 50px; height: 50px; border-radius: 14px; }
.ic.lg svg { width: 28px; height: 28px; stroke-width: 1.9; }
.ic.xl { width: 68px; height: 68px; border-radius: 19px; }
.ic.xl svg { width: 38px; height: 38px; stroke-width: 1.8; }
.ic.letter { font-size: 16px; font-weight: 700; color: #fff; }
.gl { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.gl .f { fill: currentColor; stroke: none; }
.gl.big { width: 40px; height: 40px; stroke-width: 1.8; margin: 0 auto; }
.ring .gl { width: 22px; height: 22px; }
.day-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 20px 4px 8px; }
.day-head span:first-child { text-transform: uppercase; letter-spacing: .02em; }
.day-head:first-child { margin-top: 4px; }
/* Long History lists: days scrolled far away are not laid out or painted until they come near */
/* (no content-visibility here: rows drawn only when they scroll into view made scrolling stutter) */

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 34px 20px; }
.empty .big { display: flex; justify-content: center; margin-bottom: 14px; }
.empty h3 { margin: 0 0 6px; font-size: 19px; font-weight: 700; }
.empty p { margin: 0 auto 18px; max-width: 290px; font-size: 15px; color: var(--text-2); }
.empty .btn { max-width: 260px; margin: 0 auto; }
.empty .link { display: inline-block; margin-top: 14px; }

/* ---------- Buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 14px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; }
.btn:active { opacity: .75; transform: scale(.99); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.btn.grey { background: var(--fill); color: var(--text); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }

/* ---------- Search & filters ---------- */
.search { display: flex; align-items: center; gap: 6px; background: var(--fill); border-radius: 11px; padding: 0 10px; height: 38px; }
.search svg { width: 17px; height: 17px; fill: none; stroke: var(--text-2); stroke-width: 2.2; stroke-linecap: round; flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; min-width: 0; }
.search input::placeholder { color: var(--text-2); }
.filters { display: flex; gap: 10px; margin: 12px 0 8px; }
.filters .seg { flex: 1; }

/* ---------- Goals ---------- */
.strip { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.goal-mini { flex: 0 0 148px; scroll-snap-align: start; text-align: left; padding: 14px; }
.goal-mini .gm-name { font-size: 15px; font-weight: 600; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-mini .gm-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-mini.add { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; color: var(--accent); background: var(--card); }
.ring { position: relative; flex: none; }
.ring .ring-txt { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.ring .emoji { font-size: 22px; }
.goal-card { display: block; width: 100%; text-align: left; }
.goal-card:active { transform: scale(.99); }
.gc-top { display: flex; align-items: center; gap: 12px; }
.gc-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.gc-date { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.meter { height: 8px; border-radius: 4px; background: var(--accent-soft); margin: 14px 0 8px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .5s cubic-bezier(.32, .72, 0, 1); animation: fill-x .9s cubic-bezier(.2, .8, .2, 1) backwards; }
.meter.tint { background: color-mix(in srgb, var(--mc) 18%, transparent); }
.meter.tint i { background: var(--mc); }
.meter.done i { background: var(--good); }
.gc-nums { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.gc-nums b { font-size: 16px; font-weight: 700; }
.gc-pace { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: .5px solid var(--sep); font-size: 13px; color: var(--text-2); }
.gc-pace b { color: var(--text); font-weight: 600; }
.gc-pace .gl { width: 16px; height: 16px; color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.chip.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--in-text); }
.chip.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--text); }
.chip.info { background: var(--accent-soft); color: var(--accent); }

/* ---------- Stats ---------- */
.period-nav { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 12px; }
.period-nav .pn-title { font-size: 17px; font-weight: 700; }
.period-nav .icon-btn[disabled] { opacity: .3; pointer-events: none; }
.sl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; }
.sl-label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.sl-row b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.sl-row.total { border-top: .5px solid var(--sep); margin-top: 6px; padding-top: 11px; }
.sl-row.total b { font-size: 20px; }
.rate-line { margin-top: 12px; padding-top: 12px; border-top: .5px solid var(--sep); font-size: 13px; color: var(--text-2); }
.rate-line b { color: var(--text); }
.brk { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.brk + .brk { border-top: .5px solid var(--sep); }
.brk-main { flex: 1; min-width: 0; }
.brk-top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.brk-top .n { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brk-top .a { font-weight: 600; white-space: nowrap; }
.brk-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.brk-bar i { display: block; height: 6px; border-radius: 0 3px 3px 0; min-width: 3px; animation: fill-x .8s cubic-bezier(.2, .8, .2, 1) backwards; }
.brk-bar i.out { background: var(--out); }
.brk-bar i.in { background: var(--in); }
.brk-bar span { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Tab bar: floating pill + round add button ---------- */
.tabbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px;
}
.tabs {
  --n: 5;
  position: relative; flex: 1; height: 62px; display: flex; padding: 5px;
  border-radius: 31px;
  background: var(--bar);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .06), inset 0 0 0 .5px var(--sep);
}
.tab-ind {
  position: absolute; top: 5px; bottom: 5px; left: 5px;
  width: calc((100% - 10px) / var(--n)); border-radius: 26px;
  background: var(--accent-soft);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .45s cubic-bezier(.3, 1.25, .45, 1);
}
.tabs button {
  position: relative; flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 10px; font-weight: 600; border-radius: 26px;
  transition: color .25s;
}
.tabs button svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.tabs button svg .fill { fill: currentColor; stroke: none; }
.tabs button span { white-space: nowrap; }
.tabs button.on { color: var(--accent); }
.tabs button.on svg { transform: translateY(-1px) scale(1.08); }
.tabs button:active svg { transform: scale(.88); }
.fab {
  flex: none; width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 45%, transparent), 0 2px 4px rgba(0, 0, 0, .1);
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.fab svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.fab:active { transform: scale(.9); }
/* Press and slide along the bar: the highlight follows the finger */
.tabbar { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tabs { touch-action: none; }
.tab-ind { transition: transform .45s cubic-bezier(.3, 1.25, .45, 1), background .25s, box-shadow .25s; }
.tabs.sliding .tab-ind { transition: background .2s, box-shadow .2s; background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 22%, transparent); }
.tabs.sliding button.on:not(.over) { color: var(--muted); }
.tabs.sliding button.on:not(.over) svg { transform: none; }
.tabs.sliding button.over { color: var(--accent); }
.tabs.sliding button.over svg { transform: translateY(-1px) scale(1.12); }

/* ---------- Sheets ---------- */
/* a row that was just added fades in where it belongs (see animateChange in core.js) */
/* the automatic dollar rate in Settings */
.rate-sub { display: block; font-size: 13px; color: var(--text-2); margin-top: 1px; }
.rate-now b { margin-left: auto; font-size: 17px; }
.rate-when { font-size: 12px; text-align: right; max-width: 60%; line-height: 1.3; }
.appear { animation: appear .4s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes appear { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
.overlay { position: fixed; inset: 0; background: var(--overlay); opacity: 0; transition: opacity .3s; z-index: 40; touch-action: none; }
.sheet { overscroll-behavior: contain; }
.sheet-grab, .sheet-head { touch-action: none; }
.overlay.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 560px; margin: 0 auto;
  max-height: calc(100% - env(safe-area-inset-top) - 44px);
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .42s cubic-bezier(.32, .72, 0, 1);
  box-shadow: 0 -6px 30px rgba(0, 0, 0, .12);
}
.sheet.show { transform: none; }
.sheet { will-change: transform; }
.sheet.dragging { transition: none; }
.sheet-grab { padding: 8px 0 2px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grab i { width: 36px; height: 5px; border-radius: 3px; background: var(--text-3); }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 16px 10px; touch-action: none; }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 700; text-align: center; }
.sheet-head .l { justify-self: start; }
.sheet-head .r { justify-self: end; font-weight: 700; }
.sheet-head button { color: var(--accent); font-size: 17px; padding: 6px 0; }
.sheet-head button[disabled] { opacity: .35; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 16px calc(env(safe-area-inset-bottom) + 28px); overscroll-behavior: contain; }

/* ---------- Form ---------- */
.amount-box { text-align: center; padding: 14px 0 6px; }

/* A screenshot kept with an entry (js/pics.js) */
.pic-row { gap: 8px; }
.pic-row .pill-btn { margin: 0; }
.pic-row.pic-in .pic-thumb, .pic-row.pic-in .pill-btn { animation: pop .3s ease; }
.pic-thumb { width: 30px; height: 40px; margin: -6px 0; border-radius: 6px; overflow: hidden; background: var(--fill); box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); flex: none; }
.pic-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.pic-thumb img:not([src]) { visibility: hidden; }
.pic-thumb.missing { opacity: .4; }
.pic-x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--danger); flex: none; }
.pic-x .gl { width: 16px; height: 16px; stroke-width: 2.4; }
.row-title .pic-mark { display: inline-block; width: 15px; height: 15px; margin-left: 6px; vertical-align: -2px; color: var(--text-3); }
.pic-view { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; opacity: 0; transition: opacity .25s ease; }
.pic-view.show { opacity: 1; }
.pic-scroll { flex: 1; overflow: auto; overscroll-behavior: contain; padding: calc(env(safe-area-inset-top) + 12px) 12px 12px; }
.pic-scroll img { display: block; width: 100%; max-width: 560px; margin: 0 auto; border-radius: 10px; transform: scale(.96); transition: transform .3s cubic-bezier(.2, .9, .3, 1); }
.pic-view.show .pic-scroll img { transform: none; }
.pic-bar { display: flex; gap: 10px; padding: 10px 16px calc(env(safe-area-inset-bottom) + 14px); }
.pic-bar button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border-radius: 14px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 16px; font-weight: 600; }
.pic-bar button:last-child { background: var(--accent); }
.pic-bar .gl { width: 19px; height: 19px; }
.amount-line { display: flex; align-items: center; justify-content: center; gap: 8px; }
.amount-input { border: 0; outline: 0; background: none; text-align: center; font-size: 46px; font-weight: 700; letter-spacing: -.03em; width: 100%; max-width: 330px; padding: 0; caret-color: var(--accent); }
.amount-input::placeholder { color: var(--text-3); }
.cur-pill { display: inline-flex; margin-top: 8px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .02em; margin: 22px 4px 8px; }
.field { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; }
.field > span { font-size: 16px; flex: none; min-width: 64px; }
.field > .ic, .field > .tick, .field > .day-dot { min-width: 0; }
.field input, .field textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; text-align: right; padding: 12px 0; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input[type="date"] { text-align: right; min-height: 44px; }
.field input[type="date"]::-webkit-date-and-time-value { text-align: right; }
.field.stacked { flex-direction: column; align-items: stretch; gap: 0; padding: 10px 16px; }
.field.stacked > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field.stacked input, .field.stacked textarea { text-align: left; padding: 4px 0 2px; }
.quick { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 0; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: none; background: var(--card); border-radius: 20px; padding: 7px 13px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); }
.quick button.on { background: var(--accent); color: #fff; }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; background: var(--card); border-radius: var(--r); padding: 16px 8px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--text-2); text-align: center; line-height: 1.2; }
.cat .ic { transition: box-shadow .15s, transform .15s; }
.cat.on { color: var(--text); font-weight: 600; }
.cat.on .ic { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--accent); }
.cat:active .ic { transform: scale(.92); }
.emojis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; background: var(--card); border-radius: var(--r); padding: 12px; }
.emojis button { display: grid; place-items: center; padding: 5px 0; border-radius: 13px; }
.emojis button .ic { transition: transform .15s, box-shadow .15s; }
.emojis button.on .ic { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--accent); }
.emojis button:active .ic { transform: scale(.92); }
.kinds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: var(--card); border-radius: var(--r); padding: 14px 6px; }
.swatches { display: flex; justify-content: space-between; background: var(--card); border-radius: var(--r); padding: 14px 16px; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; background: var(--c); transition: transform .15s, box-shadow .15s; }
.swatches button.on { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--c); }
.swatches button:active { transform: scale(.9); }

/* Account picker in the entry form */
.acc-pick { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.acc-pick::-webkit-scrollbar { display: none; }
.acc-pick button { flex: none; display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 22px; padding: 6px 14px 6px 6px; font-size: 15px; font-weight: 500; box-shadow: var(--shadow), inset 0 0 0 1.5px transparent; transition: box-shadow .15s; }
.acc-pick button.on { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); font-weight: 600; }
.hint { font-size: 13px; color: var(--text-2); margin: 8px 4px 0; line-height: 1.4; }
.actions { margin-top: 26px; }
.actions > * + * { margin-top: 10px; }

/* Toggle switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s cubic-bezier(.32, .72, 0, 1); }
.switch input:checked + i { background: #34C759; }
.switch input:checked + i::after { transform: translateX(20px); }

/* Goal detail */
.gd-hero { text-align: center; padding: 10px 0 4px; }
.gd-hero .ring, .gd-hero .ic { margin: 0 auto; }
.gd-name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 12px; }
.gd-amt { font-size: 15px; color: var(--text-2); margin-top: 4px; }
.gd-amt b { color: var(--text); font-size: 17px; }
.inline-add { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: 14px; padding: 6px 6px 6px 14px; margin-top: 12px; }
.inline-add input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 20px; font-weight: 600; }
.inline-add .btn { width: auto; height: 42px; padding: 0 18px; font-size: 16px; border-radius: 10px; }

/* ---------- Dialog (action sheet) ---------- */
.dlg-wrap { position: fixed; inset: 0; z-index: 85; display: flex; align-items: flex-end; justify-content: center; padding: 0 10px calc(env(safe-area-inset-bottom) + 10px); }
.dlg-wrap .overlay { z-index: 0; }
.dlg { position: relative; width: 100%; max-width: 420px; transform: translateY(110%); transition: transform .35s cubic-bezier(.32, .72, 0, 1); }
.dlg.show { transform: none; }
.dlg-box { background: var(--elev); border-radius: 14px; overflow: hidden; }
.dlg-msg { padding: 16px 18px 14px; text-align: center; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.dlg-msg b { display: block; font-size: 14px; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.dlg-box button { display: block; width: 100%; height: 56px; font-size: 19px; color: var(--accent); border-top: .5px solid var(--sep); }
.dlg-box button.destructive { color: var(--danger); }
.dlg-box button:active { background: var(--fill-2); }
.dlg-cancel { margin-top: 8px; font-weight: 600; }
.dlg-cancel button { border-top: 0; }

/* ---------- Lock screen ---------- */
.lock { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: env(safe-area-inset-top) 24px env(safe-area-inset-bottom); animation: fade .2s; }
.lock-ic { width: 60px; height: 60px; border-radius: 16px; overflow: hidden; margin-bottom: 18px; }
.lock-ic img { width: 100%; height: 100%; }
.lock-title { font-size: 20px; font-weight: 700; }
.lock-sub { font-size: 14px; color: var(--text-2); margin-top: 6px; min-height: 19px; text-align: center; }
.dots { display: flex; gap: 18px; margin: 26px 0 36px; }
.dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--text); transition: background .1s; }
.dots i.on { background: var(--text); }
.dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px 24px; }
.pad button { width: 76px; height: 76px; border-radius: 50%; background: var(--fill); font-size: 30px; font-weight: 500; }
.pad button:active { background: var(--text-3); }
.pad button.ghost { background: none; font-size: 16px; font-weight: 600; color: var(--accent); }
.pad button.ghost svg { width: 28px; height: 28px; margin: auto; fill: none; stroke: var(--text); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lock-foot { margin-top: 26px; }

/* ---------- Toast & banner ---------- */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 10px); z-index: 90;
  transform: translate(-50%, -160%); opacity: 0; transition: transform .35s cubic-bezier(.32, .72, 0, 1), opacity .25s;
  background: var(--elev); color: var(--text); padding: 10px 18px; border-radius: 24px;
  font-size: 14px; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, .16), 0 0 0 .5px var(--sep);
  width: max-content; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-btn { color: var(--accent); font-weight: 700; font-size: 14px; padding: 2px 0; }
.banner { display: flex; align-items: center; gap: 12px; background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; width: 100%; text-align: left; }
.banner .ic { box-shadow: none; }
.banner b { display: block; font-weight: 600; }
.banner span.s { color: var(--text-2); font-size: 13px; }
.banner.demo { background: color-mix(in srgb, var(--warn) 16%, transparent); }

/* Accounts */
.acc-card { flex: 0 0 158px; scroll-snap-align: start; text-align: left; padding: 14px; }
.acc-card .acc-name { font-size: 14px; font-weight: 600; color: var(--text-2); margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-card .acc-bal { font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-card .acc-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; white-space: nowrap; }
.acc-card.add { color: var(--accent); }
.acc-card.add .acc-name { color: var(--accent); }
.acc-hero-bal { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }

/* History filter chips */
.fchips { display: flex; align-items: center; gap: 8px; overflow-x: auto; margin: 10px -16px 4px; padding: 2px 16px 4px; scrollbar-width: none; }
.fchips::-webkit-scrollbar { display: none; }
.fchip { flex: none; padding: 6px 13px; border-radius: 16px; background: var(--card); font-size: 14px; font-weight: 500; box-shadow: var(--shadow); }
.fchip.on { background: var(--accent); color: #fff; }
.fsep { flex: none; width: 1px; height: 20px; background: var(--sep); }

/* ================= Motion ================= */
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes fill-x { from { width: 0; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes ring-in { from { stroke-dashoffset: var(--c); } }
@keyframes swap-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes slide-l { from { opacity: 0; transform: translateX(-28px); } }
@keyframes slide-r { from { opacity: 0; transform: translateX(28px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 55%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.view { animation: none; }
.view.enter > * { animation: rise .5s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
/* Another tab: the new page slides in from its side while the old one ("ghost") slides out */
.view.slide { animation: page-in .34s cubic-bezier(.2, .8, .2, 1) .07s both; }
.view.ghost { position: fixed; left: 0; right: 0; z-index: 1; pointer-events: none; animation: page-out .16s cubic-bezier(.4, 0, 1, 1) both; }
.view.ghost * { animation: none !important; } /* moving the old page's blocks would replay their entrances */
.view.ghost .chart .line.anim { stroke-dashoffset: 0; }
@keyframes page-in { from { opacity: 0; transform: translate3d(calc(var(--dir, 1) * 44px), 0, 0); } }
@keyframes page-out { to { opacity: 0; transform: translate3d(calc(var(--dir, 1) * -44px), 0, 0); } }
/* A new choice in a segmented control: what's below it slides in from that side */
.sub-in { animation: sub-in .36s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes sub-in { from { opacity: 0; transform: translate3d(calc(var(--dir, 1) * 30px), 0, 0); } }
.row.flash { animation: flash 1.6s ease-out; }
.chart .line.anim { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s cubic-bezier(.45, 0, .2, 1) forwards; }
.chart .area.anim { animation: fade-in 1s ease .25s backwards; }
.chart .end-dot.anim { transform-box: fill-box; transform-origin: center; animation: pop .45s ease .85s backwards; }
.chart .bar.anim { transform-box: fill-box; transform-origin: 50% 100%; animation: grow-y .6s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.ring-prog { animation: ring-in 1s cubic-bezier(.2, .8, .2, 1) backwards; }
.sheet.swap > * { animation: swap-in .3s cubic-bezier(.2, .8, .2, 1) backwards; }
.lock.out { animation: fade-out .25s forwards; }
.card, .btn, .banner, .row, .fchip, .quick button, .acc-pick button, .grp-pick button, .act-pick button, .dur-pick button, .pill-btn {
  transition: transform .18s cubic-bezier(.3, .7, .4, 1), background-color .2s, box-shadow .2s, opacity .2s;
}
button.card:active, .banner:active, .pill-btn:active { transform: scale(.97); }
.fchip:active, .quick button:active, .acc-pick button:active, .grp-pick button:active, .act-pick button:active, .dur-pick button:active { transform: scale(.94); }

/* ================= Shared pieces ================= */
.ic.badge { font-size: var(--fs, 13px); font-weight: 800; letter-spacing: -.02em; color: #fff; line-height: 1; }
.ic.sm.badge { font-size: calc(var(--fs, 13px) * .85); }
.ic.lg.badge { font-size: calc(var(--fs, 13px) * 1.3); }
.ic.xl.badge { font-size: calc(var(--fs, 13px) * 1.75); }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 14px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }
.pill-btn .gl { width: 16px; height: 16px; }
.pill-btn.on { background: var(--accent); color: #fff; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--fill); border-radius: 20px; padding: 3px; flex: none; }
.stepper button { width: 32px; height: 30px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); }
.stepper button:active { background: var(--card); }
.stepper .gl { width: 16px; height: 16px; stroke-width: 2.4; }
.stepper b { min-width: 46px; text-align: center; font-size: 14px; font-weight: 700; }
.stepper.sm b { min-width: 40px; font-size: 13px; }
.stepper.sm button { width: 28px; height: 28px; }
.glyph-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; background: var(--card); border-radius: var(--r); padding: 10px; }
.glyph-grid button { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); transition: background .2s, color .2s, transform .15s; }
.glyph-grid button .gl { width: 22px; height: 22px; }
.glyph-grid button.on { background: var(--c); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 40%, transparent); }
.glyph-grid button:active { transform: scale(.9); }
.swatches { flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
.swatches button { width: calc((100% - 60px) / 7); height: auto; aspect-ratio: 1; }
.cat.add { color: var(--accent); }
.cat.add .ic { background: var(--fill); box-shadow: none; }
.cat.add .ic .gl { width: 22px; height: 22px; color: var(--accent); }
.grp-pick, .act-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.grp-pick button, .act-pick button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 20px; background: var(--card); font-size: 14px; font-weight: 600; box-shadow: var(--shadow), inset 0 0 0 2px transparent; }
.grp-pick button i, .act-pick button i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); }
.grp-pick button.on, .act-pick button.on { box-shadow: var(--shadow), inset 0 0 0 2px var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--card)); }
.grp-pick.take button { transition: box-shadow .2s, background-color .2s, transform .15s; }
.grp-pick.take small { font-size: 12px; font-weight: 500; color: var(--text-2); }
.take-hint .warn-t, .hint .warn-t { color: var(--danger); font-weight: 600; }
.goal-mini .gm-open { height: 46px; display: flex; align-items: center; }
.act-pick button.free i { background: transparent; border: 1.5px dashed var(--muted); }
.act-pick button.add { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.act-pick button.add .gl { width: 16px; height: 16px; }
.dur-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.dur-pick button { padding: 8px 14px; border-radius: 20px; background: var(--card); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.dur-pick button.on { background: var(--accent); color: #fff; }
.drag { flex: none; width: 34px; height: 44px; display: grid; place-items: center; color: var(--text-3); touch-action: none; cursor: grab; }
.drag .gl { width: 20px; height: 20px; }
[data-sort] { transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
[data-sort].lifting { transition: none; position: relative; z-index: 5; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); border-radius: 14px; background: var(--card); }
.sort-list .row { padding-right: 6px; }
.sort-list .row + .row::before { left: 64px; }
.row-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; }
.sorting { user-select: none; -webkit-user-select: none; }
textarea { font: inherit; color: inherit; }
.group textarea { display: block; width: 100%; border: 0; outline: 0; background: none; resize: vertical; padding: 14px 16px; font-size: 16px; line-height: 1.5; min-height: 150px; }
.group textarea::placeholder { color: var(--text-3); }
.tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--text-3); color: transparent; transition: background .2s, box-shadow .2s; }
.tick .gl { width: 15px; height: 15px; stroke-width: 2.8; }
.tick.on { background: var(--accent); box-shadow: none; color: #fff; animation: pop .3s ease; }
.day-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--dc); flex: none; }

/* ================= Stats & report ================= */
.report-cta { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-bottom: 12px; }
.report-cta b { display: block; font-size: 16px; font-weight: 700; }
.report-cta span { font-size: 13px; color: var(--text-2); }
.rep-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px 20px; color: #fff; background: linear-gradient(135deg, #2BDDA0, #0FA57C 55%, #05705D); box-shadow: 0 12px 30px rgba(5, 112, 93, .3); }
.rep-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .3), transparent 60%); pointer-events: none; }
.rep-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.rep-title { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.rep-label { font-size: 14px; font-weight: 600; opacity: .85; margin-top: 16px; }
.rep-big { font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.rep-sub { font-size: 14px; opacity: .92; margin-top: 4px; }
.rep-hl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.rep-hl > div { background: var(--fill-2); border-radius: 14px; padding: 12px; min-width: 0; }
.rep-hl span { display: block; font-size: 12px; color: var(--text-2); font-weight: 600; }
.rep-hl b { display: block; font-size: 18px; font-weight: 700; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-hl small { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn .gl { width: 20px; height: 20px; }

/* ================= Groups ================= */
.les-card { display: block; width: 100%; text-align: left; }
.les-top { display: flex; align-items: center; gap: 14px; }
.les-big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; word-break: break-word; }
.les-big small { font-size: 15px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.les-ring { font-size: 14px; font-weight: 800; }
.les-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.les-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 14px; background: color-mix(in srgb, var(--c) 12%, transparent); font-size: 13px; font-weight: 600; }
.les-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.les-chip b { color: var(--text-2); font-weight: 600; }
.sum-card .meter { margin: 12px 0 8px; }
.grp-card { display: block; width: 100%; text-align: left; }
.grp-card .chev { margin-left: 4px; }
.roster .row { min-height: 60px; }
.pay-st { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.pay-st.paid { background: var(--good); color: #fff; animation: pop .4s ease backwards; }
.pay-st.paid .gl { width: 16px; height: 16px; stroke-width: 3; }
.pay-st.part { background: conic-gradient(var(--warn) var(--p), var(--fill) 0); }
.pay-btn { flex: none; padding: 6px 12px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.row.none .row-sub { color: var(--text-3); }
.gq { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; }
.gq b { display: block; font-size: 15px; }
.gq span { font-size: 13px; color: var(--text-2); }
.fchip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.fchip.on i { background: #fff; }

/* ================= Schedule ================= */
.sched-seg { width: 132px; }
/* Day: this week's dates in one slim row (dots = that day's lessons) */
.wstrip { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(7, 1fr); background: var(--card); border-radius: 18px; padding: 7px 4px 6px; box-shadow: var(--shadow); margin-bottom: 12px; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.wstrip button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 1px 0; }
.wstrip small { font-size: 11px; line-height: 15px; font-weight: 600; color: var(--text-2); }
.wstrip b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 600; transition: color .2s, transform .15s; }
.wstrip .today b { color: var(--accent); }
.wstrip .sel b { color: #fff; }
.wstrip button:active b { transform: scale(.9); }
/* The blue circle is its own piece: it glides from day to day, follows a finger sliding along the
   row, and moves along with a swipe of the day below */
.ws-ind { position: absolute; z-index: 0; top: 26px; left: 4px; width: calc((100% - 8px) / 7); height: 34px; pointer-events: none; transform: translateX(calc(var(--i) * 100%)); animation: seg-slide .38s cubic-bezier(.3, .8, .25, 1); transition: transform .32s cubic-bezier(.3, 1.2, .5, 1); }
.ws-ind::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 34px; margin-left: -17px; border-radius: 50%; background: var(--accent); transition: box-shadow .2s; }
.wstrip.moving .ws-ind::before { box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent); }
.wstrip.glide .sel b { animation: ws-lit .38s ease both; } /* turns white as the circle arrives */
@keyframes ws-lit { 0%, 45% { color: var(--text); } }
.wstrip.moving .sel b { color: var(--text); animation: none; }
.wstrip.moving .today b { color: var(--accent); }
.wstrip.moving .lit b { color: #fff; }
.wstrip.moving button:active b { transform: none; }
.wdots { display: flex; gap: 3px; height: 5px; }
.wdots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
/* What's on now */
.nowc { padding: 14px 16px; margin-bottom: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 16%, var(--card)), var(--card)); }
.nc-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.nc-top .r { margin-left: auto; }
.nc-badge { background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 8px; }
.nowc.free .nc-badge { background: var(--in); }
.nowc.soon .nc-badge { background: var(--fill); color: var(--text-2); }
.nc-name { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.nc-prog { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--c) 18%, transparent); margin: 10px 0; overflow: hidden; }
.nc-prog i { display: block; height: 100%; border-radius: 3px; background: var(--c); }
.nc-next { font-size: 14px; color: var(--text-2); padding-top: 10px; border-top: .5px solid var(--sep); }
.nc-next b { color: var(--text); }
.dsum { font-size: 13px; color: var(--text-2); margin: 4px 4px 8px; }
.dsum b { color: var(--text); font-weight: 600; }
/* Day: the list — the same slim row whatever the length */
.dlist { padding: 4px 0; }
.drow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 9px 16px; position: relative; text-align: left; }
.drow + .drow::before { content: ""; position: absolute; top: 0; left: 76px; right: 0; height: .5px; background: var(--sep); }
.drow:active { background: var(--fill-2); }
.dt { width: 46px; flex: none; display: flex; flex-direction: column; }
.dt b { font-size: 15px; font-weight: 700; }
.dt span { font-size: 12px; color: var(--text-2); }
.dbar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--c); flex: none; }
.dmain { flex: 1; min-width: 0; }
.dmain b { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.dmain > span { display: block; font-size: 13px; color: var(--text-2); }
.dmain em { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--danger); border-radius: 6px; padding: 2px 6px; }
.dd { font-size: 14px; font-weight: 600; color: var(--text-2); }
.drow.now { background: color-mix(in srgb, var(--c) 10%, transparent); }
.drow.free { min-height: 38px; padding-top: 5px; padding-bottom: 5px; }
.drow.free .dt b { font-size: 13px; font-weight: 600; color: var(--text-2); }
.drow.free .dbar { width: 2px; margin: 0 1px; background: repeating-linear-gradient(to bottom, var(--text-3) 0 3px, transparent 3px 6px); }
.drow.free .dmain { font-size: 13px; font-style: italic; color: var(--text-2); }
.drow.free.now { background: color-mix(in srgb, var(--in) 10%, transparent); }
.dadd { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); flex: none; }
.dadd .gl { width: 15px; height: 15px; stroke-width: 2.6; }
.dfoot { text-align: center; margin-top: 14px; }
.dfoot .link { font-size: 14px; }
/* Pages that follow the finger sideways (a day here, a month in Stats and the History calendar):
   the pages next to it (.pg-side) come in from the sides */
.pager { position: relative; touch-action: pan-y; }
.pager.from-r { animation: slide-r .35s cubic-bezier(.2, .8, .2, 1); }
.pager.from-l { animation: slide-l .35s cubic-bezier(.2, .8, .2, 1); }
.pager.paging { will-change: transform; }
.pager.settling { pointer-events: none; }
.pg-side { position: absolute; top: 0; left: 0; width: 100%; pointer-events: none; }
.pager > :first-child, .pg-side > :first-child { margin-top: 0; } /* so the pages next to it line up exactly */
.view { overflow-x: clip; } /* the pages waiting at the sides never widen the page */
/* Week: every day as a short list, with a line for each free gap */
.wday { padding: 2px 0 8px; }
.wday + .wday { margin-top: 10px; }
.wdh { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px 6px; text-align: left; }
.wdh b { font-size: 17px; font-weight: 700; }
.wdh .r { margin-left: auto; font-size: 13px; color: var(--text-2); }
.wday.today .wdh b { color: var(--accent); }
.wli { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 16px; font-size: 15px; text-align: left; }
.wli .t { width: 44px; flex: none; font-weight: 700; }
.wli i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.wli.other i { background: none; box-shadow: inset 0 0 0 2px var(--c); }
.wli .n { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wli.other .n { color: var(--text-2); }
.wli .d { color: var(--text-2); font-size: 13px; }
.wli.free { font-size: 13.5px; padding-top: 3px; padding-bottom: 3px; }
.wli.free i { width: 10px; height: 10px; background: none; border-radius: 3px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--in) 75%, transparent); }
.wli.free .n, .wli.free .d { color: var(--in-text); font-weight: 600; }
.wli:active, .wdh:active { background: var(--fill-2); }
.wdf { margin: 6px 16px 0; padding-top: 7px; border-top: .5px solid var(--sep); font-size: 12.5px; color: var(--text-2); }
.wdf b { color: var(--in-text); font-weight: 600; }
.woff { padding: 0 16px 6px; font-size: 14px; color: var(--text-2); font-style: italic; }
/* Block sheet */
.blk-preview { border-radius: 20px; padding: 16px 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, var(--card)), color-mix(in srgb, var(--c) 14%, var(--card))); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); transition: background .3s; }
.bp-time { font-size: 14px; font-weight: 700; color: var(--text-2); }
.bp-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.bp-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.blk-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.blk-days button { height: 40px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; font-weight: 700; color: var(--dc); transition: background .2s, color .2s, transform .15s, box-shadow .2s; }
.blk-days button.sib:not(.on) { box-shadow: var(--shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--dc) 55%, transparent); }
.blk-days button.on { background: var(--dc); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--dc) 35%, transparent); }
.blk-days button:active { transform: scale(.93); }
.trow { gap: 10px; }
.trow > span:first-child { flex: 1; }
.tbtn { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); touch-action: manipulation; -webkit-user-select: none; user-select: none; transition: transform .12s, background .2s; }
.tbtn .gl { width: 20px; height: 20px; stroke-width: 2.6; }
.tbtn:active { transform: scale(.9); background: color-mix(in srgb, var(--accent) 26%, transparent); }
.trow .tval { position: relative; flex: none; width: 86px; min-width: 0; text-align: center; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.tval input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; opacity: 0; cursor: pointer; }
label.tval b { border-bottom: 1.5px dashed var(--text-3); }
.blk-warn {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--warn) 14%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent);
  animation: swap-in .25s ease;
}
.blk-warn .gl { width: 20px; height: 20px; flex: none; color: var(--warn); margin-top: 1px; }
.blk-warn b { display: block; font-size: 14px; font-weight: 700; }
.blk-warn span { display: block; font-size: 13px; color: var(--text-2); margin-top: 2px; line-height: 1.35; }

/* ================= Goals ↔ balance ================= */
.alloc { margin-bottom: 0; }
.alloc + .alloc { margin-top: 12px; }
.al-total { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.al-bar { display: flex; gap: 2px; overflow: hidden; height: 16px; border-radius: 8px; margin: 12px 0 10px; }
.al-bar i { display: block; height: 100%; background: var(--c); flex: none; animation: fill-x .8s cubic-bezier(.2, .8, .2, 1) backwards; }
.al-bar i.free { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--in) 40%, transparent) 0 5px, color-mix(in srgb, var(--in) 18%, transparent) 5px 10px); box-shadow: none; }
.al-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); }
.al-legend span { display: inline-flex; align-items: center; gap: 6px; }
.al-legend b { color: var(--text); font-weight: 700; }
.al-legend i { width: 10px; height: 10px; border-radius: 3px; }
.al-legend i.g { background: linear-gradient(90deg, #FF3B30, #007AFF, #34C759); }
.al-legend i.f { background: color-mix(in srgb, var(--in) 45%, transparent); }
.mv-sub { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.mv-sub b { color: var(--text); }
.mv-chips { flex-wrap: wrap; margin: 4px 0 0; padding-top: 4px; }
.mv-chips button { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: none; }
.banner.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.btn.soft .gl { width: 20px; height: 20px; }
/* A goal as one bar: already paid (darker) · in the envelope · still needed (empty) */
.g3 { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--fill); margin: 14px 0 10px; }
.g3.big { height: 14px; border-radius: 7px; margin-top: 2px; }
.g3 i { display: block; height: 100%; flex: none; animation: fill-x .9s cubic-bezier(.2, .8, .2, 1) backwards; }
.g3-leg { display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.g3-leg.open { margin-top: 14px; }
.g3-leg div { display: flex; align-items: center; gap: 8px; }
.g3-leg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.g3-leg b { margin-left: auto; color: var(--text); font-weight: 600; white-space: nowrap; }
.gl-last { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--text); }
.gl-last > span { flex: 1; }

/* ================= Home: one total ================= */
.split-h { margin-top: 14px; }
.split { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; margin: 8px 0 10px; }
.split i { display: block; height: 100%; min-width: 3px; flex: none; animation: fill-x .8s cubic-bezier(.2, .8, .2, 1) backwards; }
.split-leg { display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.split-leg div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.split-leg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.split-leg b { margin-left: auto; color: var(--text); font-weight: 600; white-space: nowrap; }
.split-leg .muted { color: var(--text-3); white-space: nowrap; }
.mon-card { display: block; width: 100%; text-align: left; }
.mon3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mon3 span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); }
.mon3 b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; }
.mon3 b.in { color: var(--in-text); }
.mon-prev { font-size: 12.5px; color: var(--text-2); margin-top: 10px; padding-top: 10px; border-top: .5px solid var(--sep); }

/* ================= Stats: where the money went, as a ring ================= */
.donut { position: relative; display: flex; justify-content: center; margin: 14px 0 6px; }
.donut svg { animation: donut-in .6s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes donut-in { from { opacity: 0; transform: rotate(-60deg) scale(.92); } }
.pg-side .donut svg, .view.ghost .donut svg { animation: none; }
.donut-c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-c b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.donut-c span { font-size: 12px; color: var(--text-2); }
.leg-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 0; font-size: 15px; text-align: left; }
.leg-row + .leg-row { border-top: .5px solid var(--sep); }
.leg-row > i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.leg-row .n { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-row b { font-weight: 600; white-space: nowrap; }
.leg-row .p { width: 38px; text-align: right; font-size: 13px; color: var(--text-2); }
.leg-row .chev, .chev-sp { width: 14px; flex: none; }
button.leg-row:active { opacity: .6; }

/* ================= History: calendar ================= */
.cal-nav { margin: 14px 0 8px; }
.cal-top { display: flex; align-items: center; gap: 8px; margin: 14px 0 2px; min-height: 36px; }
.cal-title { display: flex; align-items: center; gap: 5px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--text); background: none; border: 0; padding: 0; }
.cal-title span { color: var(--accent); }
.cal-title .gl { width: 16px; height: 16px; color: var(--accent); }
.cal-today { font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 6px 11px; }
.cal-top .cal-mode, .cal-top .yr-arrows { margin-left: auto; }
.cal-top .cal-mode { flex: none; width: 168px; }
.yr-arrows { display: flex; gap: 8px; }
.yr-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--accent); }
.cal-sum { font-size: 13px; color: var(--text-2); margin: 2px 0 10px; }
.cal-sum b { color: var(--text); font-weight: 600; }
.cal-h.we { color: color-mix(in srgb, var(--out) 70%, var(--text-2)); }
.cal-d.hol b { color: var(--danger); }
.cal.plain .cal-d { background: none; box-shadow: none; min-height: 50px; gap: 4px; padding: 3px 0 0; }
.cal.plain .cal-d b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 500; transition: background .2s, color .2s, box-shadow .2s; }
.cal.plain .cal-d.we:not(.hol) b { color: var(--text-2); }
.cal.plain .cal-d.today b { background: var(--accent); color: #fff; font-weight: 700; }
.cal.plain .cal-d.sel { background: none; box-shadow: none; }
.cal.plain .cal-d.sel b { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); font-weight: 700; }
.cal.plain .cal-d.today.sel b { box-shadow: none; color: #fff; }
.cal.plain .cal-d.fut { opacity: 1; }
.cal-dots { display: flex; gap: 3px; height: 5px; }
.cal-dots i, .cal-key i { width: 5px; height: 5px; border-radius: 50%; }
.cal-key i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; vertical-align: 1px; }
.cal-key span { margin-right: 12px; }
.cal-dots .o, .cal-key .o { background: var(--out); }
.cal-dots .g, .cal-key .g { background: var(--in); }
.cal-key .r { background: var(--danger); }
.cal.money .cal-d { background: color-mix(in srgb, var(--out) calc(var(--h, 0) * 62%), var(--card)); justify-content: center; min-height: 54px; gap: 1px; padding: 4px 1px; }
.cal.money .cal-d small { color: var(--text); opacity: .75; }
.cal.money .cal-d.hot b, .cal.money .cal-d.hot small { color: #fff; opacity: 1; }
.cal.money .cal-d.fut { opacity: 1; background: none; box-shadow: none; }
.cal.money .cal-d.fut b { color: var(--text-2); font-weight: 500; }
.cal.money .cal-d.fut.hol b { color: var(--danger); }
.cal.money .cal-d.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal.money .cal-d.sel { background: color-mix(in srgb, var(--out) calc(var(--h, 0) * 62%), var(--card)); box-shadow: inset 0 0 0 2px var(--text); }
.cal.money .cal-d.today.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-heat i { display: inline-block; width: 64px; height: 8px; border-radius: 99px; margin: 0 4px; vertical-align: 0; background: linear-gradient(90deg, var(--card), var(--out)); box-shadow: inset 0 0 0 .5px var(--sep); }
.cal-hol { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: color-mix(in srgb, var(--danger) 10%, var(--card)); }
.cal-hol b { color: var(--danger); font-weight: 600; }
.cal-fade { animation: cal-fade .28s ease-out; }
.cal-zoom-in { animation: cal-zoom-in .3s cubic-bezier(.2, .8, .2, 1); }
.cal-zoom-out { animation: cal-zoom-out .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes cal-fade { from { opacity: .35; } }
@keyframes cal-zoom-in { from { opacity: 0; transform: scale(.9); } }
@keyframes cal-zoom-out { from { opacity: 0; transform: scale(1.08); } }
.yr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; margin-top: 6px; }
.yr-m { display: flex; flex-direction: column; align-items: stretch; text-align: left; background: none; border: 0; padding: 6px; margin: -6px; border-radius: 12px; color: var(--text); transition: background .15s, transform .12s; }
.yr-m:active { transform: scale(.96); background: var(--fill); }
.yr-m.now { box-shadow: inset 0 0 0 1.5px var(--accent); }
.yr-n { font-size: 15px; font-weight: 700; color: var(--accent); }
.yr-m.past .yr-n { color: var(--text); }
.yr-o { font-size: 10.5px; font-weight: 600; color: var(--out); height: 14px; margin-bottom: 2px; }
.yr-g { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 1px; }
.yr-g b { font-size: 9px; font-weight: 500; text-align: center; height: 13px; line-height: 13px; border-radius: 50%; }
.yr-g b.h { color: var(--danger); font-weight: 700; }
.yr-g b.t { background: var(--accent); color: #fff; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .cal-fade, .cal-zoom-in, .cal-zoom-out { animation: none; } }
.cal-t { text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { font-size: 11px; font-weight: 600; color: var(--text-2); text-align: center; padding: 0 0 4px; }
.cal-d { min-height: 54px; border-radius: 10px; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 1px 4px; transition: background .2s, box-shadow .2s, transform .12s; }
.cal-d b { font-size: 14px; font-weight: 600; }
.cal-d small { font-size: 10px; font-weight: 600; color: var(--out); letter-spacing: -.02em; white-space: nowrap; }
.cal-in { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--in); }
.cal-d.today b { color: var(--accent); }
.cal-d.sel { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-d.fut { opacity: .4; }
.cal-d:active { transform: scale(.94); }
.cal-key { margin: 8px 4px 0; }
.cal-k-out { color: var(--out); font-weight: 600; }
.cal-none { text-align: center; margin: 22px 0 0; }

/* ================= Entry form: "Again?" ================= */
.again button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 13px; border-radius: 14px; text-align: left; }
.again button b { font-weight: 600; }
.again button small { font-size: 12px; color: var(--text-2); font-weight: 500; }
.again button.on small { color: rgba(255, 255, 255, .82); }

/* Phone turned sideways: a slimmer tab bar leaves more room for the table */
@media (max-height: 500px) {
  .tabs { height: 50px; }
  .tabs button span { display: none; }
  .tab-ind { border-radius: 20px; }
  .fab { width: 50px; height: 50px; }
  .view { padding-bottom: calc(env(safe-area-inset-bottom) + 90px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}

/* Split money in: the bar in its sheet glides to new sizes; the box in the Money in form */
.split.still i { animation: none; transition: width .35s cubic-bezier(.2, .9, .3, 1), min-width .35s; }
.split-box #split-lines span { display: block; margin-top: 3px; }
.split-box #split-lines b { display: inline; font-size: inherit; color: var(--text); }
#split-lines { transition: opacity .2s; }
#split-lines.off { opacity: .55; }
.link.inl { font-size: inherit; padding: 0; }
.row.dim { opacity: .55; }
.stepper b.bump { animation: split-bump .3s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes split-bump { 40% { transform: scale(1.18); } }

/* A page put back on the screen (after the other tabs were prepared, or coming back to a tab) keeps
   its finished look: nothing inside it plays its entrance animation again. */
.view.settled *, .view.settled *::before, .view.settled *::after { animation: none !important; }
.view.settled .chart .line.anim { stroke-dashoffset: 0; }

/* ---------- Geometric look (matches the app icon): the icon's circles in the corner of the balance card
   and of the small account and goal cards; a yellow ring around the + button ---------- */
.hero-card { background:
  radial-gradient(circle at calc(100% - 20px) 2px, var(--geo-y) 0 44px, transparent 45px),
  radial-gradient(circle at calc(100% - 74px) -14px, var(--geo-g) 0 46px, transparent 47px),
  radial-gradient(circle at calc(100% + 6px) 58px, var(--geo-t) 0 30px, transparent 31px), var(--card); }
.acc-card, .goal-mini { position: relative; overflow: hidden; }
.acc-card > *, .goal-mini > * { position: relative; z-index: 1; }
.acc-card::after, .goal-mini::after { content: ""; position: absolute; right: -22px; top: -22px; width: 64px; height: 64px; border-radius: 50%; background: var(--geo-c, var(--geo-y2)); pointer-events: none; }
.strip > .card:nth-child(3n+2) { --geo-c: var(--geo-g2); }
.strip > .card:nth-child(3n) { --geo-c: var(--geo-t2); }
.acc-card.add::after, .goal-mini.add::after { display: none; }
.fab { box-shadow: 0 0 0 5px var(--geo-ring), 0 10px 26px color-mix(in srgb, var(--accent) 40%, transparent), 0 2px 4px rgba(0, 0, 0, .1); }
