:root {
  color-scheme: light dark;
  --app-bg: var(--tg-theme-bg-color, #fff8f1);
  --app-text: var(--tg-theme-text-color, #2d211b);
  --app-muted: var(--tg-theme-hint-color, #806f66);
  --app-card: var(--tg-theme-secondary-bg-color, #fff0df);
  --app-accent: #e87522;
  --app-accent-deep: color-mix(in srgb, var(--app-accent) 78%, #000);
  --app-accent-soft: color-mix(in srgb, var(--app-accent) 12%, transparent);
  --app-accent-border: color-mix(in srgb, var(--app-accent) 22%, transparent);
  --app-cream: #fff4df;
  --app-shadow: rgba(106, 50, 16, 0.14);
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.svg-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  color: var(--app-text);
  background:
    radial-gradient(circle at 92% 3%, var(--app-accent-soft), transparent 27%),
    var(--app-bg);
}

html, body { overflow-anchor: none; }

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.brand-header {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 20px;
  gap: 9px;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-tagline {
  margin-left: auto;
  color: var(--app-muted);
  font-size: 12px;
}

.mini-logo {
  position: relative;
  display: grid;
  width: 35px;
  height: 31px;
  place-items: center;
  border-radius: 13px 13px 15px 15px;
  color: #6b2e0d;
  background: linear-gradient(145deg, #ffad4d, #ef6f1b);
  box-shadow: 0 5px 12px rgba(216, 91, 17, 0.25);
}

.mini-logo__ear {
  position: absolute;
  top: -5px;
  width: 12px;
  height: 13px;
  background: #f47a21;
  transform: rotate(45deg);
  border-radius: 3px 8px 3px 8px;
}

.mini-logo__ear--left { left: 3px; }
.mini-logo__ear--right { right: 3px; transform: rotate(45deg) scaleX(-1); }
.mini-logo__face { position: relative; z-index: 1; font-size: 12px; font-weight: 800; }

.budget-card {
  --budget-color: #2A9D8F;
  position: relative;
  display: grid;
  grid-template-columns: 1.12fr 2fr;
  overflow: hidden;
  padding: 16px 18px;
  border: 2px solid var(--budget-color);
  border-radius: 28px;
  color: #fffaf5;
  background: linear-gradient(145deg, var(--budget-color) 0%, var(--app-accent-deep) 62%, color-mix(in srgb, var(--app-accent-deep) 82%, #000) 100%);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--budget-color) 32%, transparent);
}
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.budget-switcher { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; margin-bottom:10px; gap:8px; }
.budget-switcher select { min-width:0; min-height:38px; font-size:16px; padding:0 10px; border:1px solid var(--app-accent-border); border-radius:12px; color:var(--app-text); background:var(--app-card); font-weight:750; }
.new-budget-form { margin-bottom:14px; padding:14px; border:1px solid var(--app-accent-soft); border-radius:18px; background:var(--app-card); }
.new-budget-form .primary-button { width:100%; margin-top:14px; }
.dashboard-page-tabs { position:sticky; top:0; z-index:10; display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); margin:14px 0 2px; padding:6px 3px 3px; border:1px solid var(--app-accent-border); border-radius:15px; background:var(--app-card); box-shadow:0 8px 18px color-mix(in srgb, var(--app-shadow) 55%, transparent); gap:3px; }
.dashboard-page-tab { min-width:0; min-height:36px; padding:7px 5px; border:0; border-radius:11px; color:var(--app-muted); background:transparent; font-size:12px; font-weight:750; cursor:pointer; }
.dashboard-page-tab.is-selected { color:var(--app-text); background:var(--app-accent-soft); box-shadow:0 1px 3px var(--app-shadow); }
.dashboard-page-tab:focus-visible { outline:2px solid var(--app-accent); outline-offset:1px; }
.dashboard-pages { display:block; width:100%; overflow-x:hidden; overscroll-behavior-x:none; touch-action:pan-y; }
.dashboard-page { position:relative; min-width:0; padding:1px; }
.budget-settings-row { display:grid; grid-template-columns:minmax(0,1fr); gap:10px; }
.budget-choice { display:grid; margin:12px 0 0; padding:0; border:0; gap:7px; }
.budget-choice legend { padding:0; color:var(--app-muted); font-size:12px; font-weight:700; }
.budget-choice label { color:var(--app-text); font-size:13px; line-height:1.35; }
.budget-color-choice { min-width:0; }
.budget-color-picker { position:relative; display:flex; min-width:0; min-height:52px; align-items:center; gap:10px; padding:6px 10px; border:1px solid var(--app-accent-border); border-radius:14px; color:var(--app-text); background:var(--app-bg); font-size:12px; cursor:pointer; }
.budget-color-picker__preview { width:36px; height:36px; flex:0 0 auto; border-radius:50%; background:var(--budget-picker-color, #2A9D8F); box-shadow:inset 0 0 0 1px rgba(0,0,0,.16); }
.budget-color-picker input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.budget-color-picker:focus-within { outline:3px solid color-mix(in srgb, var(--app-accent) 42%, transparent); outline-offset:2px; }

.budget-card__glow {
  position: absolute;
  top: -100px;
  right: -60px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--budget-color) 40%, #fff 60%);
}

.budget-card__header { min-height:36px; position:relative; z-index:2; display:flex; grid-column:1 / -1; align-items:center; justify-content:space-between; gap:8px; }
.eyebrow {
  position: relative;
  margin: 0 0 5px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.budget-card h1 {
  position: relative;
  grid-column: 1 / -1;
  margin: 0;
  font-size: clamp(22px, 6vw, 27px);
  letter-spacing: -0.035em;
}
.budget-settings-button { --budget-control-background: color-mix(in srgb, var(--budget-color) 28%, #2d211b 72%); --budget-control-border: color-mix(in srgb, var(--budget-color) 58%, #fff 42%); position:relative; display:grid; flex:0 0 auto; width:36px; height:36px; place-items:center; border:1px solid var(--budget-control-border); border-radius:50%; color:var(--budget-color); background:var(--budget-control-background); box-shadow:0 2px 8px rgba(0,0,0,.14); cursor:pointer; }
.budget-settings-button:hover { background:var(--budget-control-background); }
.budget-settings-button:focus-visible { outline:3px solid rgba(255,255,255,.84); outline-offset:3px; }
.budget-settings-icon { position:relative; left:-0.5px; top:-0.5px; width:24px; height:24px; fill:currentColor; }
.budget-settings-panel { margin-top:12px; padding:18px; border-radius:20px; background:var(--app-card); box-shadow:0 12px 30px var(--app-shadow); }

.available-balance {
  position: relative;
  display: flex;
  grid-column: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  margin: 15px 0 0;
  padding: 11px 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.available-balance.is-negative strong {
  color: #a7442c;
}

.available-balance span {
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.available-balance strong {
  font-size: clamp(28px, 8vw, 35px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.055em;
}

.balance-grid {
  position: relative;
  display: grid;
  grid-column: 2;
  grid-template-columns: 1fr 1fr;
  margin-top: 15px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  gap: 8px;
}

.balance-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-end;
}

.balance-item--interactive { width:100%; padding:0; border:0; color:inherit; background:transparent; font:inherit; text-align:left; cursor:pointer; }
.balance-item--interactive:focus-visible { outline:2px solid rgba(255,255,255,.9); outline-offset:4px; border-radius:8px; }

.balance-item strong {
  margin-top: 2px;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.balance-label {
  color: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
}

.balance-icon {
  display: none;
}

.operations-card {
  margin-top: 17px;
  padding: 22px;
  border: 1px solid var(--app-accent-soft);
  border-radius: 26px;
  background: var(--app-card);
  box-shadow: 0 12px 30px var(--app-shadow);
}
.statistics-card { margin-top:17px; padding:22px; border:1px solid var(--app-accent-soft); border-radius:26px; background:var(--app-card); box-shadow:0 12px 30px var(--app-shadow); }
.statistics-card #statistics-month { min-height:38px; max-width:145px; border:1px solid var(--app-accent-border); border-radius:11px; color:var(--app-text); background:var(--app-bg); }
.statistics-totals { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); margin-top:14px; gap:8px; }
.statistics-totals div { min-width:0; padding:10px 7px; border-radius:13px; background:var(--app-bg); }
.statistics-totals span { display:block; color:var(--app-muted); font-size:11px; }.statistics-totals strong { display:block; margin-top:3px; overflow-wrap:anywhere; font-size:16px; }
.statistics-donut { position:relative; width:150px; height:150px; margin:18px auto; border-radius:50%; overflow:hidden; background:var(--app-accent-soft); }.statistics-donut::after { position:absolute; inset:38px; border-radius:50%; background:var(--app-card); content:""; }.statistics-donut__slice { position:absolute; inset:0; border-radius:50%; }
.statistics-list { display:grid; gap:5px; }.statistics-row { margin:0; padding:8px 0; border-bottom:1px solid var(--app-accent-soft); overflow-wrap:anywhere; font-size:13px; }.statistics-category-row { display:flex; align-items:flex-start; gap:8px; }.statistics-category-swatch { flex:0 0 auto; width:10px; height:10px; margin-top:4px; border:1px solid color-mix(in srgb, var(--app-text) 20%, transparent); border-radius:50%; }.statistics-subtitle { margin:20px 0 7px; font-size:15px; }
.statistics-chart-legend { display:flex; flex-wrap:wrap; margin:8px 0 4px; gap:12px; color:var(--app-muted); font-size:12px; font-weight:700; }.statistics-chart-legend span::before { display:inline-block; width:10px; height:10px; margin-right:5px; border-radius:50%; content:""; }.statistics-chart-legend__income::before { background:#087f5b; }.statistics-chart-legend__expense::before { background:#c2410c; }
.statistics-chart { display:block; width:100%; height:auto; margin:8px 0 4px; border-radius:12px; background:var(--app-bg); }.statistics-chart polyline { fill:none; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }.statistics-chart__income { stroke:#087f5b; }.statistics-chart__expense { stroke:#c2410c; }.statistics-chart__month { cursor:pointer; }.statistics-chart__month-hit { fill:transparent; }.statistics-chart__month-label { fill:var(--app-muted); font-size:8px; pointer-events:none; text-anchor:middle; }.statistics-chart__month:focus { outline:none; }.statistics-chart__month:focus .statistics-chart__month-hit { fill:var(--app-accent-soft); stroke:var(--app-accent); stroke-width:1; }.statistics-comparison-block { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; margin-top:6px; gap:8px; }.statistics-comparisons { display:grid; min-width:0; gap:3px; }.statistics-comparison-block .form-hint { margin:0; }.statistics-comparison-help { min-width:30px; min-height:30px; justify-self:end; padding:2px 6px; border:0; border-radius:50%; color:var(--app-accent-deep); background:var(--app-accent-soft); font-size:15px; font-weight:700; cursor:pointer; }.statistics-comparison-help:focus-visible { outline:2px solid var(--app-accent); outline-offset:2px; }.statistics-comparison-dialog { max-width:min(360px, calc(100% - 32px)); border:1px solid var(--app-accent-border); border-radius:16px; color:var(--app-text); background:var(--app-card); box-shadow:0 12px 32px var(--app-shadow); }.statistics-comparison-dialog::backdrop { background:rgba(0,0,0,.38); }.statistics-comparison-dialog h3 { margin:0; }.statistics-comparison-dialog .text-button { margin-top:12px; }.statistics-member-list { margin-bottom:4px; }
.statistics-kind-switch { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); width:100%; margin-top:18px; padding:4px; border-radius:14px; background:var(--app-accent-soft); gap:4px; }.statistics-kind-button { min-height:40px; padding:6px 12px; border:0; border-radius:11px; color:var(--app-text); background:transparent; font:inherit; font-size:13px; font-weight:700; cursor:pointer; }.statistics-kind-button[aria-pressed="true"] { color:#fff; background:var(--app-accent); }.statistics-kind-button:focus-visible, .statistics-member-toggle:focus-visible { outline:2px solid var(--app-accent); outline-offset:2px; }.statistics-member-toggle { display:flex; width:100%; min-height:38px; align-items:center; justify-content:space-between; gap:8px; padding:6px 0; border:0; color:var(--app-text); background:transparent; font:inherit; text-align:left; cursor:pointer; }.statistics-member-toggle::after { flex:0 0 auto; content:"⌄"; font-size:20px; line-height:1; transition:transform .15s ease; }.statistics-member-toggle[aria-expanded="true"]::after { transform:rotate(180deg); }.statistics-member-detail { margin:4px 0 10px; padding:0 10px 10px; border:1px solid var(--app-accent-soft); border-radius:14px; }.statistics-member-detail .statistics-donut { width:130px; height:130px; margin:12px auto; }.statistics-member-detail .statistics-donut::after { inset:33px; }.category-back-button { display:inline-flex; min-height:42px; align-items:center; margin:8px 0 2px; padding:0 14px; border:1px solid var(--app-accent); border-radius:12px; color:var(--app-accent-deep); background:var(--app-accent-soft); font:inherit; font-weight:800; cursor:pointer; }.category-back-button:focus-visible { outline:3px solid var(--app-accent); outline-offset:3px; }
#operation-change-category { margin:18px 0 10px; }
.deposit-card, .deposit-history-card, .statement-export-card { margin-top: 17px; padding: 22px; border: 1px solid var(--app-accent-soft); border-radius: 26px; background: var(--app-card); box-shadow: 0 12px 30px var(--app-shadow); }
.statement-export-card .primary-button { width:100%; margin-top:0; }
.deposit-history-title { margin:18px 0 0; font-size:15px; }
.invite-card { margin-top:17px; padding:22px; border:1px solid var(--app-accent-soft); border-radius:26px; background:var(--app-card); box-shadow:0 12px 30px var(--app-shadow); }.invite-card #invite-result { display:grid; grid-template-columns:minmax(0,1fr) auto; margin-top:12px; gap:8px; }.invite-card #invite-url { min-width:0; font-size:12px; }.members-list { display:grid; margin-top:12px; gap:6px; }.member-item { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; padding:9px 0; border-bottom:1px solid rgba(128,111,102,.18); color:var(--app-muted); font-size:13px; }.member-actions { display:flex; align-items:center; justify-content:flex-end; gap:2px; }.member-actions-toggle { display:grid; width:36px; height:36px; padding:0; place-items:center; border:0; border-radius:50%; color:var(--app-accent-deep); background:transparent; cursor:pointer; }.member-actions-toggle:focus-visible { outline:2px solid var(--app-accent); outline-offset:2px; }.member-actions-menu { display:flex; grid-column:1 / -1; flex-wrap:wrap; justify-content:flex-end; gap:2px; }.member-actions .text-button { min-height:28px; font-size:11px; }.member-actions-gear { width:24px; height:24px; fill:currentColor; transform-box:view-box; transform-origin:12px 12px; }.member-remove { color:#bc482c; }
.deposit-form .primary-button { width: 100%; margin-top: 10px; }.deposit-submit-bar { display:grid; place-items:center; position:sticky; z-index:1; bottom:0; margin:10px -4px -4px; padding:8px 4px calc(8px + env(safe-area-inset-bottom)); background:var(--app-card); box-shadow:0 -8px 16px color-mix(in srgb, var(--app-card) 76%, transparent); pointer-events:none; }.deposit-submit-bar > button { pointer-events:auto; }.deposit-history { display: grid; margin-top: 16px; gap: 8px; }.deposit-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:10px 0; border-bottom:1px solid rgba(128,111,102,.18); }.deposit-item small { color:var(--app-muted); font-size:11px; }.deposit-item__manual { display:block; margin-top:2px; }.deposit-item__author { display:block; margin-top:2px; }.deposit-amount--to { color:var(--app-accent-deep); }.deposit-amount--from { color:#2a9d8f; }

.operation-form-card { margin-top: 17px; padding: 22px; border: 1px solid var(--app-accent-soft); border-radius: 26px; background: var(--app-card); box-shadow: 0 12px 30px var(--app-shadow); }
.categories-manager { margin-top: 17px; padding: 22px; border: 1px solid var(--app-accent-soft); border-radius: 26px; background: var(--app-card); box-shadow: 0 12px 30px var(--app-shadow); }
.text-button { min-height: 34px; padding: 0 8px; border: 0; border-radius: 9px; color: var(--app-accent-deep); background: transparent; font-weight: 750; cursor: pointer; }
.category-editor { margin-top: 14px; }.category-editor .primary-button { width: 100%; margin-top: 16px; }.category-editor-details { display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:end; gap:10px; }.category-editor-details .field-label { margin-top:0; }.category-editor-details .field-label, .category-editor-details input { min-width:0; }.category-color-control { position:relative; display:grid; width:42px; height:42px; place-items:center; border:1px solid var(--app-accent-border); border-radius:50%; cursor:pointer; }.category-color-preview { width:32px; height:32px; border-radius:50%; background:var(--category-preview-color, #E87522); box-shadow:inset 0 0 0 1px rgba(0,0,0,.16); }.category-color-control input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }.category-delete-button { width:100%; min-height:42px; margin-top:8px; border:1px solid #bc482c; border-radius:13px; color:#bc482c; background:transparent; font-weight:750; cursor:pointer; }.secondary-button { width:100%; min-height:42px; margin-top:8px; border:1px solid var(--app-accent-border); border-radius:13px; color:var(--app-accent-deep); background:transparent; font-weight:750; cursor:pointer; }
.category-kind-readonly { margin:8px 0 0; color:var(--app-muted); font-size:13px; font-weight:700; }.category-editor.is-editing .category-name-label { display:none; }.subcategory-editor-details { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; }.subcategory-editor-details .field-label { min-width:0; margin-top:0; }.subcategory-editor-details input { min-width:0; }.subcategory-editor-details .category-color-control { margin-bottom:0; } #subcategory-form .primary-button { width:100%; margin-top:14px; }
.category-manager-status { margin-top: 12px; }.category-manager-status--success { color:var(--app-accent-deep); font-weight:700; }.managed-category-list { display: grid; margin-top: 14px; gap: 7px; }.managed-category-group { margin:10px 0 0; color:var(--app-muted); font-size:12px; font-weight:700; }.managed-category { display: grid; grid-template-columns: 12px minmax(0,1fr) auto; align-items: center; padding: 9px 0; border-bottom:1px solid rgba(128,111,102,.18); scroll-margin-top:58px; gap: 8px; }.managed-category strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.category-swatch { width:10px; height:10px; border-radius:50%; }.managed-actions { display:flex; gap:2px; }.managed-actions button, .categories-manager__button { display:grid; min-width:36px; min-height:36px; padding:0; place-items:center; border:0; border-radius:50%; color:var(--app-accent-deep); background:transparent; cursor:pointer; }.budget-settings-icon, .categories-manager__gear, .managed-category__gear { width:24px; height:24px; fill:currentColor; }.managed-category__edit:focus-visible, .categories-manager__button:focus-visible, .category-color-control:focus-within { outline:2px solid var(--app-accent); outline-offset:2px; } #archived-categories { margin-top:14px; color:var(--app-muted); } #archived-categories summary { cursor:pointer; font-weight:700; }
.subcategory-manager { grid-column:1 / -1; margin-top:14px; }.subcategory-manager__heading { margin:14px 0 10px; color:var(--app-text); font-size:16px; font-weight:750; scroll-margin-top:58px; }.subcategory-manager__heading#subcategory-manager-title { scroll-margin-top:58px; }.subcategory-manager__separator { margin-top:16px; padding-top:10px; border-top:1px solid var(--app-accent-soft); }
.kind-switch { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0; padding: 4px; border-radius: 14px; background: var(--app-accent-soft); gap: 4px; }
.kind-button, .category-button { min-height: 40px; border: 0; border-radius: 11px; color: var(--app-text); background: transparent; font-weight: 700; cursor: pointer; }.budget-settings-icon, .categories-manager__gear, .managed-category__gear { transform-box:view-box; transform-origin:12px 12px; }
.kind-button.is-selected { color: #fff; background: var(--app-accent); }
.field-label { display: grid; margin-top: 14px; color: var(--app-muted); font-size: 12px; font-weight: 700; gap: 5px; }
.amount-input, .field-label input, .field-label select { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid var(--app-accent-border); border-radius: 13px; color: var(--app-text); background: var(--app-bg); }
.field-label input:not(.amount-input), .field-label select { font-size: 16px; }
.amount-input { font-size: 20px; }
.amount-input { font-weight: 750; }
#operation-amount { margin-top: 9px; }
.form-hint { margin: 6px 0 0; color: var(--app-muted); font-size: 11px; }
.category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 15px; gap: 7px; }
.category-list.category-list--drilled { grid-template-columns:1fr; }.operation-subcategory-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:8px; }.operation-subcategory-button { min-height:42px; border:1px solid var(--subcategory-color); border-radius:11px; color:var(--subcategory-color); background:transparent; font-weight:700; overflow-wrap:anywhere; }.operation-subcategory-button[aria-pressed="true"] { color:#fff; background:var(--subcategory-color); }.subcategory-swatch { width:10px; height:10px; border-radius:50%; background:var(--subcategory-color); }
.category-button { min-width:0; min-height: 48px; padding: 7px 12px; border: 1px solid var(--category-color); color: var(--category-color); line-height:1.2; overflow-wrap:anywhere; }
.category-button.is-selected { color: #fff; background: var(--category-color); }
#operation-form .category-list + .date-time-row { margin-top:8px; }
#operation-form .date-time-row .field-label { margin-top:0; }
.date-time-row { display: grid; grid-template-columns: 1fr; gap: 6px; width:100%; min-width:0; max-width:100%; }
.date-time-row, .date-time-row .field-label, .date-time-row input { max-width:100%; box-sizing:border-box; }
.date-time-row .field-label, .date-time-row input { min-width:0; width:100%; }
.form-error { margin: 12px 0 0; color: #bc482c; font-size: 13px; }
.operation-submit-bar { display:grid; place-items:center; position:sticky; z-index:1; bottom:0; margin:10px -4px -4px; padding:8px 4px calc(8px + env(safe-area-inset-bottom)); background:var(--app-card); box-shadow:0 -8px 16px color-mix(in srgb, var(--app-card) 76%, transparent); pointer-events:none; }
.operation-submit-bar > button { pointer-events:auto; }
.operation-form-card:is(.is-amount-editing, .is-following-viewport) .operation-submit-bar { position:fixed; left:var(--operation-submit-left, 12px); bottom:0; width:var(--operation-submit-width, calc(100% - 24px)); margin:0; }
.operation-form-card:is(.is-amount-editing, .is-following-viewport) #operation-form .operation-submit-bar { margin:0; }
#deposit-form.is-amount-editing .deposit-submit-bar { position:fixed; z-index:30; left:var(--deposit-submit-left, 12px); bottom:0; width:var(--deposit-submit-width, calc(100% - 24px)); margin:0; box-sizing:border-box; pointer-events:auto; touch-action:manipulation; }
.operation-form-card, .deposit-card, .categories-manager, .deposit-goals-manager { scroll-margin-top:58px; }
.operation-submit { width:min(100%, 420px); }
#operation-form .date-time-row ~ .operation-submit-bar { margin:14px -4px -15px; }
#operation-form .operation-submit-bar .operation-submit { margin-top:0; }
.operation-submit:disabled { cursor: wait; opacity: 0.65; }
.operation-save-status { position:absolute; }.category-editor-message--success { color:#178f7b; font-weight:700; }.category-toast { position:fixed; z-index:3; right:12px; bottom:calc(12px + env(safe-area-inset-bottom)); left:12px; margin:0; padding:12px 14px; border:1px solid #0f6b59; border-radius:12px; color:#fff; background:#178f7b; box-shadow:0 8px 24px var(--app-shadow); font-size:14px; font-weight:700; }.budget-settings-panel .primary-button, .budget-delete-button { width:100%; }.budget-delete-button { min-height:42px; margin-top:8px; border:1px solid #bc482c; border-radius:13px; color:#bc482c; background:transparent; font-weight:750; cursor:pointer; }
.operations-list { display: grid; margin-top: 16px; gap: 8px; }
.operation-filters { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); margin-top:14px; gap:8px; }.operation-filters label { display:grid; min-width:0; color:var(--app-muted); font-size:11px; gap:3px; }.operation-filters input, .operation-filters select { min-width:0; min-height:36px; border:1px solid var(--app-accent-border); border-radius:9px; color:var(--app-text); background:var(--app-bg); }.operations-pagination { position:sticky; top:58px; z-index:2; display:flex; align-items:center; justify-content:space-between; margin-top:12px; padding:6px 0; gap:6px; background:var(--app-card); }.operations-pagination span { color:var(--app-muted); font-size:12px; text-align:center; }.operations-pagination button:disabled { opacity:.45; }
.operation-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(128, 111, 102, 0.18); gap: 10px; }
.operation-item div { min-width: 0; }
.operation-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-item small { color: var(--app-muted); font-size: 11px; }.operation-item small + small { margin-left:4px; }
.operation-marker { width: 8px; height: 28px; border-radius: 99px; background: var(--operation-category-color, #8b817b); }.operation-marker--income, .operation-marker--expense { background: var(--operation-category-color, #8b817b); }
.operation-amount { font-size: 15px; }.operation-amount--income { color: #178f7b; }.operation-amount--expense { color: #b44b33; }
.operation-actions, .operation-history { grid-column:2 / -1; }.operation-actions { display:flex; flex-wrap:wrap; gap:4px; }.operation-actions .text-button { min-height:28px; font-size:12px; }.operation-delete { color:#bc482c; }.operation-history { white-space:pre-line; padding:8px; border-radius:10px; background:color-mix(in srgb, var(--app-accent-soft) 36%, transparent); color:var(--app-muted); font-size:12px; }

@media (max-width: 480px) {
  .operation-form-card { padding-right:12px; padding-left:12px; }
  .date-time-row { grid-template-columns:1fr; gap:6px; }
  .date-time-row { width:100%; margin-inline:0; }
  .date-time-row .field-label { min-width:0; }
  .date-time-row input { min-width:0; width:100%; max-width:100%; padding:6px 4px; font-size:12px; }
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-heading--collapsible { gap:10px; }.section-heading--collapsible > :first-child { min-width:0; }.section-heading-actions { display:flex; align-items:center; flex:0 0 auto; gap:6px; }.section-collapse-toggle { display:grid; width:42px; height:32px; flex:0 0 auto; place-items:center; padding:0; border:1px solid var(--app-accent-border); border-radius:11px; color:var(--app-accent-deep); background:linear-gradient(135deg, var(--app-bg), color-mix(in srgb, var(--app-accent-soft) 72%, var(--app-bg))); box-shadow:0 4px 10px color-mix(in srgb, var(--app-shadow) 55%, transparent); cursor:pointer; transition:transform .16s ease, border-color .16s ease, box-shadow .16s ease; }.section-collapse-icon { width:18px; height:18px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:2.4; transition:transform .18s ease; }.section-collapse-toggle[aria-expanded="true"] .section-collapse-icon { transform:rotate(90deg); }.section-collapse-toggle:hover { border-color:var(--app-accent); box-shadow:0 6px 14px color-mix(in srgb, var(--app-shadow) 70%, transparent); transform:translateY(-1px); }.section-collapse-toggle:focus-visible { outline:2px solid var(--app-accent); outline-offset:2px; }.collapsible-section-content { margin-top:0; overflow-anchor:none; }
.section-settings-button { display:grid; width:36px; height:36px; flex:0 0 auto; place-items:center; padding:0; border:1px solid var(--app-accent-border); border-radius:50%; color:var(--app-accent); background:var(--app-bg); cursor:pointer; }.section-settings-button:focus-visible { outline:2px solid var(--app-accent); outline-offset:2px; }.section-settings-icon { width:24px; height:24px; fill:currentColor; transform-box:view-box; transform-origin:12px 12px; }

.eyebrow--dark {
  color: var(--app-accent-deep);
}

.section-heading h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.025em;
}

.count-badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: var(--app-accent-deep);
  background: var(--app-accent-soft);
  font-weight: 800;
}

.empty-state,
.state-card {
  text-align: center;
}

.empty-state {
  padding: 32px 12px 12px;
}

.empty-state h3,
.state-card h1 {
  margin: 20px 0 7px;
  letter-spacing: -0.025em;
}

.empty-state h3 { font-size: 19px; }

.empty-state p,
.state-card p {
  max-width: 310px;
  margin: 0 auto;
  color: var(--app-muted);
  font-size: 14px;
  line-height: 1.5;
}

.fox {
  position: relative;
  width: 90px;
  height: 74px;
  margin: 0 auto;
}

.fox__face {
  position: absolute;
  z-index: 2;
  top: 15px;
  left: 14px;
  width: 62px;
  height: 55px;
  border-radius: 23px 23px 29px 29px;
  background: linear-gradient(145deg, #ffab48, #ec6f1d);
  box-shadow: inset -7px -7px 12px rgba(188, 67, 8, 0.15), 0 9px 18px rgba(188, 67, 8, 0.18);
}

.fox__face::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 17px;
  width: 28px;
  height: 20px;
  border-radius: 50% 50% 55% 55%;
  background: #fff1d8;
}

.fox__face i {
  position: absolute;
  z-index: 2;
  top: 23px;
  width: 5px;
  height: 7px;
  border-radius: 50%;
  background: #602b12;
}

.fox__face i:first-child { left: 16px; }
.fox__face i:nth-child(2) { right: 16px; }

.fox__face b {
  position: absolute;
  z-index: 3;
  bottom: 11px;
  left: 28px;
  width: 7px;
  height: 5px;
  border-radius: 50% 50% 60% 60%;
  background: #602b12;
}

.fox__ear {
  position: absolute;
  z-index: 1;
  top: 6px;
  width: 28px;
  height: 30px;
  border-radius: 7px 18px 6px 15px;
  background: #ee741f;
  transform: rotate(45deg);
}

.fox__ear::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 4px 10px;
  background: #8d3a18;
  opacity: 0.42;
}

.fox__ear--left { left: 10px; }
.fox__ear--right { right: 10px; transform: rotate(45deg) scaleX(-1); }

.fox__tail {
  position: absolute;
  z-index: 0;
  right: -3px;
  bottom: 0;
  width: 48px;
  height: 25px;
  border-radius: 70% 50% 70% 25%;
  background: linear-gradient(90deg, #e66718 55%, #fff0d8 56%);
  transform: rotate(-13deg);
}

.state-card {
  display: grid;
  min-height: calc(100vh - 110px);
  align-content: center;
  justify-items: center;
  padding: 30px 20px;
}

.state-card--loading .fox { margin-bottom: 4px; }
.state-card h1 { font-size: 25px; }

.state-symbol {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 25px;
  color: #fff;
  background: linear-gradient(145deg, #f4953d, #da5b17);
  box-shadow: 0 12px 25px rgba(188, 67, 8, 0.2);
  font-size: 31px;
  font-weight: 800;
}

.state-symbol--error { background: linear-gradient(145deg, #e78658, #bd482c); }

.loading-dots {
  display: flex;
  margin-top: 25px;
  gap: 6px;
}

.loading-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--app-accent);
  animation: pulse 1.1s infinite ease-in-out;
}

.loading-dots i:nth-child(2) { animation-delay: 0.15s; }
.loading-dots i:nth-child(3) { animation-delay: 0.3s; }
.fox--bobbing { animation: bob 2.4s infinite ease-in-out; }

.primary-button {
  min-height: 48px;
  margin-top: 24px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--app-accent), var(--app-accent-deep));
  box-shadow: 0 10px 22px var(--app-accent-soft);
  font-weight: 750;
  cursor: pointer;
}

.primary-button:focus-visible {
  outline: 3px solid var(--app-accent-border);
  outline-offset: 3px;
}

.footer-note {
  margin: 22px 0 0;
  color: var(--app-muted);
  font-size: 11px;
  text-align: center;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

@keyframes pulse {
  0%, 70%, 100% { transform: scale(0.72); opacity: 0.35; }
  35% { transform: scale(1); opacity: 1; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --app-bg: var(--tg-theme-bg-color, #1f1815);
    --app-text: var(--tg-theme-text-color, #fff7f0);
    --app-muted: var(--tg-theme-hint-color, #b9a79d);
    --app-card: var(--tg-theme-secondary-bg-color, #2b211d);
    --app-shadow: rgba(0, 0, 0, 0.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .budget-switcher select { box-sizing: border-box; height: 44px; min-height: 44px; }
  .budget-color-picker { min-height: 52px; }
}

.budget-settings-icon, .categories-manager__gear, .managed-category__gear, .managed-deposit-goal__gear, .member-actions-gear { width:24px; height:24px; fill:currentColor; transform-box:view-box; transform-origin:12px 12px; }
.managed-item__name { cursor:pointer; }
.managed-item__name:focus-visible { outline:2px solid var(--app-accent); outline-offset:2px; border-radius:4px; }
.categories-manager__button, .managed-actions .managed-category__edit, .managed-deposit-goal__edit, .member-actions-toggle { color:var(--app-accent); }
.deposit-direction-switch { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.deposit-direction-switch .kind-button { min-width:0; padding:6px 5px; font-size:12px; line-height:1.15; }
.deposit-direction-switch .kind-button:last-child { grid-column:1 / -1; }
.deposit-between-goals { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
.deposit-goal-options { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); margin-top:2px; gap:7px; }
.deposit-goal-choice { min-width:0; min-height:46px; padding:6px 7px; font-size:12px; }
.deposit-goal-choice__name, .deposit-goal-choice__progress { display:block; overflow-wrap:anywhere; }
.deposit-goal-choice__progress { margin-top:2px; font-size:11px; font-weight:600; }
.deposit-goal-progress { display:grid; margin-top:16px; gap:7px; }
.deposit-goal-progress-item { display:grid; grid-template-columns:12px minmax(0, 1fr); align-items:center; gap:8px; padding:8px 0; border-bottom:1px solid rgba(128,111,102,.18); }
.deposit-goal-progress-item strong, .deposit-goal-progress-item small { display:block; overflow-wrap:anywhere; }
.deposit-goal-progress-item small { margin-top:3px; color:var(--app-muted); font-size:11px; }
.deposit-goals-manager { margin-top:17px; padding:22px; border:1px solid var(--app-accent-soft); border-radius:26px; background:var(--app-card); box-shadow:0 12px 30px var(--app-shadow); scroll-margin-top:58px; }
.deposit-goal-editor { margin-top:14px; }.deposit-goal-editor .primary-button { width:100%; }.deposit-goal-editor-details { display:grid; grid-template-columns:1fr; gap:8px; width:100%; box-sizing:border-box; }.deposit-goal-editor-details .field-label { min-width:0; width:100%; box-sizing:border-box; }.deposit-goal-editor-details .field-label input { box-sizing:border-box; min-width:0; width:100%; max-width:100%; }.deposit-goal-date-field { padding-right:0; box-sizing:border-box; }.deposit-goal-date-field input { display:block; width:100%; max-width:100%; margin-right:0; box-sizing:border-box; }.deposit-goal-target-row { display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:end; gap:10px; width:100%; min-width:0; }.deposit-goal-target-row .field-label { min-width:0; margin-top:0; }.deposit-goal-color-control { margin:0 0 4px; }.deposit-goal-editor.is-general-editing .deposit-goal-date-field, .deposit-goal-editor.is-general-editing #deposit-goal-target-field { display:none; }.deposit-goal-editor.is-general-editing .deposit-goal-target-row { display:flex; align-items:center; }.deposit-goal-editor.is-general-editing .deposit-goal-color-control { margin-top:0; }.managed-deposit-goal-list { display:grid; margin-top:14px; gap:7px; }.managed-deposit-goal { display:grid; grid-template-columns:12px minmax(0, 1fr) auto; align-items:center; padding:9px 0; border-bottom:1px solid rgba(128,111,102,.18); gap:8px; }.managed-deposit-goal strong, .managed-deposit-goal small { display:block; overflow-wrap:anywhere; }.managed-deposit-goal small { margin-top:3px; color:var(--app-muted); font-size:11px; }.managed-deposit-goal--archived { opacity:.62; }.managed-deposit-goal__delete { min-height:34px; padding:0 8px; border:1px solid #bc482c; border-radius:9px; color:#bc482c; background:transparent; font-size:11px; font-weight:750; cursor:pointer; }.managed-deposit-goal__delete:focus-visible { outline:2px solid #bc482c; outline-offset:2px; }.managed-actions .managed-deposit-goal__delete { display:inline-flex; min-width:auto; min-height:34px; padding:0 10px; border:1px solid #bc482c; border-radius:9px; color:#bc482c; background:transparent; font-size:11px; font-weight:750; align-items:center; justify-content:center; }.deposit-amount--between { color:var(--app-accent-deep); }
.deposit-statistics { margin-top:20px; padding-top:14px; border-top:1px solid var(--app-accent-soft); }.deposit-statistics h3 { margin:0; font-size:15px; }.deposit-statistics-chart { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); align-items:end; min-height:150px; margin-top:10px; gap:8px; }.deposit-statistics-item { display:grid; min-width:0; grid-template-rows:auto auto auto 86px auto; justify-items:center; align-items:end; gap:4px; }.deposit-statistics-item__date, .deposit-statistics-item__value, .deposit-statistics-item__percent, .deposit-statistics-item strong { max-width:100%; overflow:hidden; text-align:center; text-overflow:ellipsis; white-space:nowrap; }.deposit-statistics-item__date { color:var(--app-muted); font-size:10px; }.deposit-statistics-item__value { font-size:11px; font-weight:750; }.deposit-statistics-item__percent { color:var(--app-muted); font-size:10px; font-weight:700; }.deposit-statistics-item strong { width:100%; font-size:12px; }.deposit-statistics-bar { display:flex; width:100%; height:86px; align-items:flex-end; overflow:hidden; border:1px solid var(--app-accent-border); border-radius:10px 10px 4px 4px; background:var(--app-accent-soft); }.deposit-statistics-bar__fill { display:block; width:100%; min-height:0; border-radius:8px 8px 2px 2px; transition:height .2s ease; }
.deposit-goal-editor.is-general-editing .deposit-goal-target-row { display:block; }.deposit-goal-editor.is-general-editing .deposit-goal-color-control { display:flex; width:100%; min-height:48px; height:48px; margin:0; box-sizing:border-box; border-radius:12px; align-items:center; justify-content:center; }
@media (max-width:360px) { .deposit-between-goals, .deposit-goal-editor-details { grid-template-columns:1fr; }.deposit-goal-target-row { grid-template-columns:minmax(0, 1fr) auto; } }

.deposit-goal-date-field { min-width:0; overflow:visible; }
.deposit-goal-date-field input { display:block; min-width:0; width:100%; max-width:100%; min-inline-size:0; inline-size:100%; padding-inline:8px; box-sizing:border-box; }
.deposit-goal-editor.is-general-editing .deposit-goal-target-row { margin-top:12px; }
.deposit-goal-editor-details { grid-template-columns:minmax(0,1fr); }
.deposit-statistics { scroll-margin-top:58px; }
.deposit-statistics-chart { align-items:start; }
.deposit-statistics-item { grid-template-rows:118px auto; align-items:start; gap:6px; }
.deposit-statistics-item__caption { display:grid; width:100%; min-width:0; gap:2px; text-align:center; }
.deposit-statistics-item__name { width:100%; overflow:hidden; text-align:center; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.deposit-statistics-item__details { display:block; width:100%; color:var(--app-muted); font-size:10px; line-height:1.3; overflow-wrap:anywhere; text-align:center; }
.deposit-statistics-bar { position:relative; height:118px; }
.deposit-statistics-bar__fill { display:block; }
@media (max-width:360px) { .deposit-statistics-chart { grid-template-columns:repeat(2, minmax(0, 1fr)); } }

@media (max-width:480px) {
  .date-time-row input[type="date"], .date-time-row input[type="time"], .deposit-goal-date-field input[type="date"] { -webkit-appearance:none; appearance:none; min-width:0; width:100%; max-width:100%; padding:6px 8px; box-sizing:border-box; text-align:left; }
  .date-time-row input[type="date"]::-webkit-datetime-edit, .date-time-row input[type="time"]::-webkit-datetime-edit, .deposit-goal-date-field input[type="date"]::-webkit-datetime-edit { padding:0; }
  .date-time-row input[type="date"]::-webkit-calendar-picker-indicator, .date-time-row input[type="time"]::-webkit-calendar-picker-indicator, .deposit-goal-date-field input[type="date"]::-webkit-calendar-picker-indicator { margin:0; padding:0; }
}
