/* Учёт — тёмная тема, утверждена владельцем 2026-10-23 (макеты: claude.ai/artifact/1D9ABCimxU9kJfYskFHbVY).
   Только классы: CSP запрещает style-атрибуты, динамические размеры ставит app.js через element.style. */
:root {
  --bg: #0E1113; --card: #171B1E; --raised: #1C2124; --field: #1F2427; --chip: #262C30; --track: #22282B;
  --line: #2C3337; --ink: #F2F4F3; --soft: #C3CAC7; --muted: #9AA3A0; --dim: #6B7471;
  --mint: #5BD6A0; --mint-soft: rgba(91, 214, 160, 0.16); --mint-ink: #8BE7BF;
  --amber: #FFB15C; --amber-soft: rgba(255, 177, 92, 0.14);
  --r-card: 28px; --r-tile: 15px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: 'Onest', system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.35;
       -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--mint); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.up { color: var(--amber); }
.down { color: var(--mint); }
.hidden-label { position: absolute; left: -9999px; }

main { max-width: 560px; margin: 0 auto; padding: 18px 20px 120px; display: flex; flex-direction: column; gap: 16px;
       position: relative; }
main.glow::before { content: ""; position: fixed; left: -80px; top: -120px; width: 420px; height: 420px;
       border-radius: 50%; background: radial-gradient(circle, rgba(91, 214, 160, 0.16), rgba(91, 214, 160, 0) 70%);
       pointer-events: none; z-index: -1; }
.loading { color: var(--muted); text-align: center; padding: 80px 0; }
.error { background: var(--amber-soft); color: var(--amber); border-radius: 18px; padding: 14px 16px; }

h1 { margin: 8px 0 2px; font-size: 32px; font-weight: 700; letter-spacing: -0.8px; }
h2 { margin: 6px 0 0; font-size: 19px; font-weight: 700; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.round { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--raised); color: var(--ink);
         display: inline-flex; align-items: center; justify-content: center; flex: none; }
.avatar { width: 44px; height: 44px; border-radius: 22px; background: linear-gradient(135deg, #5BD6A0, #2E9C70);
          color: #0E1113; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.avatar.big { width: 56px; height: 56px; border-radius: 28px; font-size: 22px; }
.pill-btn { height: 40px; padding: 0 12px; border-radius: 20px; border: 0; background: var(--raised);
            display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }

.card { background: var(--card); border-radius: var(--r-card); padding: 6px 8px; }
.card.pad { padding: 18px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px; color: var(--ink); min-height: 56px; }
a.row:hover, button.row:hover { background: rgba(255, 255, 255, 0.03); border-radius: 18px; }
button.row { width: 100%; border: 0; background: transparent; text-align: left; }
.row .main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row .title { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amount { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .amount.plus { color: var(--mint); font-weight: 700; }
.tile { width: 44px; height: 44px; border-radius: var(--r-tile); display: inline-flex; align-items: center;
        justify-content: center; flex: none; font-weight: 800; font-size: 17px; }
.dot { width: 12px; height: 12px; border-radius: 6px; flex: none; }
.day { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-top: 6px; }
.day b { color: var(--soft); font-weight: 600; }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px;
          background: var(--amber-soft); color: var(--ink); }
.banner .tile { width: 36px; height: 36px; border-radius: 12px; background: rgba(255, 177, 92, 0.2); color: var(--amber); }
.banner .sub { font-size: 13px; color: #C9B49B; }
.banner.mint { background: var(--mint-soft); }
.banner.mint .tile { background: rgba(91, 214, 160, 0.2); color: var(--mint); }
.banner.mint .sub { color: var(--soft); }

.donut-card { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 22px 18px 18px; }
.donut { position: relative; width: 236px; height: 236px; }
.donut svg { display: block; }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
                 justify-content: center; gap: 4px; }
.donut .total { font-size: 34px; font-weight: 700; letter-spacing: -1px; }
.facts { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 14px; color: var(--muted); }
.facts b { color: var(--ink); }

.legend { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 64px; gap: 12px; align-items: center;
          min-height: 48px; padding: 0 8px; font-size: 16px; }
.legend .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .name small { color: var(--muted); font-weight: 500; font-size: 14px; }
.legend .delta { font-size: 14px; font-weight: 600; text-align: right; }
.more-link { display: flex; justify-content: center; align-items: center; min-height: 44px; font-weight: 600;
             border: 0; background: transparent; color: var(--mint); width: 100%; font-size: 15px; }

.bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar > span { display: block; height: 6px; border-radius: 3px; background: var(--mint); }
.bar.thick, .bar.thick > span { height: 10px; border-radius: 5px; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 3px; }
.stack > span { display: block; height: 10px; }
.keys { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--soft); }
.keys span { display: inline-flex; align-items: center; gap: 6px; }
.keys i { width: 8px; height: 8px; border-radius: 4px; display: inline-block; }
.catbar { display: flex; flex-direction: column; gap: 6px; padding: 9px 4px; }
.catbar .top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.catbar .top b { font-weight: 600; }
.catbar .top .right { display: flex; gap: 10px; }
.catbar .top .right span:last-child { width: 52px; text-align: right; font-weight: 600; }

.search { display: flex; align-items: center; gap: 10px; background: var(--raised); border-radius: 24px;
          padding: 0 16px; height: 48px; color: var(--muted); }
.search input { flex: 1; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit;
                font-size: 16px; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 38px; padding: 0 16px; border-radius: 19px; border: 0; background: var(--raised); color: var(--ink);
        font-size: 14px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--mint); color: var(--bg); font-weight: 700; }
.seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; background: var(--raised);
       border-radius: 18px; padding: 4px; }
