:root{
  /* бумага расходной книги: тёплый серый с фиолетовым уклоном */
  --bg:#F1EFF4; --surface:#FFFFFF; --surface-2:#F8F6FB; --sunk:#E7E4EE;
  --ink:#16151F; --ink-2:#3B394B; --muted:#6E6B80;
  --line:#E4E1EB; --line-strong:#CCC8DA;
  --accent:#2E2F63; --accent-ink:#2E2F63; --accent-soft:#E5E5F5; --on-accent:#FFFFFF;
  --gold:#A6741B; --gold-soft:#F7ECD6;
  --good:#256F52; --good-soft:#DCEFE5;
  --over:#9E2E33; --over-soft:#F8E2E2;
  --hero-a:#2A2B5C; --hero-b:#3D3D78; --hero-ink:#F3F2FA; --hero-dim:#AFAEDA; --hero-line:#55558F;
  --c1:#4B5BB5; --c2:#1F7A5C; --c3:#B85E23; --c4:#2F7FA8; --c5:#A83F5C;
  --c6:#6B67A0; --c7:#7C7420; --c8:#8E3F9C; --c9:#476B4E;
  --s1:#2F7D4F; --s2:#2B6BB5; --s3:#C06A22; --s4:#4A8C2F; --s5:#B23A3A; --s6:#A6741B;
  --r-lg:18px; --r:12px; --r-sm:9px;
  --shadow:0 1px 2px rgba(22,21,31,.04);
  --shadow-lift:0 2px 4px rgba(22,21,31,.06),0 18px 40px -26px rgba(22,21,31,.5);
  --shadow-up:0 -10px 30px -18px rgba(22,21,31,.35);
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0D0C13; --surface:#17161F; --surface-2:#1E1D28; --sunk:#0A0910;
  --ink:#EDECF4; --ink-2:#C3C0D2; --muted:#8A87A0;
  --line:#26242F; --line-strong:#3B3849;
  --accent:#9EA2F2; --accent-ink:#B0B3F7; --accent-soft:#232347; --on-accent:#111020;
  --gold:#E2A93F; --gold-soft:#332811;
  --good:#5BBE92; --good-soft:#102A1F;
  --over:#E58286; --over-soft:#31181B;
  --hero-a:#1D1D3D; --hero-b:#2B2B57; --hero-ink:#EFEEFA; --hero-dim:#9E9CD0; --hero-line:#43426F;
  --c1:#8C98E0; --c2:#5EBE9C; --c3:#E39A5F; --c4:#74B4D8; --c5:#DE8096;
  --c6:#A9A4D0; --c7:#C3BA5E; --c8:#C286CC; --c9:#8FB396;
  --s1:#5EBE8B; --s2:#77A9EC; --s3:#E39A5F; --s4:#8CC95F; --s5:#E58286; --s6:#E2A93F;
  --shadow:0 1px 2px rgba(0,0,0,.45);
  --shadow-lift:0 2px 4px rgba(0,0,0,.5),0 18px 40px -26px rgba(0,0,0,.9);
  --shadow-up:0 -10px 30px -18px rgba(0,0,0,.85);
}}
:root[data-theme="dark"]{
  --bg:#0D0C13; --surface:#17161F; --surface-2:#1E1D28; --sunk:#0A0910;
  --ink:#EDECF4; --ink-2:#C3C0D2; --muted:#8A87A0;
  --line:#26242F; --line-strong:#3B3849;
  --accent:#9EA2F2; --accent-ink:#B0B3F7; --accent-soft:#232347; --on-accent:#111020;
  --gold:#E2A93F; --gold-soft:#332811;
  --good:#5BBE92; --good-soft:#102A1F;
  --over:#E58286; --over-soft:#31181B;
  --hero-a:#1D1D3D; --hero-b:#2B2B57; --hero-ink:#EFEEFA; --hero-dim:#9E9CD0; --hero-line:#43426F;
  --c1:#8C98E0; --c2:#5EBE9C; --c3:#E39A5F; --c4:#74B4D8; --c5:#DE8096;
  --c6:#A9A4D0; --c7:#C3BA5E; --c8:#C286CC; --c9:#8FB396;
  --s1:#5EBE8B; --s2:#77A9EC; --s3:#E39A5F; --s4:#8CC95F; --s5:#E58286; --s6:#E2A93F;
  --shadow:0 1px 2px rgba(0,0,0,.45);
  --shadow-lift:0 2px 4px rgba(0,0,0,.5),0 18px 40px -26px rgba(0,0,0,.9);
  --shadow-up:0 -10px 30px -18px rgba(0,0,0,.85);
}

