/* Scrooge design system. Terracotta and cream, warm in both themes. */
@font-face { font-family: 'Figtree'; src: url('../fonts/figtree.woff2') format('woff2'); font-weight: 300 900; font-style: normal; font-display: swap; }

:root {
  /* colour */
  --cream: #F5E9D8;          /* page */
  --surface: #FBF3E6;        /* cards */
  --raised: #FFF9EF;         /* sheets, inputs */
  --sand: #EBDAC2;           /* tracks, quiet fills */
  --sand-deep: #DFC9AB;
  --line: rgba(110, 72, 46, .12);
  --ink: #3A2920;            /* primary text, espresso */
  --taupe: #806C5E;          /* secondary text */
  --taupe-soft: #A8968A;
  --terracotta: #BD5D3A;
  --terracotta-soft: #E9C4AE;
  --terracotta-wash: #F3DCCB;
  --clay: #8A3D29;           /* overspend, deeper and muted */
  --clay-wash: #EACBBB;
  --sage: #6F7F52;           /* positive */
  --sage-wash: #DDE3C8;
  --on-accent: #FFF4E6;
  --hero-a: #CB6E47; --hero-b: #B04F2D; --hero-glow: rgba(255, 226, 190, .38);
  --scrim: rgba(58, 41, 32, .38);

  /* type */
  --font: 'Figtree', ui-rounded, -apple-system, 'Helvetica Neue', sans-serif;
  --t-xs: 12px; --t-sm: 14px; --t-md: 16px; --t-lg: 19px; --t-xl: 24px; --t-2xl: 32px; --t-3xl: 44px; --t-hero: 58px;

  /* space, radii */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 44px;
  --r-sm: 12px; --r-md: 18px; --r-lg: 26px; --r-xl: 34px; --r-pill: 999px;

  /* shadows, warm and layered */
  --sh-1: 0 1px 2px rgba(98, 60, 36, .06), 0 4px 12px rgba(98, 60, 36, .06);
  --sh-2: 0 2px 4px rgba(98, 60, 36, .06), 0 12px 28px rgba(98, 60, 36, .10);
  --sh-3: 0 4px 10px rgba(98, 60, 36, .10), 0 24px 48px rgba(98, 60, 36, .18);
  --sh-accent: 0 6px 14px rgba(176, 79, 45, .30), 0 18px 36px rgba(176, 79, 45, .22);

  /* motion */
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --fast: 140ms; --mid: 280ms; --slow: 640ms;

  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #1F1611; --surface: #2A1E17; --raised: #35261D; --sand: #43332A; --sand-deep: #54412F;
    --line: rgba(243, 228, 208, .09);
    --ink: #F3E4D0; --taupe: #BDA791; --taupe-soft: #8E7B6B;
    --terracotta: #DD8458; --terracotta-soft: #6E3B27; --terracotta-wash: #4A2B1E;
    --clay: #C0664A; --clay-wash: #4D2A1F;
    --sage: #A9B787; --sage-wash: #363C28;
    --on-accent: #FFF1E0;
    --hero-a: #A9522F; --hero-b: #713320; --hero-glow: rgba(255, 190, 130, .22);
    --scrim: rgba(12, 8, 6, .6);
    --sh-1: 0 1px 2px rgba(0, 0, 0, .25), 0 4px 12px rgba(0, 0, 0, .22);
    --sh-2: 0 2px 4px rgba(0, 0, 0, .25), 0 12px 28px rgba(0, 0, 0, .32);
    --sh-3: 0 4px 10px rgba(0, 0, 0, .3), 0 24px 48px rgba(0, 0, 0, .45);
    --sh-accent: 0 6px 14px rgba(0, 0, 0, .35), 0 18px 40px rgba(221, 132, 88, .16);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--cream); color: var(--ink); font-family: var(--font); font-size: var(--t-md); line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overscroll-behavior: none; overflow: hidden;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea { -webkit-user-select: text; user-select: text; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; letter-spacing: -.01em; }
.muted { color: var(--taupe); } .small { font-size: var(--t-sm); } .xs { font-size: var(--t-xs); }
.pos { color: var(--sage); } .neg { color: var(--clay); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }

