@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/static/fonts/manrope-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/static/fonts/manrope-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f2f3f6;
  --card: #ffffff;
  --text: #0e1014;
  --muted: #747a86;
  --line: #e9ebf0;
  --soft: #f4f5f8;
  --accent: #4b52ff;
  --accent-soft: #ecedff;
  --ink: #111318;
  --ink-2: #1c1f27;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --up: #ff8d8d;
  --down: #5ee0a0;
  --h1: #e6e8ff; --h2: #c4c8ff; --h3: #959cff; --h4: #6d74ff; --h5: #4b52ff;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(15, 20, 30, .04), 0 4px 16px rgba(15, 20, 30, .04);
  --tabbar: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b0e; --card: #15171c; --text: #f3f4f6; --muted: #8b909b; --line: #23262e; --soft: #1c1f26;
    --accent: #7b80ff; --accent-soft: #1e2140; --ink: #1a1d25; --ink-2: #242832; --danger-soft: #3a1d20;
    --h1: #1e2140; --h2: #2b3070; --h3: #3d44a8; --h4: #5a61e0; --h5: #7b80ff;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0b0e; --card: #15171c; --text: #f3f4f6; --muted: #8b909b; --line: #23262e; --soft: #1c1f26;
  --accent: #7b80ff; --accent-soft: #1e2140; --ink: #1a1d25; --ink-2: #242832; --danger-soft: #3a1d20;
  --h1: #1e2140; --h2: #2b3070; --h3: #3d44a8; --h4: #5a61e0; --h5: #7b80ff;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 500 15px/1.4 "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-feature-settings: "tnum" 1;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2 { margin: 0; }
h2 { font-size: 17px; font-weight: 750; letter-spacing: -.2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); }
.amount, .num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
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: 14px; height: 14px; stroke-width: 2.4; }

/* ---------- layout ---------- */
.app { min-height: 100vh; }
.main { padding: 0 16px calc(var(--tabbar) + 32px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
.tabs {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; height: var(--tabbar);
  display: flex; padding: 6px; gap: 4px; border-radius: 24px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  box-shadow: 0 8px 30px rgba(10, 12, 20, .12), 0 0 0 1px var(--line);
}
.brand { display: none; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 650; color: var(--muted); border-radius: 18px; transition: background .15s, color .15s;
}
.tab .i { width: 22px; height: 22px; }
.tab.active { color: var(--accent); background: var(--accent-soft); }

@media (min-width: 900px) {
  .tabs {
    left: 0; right: auto; top: 0; bottom: 0; width: 232px; height: auto; flex-direction: column; padding: 24px 14px; gap: 4px;
    border-radius: 0; box-shadow: none; border-right: 1px solid var(--line); background: var(--card);
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; padding: 0 10px 24px; letter-spacing: -.3px; }
  .brand .logo { width: 34px; height: 34px; border-radius: 11px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 17px; }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; font-size: 15px; border-radius: 14px; }
  .main { margin-left: 232px; padding: 0 36px 48px; }
  .period { grid-template-columns: minmax(0, 480px) 1fr; align-items: center; column-gap: 24px; padding: 20px 0 16px; }
  .period-nav { justify-content: flex-end; gap: 14px; }
  .period-label { order: -1; flex: 1; text-align: right; }
  .custom { grid-column: 2; justify-content: flex-end; }
  .filter { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- period bar ---------- */
.period {
  position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: 12px 0 12px; display: grid; gap: 10px;
}
.seg { display: flex; background: var(--card); border-radius: 16px; padding: 4px; box-shadow: var(--shadow); }
.seg button { flex: 1; padding: 8px 2px; border-radius: 12px; font-size: 13.5px; font-weight: 650; color: var(--muted); min-height: 36px; transition: background .15s, color .15s; }
.seg button.on { background: var(--ink); color: #fff; }
:root[data-theme="dark"] .seg button.on { background: var(--text); color: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: var(--text); color: var(--bg); } }
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.period-label { font-weight: 800; font-size: 18px; letter-spacing: -.3px; text-align: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 14px; display: inline-grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow); color: var(--text);
}
.icon-btn:disabled { opacity: .3; cursor: default; }
.period.cal-mode .seg, .period.cal-mode .period-nav, .period.cal-mode .custom { display: none !important; }
.period.cal-mode { padding: 8px 0 0; }
.period.cal-mode:has(.filter[hidden]) { display: none; }
.custom { display: flex; align-items: center; gap: 8px; justify-content: center; }
.custom input, .sheet input {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-height: 42px; font-weight: 600;
}
.filter { display: flex; justify-content: center; }
.chip-on {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--card)); color: var(--c, var(--accent)); font-size: 14px; font-weight: 700;
}
.chip-on .i { width: 16px; height: 16px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 12px; }
@media (min-width: 900px) { .grid { grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; } .span2 { grid-column: span 2; } .hero { grid-column: span 2; } }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.link { color: var(--accent); font-weight: 700; font-size: 14px; }