*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:"Golos Text",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:15px; line-height:1.45; -webkit-text-size-adjust:100%;
}
.num{font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace; font-variant-numeric:tabular-nums; font-feature-settings:"tnum"}
h1,h2,h3{margin:0; font-weight:600}
h1{font-family:Literata,Georgia,"Times New Roman",serif; font-size:20px; letter-spacing:-.01em}
h2{font-family:Literata,Georgia,serif; font-size:15.5px; letter-spacing:-.005em; font-weight:600}
.eyebrow{font-size:10.5px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--muted)}
button{font:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent}
button:active{transform:translateY(.5px)}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:4px}


/* ---- иконки ---- */
.ic{width:18px; height:18px; flex:none; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round}
.ic.sm{width:15px; height:15px; stroke-width:1.8}
.tile{
  width:34px; height:34px; border-radius:11px; display:grid; place-items:center; flex:none;
  background:color-mix(in srgb, var(--tc) 13%, var(--surface));
  border:1px solid color-mix(in srgb, var(--tc) 24%, transparent);
  color:var(--tc);
}
.tile.sm{width:28px; height:28px; border-radius:9px}
.tile.flat{background:var(--surface-2); border-color:var(--line); color:var(--muted)}
.opic{position:relative}
.whoDot{
  position:absolute; right:-5px; bottom:-5px; width:17px; height:17px; border-radius:50%;
  display:grid; place-items:center; font-size:9px; font-weight:700; font-style:normal;
  color:#fff; border:2px solid var(--surface);
}
.schip{display:inline-flex; align-items:center; gap:7px; color:var(--ink-2)}
.schip .ic{color:var(--sc)}
.schip[aria-pressed=true]{background:var(--sc); border-color:var(--sc); color:#fff}
.schip[aria-pressed=true] .ic{color:#fff}
.qchip{display:inline-flex; align-items:center; gap:6px}
.qchip .ic{color:var(--muted)}
.legend .lg .ic{width:16px; height:16px}

/* ---- каркас ---- */
.app{max-width:640px; margin:0 auto; padding-inline:16px; padding-bottom:172px}
.topbar{
  position:sticky; top:0; z-index:30;
  background:var(--bg);
  margin-inline:-16px;
  padding:calc(12px + env(safe-area-inset-top,0px)) 16px 0;
  box-shadow:0 8px 12px -12px rgba(22,21,31,.35);
}
.brand{display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:11px}
.brandL{display:flex; align-items:center; gap:10px; min-width:0}
.pot{width:26px; height:26px; flex:none; color:var(--accent); display:block}
.pot svg{width:100%; height:100%; display:block}
.sync{display:inline-flex; align-items:center; gap:6px; font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); white-space:nowrap}
.sync i{width:6px; height:6px; border-radius:50%; background:var(--line-strong)}
.sync.on i{background:var(--good); box-shadow:0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent)}

/* вкладки — подчёркнутая навигация, не таблетки */
.tabs{
  display:flex; gap:2px; overflow-x:auto; scrollbar-width:none;
  border-bottom:1px solid var(--line); margin-bottom:14px;
}
.tabs::-webkit-scrollbar{display:none}
.tabs button{
  flex:1 0 auto; border:0; background:none; padding:8px 9px 9px; white-space:nowrap;
  display:flex; flex-direction:column; align-items:center; gap:3px;
  font-size:11.5px; font-weight:500; color:var(--muted);
  border-bottom:2px solid transparent; margin-bottom:-1px; transition:color .18s ease, border-color .18s ease;
}
.tabs button .ic{width:20px; height:20px}
.tabs button[aria-selected=true]{color:var(--ink); font-weight:600; border-bottom-color:var(--accent)}

/* ---- листы ---- */
.card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:var(--shadow); overflow:hidden;
}
.stack{display:flex; flex-direction:column; gap:14px; padding-block:2px 0}
.chead{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 16px 12px; border-bottom:1px solid var(--line);
}
.chead h2{flex:1; min-width:0}
.chead .aside{font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); white-space:nowrap}

/* ---- навигация по месяцам ---- */
.mnav{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:2px 2px 0}
.mnav b{font-family:Literata,Georgia,serif; font-size:16px; font-weight:600; letter-spacing:-.01em}
.mnav button{
  border:1px solid var(--line); background:var(--surface); color:var(--ink-2);
  width:34px; height:34px; border-radius:50%; line-height:1; font-size:15px;
  display:grid; place-items:center; box-shadow:var(--shadow);
}
.mnav button:disabled{opacity:.3; cursor:default; box-shadow:none}