/* ---------- shell ---------- */
#app { position: fixed; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding: calc(var(--safe-t) + var(--s4)) var(--s5) calc(var(--safe-b) + var(--tabbar-h) + var(--s8)); }
.screen { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s4); }
.screen-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s1) 0; }
.screen-head h1 { margin: 0; font-size: var(--t-2xl); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.screen-head p { margin: 4px 0 0; color: var(--taupe); font-size: var(--t-sm); }
.enter > * { animation: rise var(--mid) var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: 40ms; } .enter > *:nth-child(3) { animation-delay: 80ms; } .enter > *:nth-child(n+4) { animation-delay: 120ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0 var(--s4) calc(var(--safe-b) + 10px); pointer-events: none; }
.tabbar-inner { pointer-events: auto; max-width: 480px; margin: 0 auto; height: var(--tabbar-h); display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: center;
  background: var(--raised); background: color-mix(in srgb, var(--raised) 86%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  border-radius: var(--r-xl); box-shadow: var(--sh-2); border: 1px solid var(--line); }
.tab { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--taupe-soft); font-size: 11px; font-weight: 600; transition: color var(--fast), transform var(--mid) var(--spring); }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--terracotta); }
.tab:active { transform: scale(.9); }
.tab-add { justify-self: center; width: 62px; height: 62px; margin-top: -26px; border-radius: 50%; color: var(--on-accent);
  background: linear-gradient(155deg, var(--hero-a), var(--hero-b)); box-shadow: var(--sh-accent); display: grid; place-items: center; transition: transform var(--mid) var(--spring); border: 4px solid var(--cream); }
.tab-add svg { width: 28px; height: 28px; }
.tab-add:active { transform: scale(.88) rotate(45deg); }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--sh-1); border: 1px solid var(--line); }
.card.flush { padding: var(--s2) 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s3); gap: var(--s3); }
.card-head h2 { margin: 0; font-size: var(--t-lg); font-weight: 700; letter-spacing: -.015em; }
.link { color: var(--terracotta); font-weight: 600; font-size: var(--t-sm); padding: 8px 0 8px 12px; }
.section-label { font-size: var(--t-sm); font-weight: 600; color: var(--taupe); padding: var(--s2) var(--s1) 0; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: var(--s6) var(--s5) var(--s5); color: var(--on-accent);
  background: radial-gradient(120% 90% at 12% 0%, var(--hero-glow), transparent 55%), linear-gradient(160deg, var(--hero-a), var(--hero-b)); box-shadow: var(--sh-accent); }
.hero::after { content: ''; position: absolute; inset: 0; opacity: .16; mix-blend-mode: soft-light; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; gap: var(--s4); margin-top: var(--s5); }
.ring { width: 104px; height: 104px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring .track { stroke: rgba(255, 244, 230, .22); }
.ring .fill { stroke: var(--on-accent); transition: stroke-dashoffset var(--slow) var(--ease); }
.ring .fill.over { stroke: #4F2013; }
.ring-mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: var(--t-xs); font-weight: 600; line-height: 1.15; opacity: .92; }
.ring-mid b { display: block; font-size: var(--t-xl); font-weight: 700; letter-spacing: -.02em; }
.hero-figs { min-width: 0; flex: 1; }
.hero-label { font-size: var(--t-sm); font-weight: 600; opacity: .86; }
.hero-num { font-size: 54px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; margin: 2px 0 6px; white-space: nowrap; }
.hero-num.tight { font-size: 42px; }
.hero-sub { font-size: var(--t-sm); opacity: .9; }
.hero-split { display: grid; gap: var(--s2); flex: 1; min-width: 0; }
.hero-split div { background: rgba(255, 244, 230, .13); border-radius: var(--r-md); padding: 8px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hero-split span { font-size: var(--t-xs); font-weight: 600; opacity: .85; line-height: 1.2; }
.hero-split b { font-size: var(--t-md); font-weight: 700; white-space: nowrap; }

/* rows */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: var(--s3); padding: 12px var(--s5); min-height: 60px; width: 100%; text-align: left; transition: transform var(--mid) var(--spring), background var(--fast); }
.row + .row { border-top: 1px solid var(--line); }
button.row:active { transform: scale(.98); background: var(--sand); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: var(--t-sm); color: var(--taupe); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-amt { font-weight: 700; white-space: nowrap; text-align: right; }
.row-amt small { display: block; font-weight: 500; color: var(--taupe); font-size: var(--t-xs); }
.dot { width: 40px; height: 40px; flex: none; border-radius: 14px; display: grid; place-items: center; font-weight: 700; font-size: var(--t-sm); background: var(--terracotta-wash); color: var(--terracotta); }
.dot svg { width: 20px; height: 20px; }
.dot.everyday { background: var(--sand); color: var(--taupe); }
.dot.income { background: var(--sage-wash); color: var(--sage); }
.dot.neutral { background: var(--sand); color: var(--taupe); }
.chev { color: var(--taupe-soft); flex: none; }

/* progress bars */
.bar { height: 10px; border-radius: var(--r-pill); background: var(--sand); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--terracotta); width: 0; transition: width var(--slow) var(--ease); }
.bar.ok > i { background: var(--sage); } .bar.warn > i { background: var(--terracotta); } .bar.over > i { background: var(--clay); }
.bar.tall { height: 14px; }
.pace { position: relative; margin: var(--s3) 0 var(--s2); }
.pace .marker { position: absolute; top: -5px; bottom: -5px; width: 3px; border-radius: 2px; background: var(--ink); opacity: .55; transform: translateX(-1px); transition: left var(--slow) var(--ease); }
.budget-line { padding: 12px var(--s5); width: 100%; text-align: left; display: block; }
.budget-line + .budget-line { border-top: 1px solid var(--line); }
.budget-line .top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin-bottom: 8px; }
.budget-line .top b { font-weight: 600; } .budget-line .top span { font-size: var(--t-sm); color: var(--taupe); white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s2); margin-top: var(--s4); }
.stat { background: var(--sand); border-radius: var(--r-md); padding: 10px 12px; }
.stat span { display: block; font-size: var(--t-xs); color: var(--taupe); font-weight: 600; }
.stat b { font-size: var(--t-md); font-weight: 700; }
.verdict { display: flex; gap: var(--s3); align-items: center; border-radius: var(--r-md); padding: 12px 14px; margin-top: var(--s3); font-weight: 600; font-size: var(--t-sm); }
.verdict.ontrack { background: var(--sage-wash); color: var(--sage); } .verdict.short { background: var(--terracotta-wash); color: var(--terracotta); } .verdict.deficit { background: var(--clay-wash); color: var(--clay); }
.verdict svg { flex: none; width: 22px; height: 22px; }

