/* Копилка — светлый минимализм (вариант B); тёмная тема — сама, по настройке телефона */
:root {
  color-scheme:light dark;
  --bg:#f6f4ef; --ink:#141414; --muted:#8a867d; --card:#fff; --line:#ece8e0; --line2:#e2ded5;
  --acc:#1f7a55; --acc-soft:#e4efe8; --neg:#b4492f; --neg-soft:#f6e6e0; --soft:#f1eee8; --seg:#ebe8e1;
  --on-ink:#fff; --track:#efebe4; --bar:#9a958b; --bar2:#d3cec4; --faint:#c4bfb4; --ph:#b3aea4;
  --tabbar:rgba(255,255,255,.92); --toast:#1b1b1b; --dim:rgba(20,20,20,.28);
  --h1:#ebe7df; --h2:#d6d0c5; --h3:#a9a397; --h4:#57534c; --h3t:#fff; --h4t:#fff;
  --shadow:0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(40,30,10,.06);
  --font:'Onest', -apple-system, system-ui, 'Segoe UI', sans-serif;
  --sat:env(safe-area-inset-top, 0px); --sab:env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#121211; --ink:#f2f0ea; --muted:#9a968d; --card:#1d1d1b; --line:#2a2926; --line2:#383632;
    --acc:#4cbb86; --acc-soft:rgba(76,187,134,.16); --neg:#ee8b6f; --neg-soft:rgba(238,139,111,.16); --soft:#282724; --seg:#24231f;
    --on-ink:#121211; --track:#2b2a27; --bar:#77736a; --bar2:#45423d; --faint:#5c5851; --ph:#6a665e;
    --tabbar:rgba(22,22,21,.9); --toast:#2e2d2a; --dim:rgba(0,0,0,.55);
    --h1:#2c2b28; --h2:#4a4741; --h3:#8d887e; --h4:#dcd7cc; --h3t:#121211; --h4t:#121211;
    --shadow:0 1px 2px rgba(0,0,0,.45);
  }
  .ic[style] svg.i, .chip[style]:not(.on) svg.i, .donut .dc svg.i, .badges svg.i { filter:brightness(1.4) saturate(.9); }
}
* { box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html { background:var(--bg); -webkit-text-size-adjust:100%; }
body { font-family:var(--font); color:var(--ink); background:var(--bg); -webkit-font-smoothing:antialiased; overscroll-behavior-y:none; min-height:100vh; }
body.lock { overflow:hidden; }
button, input, select, textarea { font:inherit; color:inherit; }
button { background:none; border:0; cursor:pointer; text-align:inherit; }
button:disabled { opacity:.3; cursor:default; }
input { outline:none; border:0; background:transparent; min-width:0; }
svg.i { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; }
svg.i.sm { width:16px; height:16px; }
svg.i.inl { width:17px; height:17px; vertical-align:-3px; color:#2f6fd6; }
.muted { color:var(--muted); }

#app { max-width:480px; margin:0 auto; position:relative; }
#screen { padding:calc(var(--sat) + 14px) 20px calc(var(--sab) + 124px); min-height:100vh; }
#screen.enter > * { animation:enter .5s cubic-bezier(.2,.8,.2,1) both; animation-delay:calc(var(--i, 0) * 40ms); }
@keyframes enter { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
#screen.in-l { animation:inl .35s cubic-bezier(.2,.8,.2,1); }
#screen.in-r { animation:inr .35s cubic-bezier(.2,.8,.2,1); }
@keyframes inl { from { opacity:.3; transform:translateX(28px); } }
@keyframes inr { from { opacity:.3; transform:translateX(-28px); } }

.top { display:flex; justify-content:space-between; align-items:center; margin:4px 0 14px; min-height:40px; gap:10px; }
.title { font:700 30px/1.05 var(--font); letter-spacing:-.02em; }
.pill { display:flex; align-items:center; gap:4px; padding:8px 11px 8px 14px; border-radius:999px; background:var(--card); font:600 14px/1 var(--font); border:1px solid var(--line2); white-space:nowrap; }
.pill svg.i { width:16px; height:16px; color:var(--muted); }
.card { background:var(--card); border-radius:22px; box-shadow:var(--shadow); }
.cap { font:600 13px/1 var(--font); color:var(--muted); }

/* ── главная: цель картинкой ── */
.hero { display:flex; align-items:flex-end; gap:8px; }
.hero-l { flex:1; min-width:0; }
.hero-art { flex:none; width:122px; margin:0 -4px 6px 0; }
.goal-name { display:flex; align-items:center; gap:8px; font:600 15px/1 var(--font); color:var(--muted); margin-top:6px; padding:4px 0; }
.goal-name svg.i { width:18px; height:18px; color:var(--acc); }
.goal-name svg.i.sm { width:15px; height:15px; color:var(--muted); }
.huge { font:300 clamp(50px, 16.5vw, 78px)/1 var(--font); letter-spacing:-.045em; margin-top:12px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.huge span { font-size:.49em; font-weight:400; margin-left:8px; letter-spacing:0; color:var(--muted); }
.huge.neg .num { color:var(--neg); }
.of { font:500 16px/1.2 var(--font); color:var(--muted); margin-top:8px; }
.art { display:block; width:100%; height:auto; overflow:visible; }
.art .fr { fill:var(--ink); }
.art .scr { fill:var(--card); }
.art .bs { fill:var(--ink); opacity:.88; }
.art .cam { fill:var(--card); opacity:.45; }
.art .fill { animation:fillup 1.4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fillup { from { transform:translateY(var(--h)); } }
.art .wave { fill:var(--acc); animation:wave 2.6s linear infinite; }
@keyframes wave { to { transform:translateX(30px); } }
.art text { font:700 15px var(--font); fill:var(--ink); }
.art text.on { fill:#fff; }
.art.ring { max-width:80px; margin-left:auto; }
.art.ring .trk { fill:none; stroke:var(--track); stroke-width:7; }
.art.ring .arc { fill:none; stroke:var(--acc); stroke-width:7; stroke-linecap:round; transform:rotate(-90deg); transform-origin:40px 40px; }
.art.ring text { font-size:16px; }
.line { position:relative; height:4px; border-radius:2px; background:var(--track); margin:26px 8px 0 0; }
.line i { position:absolute; left:0; top:0; bottom:0; width:0; border-radius:2px; background:var(--acc); transition:width .9s cubic-bezier(.2,.8,.2,1); }
.line em { position:absolute; left:0; top:50%; width:16px; height:16px; border-radius:50%; background:var(--card); border:3px solid var(--acc); transform:translate(-50%,-50%); transition:left .9s cubic-bezier(.2,.8,.2,1); }
.meta { display:flex; justify-content:space-between; margin-top:14px; font:500 14px/1 var(--font); color:var(--muted); }
.meta b { color:var(--ink); font-weight:600; }
.eta { display:inline-flex; align-items:center; gap:6px; margin-top:16px; padding:8px 12px; border-radius:999px; background:var(--acc-soft); color:var(--acc); font:600 13px/1.2 var(--font); }
.eta svg.i { width:15px; height:15px; }
.eta.warn { background:var(--neg-soft); color:var(--neg); }
.eta.wait { background:var(--soft); color:var(--muted); }
.huge .num, .big .num { font-weight:inherit; }
.stks { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.stk { display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border-radius:999px; background:var(--card); box-shadow:var(--shadow); font:500 13px/1 var(--font); color:var(--muted); }
.stk b { color:var(--ink); font-weight:700; }
.stk svg.i { width:16px; height:16px; color:#e8762b; }
.stk.g svg.i { color:var(--acc); }
.stk.off { opacity:.75; }
.trio { display:grid; grid-template-columns:repeat(3,1fr); margin-top:16px; padding:16px 4px; width:100%; }
.trio .c { display:flex; flex-direction:column; gap:8px; align-items:center; min-width:0; }
.trio .c + .c { border-left:1px solid var(--line); }
.trio small { font:500 12px/1 var(--font); color:var(--muted); }
.trio b { font:600 18px/1 var(--font); letter-spacing:-.01em; white-space:nowrap; }
.trio b.pos { color:var(--acc); }
.trio b.neg { color:var(--neg); }
.week { display:block; width:100%; margin-top:12px; padding:14px 16px 12px; text-align:left; }
.wk-h { display:flex; justify-content:space-between; align-items:baseline; }
.wk-h b { font:600 18px/1 var(--font); letter-spacing:-.01em; }
.wk-b { position:relative; display:flex; justify-content:space-between; align-items:flex-end; gap:8px; height:94px; margin-top:8px; }
.wk-b .g { flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; }
.wk-b i { display:block; width:100%; max-width:28px; border-radius:6px 6px 3px 3px; background:var(--bar2); transform-origin:bottom; animation:rise .7s cubic-bezier(.2,.8,.2,1) both; }
.wk-b .now i { background:var(--ink); }
.wk-b .fut i { background:transparent; border:1.5px dashed var(--line2); border-bottom:0; }
.wk-b .g > span { font:600 11px/1 var(--font); color:var(--muted); }
.wk-b .now > span { color:var(--ink); }
.wk-b .avg { position:absolute; left:0; right:0; height:0; border-top:1.5px dashed var(--acc); z-index:1; pointer-events:none; }
.wk-b .avg small { position:absolute; right:0; top:-17px; padding-left:6px; background:var(--card); font:600 11px/1 var(--font); color:var(--acc); }
.mini { display:flex; align-items:center; gap:12px; margin-top:10px; padding:13px 16px; width:100%; }
.mini .tx2 { flex:1; display:flex; flex-direction:column; gap:6px; min-width:0; }
.mini b { font:600 15px/1.1 var(--font); }
.mini span { font:500 13px/1.2 var(--font); color:var(--muted); }
.art-mini { width:52px; flex:none; }
.art-mini text { display:none; }
.ok { width:26px; height:26px; border-radius:50%; background:var(--acc); color:#fff; display:grid; place-items:center; flex:none; }
.ok svg.i { width:15px; height:15px; stroke-width:2.8; }
.pct { font:600 14px/1 var(--font); color:var(--muted); flex:none; }
.story-cta { display:flex; align-items:center; gap:12px; width:100%; margin-bottom:14px; padding:14px 14px 14px 16px; text-align:left; color:#fff; background:linear-gradient(120deg, #1f7a55, #2b8a86); box-shadow:0 10px 26px rgba(31,122,85,.28); }
.story-cta .ic { background:rgba(255,255,255,.18); color:#fff; }
.story-cta .tx2 { flex:1; display:flex; flex-direction:column; gap:5px; min-width:0; }
.story-cta b { font:700 15px/1.2 var(--font); }
.story-cta .tx2 > span { font:500 13px/1.3 var(--font); color:rgba(255,255,255,.85); }
.story-cta svg.i.go { width:18px; height:18px; color:#fff; }
.achc { display:flex; align-items:center; gap:12px; width:100%; margin-top:12px; padding:13px 14px 13px 16px; text-align:left; }
.achc .tx2 { flex:1; display:flex; flex-direction:column; gap:5px; min-width:0; }
.achc b { font:600 15px/1.1 var(--font); }
.achc .tx2 > span { font:500 12.5px/1.25 var(--font); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.badges { display:flex; padding-left:6px; }
.badges i { width:32px; height:32px; border-radius:50%; display:grid; place-items:center; margin-left:-7px; background:var(--card); box-shadow:inset 0 0 0 40px var(--s); color:var(--c); border:2px solid var(--card); }
.badges svg.i { width:15px; height:15px; }

/* ── карточки-подсказки ── */
.note-card { position:relative; padding:16px 44px 16px 16px; margin-bottom:16px; display:flex; flex-direction:column; gap:8px; font:500 14px/1.4 var(--font); }
.note-card b { font:700 15px/1.25 var(--font); }
.note-card small { font:500 12.5px/1.35 var(--font); color:var(--muted); }
.note-card .x { position:absolute; top:10px; right:10px; width:30px; height:30px; display:grid; place-items:center; color:var(--muted); }
.note-card .x svg.i { width:18px; height:18px; }
.note-card.lim-hint, .note-card.sw-hint { margin:12px 0 0; }
.btn { align-self:flex-start; padding:11px 16px; border-radius:14px; background:var(--ink); color:var(--on-ink); font:700 14px/1 var(--font); }
.btn.soft { background:var(--soft); color:var(--ink); }

/* ── списки записей ── */
.sec { display:flex; justify-content:space-between; align-items:baseline; margin:24px 2px 10px; font:700 18px/1 var(--font); }
.sec button { font:600 14px/1 var(--font); color:var(--muted); }
.day { display:flex; justify-content:space-between; align-items:baseline; margin:20px 4px 8px; font:600 14px/1 var(--font); }
.day span { color:var(--muted); font-weight:500; }
.list { display:flex; flex-direction:column; background:var(--card); border-radius:22px; padding:2px 16px; box-shadow:var(--shadow); overflow:hidden; }
.it { display:flex; align-items:center; gap:12px; padding:11px 0; width:100%; min-height:62px; }
.it + .it { border-top:1px solid var(--line); }
.ic { width:40px; height:40px; border-radius:13px; display:grid; place-items:center; flex:none; background:var(--soft); color:var(--ink); }
.ic[style] { background:var(--s); color:var(--c); }
.ic svg.i { width:20px; height:20px; }
.ic.inc { background:var(--acc-soft); color:var(--acc); }
.tx { flex:1; display:flex; flex-direction:column; gap:6px; min-width:0; }
.tx b { font:600 15px/1.1 var(--font); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tx > span { font:500 13px/1.1 var(--font); color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tx > span:empty { display:none; }
.am { font:600 16px/1 var(--font); letter-spacing:-.01em; white-space:nowrap; text-align:right; display:flex; flex-direction:column; gap:5px; align-items:flex-end; }
.am small { font:500 12px/1 var(--font); color:var(--muted); letter-spacing:0; }
.am.pos { color:var(--acc); }
.empty { text-align:center; padding:34px 24px; color:var(--muted); font:500 15px/1.45 var(--font); display:flex; flex-direction:column; align-items:center; gap:12px; }
.empty .ic { width:56px; height:56px; border-radius:18px; }
.empty .ic svg.i { width:28px; height:28px; color:var(--acc); }
.empty b { color:var(--ink); font:700 17px/1.2 var(--font); }
.more { display:block; margin:16px auto 0; padding:12px 18px; border-radius:14px; background:var(--soft); font:600 14px/1 var(--font); }
/* свайп по записи: влево — удалить, вправо — повторить */
.it[data-a^="edit:"] { touch-action:pan-y; position:relative; background:var(--card); }
.it.swiping { z-index:1; }
.it.sw-del::after, .it.sw-dup::before { position:absolute; top:-1px; bottom:-1px; width:420px; display:flex; align-items:center; font:700 14px/1 var(--font); color:#fff; }
.it.sw-del::after { content:'Удалить'; left:100%; padding-left:22px; background:var(--neg); }
.it.sw-dup::before { content:'Повторить сегодня'; right:100%; justify-content:flex-end; padding-right:22px; background:var(--acc); }
.it.sw-go::after, .it.sw-go::before { font-size:15.5px; }

/* ── история ── */
.search { display:flex; align-items:center; gap:10px; padding:0 14px; height:48px; border-radius:16px; background:var(--card); box-shadow:var(--shadow); color:var(--muted); }
.search input { flex:1; height:100%; font:500 16px/1 var(--font); color:var(--ink); }
.search input::-webkit-search-cancel-button { -webkit-appearance:none; }
.chips-row { display:flex; gap:8px; margin-top:12px; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:10px 14px; border-radius:999px; border:1px solid var(--line2); font:600 14px/1 var(--font); white-space:nowrap; }
.chip.on { background:var(--ink); border-color:var(--ink); color:var(--on-ink); }
.chip.add { color:var(--muted); border-style:dashed; }
.chip[style] svg.i { color:var(--c); }
.chips.wrap { display:flex; flex-wrap:wrap; gap:8px; }
.hchips { display:flex; gap:8px; overflow-x:auto; margin:10px -20px 0; padding:2px 20px 4px; scrollbar-width:none; }
.hchips::-webkit-scrollbar { display:none; }
.hchips .chip { flex:none; padding:8px 12px; font-size:13px; }
.chip.cc i { width:8px; height:8px; border-radius:50%; background:var(--c); }
.chip.cc.on { background:var(--c); border-color:var(--c); color:#fff; }
.chip.cc.on i { background:#fff; }
.hsum { margin:16px 4px -6px; font:500 13.5px/1.3 var(--font); color:var(--muted); }
.hsum b { color:var(--ink); font-weight:700; }
.hsum b.pos { color:var(--acc); }

/* ── сегменты, переключатель периода, быстрые кнопки ── */
.seg { display:grid; grid-auto-columns:1fr; grid-auto-flow:column; padding:4px; border-radius:16px; background:var(--seg); }
.seg button { text-align:center; padding:12px 0; border-radius:12px; font:700 15px/1 var(--font); color:var(--muted); transition:background .2s, color .2s; }
.seg button.on { background:var(--card); color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.12); }
.seg.sm button { padding:10px 0; font-size:14px; }
.msw { display:flex; justify-content:space-between; align-items:center; margin-top:10px; padding:6px; border-radius:16px; background:var(--card); box-shadow:var(--shadow); font:700 15px/1 var(--font); }
.msw button { width:38px; height:34px; display:grid; place-items:center; border-radius:10px; color:var(--muted); }
.nav { display:flex; gap:8px; overflow-x:auto; margin:10px -20px 0; padding:2px 20px 6px; scrollbar-width:none; }
.nav::-webkit-scrollbar { display:none; }
.nav button { flex:none; padding:8px 12px; border-radius:999px; background:var(--card); box-shadow:var(--shadow); font:600 13px/1 var(--font); color:var(--muted); }
.sx { display:block; scroll-margin-top:14px; }

/* ── траты ── */
.total { margin-top:12px; padding:18px 18px 16px; display:flex; flex-direction:column; gap:10px; }
.tot-row { display:flex; align-items:center; gap:16px; }
.tot-tx { flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; }
.big { font:300 52px/1 var(--font); letter-spacing:-.04em; white-space:nowrap; }
.tot-row .big { font-size:clamp(34px, 10.5vw, 44px); }
.big span { font-size:.5em; font-weight:400; margin-left:6px; letter-spacing:0; color:var(--muted); }
.donut { position:relative; width:108px; height:108px; flex:none; }
.donut svg { width:100%; height:100%; transform:rotate(-90deg); overflow:visible; }
.donut circle { fill:none; stroke:var(--c); stroke-width:14; animation:seg .8s cubic-bezier(.2,.8,.2,1) both; animation-delay:var(--d); cursor:pointer; }
@keyframes seg { from { opacity:0; stroke-width:3; } }
.donut .dc { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; color:var(--c); pointer-events:none; }
.donut .dc svg.i { width:21px; height:21px; }
.donut .dc b { font:700 14px/1 var(--font); color:var(--ink); }
.st-btn { align-self:flex-start; display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border-radius:999px; background:var(--acc-soft); color:var(--acc); font:700 13px/1 var(--font); white-space:nowrap; }
.st-btn svg.i { width:15px; height:15px; }
.row-sub { font:500 13.5px/1.35 var(--font); color:var(--muted); }
.row-sub b { font-weight:600; }
.row-sub .up { color:var(--neg); }
.row-sub .down { color:var(--acc); }
.total .row-sub + .row-sub { margin-top:-4px; }
.box { margin-top:12px; padding:16px; overflow:hidden; }
.box h3 { font:700 15px/1 var(--font); margin-bottom:6px; display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.box h3 small { font:500 12px/1 var(--font); color:var(--muted); text-align:right; }
.box .row-sub { margin-top:6px; }
.wr { display:flex; align-items:center; gap:12px; width:100%; padding:10px 0; }
.wr + .wr { border-top:1px solid var(--line); }
.wr .nm { flex:1; display:flex; flex-direction:column; gap:6px; min-width:0; }
.wr .nm b { font:600 15px/1.1 var(--font); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wr .nm small { font:500 12px/1.35 var(--font); color:var(--muted); }
.wr .nm small b.over { color:var(--neg); font-weight:600; }
.tr { display:block; height:6px; border-radius:3px; background:var(--track); overflow:hidden; }
.tr i { display:block; height:100%; border-radius:3px; background:var(--c, var(--bar)); transform-origin:left; animation:grow .7s cubic-bezier(.2,.8,.2,1) both; }
.tr.inc i, .tr.acc i { background:var(--acc); }
.tr.neg i { background:#d39a86; }
.tr.over i { background:var(--neg); }
@keyframes grow { from { transform:scaleX(0); } }
.wr em { font-style:normal; text-align:right; font:600 15px/1 var(--font); white-space:nowrap; min-width:84px; }
.wr em.up { color:var(--neg); }
.wr em.down { color:var(--acc); }
.total + .list { margin-top:12px; }
.wr svg.i.go, .it svg.i.go { width:16px; height:16px; color:var(--faint); }
.empty-s { color:var(--muted); font:500 14px/1.4 var(--font); padding:10px 0 4px; }
.lnk { font:600 13px/1 var(--font); color:var(--acc); padding:4px 0; white-space:nowrap; }
.lg { display:flex; gap:12px; font:600 12px/1 var(--font); color:var(--muted); }
.lg i { display:inline-block; width:8px; height:8px; border-radius:3px; margin-right:5px; background:var(--acc); }
.lg i.x { background:var(--bar2); }
.bars { display:flex; justify-content:space-between; align-items:flex-end; margin-top:16px; padding:0 4px; }
.bars .g { display:flex; flex-direction:column; align-items:center; gap:8px; flex:1; padding:4px 0; border-radius:12px; }
.bars .pair { display:flex; gap:4px; align-items:flex-end; height:110px; }
.bars .pair i { width:13px; min-height:2px; border-radius:5px 5px 3px 3px; background:var(--acc); transform-origin:bottom; animation:rise .7s cubic-bezier(.2,.8,.2,1) both; }
.bars .pair i + i { background:var(--bar2); }
@keyframes rise { from { transform:scaleY(0); } }
.bars .g > span:last-child { font:600 11px/1 var(--font); color:var(--muted); }
.bars .g:not(.sel) .pair { opacity:.45; }
.bars .g.sel { background:var(--soft); }
.bars .g.sel > span:last-child { color:var(--ink); }
.mdet { display:flex; flex-direction:column; gap:4px; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); font:500 13.5px/1.35 var(--font); color:var(--muted); }
.mdet b { color:var(--ink); font:700 15px/1.2 var(--font); }
.mdet .pos { color:var(--acc); font-weight:600; }
.mdet .neg { color:var(--neg); font-weight:600; }
.back { display:inline-flex; align-items:center; gap:2px; margin:2px 0 8px -6px; padding:8px 8px 8px 0; font:600 16px/1 var(--font); color:var(--acc); }
.cat-head { display:flex; align-items:center; gap:14px; margin-bottom:6px; }
.cat-head .ic { width:52px; height:52px; border-radius:16px; }
.cat-head .ic svg.i { width:26px; height:26px; }
.cat-head .title { font-size:26px; }
.cat-head .wmark { margin:0 0 0 auto; }
.w-big { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px 12px; margin:8px 0 4px; }
.w-n { font:300 40px/1 var(--font); letter-spacing:-.035em; white-space:nowrap; }
.w-n span { font-size:20px; font-weight:400; margin-left:5px; letter-spacing:0; color:var(--muted); }
.w-big small { font:500 13px/1.2 var(--font); color:var(--muted); }
.w-goal { display:flex; gap:8px; align-items:flex-start; margin:10px 0 6px; padding:10px 12px; border-radius:14px; background:var(--acc-soft); color:var(--acc); font:600 13px/1.4 var(--font); }
.w-goal svg.i { width:16px; height:16px; margin-top:1px; }
.w-alt { font:500 13px/1.4 var(--font); color:var(--muted); margin:2px 2px 4px; }
.w-sub { font:700 11.5px/1 var(--font); color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin:16px 0 2px; }
.w-small { display:flex; align-items:flex-start; gap:10px; margin-top:12px; padding-top:12px; border-top:1px solid var(--line); font:500 13.5px/1.4 var(--font); color:var(--muted); }
.w-small svg.i { width:18px; height:18px; margin-top:1px; }
.w-small b { color:var(--ink); font-weight:600; }
.cal { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; margin-top:12px; }
.cal .wd { text-align:center; font:600 11px/1 var(--font); color:var(--muted); padding:2px 0 4px; }
.cal button { aspect-ratio:1; border-radius:10px; display:grid; place-items:center; text-align:center; font:600 13px/1 var(--font); background:var(--soft); color:var(--ink); transition:box-shadow .15s; }
.cal .l1 { background:var(--h1); }
.cal .l2 { background:var(--h2); }
.cal .l3 { background:var(--h3); color:var(--h3t); }
.cal .l4 { background:var(--h4); color:var(--h4t); }
.cal .free { background:var(--acc-soft); color:var(--acc); }
.cal .pre, .cal .fut { background:transparent; color:var(--faint); }
.cal .td { box-shadow:inset 0 0 0 2px var(--ink); }
.cal .sel { box-shadow:inset 0 0 0 2px var(--acc), 0 0 0 2px var(--acc-soft); }
.cal-stats { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:6px 12px; margin-top:12px; font:500 13px/1.3 var(--font); color:var(--muted); }
.cal-stats b { color:var(--ink); font-weight:600; }
.cal-stats button { color:var(--muted); text-align:right; }
.cal-day { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.cal-day .dh { display:flex; justify-content:space-between; font:600 14px/1 var(--font); margin-bottom:2px; }
.cal-day .dh span { color:var(--muted); font-weight:500; }
.wdb { display:flex; justify-content:space-between; align-items:flex-end; gap:8px; height:118px; margin-top:12px; padding:0 2px; }
.wdb .g { flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; }
.wdb i { display:block; width:100%; max-width:30px; min-height:3px; border-radius:6px 6px 3px 3px; background:var(--bar2); transform-origin:bottom; animation:rise .7s cubic-bezier(.2,.8,.2,1) both; }
.wdb .top i { background:var(--ink); }
.wdb span { font:600 11px/1 var(--font); color:var(--muted); }
.wdb .top span { color:var(--ink); }

/* ── главная: лимит, подсказка, план цели ── */
.lim { display:flex; flex-direction:column; gap:10px; margin-top:12px; padding:16px 18px; width:100%; text-align:left; }
.lim-big { font:300 40px/1 var(--font); letter-spacing:-.035em; white-space:nowrap; }
.lim-big span { font-size:20px; font-weight:400; margin-left:5px; letter-spacing:0; color:var(--muted); }
.lim-big.neg .num { color:var(--neg); }
.lim small { font:500 12.5px/1.35 var(--font); color:var(--muted); }
.tip { display:flex; align-items:center; gap:12px; margin-top:12px; padding:12px 12px 12px 14px; width:100%; text-align:left; font:500 14px/1.4 var(--font); }
.tip .ic { width:36px; height:36px; border-radius:12px; background:var(--acc-soft); color:var(--acc); }
.tip .ic svg.i { width:18px; height:18px; }
.tip > span { flex:1; min-width:0; }
.tip b { font-weight:700; }
.tip svg.i.go { width:16px; height:16px; color:var(--faint); }
.plan { display:flex; gap:10px; align-items:flex-start; margin-top:12px; padding:12px 14px; border-radius:16px; background:var(--card); box-shadow:var(--shadow); width:100%; text-align:left; }
.plan > svg.i { width:18px; height:18px; color:var(--acc); margin-top:1px; }
.plan .tx3 { display:flex; flex-direction:column; gap:5px; min-width:0; }
.plan b { font:600 14px/1.3 var(--font); }
.plan .tx3 > span { font:500 13px/1.4 var(--font); color:var(--muted); }
.plan em { font-style:normal; font-weight:600; }
.ok-t { color:var(--acc); }
.bad-t { color:var(--neg); }
.plan-set { display:inline-flex; align-items:center; gap:6px; margin:16px 0 0 12px; padding:8px 0; vertical-align:top; font:600 13px/1 var(--font); color:var(--muted); }
.plan-set svg.i { width:15px; height:15px; }

/* ── настройки ── */
.sec-t { font:600 13px/1 var(--font); color:var(--muted); margin:24px 4px 10px; text-transform:uppercase; letter-spacing:.04em; }
.it.danger .tx b, .it.danger .ic { color:var(--neg); }
.it.add .tx b { color:var(--acc); }
.foot { text-align:center; color:var(--muted); font:500 12.5px/1.6 var(--font); margin-top:28px; }

/* ── меню снизу ── */
.tabbar { position:fixed; left:50%; transform:translateX(-50%); bottom:0; width:100%; max-width:480px; height:calc(70px + var(--sab)); display:flex; justify-content:space-around; align-items:flex-start; padding:10px 8px 0; z-index:20;
  background:var(--tabbar); border-top:1px solid var(--line); -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); }
.tabbar button { display:flex; flex-direction:column; align-items:center; gap:5px; font:600 11px/1 var(--font); color:var(--muted); width:64px; padding-top:2px; }
.tabbar button.on { color:var(--ink); }
.tabbar .fab { width:58px; height:58px; border-radius:50%; display:grid; place-items:center; background:var(--ink); color:var(--on-ink); margin-top:-18px; box-shadow:0 8px 20px rgba(0,0,0,.22); padding:0; transition:transform .15s; }
.tabbar .fab:active { transform:scale(.92); }
.tabbar .fab svg.i { width:28px; height:28px; stroke-width:2.2; }

/* ── шторка «+» ── */
.sheet { position:fixed; inset:0; z-index:40; display:flex; justify-content:center; pointer-events:none; }
.sheet .dim, .modal .dim { position:absolute; inset:0; background:var(--dim); opacity:0; transition:opacity .3s; }
.sheet .panel { position:relative; width:100%; max-width:480px; height:100%; background:var(--bg); display:flex; flex-direction:column; transform:translateY(100%); transition:transform .38s cubic-bezier(.2,.85,.2,1); padding:calc(var(--sat) + 10px) 20px calc(var(--sab) + 12px); }
.sheet.open { pointer-events:auto; }
.sheet.open .dim, .modal.open .dim { opacity:1; }
.sheet.open .panel { transform:none; }
.sheet .body { flex:1; overflow-y:auto; overflow-x:hidden; min-height:0; margin:0 -20px; padding:0 20px 8px; }
.sheet-top { display:grid; grid-template-columns:90px 1fr 90px; align-items:center; margin:4px 0 16px; font:600 15px/1 var(--font); }
.sheet-top > :first-child { color:var(--muted); text-align:left; padding:8px 0; }
.sheet-top > b { font:700 17px/1 var(--font); text-align:center; }
.sheet-top > :last-child { text-align:right; padding:8px 0; }
.sheet-top .danger { color:var(--neg); }
.sheet-top .strong { color:var(--acc); font-weight:700; }
.amount { text-align:center; font:300 74px/1 var(--font); letter-spacing:-.045em; margin-top:24px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.amount.ph .num { color:var(--faint); }
.amount.long { font-size:54px; }
.amount .cur { color:var(--muted); font-size:36px; margin-left:8px; font-weight:400; letter-spacing:0; }
.amount .caret { display:inline-block; width:3px; height:.78em; background:var(--acc); vertical-align:-0.04em; margin-left:4px; border-radius:2px; animation:blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity:0; } }
.curs { display:flex; justify-content:center; gap:8px; margin-top:16px; }
.curs.left { justify-content:flex-start; margin-top:0; }
.curs button { min-width:50px; text-align:center; padding:9px 0; border-radius:999px; border:1px solid var(--line2); font:700 15px/1 var(--font); color:var(--muted); }
.curs button.on { color:var(--ink); border-color:var(--ink); }
.conv { text-align:center; font:500 13px/1.2 var(--font); color:var(--muted); margin-top:12px; min-height:16px; }
.lbl { display:flex; justify-content:space-between; align-items:center; font:600 13px/1 var(--font); color:var(--muted); margin:20px 2px 10px; }
.picks { display:grid; grid-auto-flow:column; grid-template-rows:repeat(2,auto); gap:8px; overflow-x:auto; margin:0 -20px; padding:2px 20px 6px; scrollbar-width:none; justify-content:start; }
.picks::-webkit-scrollbar { display:none; }
.picks .chip { background:transparent; }
.picks .chip svg.i { color:var(--muted); }
.picks .chip[style] svg.i { color:var(--c); }
.picks .chip.on { background:var(--ink); border-color:var(--ink); color:var(--on-ink); }
.picks .chip.on[style] { background:var(--c); border-color:var(--c); color:#fff; }
.picks .chip.on svg.i { color:inherit; }
.shake { animation:shake .4s; }
@keyframes shake { 20%,60% { transform:translateX(-6px); } 40%,80% { transform:translateX(6px); } }
.fields { display:grid; grid-template-columns:1.6fr 1fr; gap:8px; margin-top:12px; }
.f { position:relative; display:flex; align-items:center; gap:8px; padding:0 14px; height:46px; border-radius:14px; background:var(--card); border:1px solid var(--line2); font:500 15px/1 var(--font); white-space:nowrap; overflow:hidden; }
.f svg.i { width:17px; height:17px; color:var(--muted); }
.f input { flex:1; height:100%; font:500 16px/1 var(--font); }
.f input::placeholder { color:var(--ph); }
.f.d input { position:absolute; inset:0; opacity:0; width:100%; height:100%; }
.pad { display:grid; grid-template-columns:repeat(3,1fr); gap:4px; margin-top:8px; flex:none; }
.pad button { height:52px; display:grid; place-items:center; border-radius:14px; font:400 27px/1 var(--font); transition:background .12s; }
.pad button:active { background:var(--seg); }
.pad button svg.i { width:25px; height:25px; }
.save { display:block; width:100%; margin-top:8px; height:56px; border-radius:18px; background:var(--ink); color:var(--on-ink); font:700 17px/1 var(--font); text-align:center; flex:none; transition:transform .12s; }
.save:active { transform:scale(.98); }
.quick { display:flex; gap:8px; overflow-x:auto; margin:12px -20px 0; padding:2px 20px 4px; scrollbar-width:none; }
.quick::-webkit-scrollbar { display:none; }
.quick .chip { flex:none; padding:9px 13px; background:var(--card); border-color:var(--line2); font:500 13.5px/1 var(--font); }
.quick .chip b { font-weight:700; }
.quick + .amount { margin-top:14px; }
.wmark { display:inline-flex; align-items:center; gap:5px; padding:6px 10px; margin:-7px 0; border-radius:999px; border:1px solid var(--line2); font:600 12.5px/1 var(--font); color:var(--muted); white-space:nowrap; }
.wmark svg.i { width:14px; height:14px; }
.wmark.on { background:var(--neg-soft); border-color:transparent; color:var(--neg); }

/* ── маленькие формы и панели ── */
.modal { position:fixed; inset:0; z-index:60; display:flex; align-items:flex-end; justify-content:center; pointer-events:none; }
.modal .panel { position:relative; width:100%; max-width:480px; max-height:92vh; overflow-y:auto; background:var(--bg); border-radius:26px 26px 0 0; padding:14px 20px calc(var(--sab) + 22px); transform:translateY(100%); transition:transform .34s cubic-bezier(.2,.85,.2,1); }
.modal.open { pointer-events:auto; }
.modal.open .panel { transform:none; }
.fl { display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.fl span { font:600 13px/1 var(--font); color:var(--muted); margin-left:2px; }
.fl input { height:50px; padding:0 14px; border-radius:14px; background:var(--card); border:1px solid var(--line2); font:500 17px/1 var(--font); }
.fl input:focus { border-color:var(--ink); }
.fl input[inputmode="numeric"] { font:600 22px/1 var(--font); letter-spacing:.12em; font-variant-numeric:tabular-nums; }
.fl input[type="date"] { -webkit-appearance:none; appearance:none; display:flex; align-items:center; text-align:left; }
.icons { display:grid; grid-template-columns:repeat(6,1fr); gap:8px; margin-bottom:14px; }
.icons button { height:48px; border-radius:14px; display:grid; place-items:center; background:var(--card); border:1px solid var(--line2); }
.icons button.on { background:var(--ink); color:var(--on-ink); border-color:var(--ink); }
.mdel { display:block; width:100%; margin-top:8px; padding:15px; border-radius:16px; background:var(--neg-soft); color:var(--neg); font:700 15px/1 var(--font); text-align:center; }
.tog { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:50px; padding:10px 14px; margin-bottom:14px; border-radius:14px; background:var(--card); border:1px solid var(--line2); font:500 15px/1.3 var(--font); text-align:left; }
.sw { display:block; position:relative; width:46px; height:28px; border-radius:14px; background:var(--line2); flex:none; transition:background .2s; }
.sw::after { content:''; position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.2); transition:transform .2s; }
.tog.on .sw { background:var(--acc); }
.tog.on .sw::after { transform:translateX(18px); }
.fchips { margin-bottom:12px; }
.fhint { font:500 12.5px/1.4 var(--font); color:var(--muted); margin:0 2px 14px; }
.ach-sum { font:500 14px/1.4 var(--font); color:var(--muted); margin:-4px 2px 16px; }
.achs { display:grid; grid-template-columns:repeat(3, 1fr); gap:16px 10px; padding-bottom:6px; }
.ach { display:flex; flex-direction:column; align-items:center; text-align:center; gap:6px; }
.ach .ic { width:58px; height:58px; border-radius:50%; }
.ach .ic svg.i { width:25px; height:25px; }
.ach b { font:700 12.5px/1.2 var(--font); }
.ach small { font:500 11px/1.3 var(--font); color:var(--muted); }
.ach.lock .ic { background:var(--soft); color:var(--faint); }
.ach.lock b { color:var(--muted); }

/* ── всплывашка, достижение, конфетти ── */
.toast { position:fixed; left:50%; bottom:calc(var(--sab) + 92px); transform:translate(-50%, 20px); opacity:0; pointer-events:none; z-index:80; display:flex; align-items:center; gap:14px; max-width:calc(100% - 32px);
  padding:12px 14px 12px 18px; border-radius:16px; background:var(--toast); color:#fff; font:600 14px/1.3 var(--font); box-shadow:0 12px 30px rgba(0,0,0,.25); transition:opacity .25s, transform .3s cubic-bezier(.2,.85,.2,1); }
.toast span { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.toast.show { opacity:1; transform:translate(-50%, 0); pointer-events:auto; }
.toast button { flex:none; color:#a8e6c6; font:700 14px/1 var(--font); padding:6px 4px; }
.achpop { position:fixed; left:50%; top:calc(var(--sat) + 10px); z-index:90; display:flex; align-items:center; gap:12px; width:calc(100% - 32px); max-width:420px; padding:12px 16px 12px 12px;
  border-radius:20px; background:var(--card); box-shadow:0 14px 40px rgba(0,0,0,.2); text-align:left; transform:translate(-50%, calc(-100% - var(--sat) - 20px)); transition:transform .5s cubic-bezier(.2,.9,.25,1.12); }
.achpop.show { transform:translate(-50%, 0); }
.achpop span { min-width:0; }
.achpop small { display:block; font:700 12px/1 var(--font); color:var(--acc); margin-bottom:5px; }
.achpop b { display:block; font:700 15px/1.25 var(--font); }
.confetti { position:fixed; inset:0; width:100%; height:100%; pointer-events:none; z-index:120; }

/* ── итоги месяца — сторис ── */
.story { position:fixed; inset:0; z-index:100; display:none; flex-direction:column; color:#fff; background:#1f7a55; transition:background .45s, color .45s; padding:calc(var(--sat) + 10px) 0 calc(var(--sab) + 18px); }
.story.open { display:flex; }
.st-bars { display:flex; gap:4px; padding:0 14px; position:relative; z-index:3; }
.st-bars i { flex:1; height:3px; border-radius:2px; position:relative; overflow:hidden; }
.st-bars i::before { content:''; position:absolute; inset:0; background:currentColor; opacity:.28; }
.st-bars i b { position:absolute; left:0; top:0; bottom:0; width:0; background:currentColor; }
.st-bars i.done b { width:100%; }
.st-bars i.run b { animation:stbar 6.5s linear forwards; }
@keyframes stbar { to { width:100%; } }
.st-x { position:absolute; top:calc(var(--sat) + 20px); right:10px; z-index:4; width:44px; height:44px; display:grid; place-items:center; color:inherit; }
.st-x svg.i { width:26px; height:26px; }
.st-body { flex:1; display:flex; }
.st-slide { flex:1; display:flex; flex-direction:column; justify-content:center; gap:14px; padding:24px 30px 70px; }
.st-slide > * { animation:stin .6s cubic-bezier(.2,.8,.2,1) both; }
.st-slide > :nth-child(2) { animation-delay:.08s; }
.st-slide > :nth-child(3) { animation-delay:.16s; }
.st-slide > :nth-child(4) { animation-delay:.24s; }
.st-slide > :nth-child(5) { animation-delay:.32s; }
.st-slide > :nth-child(6) { animation-delay:.4s; }
@keyframes stin { from { opacity:0; transform:translateY(18px); } }
.st-nav { position:absolute; inset:0; display:flex; z-index:2; }
.st-nav button:first-child { flex:.6; }
.st-nav button:last-child { flex:1; }
.st-k { font:700 13px/1 var(--font); letter-spacing:.08em; text-transform:uppercase; opacity:.8; }
.st-h { font:800 64px/1 var(--font); letter-spacing:-.03em; }
.st-h2 { font:700 32px/1.1 var(--font); letter-spacing:-.02em; }
.st-big { font:300 clamp(54px, 17vw, 76px)/1 var(--font); letter-spacing:-.04em; white-space:nowrap; }
.st-big .num { font-weight:300; }
.st-big span { font-size:.42em; margin-left:8px; opacity:.75; letter-spacing:0; }
.st-s { font:500 17px/1.4 var(--font); opacity:.92; }
.st-s b { font-weight:700; }
.st-ic { width:68px; height:68px; border-radius:22px; display:grid; place-items:center; background:rgba(255,255,255,.2); }
.st-ic svg.i { width:34px; height:34px; }
.st-list { display:flex; flex-direction:column; gap:10px; margin-top:6px; }
.st-list span { display:flex; align-items:center; gap:10px; font:500 16px/1.2 var(--font); }
.st-list i { width:10px; height:10px; border-radius:50%; flex:none; box-shadow:0 0 0 2px rgba(255,255,255,.7); }
.st-list b { margin-left:auto; font-weight:700; white-space:nowrap; }
.st-art { width:230px; max-width:72%; }
.story .art .fr, .story .art .bs { fill:currentColor; }
.story .art .scr { fill:#262624; }
.story .art .cam { fill:#6b6b68; }
.story .art text { fill:currentColor; }
.st-acts { display:flex; flex-direction:column; gap:10px; margin-top:18px; position:relative; z-index:3; }
.st-acts .btn { align-self:stretch; text-align:center; padding:16px; font-size:15px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation:none !important; transition:none !important; } }
@media (max-height: 700px) {
  .amount { font-size:60px; margin-top:12px; }
  .amount .cur { font-size:30px; }
  .pad button { height:46px; }
  .lbl { margin-top:14px; }
}