.hero {
  color: #fff; padding: 22px 20px 18px; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #3a3fd8 0%, rgba(58, 63, 216, 0) 55%), var(--ink);
}
.hero .label { color: rgba(255, 255, 255, .62); font-size: 14px; font-weight: 600; }
.hero .big { font-size: 40px; font-weight: 800; letter-spacing: -1.4px; margin: 6px 0 12px; line-height: 1.05; }
.hero .big small { font-size: 24px; font-weight: 700; letter-spacing: -.5px; color: rgba(255, 255, 255, .62); margin-left: 1px; }
.hero .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-weight: 650; color: rgba(255, 255, 255, .82); }
.pill.up { color: var(--up); background: rgba(255, 110, 110, .14); }
.pill.down { color: var(--down); background: rgba(70, 220, 150, .14); }
.hero .stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 14px; }
.hero .stat + .stat { border-left: 1px solid rgba(255, 255, 255, .1); padding-left: 14px; }
.hero .stat b { display: block; font-size: 15.5px; font-weight: 750; white-space: nowrap; }
.hero .stat span { font-size: 12.5px; color: rgba(255, 255, 255, .55); font-weight: 600; }

/* ---------- icons ---------- */
.ico {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--card));
}
.ico .i { width: 20px; height: 20px; }

/* ---------- categories ---------- */
.cats { display: grid; gap: 14px; justify-items: center; }
@media (min-width: 560px) and (max-width: 899px) { .cats { grid-template-columns: 168px 1fr; gap: 24px; align-items: center; } }
.donut { width: 168px; height: 168px; }
.donut text { fill: var(--text); font-family: inherit; }
.cat-list { display: grid; gap: 2px; width: 100%; min-width: 0; }
.cat-row {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; text-align: left;
  padding: 7px 6px; margin: 0 -6px; border-radius: 14px; min-height: 54px; width: calc(100% + 12px);
}
.cat-row:hover { background: var(--soft); }
.cat-row.dim { opacity: .4; }
.cat-row .nm { min-width: 0; }
.cat-row .nm b { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-mini { display: block; height: 5px; background: var(--soft); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar-mini i { display: block; height: 100%; border-radius: 3px; }
.cat-row .r { text-align: right; min-width: 96px; }
.cat-row .r small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 2px; }

/* ---------- day bars ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 8px; }
.bars .b { flex: 1; min-width: 1px; background: var(--accent); border-radius: 6px 6px 3px 3px; opacity: .9; }
.bars .b.zero { background: var(--line); height: 3px !important; }
.bars .b:hover { opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 600; }

/* ---------- lists ---------- */
.tx-day { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 2px 6px; font-size: 13px; color: var(--muted); font-weight: 700; position: sticky; top: 0; background: var(--card); z-index: 1; }
.tx-day:first-child { padding-top: 2px; }
.tx, .top-row {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 8px 2px; border-radius: 14px; min-height: 58px;
}
.tx:hover { background: var(--soft); }
.tx .t, .top-row .t { min-width: 0; }
.tx .t b, .top-row .t b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .t span, .top-row .t span { font-size: 13px; color: var(--muted); font-weight: 600; }
.tx .t em { font-style: normal; color: #d97706; }
.empty { color: var(--muted); text-align: center; padding: 22px 8px; margin: 0; font-weight: 600; }
.list-card { padding: 14px 16px; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-title { font-size: 19px; font-weight: 800; text-transform: capitalize; letter-spacing: -.3px; }
.cal-sum { text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; margin: 4px 0 14px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .wd { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 4px; font-weight: 700; }
.day {
  aspect-ratio: 1 / 1.05; border-radius: 12px; background: var(--soft); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; padding: 2px; min-height: 44px; position: relative;
}
.day .d { font-size: 14px; font-weight: 750; line-height: 1; }
.day .s { font-size: 10.5px; line-height: 1; font-weight: 650; opacity: .85; }
.day.h1 { background: var(--h1); } .day.h2 { background: var(--h2); } .day.h3 { background: var(--h3); color: #fff; }
.day.h4 { background: var(--h4); color: #fff; } .day.h5 { background: var(--h5); color: #fff; }
.day.today { outline: 2px solid var(--text); outline-offset: -2px; }
.day.sel { box-shadow: 0 0 0 2px var(--accent) inset, 0 0 0 4px var(--card) inset; }
.day.future { background: transparent; color: var(--muted); opacity: .5; }
.day.out { visibility: hidden; }
.cal-legend { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 14px; }
.cal-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.cal-legend .h1 { background: var(--h1); } .cal-legend .h2 { background: var(--h2); } .cal-legend .h3 { background: var(--h3); }
.cal-legend .h4 { background: var(--h4); } .cal-legend .h5 { background: var(--h5); }

/* ---------- chat ---------- */
.chat-view { display: flex; flex-direction: column; height: calc(100vh - var(--tabbar) - 28px - env(safe-area-inset-bottom)); height: calc(100dvh - var(--tabbar) - 28px - env(safe-area-inset-bottom)); min-height: 320px; padding-top: 12px; }
@media (min-width: 900px) { .chat-view { height: calc(100vh - 40px); height: calc(100dvh - 40px); max-width: 760px; margin: 0 auto; padding-top: 20px; } }
.chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 0 12px; }
.msg { max-width: 84%; padding: 11px 15px; border-radius: 20px; white-space: pre-wrap; word-wrap: break-word; font-weight: 550; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.msg.bot .tx { padding: 6px 0; min-height: 0; }
.msg.typing { color: var(--muted); }
.msg .heard { font-style: italic; opacity: .9; }
.composer {
  display: flex; gap: 6px; align-items: center; background: var(--card); border-radius: 26px; padding: 6px;
  box-shadow: var(--shadow), 0 0 0 1px var(--line); margin-bottom: 8px;
}
.composer input#msg { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 4px; outline: none; font-weight: 600; }
.composer .icon-btn { box-shadow: none; background: none; width: 42px; height: 42px; color: var(--muted); }
.mic, .send { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.mic { background: var(--accent-soft); color: var(--accent); }
.mic.rec { background: var(--danger); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.send { background: var(--accent); color: #fff; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* список вопросов в чате */
.msg.list { max-width: 96%; width: 520px; white-space: normal; padding: 16px; }
.qhead { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.qhead > .i { width: 40px; height: 40px; padding: 9px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); }
.qhead b { display: block; font-size: 16px; font-weight: 800; }
.qhead span { color: var(--muted); font-size: 13px; font-weight: 600; }
.qlist { display: grid; }
.qrow { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.qn { width: 28px; height: 28px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.qrow .t { min-width: 0; }
.qrow .t b { display: block; font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .t span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.qrow .amount { font-size: 14.5px; }
.msg .hint { font-size: 13px; color: var(--muted); margin-top: 10px; font-weight: 550; }
.msg .hint i { color: var(--text); font-style: normal; font-weight: 650; }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--card); width: 100%; max-width: 480px; border-radius: 26px 26px 0 0; padding: 12px 18px calc(18px + env(safe-area-inset-bottom));
  display: grid; gap: 12px; animation: up .18s ease-out; max-height: 92vh; overflow-y: auto;
}
@media (min-width: 600px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 26px; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); justify-self: center; }
.sheet h2 { font-size: 19px; }
.sheet label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 650; }
.sheet label input { color: var(--text); font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--soft); font-size: 14px; font-weight: 650; min-height: 38px; }
.chip .i { width: 16px; height: 16px; color: var(--c, currentColor); }
.chip.on { background: var(--ink); color: #fff; }
.chip.on .i { color: #fff; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { background: var(--accent); color: #fff; border-radius: 14px; padding: 12px 16px; font-weight: 750; min-height: 48px; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: var(--soft); color: var(--text); }
.btn.wide { width: 100%; margin-top: 8px; }

/* ---------- misc ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px; z-index: 60; font-size: 14px; font-weight: 650; max-width: 90vw;
}
.skel { background: linear-gradient(90deg, var(--line), var(--soft), var(--line)); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--card); border-radius: 28px; padding: 36px 24px; text-align: center; box-shadow: var(--shadow); width: 100%; max-width: 360px; display: grid; gap: 10px; justify-items: center; }
.login-card h1 { font-weight: 800; letter-spacing: -.5px; }
.login-logo { width: 60px; height: 60px; border-radius: 18px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
#view-calendar { padding-top: 12px; }
@media (min-width: 900px) { #view-calendar { padding-top: 20px; } }

/* ---------- плашка «без категории» ---------- */
.ask-banner {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; text-align: left; width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.ask-banner .t b { display: block; font-weight: 750; }
.ask-banner .t span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.ask-banner .go { background: var(--accent); color: #fff; padding: 9px 14px; border-radius: 12px; font-weight: 750; font-size: 14px; }
.ask-banner .t b { font-size: 15.5px; }
@media (min-width: 900px) { .ask-banner { grid-column: span 2; } }
.msg.q { max-width: 92%; white-space: normal; }
.msg.q .qchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg.q .chip.last { background: var(--accent); color: #fff; }
.msg.q .chip.muted { color: var(--muted); }
.msg.q.done .qchips, .msg.q.done .hint { display: none; }

/* ================= v7: главная, операции, настройки ================= */
.view { padding-top: 4px; }
.page-head { padding: 18px 2px 14px; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.8px; line-height: 1.1; }
.page-head .cap { font-weight: 700; margin-bottom: 2px; }
.sub-head { display: flex; align-items: center; gap: 12px; padding: 14px 0 12px; position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.sub-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
@media (min-width: 900px) { .page-head { padding: 28px 2px 18px; } .sub-head { padding-top: 24px; } }

.label { font-size: 14px; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.big { font-size: 34px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.1; margin: 6px 0 4px; white-space: nowrap; }
.big small { font-size: 21px; font-weight: 700; letter-spacing: -.4px; color: var(--muted); }
.big.dim { color: var(--muted); }
.cap-line { font-size: 13px; color: var(--muted); font-weight: 600; }

.balance {
  text-align: left; color: #fff; display: block; width: 100%;
  background: radial-gradient(120% 140% at 100% 0%, #3a3fd8 0%, rgba(58, 63, 216, 0) 58%), var(--ink);
}
.balance .label, .balance .cap-line, .balance .big small { color: rgba(255, 255, 255, .62); }
.balance .big.dim { color: rgba(255, 255, 255, .45); }
.balance .label .i { width: 14px; height: 14px; }

.meter { height: 10px; border-radius: 6px; background: var(--soft); overflow: hidden; margin: 14px 0 8px; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .4s ease; }
.meter.warn i { background: #f59e0b; }
.meter.over i { background: var(--danger); }
.meter-row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.meter-row b { font-weight: 800; }
.meter.over + .meter-row b { color: var(--danger); }
.month .cap-line + .cap-line, .meter-row + .cap-line { margin-top: 4px; }
.set-limit { margin-top: 12px; display: inline-flex; padding: 9px 14px; border-radius: 12px; background: var(--accent-soft); }

.upload { padding: 6px; }
.upload-btn { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; cursor: pointer; border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, transparent); }
.upload-btn:hover { background: var(--soft); }
.upload-btn .t b { display: block; font-weight: 750; }
.upload-btn .t span { font-size: 13px; color: var(--muted); font-weight: 600; }
.upload-result { padding: 6px 10px 8px; display: grid; gap: 4px; }
.up-line { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 6px 0; font-size: 14px; }
.up-line b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-line span span { color: var(--muted); font-size: 13px; font-weight: 600; }
.up-line .i.ok { color: #16a34a; } .up-line .i.bad { color: var(--danger); }
.spin { width: 18px; height: 18px; margin: 2px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

.link-head { width: 100%; text-align: left; }
.go-arrow { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 700; font-size: 14px; }
.ask-banner .go { background: #d97706; }
.ask-banner { border-color: color-mix(in srgb, #d97706 30%, transparent); }
.tx.ask .ico { box-shadow: 0 0 0 2px color-mix(in srgb, #d97706 50%, transparent); }
.badge:not(:empty) { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #d97706; color: #fff; font-size: 11.5px; font-weight: 800; margin-left: 4px; }
#ops-filter { margin-bottom: 12px; }

/* сегменты */
.seg6 button { font-size: 12.5px; padding: 8px 0; }
@media (min-width: 400px) { .seg6 button { font-size: 13.5px; } }
.seg3 { margin-top: 12px; box-shadow: none; background: var(--soft); }
#view-analytics .period { padding-top: 14px; }
@media (min-width: 900px) { #view-analytics .period { padding-top: 24px; } }
.cats.wide { justify-items: center; }
@media (min-width: 900px) { .cats.wide { grid-template-columns: 200px 1fr; gap: 32px; align-items: start; } .cats.wide .donut { width: 200px; height: 200px; } }
.bars { gap: var(--gap, 3px); }
.day-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.day-box .card-head { margin-bottom: 4px; }

/* настройки */
.settings { display: grid; gap: 12px; max-width: 640px; }
.rows h2, .faq h2 { margin-bottom: 6px; }
.srow { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.srow:first-of-type { border-top: 0; }
.srow .t b { display: block; font-weight: 700; }
.srow .t span { font-size: 13px; color: var(--muted); font-weight: 600; }
.srow .v { font-weight: 750; color: var(--accent); white-space: nowrap; }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-of-type { border-top: 0; }
.faq summary { list-style: none; cursor: pointer; padding: 14px 28px 14px 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq p { margin: 0 0 14px; color: var(--muted); font-weight: 550; line-height: 1.5; }

/* шторка «уточнить» */
.q-op { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--soft); }
.q-op .t { min-width: 0; }
.q-op .t b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-op .t span { font-size: 13px; color: var(--muted); font-weight: 600; }
.chip.own { background: var(--accent-soft); color: var(--accent); }
.chip.own .i { color: var(--accent); }
#q-cats .chip { min-height: 42px; }

@media (min-width: 900px) {
  .grid > .balance, .grid > .month { min-height: 180px; }
}

/* ================= v8: «+», подсказки, тренд, свои категории ================= */
/* кнопка «+» в нижней панели */
.tab-add { flex: none; width: 58px; display: grid; place-items: center; }
.tab-add svg.i { width: 50px; height: 50px; padding: 13px; border-radius: 18px; background: var(--accent); color: #fff; stroke-width: 2.4;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .15s; }
.tab-add:active svg.i { transform: scale(.94); }
.tab-add span { display: none; }
@media (min-width: 900px) {
  .tab-add { order: -1; width: auto; display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 14px; border-radius: 14px;
    background: var(--accent); color: #fff; font-weight: 750; font-size: 15px; }
  .tab-add svg.i { width: 22px; height: 22px; padding: 0; background: none; box-shadow: none; }
  .tab-add span { display: inline; }
  .brand { order: -2; }
}

/* столбики: колонка во всю высоту, чтобы легко попасть пальцем и мышкой */
.bars .col { flex: 1; min-width: 1px; height: 100%; display: flex; align-items: flex-end; cursor: pointer; }
.bars .col .b { width: 100%; flex: none; transition: opacity .12s; }
.bars:hover .col .b, .bars:has(.col.on) .col .b { opacity: .45; }
.bars .col.on .b, .bars:has(.col.on) .col.on .b, .bars:hover .col:hover .b { opacity: 1; }
.bars .b.stack { display: flex; flex-direction: column-reverse; overflow: hidden; background: transparent; gap: 1px; }
.bars .b.stack i { display: block; flex-basis: 0; min-height: 1px; }
.tip {
  position: fixed; z-index: 70; pointer-events: none; min-width: 120px; max-width: 240px;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 9px 12px; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
:root[data-theme="dark"] .tip { background: #2a2e3a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tip { background: #2a2e3a; } }
.tip-t { color: rgba(255, 255, 255, .65); font-size: 12px; }
.tip-v { font-size: 16px; font-weight: 800; margin: 1px 0 3px; }
.tip-l { display: grid; grid-template-columns: 8px 1fr auto; gap: 7px; align-items: center; padding: 2px 0; }
.tip-l i { width: 8px; height: 8px; border-radius: 3px; }
.tip-l b { font-weight: 750; }
.tip-l.more { display: block; color: rgba(255, 255, 255, .6); }

/* тренд по категориям */
.trend-chips { display: flex; gap: 6px; overflow-x: auto; margin: -4px -18px 12px; padding: 2px 18px 4px; scrollbar-width: none; }
.trend-chips::-webkit-scrollbar { display: none; }
.tchip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--soft); font-size: 13.5px; font-weight: 650; white-space: nowrap; }
.tchip i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.tchip.on { background: var(--ink); color: #fff; }
:root[data-theme="dark"] .tchip.on { background: var(--text); color: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tchip.on { background: var(--text); color: var(--bg); } }
.trend-sum { margin-top: 12px; font-size: 14px; color: var(--muted); font-weight: 600; line-height: 1.5; }
.trend-sum b { color: var(--text); }

/* шторка «Добавить» */
.add-choose { display: grid; gap: 8px; }
.add-opt { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: 16px; background: var(--soft); cursor: pointer; width: 100%; }
.add-opt .t b { display: block; font-weight: 750; }
.add-opt .t span { font-size: 13px; color: var(--muted); font-weight: 600; }
.add-form { display: grid; gap: 12px; }
.add-form #a-amount { font-size: 24px; font-weight: 800; }
.chip.new { background: transparent; border: 1.5px dashed var(--line); color: var(--accent); }
.chip.new .i { color: var(--accent); }

/* новая категория */
.c-preview { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--soft); font-size: 16px; }
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-grid .ic { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--muted); }
.icon-grid .ic .i { width: 20px; height: 20px; }
.icon-grid .ic.on { background: color-mix(in srgb, var(--c) 16%, var(--card)); color: var(--c); box-shadow: 0 0 0 2px var(--c) inset; }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.color-row .cl { width: 32px; height: 32px; border-radius: 50%; background: var(--c); }
.color-row .cl.on { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c); }
@media (max-width: 360px) { .icon-grid { grid-template-columns: repeat(6, 1fr); } }

/* свои категории в настройках */
.cat-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.cat-item:first-child { border-top: 0; }
.cat-item b { font-weight: 700; }
.cat-item .icon-btn { box-shadow: none; background: var(--soft); color: var(--muted); }
#s-cats + .btn { margin-top: 10px; }

/* доходы */
.amount.plus { color: #16a34a; }
.income-line { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; }
.income-line b { color: #16a34a; font-weight: 800; }
.sheet label.add-opt { grid-template-columns: 40px 1fr; gap: 12px; font-size: 15px; color: var(--text); font-weight: 500; }

/* v9: поступление */
.plus-title { color: #16a34a; font-variant-numeric: tabular-nums; }
#i-sub { margin: -6px 0 12px; }
#i-chips { margin: 4px 0 14px; }
#i-own { margin-top: 2px; }
#i-own-hint { margin: 6px 2px 0; }
.cat-more {
  display: grid; grid-template-columns: auto 1fr 18px; gap: 10px; align-items: center; text-align: left;
  margin: 6px -6px 0; padding: 12px 8px; border-radius: 0 0 14px 14px; width: calc(100% + 12px);
  border-top: 1px solid var(--line); font-weight: 650; color: var(--accent);
}
.cat-more .muted { font-weight: 600; font-size: 13.5px; text-align: right; }
.cat-more .i { width: 18px; height: 18px; }
.cat-more:hover { background: var(--soft); }