.seg button { height: 40px; border: 0; border-radius: 14px; background: transparent; color: var(--muted);
              font-size: 14px; font-weight: 600; }
.seg button[aria-checked="true"] { background: var(--line); color: var(--ink); font-weight: 700; }

.big-total { font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -1.5px; }
.big-total small, .donut .total small { color: var(--dim); font-weight: 600; font-size: inherit; }
.badge { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 14px;
         background: var(--mint-soft); color: var(--mint); font-size: 14px; font-weight: 700; }
.badge.up { background: var(--amber-soft); color: var(--amber); }
.qty { display: inline-block; border-radius: 8px; padding: 2px 8px; font-weight: 700; background: var(--chip);
       color: var(--soft); }
.qty.weight { background: rgba(198, 227, 107, 0.16); color: #D9F08E; }
.pantry { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center;
          justify-content: center; flex: none; background: var(--mint-soft); color: var(--mint); }
.pantry.off { background: transparent; border: 1.5px dashed #4A5257; color: var(--dim); }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; display: flex; gap: 8px; align-items: center; }

.months { position: relative; height: 128px; margin-top: 4px; }
.months .avg { position: absolute; left: 0; right: 0; border-top: 1.5px dashed #3A4246; }
.months .avg-label { position: absolute; right: 0; font-size: 11px; color: var(--muted); transform: translateY(-18px); }
.months .bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
                gap: 7px; align-items: end; }
.months .bars span { display: block; background: var(--line); border-radius: 6px; min-height: 3px; }
.months .bars span.now { background: var(--mint); }
.month-labels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 7px; font-size: 11px;
                color: var(--muted); text-align: center; }
.month-labels .now { color: var(--mint); font-weight: 700; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tiles > * { background: var(--card); border-radius: 26px; padding: 16px; color: var(--ink); display: flex;
             flex-direction: column; gap: 14px; border: 0; text-align: left; }
.tiles .tile { width: 40px; height: 40px; border-radius: 14px; }
.tiles b { font-size: 16px; }
.tiles small { font-size: 13px; color: var(--muted); }
.btn { height: 52px; border-radius: 18px; border: 0; background: var(--mint); color: var(--bg); font-weight: 800;
       font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.btn.ghost { background: var(--raised); color: var(--ink); font-weight: 600; }
.btn.small { height: 40px; width: auto; padding: 0 14px; font-size: 14px; border-radius: 14px; }

.login { min-height: 100vh; max-width: 480px; margin: 0 auto; padding: 32px 24px 40px; display: flex;
         flex-direction: column; justify-content: flex-end; gap: 24px; position: relative; }
.login .logo { width: 132px; height: 132px; border-radius: 42px; background: linear-gradient(145deg, #5BD6A0, #2E9C70);
               color: #0E1113; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px;
               box-shadow: 0 30px 60px rgba(91, 214, 160, 0.25); }
.login h1 { font-size: 40px; font-weight: 800; letter-spacing: -1.2px; margin: 0; }
.login p { margin: 0; color: var(--soft); line-height: 1.55; }

.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom));
          width: min(528px, calc(100% - 32px)); height: 66px; border-radius: 33px; background: rgba(31, 36, 39, 0.92);
          backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
          display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; padding: 0 6px;
          z-index: 10; }
.tabbar[hidden] { display: none; }
.tabbar a, .tabbar button { height: 50px; margin: 0 2px; border-radius: 25px; color: var(--muted); display: flex;
                            align-items: center; justify-content: center; border: 0; background: transparent; }
.tabbar a[aria-current="page"] { background: var(--mint-soft); color: var(--mint); }
.tabbar .plus { width: 54px; height: 54px; border-radius: 27px; background: var(--mint); color: var(--bg);
                margin: 0 auto; }

.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: flex; align-items: flex-end;
         justify-content: center; z-index: 20; }
.sheet[hidden] { display: none; }
.sheet .panel { background: var(--card); width: min(560px, 100%); border-radius: 28px 28px 0 0;
                padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet .panel p { margin: 0; color: var(--soft); line-height: 1.55; }

@media (min-width: 900px) {
  main { padding-top: 32px; }
}
.stack-days { display: flex; flex-direction: column; gap: 12px; }
/* Подписи легенды: доля отдельной колонкой, чтобы не съедала название */
.legend { grid-template-columns: 12px minmax(0, 1fr) auto auto 52px; gap: 10px; }
.legend .share { color: var(--muted); font-size: 13px; }
.donut .total { font-size: 30px; }
.tabbar button.add { height: 54px; }
.tabbar .plus { display: flex; align-items: center; justify-content: center; }