/* ---- герой: единственная тонированная панель ---- */
.heroCard{
  border:0; border-radius:var(--r-lg); overflow:hidden; box-shadow:var(--shadow-lift);
  background:linear-gradient(158deg, var(--hero-a), var(--hero-b));
  color:var(--hero-ink);
}
.hero{padding:18px 17px 16px}
.heroTop{display:flex; align-items:flex-end; justify-content:space-between; gap:14px; flex-wrap:wrap}
.spent{
  font-family:Literata,Georgia,serif; font-variant-numeric:tabular-nums; font-feature-settings:"tnum";
  font-size:42px; font-weight:700; line-height:.95; letter-spacing:-.025em; color:var(--hero-ink);
}
.heroTop .of{text-align:right; font-size:12px; color:var(--hero-dim); line-height:1.5}
.heroTop .of b{display:block; font-size:14px; color:var(--hero-ink); font-family:"JetBrains Mono",monospace; font-weight:500}
.heroCard .meter{height:8px; border-radius:99px; background:rgba(255,255,255,.16); margin-top:16px; overflow:hidden; display:flex}
.heroCard .meter i{display:block; height:100%; background:var(--hero-ink); border-radius:99px; transition:width .3s ease}
.heroCard .meter i.over{background:#F09A9D}
.pace{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:11px; font-size:12.5px; color:var(--hero-dim)}
.pace b{color:var(--hero-ink); font-weight:600}
.badge{display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; padding:4px 9px; border-radius:99px; letter-spacing:.01em}
.heroCard .badge.ok{background:rgba(255,255,255,.14); color:var(--hero-ink)}
.heroCard .badge.over{background:#F09A9D; color:#3A1113}
.heroCard .badge.warn{background:#E9C173; color:#3A2A08}
.badge.ok{background:var(--good-soft); color:var(--good)}
.badge.over{background:var(--over-soft); color:var(--over)}
.badge.warn{background:var(--gold-soft); color:var(--gold)}
.chart{padding:4px 12px 12px}
.heroCard .chart{padding:0 12px 10px}
svg{display:block; width:100%; height:auto; max-width:100%}

/* ---- строки показателей ---- */
.kpi{padding:2px 16px 14px}
.kpi .k{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:11px 0; border-top:1px solid var(--line); font-size:13.5px; color:var(--ink-2);
}
.kpi .k:first-child{border-top:0}
.kpi .k .kn{min-width:0}
.kpi .k .kn small{display:block; color:var(--muted); font-size:11.5px; line-height:1.35}
.kpi .k .kv{white-space:nowrap; font-weight:500; color:var(--ink)}
.kpi .k .kv.pos{color:var(--good)}
.kpi .k .kv.neg{color:var(--over)}
.kpi .k.total{border-top:1px solid var(--line-strong); padding-top:13px}
.kpi .k.total .kn{font-family:Literata,Georgia,serif; font-weight:600; color:var(--ink); font-size:14.5px}
.kpi .k.total .kv{font-size:19px; font-weight:600}

/* ---- группы категорий ---- */
.grp{border-bottom:1px solid var(--line)}
.grp:last-child{border-bottom:0}
.grpHead{
  width:100%; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:12px;
  background:none; border:0; text-align:left; padding:13px 16px; color:var(--ink);
}
.dot{width:8px; height:8px; border-radius:2px; flex:none; transform:rotate(45deg)}
.grpHead .nm{display:flex; flex-direction:column; gap:6px; min-width:0}
.grpHead .nm span{font-size:14.5px; font-weight:500}
.grpHead .amt{text-align:right; font-size:14px; white-space:nowrap; font-weight:500}
.grpHead .amt small{display:block; color:var(--muted); font-size:11px; font-weight:400; letter-spacing:.02em}
.gbar{height:4px; border-radius:99px; background:var(--sunk); overflow:hidden}
.gbar i{display:block; height:100%; border-radius:99px; transition:width .3s ease}
.cats{padding:2px 16px 12px 36px; display:flex; flex-direction:column}
.cat{display:flex; align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--line)}
.cat .cn{flex:1; min-width:0; font-size:13.5px; color:var(--ink-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.cat .cv{font-size:12.5px; white-space:nowrap; color:var(--muted)}
.cat .cv b{color:var(--ink); font-weight:500}
.cat .cv b.over{color:var(--over)}
.cat input{
  width:68px; text-align:right; font-family:"JetBrains Mono",monospace; font-size:13px;
  background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:5px 7px; color:var(--ink);
  -moz-appearance:textfield;
}
.cat input::-webkit-outer-spin-button,.cat input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.planbtn{
  border:1px solid var(--line-strong); background:none; color:var(--ink-2);
  border-radius:99px; padding:5px 12px; font-size:12px; font-weight:500; white-space:nowrap;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.planbtn:hover{border-color:var(--accent); color:var(--accent-ink)}
.planbtn[aria-pressed=true]{background:var(--accent); border-color:var(--accent); color:var(--on-accent)}
.recToggle{
  border:1px solid var(--line); background:var(--surface-2); color:var(--muted);
  border-radius:var(--r-sm); width:30px; height:27px; font-size:13px; line-height:1; flex:none; padding:0;
}
.recToggle[aria-pressed=true]{background:var(--gold-soft); border-color:var(--gold); color:var(--gold)}
.planhelp{padding:0 16px 14px; font-size:12px; color:var(--muted); line-height:1.5}

/* ---- регулярные платежи ---- */
.rec{display:flex; align-items:center; gap:12px; padding:12px 16px; border-top:1px solid var(--line); font-size:13.5px}
.rec:first-child{border-top:0}
.rec .rn{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.rec .rn small{display:block; color:var(--muted); font-size:11.5px}
.rec .rv{color:var(--muted); font-size:13px; white-space:nowrap}
.rec.done .rn{color:var(--muted)}
.addmini{
  border:1px solid var(--accent); background:var(--accent); color:var(--on-accent);
  border-radius:99px; padding:5px 13px; font-size:12.5px; font-weight:600; flex:none;
}
.okmark{color:var(--good); font-size:12px; font-weight:600; flex:none; letter-spacing:.02em}

/* ---- кольцо расходов ---- */
.donut{display:flex; gap:18px; align-items:center; padding:16px; flex-wrap:wrap}
.donut .dw{width:140px; height:140px; flex:none; position:relative}
.donut .dw svg{width:140px; height:140px}
.donut .dc{position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px}
.donut .dc b{font-family:Literata,Georgia,serif; font-size:20px; font-weight:700; font-variant-numeric:tabular-nums}
.donut .dc small{font-size:10px; color:var(--muted); letter-spacing:.08em; text-transform:uppercase}
.legend{flex:1; min-width:168px; display:flex; flex-direction:column; gap:8px}
.legend .lg{display:flex; align-items:center; gap:9px; font-size:12.5px}
.legend .lg .dot{width:7px; height:7px}
.legend .lg span{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink-2)}
.legend .lg b{font-weight:500; white-space:nowrap}
.legend .lg em{font-style:normal; color:var(--muted); width:36px; text-align:right}

/* ---- топ категорий ---- */
.tc{padding:12px 16px; border-top:1px solid var(--line)}
.tc:first-child{border-top:0}
.tcTop{display:flex; align-items:baseline; justify-content:space-between; gap:10px; font-size:13.5px; margin-bottom:7px}
.tcTop .tcn{min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.tcTop .tcv{white-space:nowrap; font-weight:500}
.tcTop .dlt{font-size:11.5px; color:var(--muted); font-weight:400; margin-left:6px}
.tcTop .dlt.up{color:var(--over)}
.tcTop .dlt.down{color:var(--good)}
.tbar{height:5px; border-radius:99px; background:var(--sunk); overflow:hidden}
.tbar i{display:block; height:100%; border-radius:99px}

/* ---- полгода ---- */
.bars{display:flex; gap:8px; padding:16px 16px 12px; align-items:flex-end; border-bottom:1px solid var(--line)}
.bcol{flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:6px}
.bwrap{position:relative; width:100%; height:100px; background:var(--surface-2); border-radius:var(--r-sm); overflow:hidden; border:1px solid var(--line)}
.bwrap i{position:absolute; left:0; right:0; bottom:0; background:var(--line-strong); border-radius:var(--r-sm) var(--r-sm) 0 0}
.bwrap i.over{background:var(--over)}
.bwrap u{position:absolute; left:0; right:0; height:2px; background:var(--good); text-decoration:none}
.bcol b{font-size:10.5px; font-weight:500; font-family:"JetBrains Mono",monospace; color:var(--muted)}
.bcol small{font-size:10.5px; color:var(--muted); white-space:nowrap; letter-spacing:.04em}
.bcol.now .bwrap{border-color:var(--accent)}
.bcol.now .bwrap i{background:var(--accent)}
.bcol.now b{color:var(--ink)}
.bcol.now small{color:var(--ink-2); font-weight:600}
.barsnote{padding:11px 16px 13px; font-size:12px; color:var(--muted); line-height:1.5; display:flex; gap:16px; flex-wrap:wrap}
.barsnote i{display:inline-block; width:12px; height:3px; border-radius:2px; vertical-align:middle; margin-right:6px}

/* ---- цель ---- */
.goal{padding:16px; display:flex; flex-direction:column; gap:11px}
.goalTop{display:flex; align-items:baseline; justify-content:space-between; gap:12px}
.goalTop b{font-family:Literata,Georgia,serif; font-size:26px; font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:-.02em}
.goalTop span{font-size:12.5px; color:var(--muted); text-align:right; line-height:1.4}
.goal .meter{height:8px; border-radius:99px; background:var(--sunk); overflow:hidden; display:flex}
.goal .meter i{display:block; height:100%; background:var(--good); border-radius:99px; transition:width .3s ease}
.goalRow{display:flex; align-items:center; gap:10px; font-size:13.5px; color:var(--ink-2)}
.goalRow label{flex:1}
.goalRow input{
  width:100px; text-align:right; font-family:"JetBrains Mono",monospace; font-size:13px;
  background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:6px 9px; color:var(--ink);
  -moz-appearance:textfield;
}
.goalRow input::-webkit-outer-spin-button,.goalRow input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.goalNote{font-size:12.5px; color:var(--muted); line-height:1.55; margin:0}

/* ---- лента операций ---- */
.filters{display:flex; gap:7px; overflow-x:auto; padding:13px 16px 12px; scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.fchip{
  border:1px solid var(--line); background:var(--surface-2); color:var(--ink-2);
  border-radius:99px; padding:6px 12px; font-size:12.5px; font-weight:500; white-space:nowrap; flex:none;
}
.fchip[aria-pressed=true]{background:var(--ink); border-color:var(--ink); color:var(--surface); font-weight:600}
.srchWrap{padding:0 16px 13px; border-bottom:1px solid var(--line)}
.srchWrap input{
  width:100%; border:1px solid var(--line); background:var(--surface-2); border-radius:99px;
  padding:9px 14px; font:inherit; font-size:13.5px; color:var(--ink);
}
.daysep{
  display:flex; justify-content:space-between; gap:10px; padding:10px 16px 7px;
  font-size:10.5px; letter-spacing:.07em; text-transform:uppercase; color:var(--muted);
  background:var(--surface-2); border-bottom:1px solid var(--line); border-top:1px solid var(--line);
}
.daysep .num{letter-spacing:0; text-transform:none; font-size:11.5px}
.op{display:grid; grid-template-columns:auto 1fr auto auto; align-items:center; gap:11px; padding:11px 16px; border-bottom:1px solid var(--line)}
.op:last-child{border-bottom:0}
.op .who{
  width:26px; height:26px; border-radius:50%; flex:none; display:grid; place-items:center;
  font-size:11px; font-weight:600; color:#fff;
}
.op .ot{min-width:0; display:flex; flex-direction:column; gap:2px}
.op .ot b{font-size:14px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.op .ot small{color:var(--muted); font-size:11.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.op .oa{text-align:right; font-size:14px; white-space:nowrap; font-weight:500}
.op .oa small{display:block; color:var(--muted); font-size:11px; font-weight:400}
.op .oa.inc{color:var(--good)}
.op .oa.setl{color:var(--muted)}
.del{border:0; background:none; color:var(--line-strong); font-size:17px; line-height:1; padding:4px 2px; border-radius:6px}
.del:hover{color:var(--over)}
.del[hidden]{display:none!important}
.empty{padding:30px 20px; text-align:center; color:var(--muted); font-size:13.5px; line-height:1.6}

/* ---- котёл ---- */
.person{display:grid; grid-template-columns:auto 1fr auto; gap:12px; align-items:center; padding:13px 16px; border-bottom:1px solid var(--line)}
.person:last-child{border-bottom:0}
.av{width:36px; height:36px; border-radius:50%; display:grid; place-items:center; font-size:14px; font-weight:600; color:#fff; flex:none}
.person .pn{min-width:0}
.person .pn b{display:block; font-size:14.5px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.person .pn small{color:var(--muted); font-size:12px}
.person .pv{text-align:right; font-size:14.5px; white-space:nowrap; font-weight:500}
.person .pv small{display:block; color:var(--muted); font-size:11.5px; font-weight:400}
.person input.wt{
  width:58px; text-align:right; font-family:"JetBrains Mono",monospace; font-size:13px;
  background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:6px 8px; color:var(--ink);
  -moz-appearance:textfield;
}
.person input.wt::-webkit-outer-spin-button,.person input.wt::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.settle{padding:14px 16px; display:flex; flex-direction:column; gap:11px}
.settle .row{display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:13.5px}
.settle .row .rl{min-width:0}
.settle .row b{font-weight:600; white-space:nowrap; font-family:"JetBrains Mono",monospace}
.settle .row .act{
  border:1px solid var(--accent); background:var(--accent); color:var(--on-accent);
  border-radius:99px; padding:5px 12px; font-size:12px; font-weight:600; white-space:nowrap; flex:none;
}
.share{
  width:100%; border:1px dashed var(--line-strong); background:var(--surface-2); color:var(--ink-2);
  border-radius:var(--r); padding:13px; font-size:13px; text-align:left; line-height:1.55;
}

/* ---- плашка примера ---- */
.banner{
  display:flex; gap:12px; align-items:flex-start; justify-content:space-between;
  background:var(--gold-soft); border:1px solid color-mix(in srgb, var(--gold) 28%, transparent);
  border-radius:var(--r); padding:12px 14px;
}
.banner p{margin:0; font-size:12.5px; color:var(--ink-2); line-height:1.5}
.banner button{border:1px solid var(--gold); background:none; color:var(--gold); border-radius:99px; padding:5px 12px; font-size:12px; font-weight:600; white-space:nowrap; flex:none}

/* ---- еда ---- */
.stores{display:flex; gap:7px; overflow-x:auto; padding:14px 16px 12px; scrollbar-width:none}
.stores::-webkit-scrollbar{display:none}
.schip{
  border:1px solid var(--line); background:var(--surface-2); color:var(--ink-2);
  border-radius:99px; padding:7px 14px; font-size:13px; font-weight:500; white-space:nowrap; flex:none;
}
.schip[aria-pressed=true]{background:var(--ink); border-color:var(--ink); color:var(--surface); font-weight:600}
.storeNote{padding:0 16px 14px; font-size:12px; color:var(--muted); line-height:1.55; margin:0}
.fset{display:flex; flex-direction:column; gap:12px; padding:14px 16px}
.fsetRow{display:flex; align-items:center; gap:10px; font-size:13.5px; color:var(--ink-2)}
.fsetRow > label{flex:1; min-width:0}
.pick{display:flex; background:var(--sunk); border-radius:99px; padding:3px; flex:none}
.pick button{border:0; background:none; border-radius:99px; padding:5px 12px; font-size:12.5px; font-weight:500; color:var(--muted)}
.pick button[aria-pressed=true]{background:var(--surface); color:var(--ink); font-weight:600; box-shadow:var(--shadow)}
.fmode{
  width:100%; border:1px solid var(--line); border-radius:var(--r); background:var(--surface-2);
  color:var(--ink); font:inherit; font-size:14px; padding:10px 12px;
}
.bigBtn{
  width:100%; border:0; background:var(--accent); color:var(--on-accent); border-radius:var(--r);
  padding:12px; font-size:14.5px; font-weight:600;
}
.bigBtn.ghost{background:none; color:var(--ink-2); border:1px solid var(--line-strong)}
.day{border-top:1px solid var(--line)}
.day:first-child{border-top:0}
.dayHead{
  display:flex; justify-content:space-between; gap:10px; padding:10px 16px 7px;
  font-size:10.5px; letter-spacing:.07em; text-transform:uppercase; color:var(--muted);
  background:var(--surface-2); border-bottom:1px solid var(--line);
}
.dayHead .num{letter-spacing:0; text-transform:none; font-size:11.5px}
.meal{display:grid; grid-template-columns:auto 1fr auto auto; gap:10px; align-items:center; padding:10px 16px; border-bottom:1px solid var(--line)}
.meal:last-child{border-bottom:0}
.meal .sl{font-size:10px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted)}
.meal .mn{min-width:0}
.meal .mn b{display:block; font-size:13.5px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.meal .mn small{color:var(--muted); font-size:11.5px}
.meal .mp{font-size:13px; white-space:nowrap; color:var(--ink-2)}
.meal .swap{border:0; background:none; color:var(--line-strong); font-size:15px; padding:3px 2px; border-radius:6px; line-height:1}
.meal .swap:hover{color:var(--accent-ink)}
.meal.left{background:var(--surface-2)}
.meal.left .mn b{font-weight:400; color:var(--ink-2)}
.tagOut{color:var(--c3)}
.dept{
  display:flex; align-items:center; gap:7px;
  padding:10px 16px 7px; font-size:10px; font-weight:600; letter-spacing:.1em; text-transform:uppercase;
  color:var(--muted); background:var(--surface-2); border-bottom:1px solid var(--line); border-top:1px solid var(--line);
}
.buy{display:grid; grid-template-columns:auto auto 1fr auto auto; gap:11px; align-items:center; padding:10px 16px; border-bottom:1px solid var(--line)}
.buy:last-child{border-bottom:0}
.buy input[type=checkbox]{width:19px; height:19px; accent-color:var(--accent); flex:none}
.buy .bn{min-width:0; font-size:13.5px}
.buy .bn small{display:block; color:var(--muted); font-size:11.5px}
.buy.got .bn{text-decoration:line-through; color:var(--muted)}
.buy .bq{font-size:12.5px; color:var(--muted); white-space:nowrap}
.buy .bp{font-size:13px; white-space:nowrap; min-width:56px; text-align:right; font-weight:500}
.buy .bp input{
  width:66px; text-align:right; font-family:"JetBrains Mono",monospace; font-size:12.5px;
  background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:4px 7px; color:var(--ink);
  -moz-appearance:textfield;
}
.buy .bp input::-webkit-outer-spin-button,.buy .bp input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.buy .bp b.mine{color:var(--gold)}
.cmp{display:flex; align-items:center; gap:12px; padding:11px 16px; border-bottom:1px solid var(--line); font-size:13.5px}
.cmp:last-child{border-bottom:0}
.cmp .cn{flex:1; min-width:0}
.cmp .cbar{width:32%; height:5px; border-radius:99px; background:var(--sunk); overflow:hidden; flex:none}
.cmp .cbar i{display:block; height:100%; background:var(--line-strong); border-radius:99px}
.cmp.best .cbar i{background:var(--good)}
.cmp.best .cv{color:var(--good); font-weight:600}
.cmp .cv{white-space:nowrap; font-size:13px; min-width:64px; text-align:right}
.cmp .cv small{color:var(--muted); font-size:11px}

/* ---- строка ввода ---- */
.composer{
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  background:var(--surface); border-top:1px solid var(--line); box-shadow:var(--shadow-up);
  padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));
}
.cin{max-width:640px; margin:0 auto; display:flex; flex-direction:column; gap:9px}
.crow0{display:flex; gap:9px; align-items:center}
.seg{display:flex; background:var(--sunk); border-radius:99px; padding:3px; flex:none}
.seg button{border:0; background:none; border-radius:99px; padding:5px 12px; font-size:12.5px; font-weight:500; color:var(--muted)}
.seg button[aria-pressed=true]{background:var(--surface); color:var(--ink); font-weight:600; box-shadow:var(--shadow)}
.seg button.pinc[aria-pressed=true]{color:var(--good)}
.quick{
  flex:1; min-width:0; display:flex; gap:7px; overflow-x:auto; scrollbar-width:none;
  -webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);
          mask-image:linear-gradient(90deg,#000 88%,transparent);
}
.quick::-webkit-scrollbar{display:none}
.qchip{
  border:1px solid var(--line); background:var(--surface-2); color:var(--ink-2);
  border-radius:99px; padding:6px 11px; font-size:12.5px; white-space:nowrap; flex:none;
}
.crow{display:flex; gap:9px; align-items:stretch}
.amtBox{display:flex; align-items:stretch; border:1px solid var(--line); border-radius:var(--r); overflow:hidden; background:var(--surface-2); flex:none; width:126px}
.amtBox input{
  width:100%; border:0; background:none; color:var(--ink); padding:10px 9px; text-align:right;
  font-family:"JetBrains Mono",monospace; font-size:17px; font-weight:500; -moz-appearance:textfield; min-width:0;
}
.amtBox input::-webkit-outer-spin-button,.amtBox input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.amtBox button{
  border:0; border-left:1px solid var(--line); background:var(--sunk); color:var(--ink-2);
  padding:0 12px; font-family:"JetBrains Mono",monospace; font-size:15px; font-weight:700; flex:none;
}
select{
  flex:1; min-width:0; border:1px solid var(--line); border-radius:var(--r); background:var(--surface-2);
  color:var(--ink); font:inherit; font-size:14px; padding:10px 12px; appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:calc(100% - 16px) 50%,calc(100% - 11px) 50%;
  background-size:5px 5px,5px 5px; background-repeat:no-repeat; padding-right:30px;
}
.crow2{display:flex; gap:9px}
.crow2 input[type=text]{
  flex:1; min-width:0; border:1px solid var(--line); border-radius:var(--r); background:var(--surface-2);
  color:var(--ink); font:inherit; font-size:14px; padding:10px 12px;
}
.addBtn{
  border:0; background:var(--accent); color:var(--on-accent); border-radius:var(--r);
  padding:10px 20px; font-size:14.5px; font-weight:600; flex:none;
}
.addBtn.inc{background:var(--good)}
.addBtn:disabled{opacity:.35}
.hint{font-size:11.5px; color:var(--muted); text-align:center; min-height:16px}

footer{color:var(--muted); font-size:12px; line-height:1.6; padding-block:6px 10px; display:flex; flex-direction:column; gap:9px}
footer b{color:var(--ink-2)}
.frow{display:flex; gap:8px; flex-wrap:wrap}
.linkbtn{border:1px solid var(--line); background:none; color:var(--muted); border-radius:99px; padding:6px 12px; font-size:12px}
.linkbtn:hover{color:var(--ink); border-color:var(--line-strong)}

@media (prefers-reduced-motion:reduce){*{transition:none!important; animation:none!important}}
@media (max-width:400px){
  .spent{font-size:36px}
  .amtBox{width:108px}
  .app{padding-inline:14px}
  .topbar{margin-inline:-14px; padding-inline:14px}
  .tabs button{font-size:12.5px; padding-inline:6px}
  .donut .dw,.donut .dw svg{width:124px; height:124px}
  .bars{gap:6px}
  .bwrap{height:88px}
  .meal{gap:8px}
  .buy{gap:9px}
}

/* ---- подключение сервера ---- */
.connect{padding:15px 16px; display:flex; flex-direction:column; gap:11px}
.connect input{
  width:100%; border:1px solid var(--line); background:var(--surface-2); border-radius:var(--r);
  padding:10px 12px; font:inherit; font-size:14px; color:var(--ink);
}
.connect .krow{display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:13.5px; color:var(--ink-2)}
.connect .krow .kn{min-width:0}
.connect .krow .kn small{display:block; color:var(--muted); font-size:11.5px; overflow:hidden; text-overflow:ellipsis}
.crowBtns{display:flex; gap:9px}
.crowBtns .bigBtn{flex:1}

/* ===================================================================
   ДЕСКТОП: боковая навигация слева, лента по центру, ввод в правой колонке
   =================================================================== */
@media (min-width:1040px){
  .topbar{
    position:fixed; inset:0 auto 0 0; width:252px; z-index:50;
    display:flex; flex-direction:column; gap:6px; margin:0;
    padding:calc(26px + env(safe-area-inset-top,0px)) 18px 18px;
    background:var(--surface); border-right:1px solid var(--line); box-shadow:none;
  }
  .brand{flex-direction:column; align-items:flex-start; gap:10px; padding-bottom:18px}
  .brandL{gap:11px}
  .brandL h1{font-size:21px}
  .sync{order:2}
  .tabs{flex-direction:column; gap:3px; border-bottom:0; margin:0; overflow:visible}
  .tabs button{
    flex:none; width:100%; flex-direction:row; justify-content:flex-start; gap:11px;
    padding:10px 12px; font-size:14px; border-bottom:0; margin:0; border-radius:10px;
    border-left:2px solid transparent;
  }
  .tabs button .ic{width:19px; height:19px}
  .tabs button[aria-selected=true]{background:var(--accent-soft); color:var(--accent-ink); border-left-color:var(--accent)}

  .app{
    max-width:none; margin:0 396px 0 252px; padding:26px 30px 40px;
  }
  .stack{gap:18px}
  #banner{margin-bottom:2px}

  .composer{
    position:fixed; left:auto; right:0; top:0; bottom:0; width:396px; z-index:45;
    border-top:0; border-left:1px solid var(--line); box-shadow:none;
    padding:26px 22px calc(22px + env(safe-area-inset-bottom,0px));
    display:flex; flex-direction:column; justify-content:flex-start;
  }
  .composer::before{
    content:"Быстрый ввод"; display:block; margin-bottom:14px;
    font-family:Literata,Georgia,serif; font-size:15.5px; font-weight:600; color:var(--ink);
  }
  .cin{gap:11px}
  .crow0{flex-direction:column; align-items:stretch; gap:10px}
  .quick{mask-image:none; -webkit-mask-image:none; flex-wrap:wrap; overflow:visible}
  .crow{flex-direction:column}
  .amtBox{width:100%}
  .crow2{flex-direction:column}
  .addBtn{width:100%; padding-block:12px}
  .hint{text-align:left}

  /* на широком экране месяц и итоги идут в две колонки */
  #tab-month, #tab-stats{
    display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); align-items:start; gap:18px;
  }
  #tab-month > .mnav, #tab-month > .heroCard{grid-column:1 / -1}
  #tab-stats > .card:first-child{grid-column:1 / -1}
  .heroCard .chart svg{max-height:210px}
}
@media (min-width:1400px){
  .app{margin-right:430px; padding-inline:44px}
  .composer{width:430px}
  #tab-ops, #tab-food{max-width:980px}
}

/* несохранённые правки: жёлтая точка состояния */
.sync.pending i{background:var(--gold)}
.connect .bigBtn.ghost{text-align:left}