/* buttons, chips */
.btn { min-height: 52px; padding: 0 var(--s5); border-radius: var(--r-md); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--sand); color: var(--ink);
  transition: transform var(--mid) var(--spring), opacity var(--fast); }
.btn:active { transform: scale(.95); }
.btn.primary { background: linear-gradient(160deg, var(--hero-a), var(--hero-b)); color: var(--on-accent); box-shadow: var(--sh-accent); }
.btn.sage { background: var(--sage); color: var(--raised); }
.btn.ghost { background: transparent; color: var(--terracotta); }
.btn.danger { background: var(--clay-wash); color: var(--clay); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: var(--t-sm); border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .4; box-shadow: none; pointer-events: none; }
.btn-row { display: flex; gap: var(--s2); } .btn-row .btn { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--s5)); padding: 2px var(--s5); scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { min-height: 42px; padding: 0 16px; border-radius: var(--r-pill); background: var(--sand); color: var(--ink); font-weight: 600; font-size: var(--t-sm); white-space: nowrap; flex: none;
  transition: transform var(--mid) var(--spring), background var(--fast), color var(--fast); display: inline-flex; align-items: center; gap: 6px; }
.chip:active { transform: scale(.93); }
.chip.on { background: var(--terracotta); color: var(--on-accent); box-shadow: 0 4px 12px rgba(176, 79, 45, .28); }
.chip.soft { background: transparent; border: 1.5px dashed var(--sand-deep); color: var(--taupe); }
.chip .k { width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); } .chip.on .k { background: var(--on-accent); } .chip .k.everyday { background: var(--taupe-soft); } .chip .k.income { background: var(--sage); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sand); border-radius: var(--r-md); padding: 4px; gap: 4px; }
.seg button { min-height: 40px; border-radius: 14px; font-weight: 600; font-size: var(--t-sm); color: var(--taupe); transition: background var(--fast), color var(--fast), transform var(--mid) var(--spring); padding: 0 6px; }
.seg button.on { background: var(--raised); color: var(--ink); box-shadow: var(--sh-1); }
.seg button:active { transform: scale(.96); }

/* banners, empty states */
.banner { display: flex; gap: var(--s3); align-items: center; border-radius: var(--r-lg); padding: 14px var(--s4); background: var(--terracotta-wash); color: var(--ink); font-size: var(--t-sm); }
.banner.sage { background: var(--sage-wash); } .banner.clay { background: var(--clay-wash); }
.banner p { margin: 0; flex: 1; } .banner b { display: block; font-size: var(--t-md); }
.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--taupe); }
.empty .glyph { width: 72px; height: 72px; margin: 0 auto var(--s4); border-radius: 26px; background: var(--sand); display: grid; place-items: center; font-size: 32px; }
.empty h3 { margin: 0 0 6px; color: var(--ink); font-size: var(--t-lg); } .empty p { margin: 0 auto; max-width: 30ch; font-size: var(--t-sm); }
.empty .btn { margin-top: var(--s4); }

/* due prompts */
.due { padding: 14px var(--s5); } .due + .due { border-top: 1px solid var(--line); }
.due-top { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; }
.due-top b { font-weight: 600; } .due .btn-row { margin-top: 10px; }
.tagline { font-size: var(--t-xs); font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); background: var(--sand); color: var(--taupe); white-space: nowrap; }
.tagline.clay { background: var(--clay-wash); color: var(--clay); } .tagline.sage { background: var(--sage-wash); color: var(--sage); } .tagline.terra { background: var(--terracotta-wash); color: var(--terracotta); }

/* ---------- sheets ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; transition: opacity var(--mid) var(--ease); }
.backdrop.in { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: calc(100% - var(--safe-t) - 12px); display: flex; flex-direction: column; background: var(--cream);
  border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--sh-3); transform: translateY(104%); transition: transform 420ms var(--ease); max-width: 560px; margin: 0 auto; }
.sheet.in { transform: none; }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--sand-deep); margin: 10px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px var(--s5) 8px; flex: none; gap: var(--s3); }
.sheet-head h2 { margin: 0; font-size: var(--t-xl); font-weight: 700; letter-spacing: -.02em; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: var(--s2) var(--s5) calc(var(--safe-b) + var(--s5)); display: flex; flex-direction: column; gap: var(--s4); }
.sheet-body > * { flex: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); color: var(--taupe); flex: none; transition: transform var(--mid) var(--spring); }
.icon-btn:active { transform: scale(.88); }
.icon-btn svg { width: 20px; height: 20px; }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: var(--t-sm); font-weight: 600; color: var(--taupe); padding-left: 4px; }
.field .hint { font-size: var(--t-xs); color: var(--taupe); padding-left: 4px; }
.input { width: 100%; min-height: 52px; border-radius: var(--r-md); border: 1.5px solid transparent; background: var(--raised); padding: 0 var(--s4); font-size: var(--t-md); font-weight: 500; box-shadow: inset 0 1px 2px rgba(98, 60, 36, .08); outline: none; -webkit-appearance: none; appearance: none; transition: border-color var(--fast); }
.input:focus { border-color: var(--terracotta); }
.input::placeholder { color: var(--taupe-soft); }
.input.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.money-wrap { position: relative; } .money-wrap span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--taupe); } .money-wrap .input { padding-left: 38px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 52px; padding: 0 4px; font-weight: 600; }
.switch input { appearance: none; -webkit-appearance: none; width: 54px; height: 32px; border-radius: 16px; background: var(--sand-deep); position: relative; transition: background var(--mid); flex: none; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--raised); box-shadow: var(--sh-1); transition: transform var(--mid) var(--spring); }
.switch input:checked { background: var(--sage); } .switch input:checked::after { transform: translateX(22px); }

/* add spend */
.add-amount { text-align: center; padding: var(--s2) 0 0; }
.add-amount .value { font-size: var(--t-hero); font-weight: 700; letter-spacing: -.04em; line-height: 1.05; transition: transform var(--fast) var(--spring); display: inline-block; }
.add-amount .value.bump { transform: scale(1.04); }
.add-amount .value .cur { font-size: .5em; font-weight: 600; color: var(--taupe); margin-right: 6px; vertical-align: .42em; letter-spacing: 0; }
.add-amount .value.zero { color: var(--taupe-soft); }
.add-amount .ctx { min-height: 20px; font-size: var(--t-sm); color: var(--taupe); margin-top: 2px; }
.cat-wrap { max-height: 158px; overflow-y: auto; margin: 0 calc(-1 * var(--s5)); padding: 2px var(--s5); -webkit-overflow-scrolling: touch; }
.cat-wrap.open { max-height: 230px; }
.cat-wrap { -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); padding-bottom: 14px; }
.detail-pills { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--s5)); padding: 0 var(--s5); scrollbar-width: none; }
.detail-pills::-webkit-scrollbar { display: none; }
.pill { flex: none; min-height: 38px; padding: 0 14px; border-radius: var(--r-pill); border: 1.5px solid var(--sand-deep); color: var(--taupe); font-size: var(--t-sm); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform var(--mid) var(--spring); }
.pill.set { border-color: transparent; background: var(--terracotta-wash); color: var(--terracotta); }
.pill:active { transform: scale(.94); }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numpad button { height: 58px; border-radius: var(--r-md); background: var(--surface); font-size: 26px; font-weight: 600; box-shadow: var(--sh-1); border: 1px solid var(--line); transition: transform var(--fast) var(--spring), background var(--fast); font-variant-numeric: tabular-nums; }
.numpad button:active { transform: scale(.92); background: var(--sand); }
.numpad button.quiet { background: transparent; box-shadow: none; border-color: transparent; color: var(--taupe); display: grid; place-items: center; }
.numpad svg { width: 26px; height: 26px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button { padding: 8px 12px; border-radius: var(--r-pill); background: var(--sand); font-size: var(--t-sm); font-weight: 600; color: var(--taupe); }

/* toast */
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 10px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 var(--s4); }
.toast { pointer-events: auto; max-width: 440px; width: fit-content; background: var(--ink); color: var(--cream); padding: 12px 18px; border-radius: var(--r-lg); box-shadow: var(--sh-3); font-weight: 600; font-size: var(--t-sm); display: flex; gap: 10px; align-items: center; animation: drop 420ms var(--spring) both; }
.toast.out { animation: lift var(--mid) var(--ease) both; }
.toast.sage { background: var(--sage); color: var(--raised); } .toast.clay { background: var(--clay); color: var(--on-accent); } .toast.terra { background: var(--terracotta); color: var(--on-accent); }
.toast svg { width: 20px; height: 20px; flex: none; }
@keyframes drop { from { opacity: 0; transform: translateY(-24px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes lift { to { opacity: 0; transform: translateY(-16px); } }

/* ledger */
.search { position: relative; } .search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--taupe-soft); } .search .input { padding-left: 46px; border-radius: var(--r-pill); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: var(--s3) var(--s1) 0; font-size: var(--t-sm); font-weight: 600; color: var(--taupe); }

/* onboarding */
.ob { position: fixed; inset: 0; z-index: 30; background: var(--cream); display: flex; flex-direction: column; padding: calc(var(--safe-t) + var(--s4)) 0 0; }
.ob-progress { display: flex; gap: 6px; padding: 0 var(--s5); } .ob-progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--sand); transition: background var(--mid); } .ob-progress i.on { background: var(--terracotta); }
.ob-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: var(--s6) var(--s5) var(--s5); display: flex; flex-direction: column; gap: var(--s4); max-width: 560px; width: 100%; margin: 0 auto; }
.ob-body h1 { margin: 0; font-size: var(--t-2xl); letter-spacing: -.03em; line-height: 1.12; font-weight: 700; }
.ob-body > p { margin: 0; color: var(--taupe); }
.ob-foot { flex: none; padding: var(--s3) var(--s5) calc(var(--safe-b) + var(--s4)); display: flex; gap: var(--s2); max-width: 560px; width: 100%; margin: 0 auto; background: linear-gradient(to top, var(--cream) 70%, transparent); }
.ob-foot .btn.primary { flex: 1; }
.ob-hero { margin: var(--s6) auto var(--s2); width: 132px; height: 132px; border-radius: 44px; display: grid; place-items: center; font-size: 68px; background: radial-gradient(120% 90% at 12% 0%, var(--hero-glow), transparent 55%), linear-gradient(160deg, var(--hero-a), var(--hero-b)); box-shadow: var(--sh-accent); animation: pop 700ms var(--spring) both; }
@keyframes pop { from { transform: scale(.6) rotate(-8deg); opacity: 0; } }
.line-edit { display: grid; grid-template-columns: 1fr 128px; gap: var(--s2); align-items: center; padding: 6px 0; }
.line-edit .name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-edit .name small { display: block; white-space: normal; line-height: 1.25; color: var(--taupe); font-weight: 500; font-size: var(--t-xs); }
.line-edit .input { min-height: 46px; text-align: right; }
.sum-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4) var(--s5); box-shadow: var(--sh-1); }
.sum-box .r { display: flex; justify-content: space-between; padding: 5px 0; } .sum-box .r.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: var(--t-lg); }
.steps { counter-reset: st; display: flex; flex-direction: column; gap: var(--s3); padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: st; display: flex; gap: var(--s3); font-size: var(--t-sm); line-height: 1.45; }
.steps li::before { content: counter(st); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--terracotta-wash); color: var(--terracotta); font-weight: 700; display: grid; place-items: center; font-size: var(--t-sm); }

/* saved bloom */
.bloom { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; pointer-events: none; }
.bloom i { width: 96px; height: 96px; border-radius: 50%; background: var(--sage); display: grid; place-items: center; color: var(--raised); animation: bloom 720ms var(--spring) both; box-shadow: var(--sh-3); }
.bloom svg { width: 46px; height: 46px; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 360ms 160ms var(--ease) forwards; }
@keyframes bloom { 0% { transform: scale(.2); opacity: 0; } 45% { transform: scale(1); opacity: 1; } 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.15); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

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