/* ============================================================================
 * Finance-Y — светлая тема: лавандово-персиковый градиент, белая «шторка»
 * контента, крупные скругления и сливовый акцент. Mobile-first.
 *
 * Порядок: токены → база → компоненты → 640px → 1024px → печать.
 * ========================================================================= */

/* --- 1. Токены ----------------------------------------------------------- */
:root {
  color-scheme: light;

  --grad-bg: linear-gradient(180deg, #c9b4de 0%, #d9c2dc 26%, #eed4d4 62%, #fbe4d3 100%);
  --bg:        #f3eef5;
  --sheet:     #ffffff;
  --surface:   #ffffff;
  --surface-2: #f5f1f7;
  --surface-3: #ebe4ee;
  --line:      rgba(60, 30, 70, .08);
  --line-2:    rgba(60, 30, 70, .16);

  --text:      #241a29;
  --muted:     #6a6074;   /* 5.9:1 на белом — мелкие подписи читаются */
  --faint:     #6f6579;   /* тоже держим норму AA для 12px */
  --on-accent: #ffffff;

  --accent:    #5b3566;
  --accent-2:  #7c4a8f;
  --accent-3:  #b48fc4;
  --accent-text: #5b3566;
  --accent-dim: rgba(91, 53, 102, .10);
  --accent-line: rgba(91, 53, 102, .22);
  --dark-pill: #3c2740;

  --pos:       #1f8f5f;
  --pos-dim:   rgba(31, 143, 95, .13);
  --neg:       #cf4444;
  --neg-dim:   rgba(207, 68, 68, .12);

  --grad-accent: linear-gradient(135deg, #6b4076 0%, #3c2740 100%);
  --grad-progress: linear-gradient(90deg, #f2b7c9 0%, #a066b8 55%, #5b3566 100%);
  --gauge-off: #e6d8ea;

  --r-xs: 12px;
  --r-sm: 16px;
  --r:    22px;
  --r-lg: 28px;
  --r-sheet: 32px;
  --pill: 999px;

  --sh-card: 0 10px 28px rgba(63, 32, 74, .08);
  --sh-pop:  0 22px 60px rgba(40, 18, 50, .22);
  --sh-fab:  0 12px 26px rgba(60, 39, 64, .38);

  --u: 4px;
  --topbar-h: 60px;
  --nav-h: 66px;
  --tap: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: 'Open Sans', 'Google Sans', -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;

  /* Пастельные плитки категорий — как цветные иконки сервисов в референсе. */
  --tile-1-bg: #d8f2e4; --tile-1-fg: #17805a;
  --tile-2-bg: #fde0e2; --tile-2-fg: #c8434c;
  --tile-3-bg: #ece1f8; --tile-3-fg: #7040a6;
  --tile-4-bg: #fdeecd; --tile-4-fg: #b3800f;
  --tile-5-bg: #dcebff; --tile-5-fg: #2a68b5;
  --tile-6-bg: #f7e3d6; --tile-6-fg: #a2643a;
}

/* Тёмный вариант — тот же язык форм, но ночная палитра. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --grad-bg: linear-gradient(180deg, #2b1f33 0%, #241b2c 40%, #1a1420 100%);
  --bg:        #140f19;
  --sheet:     #1c1622;
  --surface:   #221b29;
  --surface-2: #2a2233;
  --surface-3: #362c40;
  --line:      rgba(255, 255, 255, .07);
  --line-2:    rgba(255, 255, 255, .14);

  --text:      #f3edf6;
  --muted:     #a99fb4;
  --faint:     #8e849a;

  --accent:    #c49ad6;
  --accent-2:  #d9b8e6;
  --accent-3:  #8d6aa0;
  --accent-text: #d9b8e6;
  --accent-dim: rgba(196, 154, 214, .16);
  --accent-line: rgba(196, 154, 214, .32);
  --dark-pill: #c49ad6;
  --on-accent: #221528;

  --pos:       #4ad295;
  --pos-dim:   rgba(74, 210, 149, .16);
  --neg:       #ff6b6b;
  --neg-dim:   rgba(255, 107, 107, .16);

  --grad-accent: linear-gradient(135deg, #c49ad6 0%, #9a6fae 100%);
  --grad-progress: linear-gradient(90deg, #e6b3cd 0%, #c49ad6 55%, #8d6aa0 100%);
  --gauge-off: #3a2f44;

  --sh-card: 0 12px 30px rgba(0, 0, 0, .38);
  --sh-pop:  0 24px 60px rgba(0, 0, 0, .55);
  --sh-fab:  0 12px 26px rgba(0, 0, 0, .5);

  --tile-1-bg: rgba(74, 210, 149, .16); --tile-1-fg: #4ad295;
  --tile-2-bg: rgba(255, 107, 107, .16); --tile-2-fg: #ff8b8b;
  --tile-3-bg: rgba(196, 154, 214, .18); --tile-3-fg: #d9b8e6;
  --tile-4-bg: rgba(228, 179, 66, .16); --tile-4-fg: #e9c069;
  --tile-5-bg: rgba(90, 150, 230, .16); --tile-5-fg: #85b3f0;
  --tile-6-bg: rgba(196, 140, 96, .16); --tile-6-fg: #d3a074;
}

/* --- 2. База ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--grad-bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 calc(var(--u) * 2); }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--on-accent); }

* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--pill); border: 3px solid transparent; background-clip: content-box; }

.ico { display: inline-block; flex: none; }
[data-icon] { display: inline-flex; align-items: center; }

/* --- 3. Шапка на градиенте ----------------------------------------------- */
.topbar {
  position: relative; z-index: 30;
  display: flex; align-items: center; gap: calc(var(--u) * 2);
  min-height: var(--topbar-h); padding: calc(var(--u) * 3) calc(var(--u) * 5) var(--u);
  background: transparent;
}
.brand { display: flex; align-items: center; gap: calc(var(--u) * 2); flex: none; }
.brand__mark {
  width: 38px; height: 38px; border-radius: var(--r-xs);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-accent); color: #fff;
  box-shadow: var(--sh-card);
}
.brand__text { display: none; font-size: 13px; font-weight: 800; line-height: 1.15; letter-spacing: .04em; text-transform: uppercase; }

.period {
  display: flex; align-items: center; gap: 2px; margin: 0 auto;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--pill); padding: 3px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
:root[data-theme="dark"] .period { background: rgba(255, 255, 255, .07); border-color: var(--line); }
.period[hidden] { display: none; }
.period .btn {
  min-height: 32px; min-width: 32px; padding: 0 var(--u);
  background: transparent; border: 0; box-shadow: none; color: var(--muted);
}
.period__label { min-width: 116px; justify-content: center; font-size: 13px; font-weight: 700; color: var(--text); padding: 0 calc(var(--u) * 2); }

.topbar__actions { display: flex; align-items: center; gap: var(--u); flex: none; margin-left: auto; }
#quick-add { display: none; }
.btn__text { display: none; }

/* Площадка на градиенте: приветствие, карточки счетов, шкала лимита */
.stage:empty { display: none; }
.stage { padding-bottom: calc(var(--u) * 2); }

/* Приветствие и аватар — как в референсе */
.hello { display: flex; align-items: center; gap: calc(var(--u) * 3); padding: 0 calc(var(--u) * 5) calc(var(--u) * 4); }
.hello__text { min-width: 0; flex: 1; }
.hello__hi { font-size: 13px; color: var(--muted); }
.hello__name { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.hello__avatar {
  width: 46px; height: 46px; border-radius: var(--pill); flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-accent); color: #fff;
  font-weight: 700; font-size: 17px;
  box-shadow: var(--sh-card);
}

/* --- 4. Кнопки ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: calc(var(--u) * 2);
  min-height: var(--tap);
  padding: 0 calc(var(--u) * 5);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--pill);
  font-size: 14px; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: background .18s ease, color .18s ease, transform .12s ease, opacity .18s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.btn--primary { background: var(--grad-accent); color: #fff; box-shadow: var(--sh-card); }
:root[data-theme="dark"] .btn--primary { color: var(--on-accent); }
.btn--icon { padding: 0; min-width: var(--tap); }
.btn--ghost { background: transparent; color: var(--muted); }
.btn--sm { min-height: 36px; padding: 0 calc(var(--u) * 4); font-size: 13px; }
.btn--sm.btn--icon { min-width: 36px; }
.btn--block { width: 100%; }
.btn--danger { color: var(--neg); background: var(--neg-dim); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--surface-3); }
  .btn--primary:hover { filter: brightness(1.08); background: var(--grad-accent); }
  .btn--ghost:hover { background: var(--surface-2); }
  .btn--danger:hover { background: var(--neg); color: #fff; }
}

/* --- 5. Каркас: белая «шторка» контента ---------------------------------- */
.shell { display: block; }

.view {
  background: var(--sheet);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: calc(var(--u) * 5) calc(var(--u) * 5);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 104px);
  min-height: calc(100vh - var(--topbar-h) - 40px);
  box-shadow: 0 -8px 30px rgba(60, 30, 70, .10);
}
.view:focus { outline: none; }

/* Нижнее меню — белая пилюля с приподнятой круглой кнопкой */
.nav {
  position: fixed; z-index: 40;
  left: calc(var(--u) * 4); right: calc(var(--u) * 4);
  bottom: calc(var(--safe-b) + var(--u) * 3);
  display: flex; align-items: center; justify-content: space-between;
  gap: 2px; padding: calc(var(--u) * 1.5) calc(var(--u) * 2);
  height: var(--nav-h);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  box-shadow: var(--sh-pop);
}
.nav__item {
  flex: 1; min-width: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: var(--u) 2px;
  border: 0; background: none; cursor: pointer;
  color: var(--faint);
  font-size: 10px; font-weight: 600;
  border-radius: var(--pill);
  transition: color .18s ease, background .18s ease;
}
.nav__item--primary, .nav__item--more { display: flex; }
.nav__item.is-active { color: var(--accent-text); background: var(--accent-dim); }
.nav__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.nav__label--full { display: none; }
.nav__key, .nav__spacer, .nav__note { display: none; }
/* Место под центральную кнопку */
.nav__gap { flex: 0 0 64px; }

.fab {
  position: fixed; z-index: 45;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + var(--u) * 5);
  width: 62px; height: 62px; border-radius: var(--pill);
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-accent); color: #fff;
  border: 4px solid var(--sheet);
  box-shadow: var(--sh-fab);
  cursor: pointer;
  transition: transform .14s ease, filter .18s ease;
}
:root[data-theme="dark"] .fab { color: var(--on-accent); }
.fab:active { transform: translateX(-50%) scale(.93); }
.fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* --- 6. Заголовок экрана ------------------------------------------------- */
.page-head {
  display: flex; align-items: center; gap: calc(var(--u) * 2);
  margin: 0 0 calc(var(--u) * 4); flex-wrap: wrap;
}
.page-head h1 { display: flex; align-items: center; gap: calc(var(--u) * 2); }
.page-head h1 .ico { color: var(--accent); }
.page-head__sub { font-size: 13px; color: var(--muted); width: 100%; order: 3; margin-top: calc(var(--u) * -1); }
.page-head__actions { margin-left: auto; display: flex; gap: var(--u); flex-wrap: wrap; }

/* --- 7. Сетка и карточки ------------------------------------------------- */
.grid { display: grid; gap: calc(var(--u) * 4); grid-template-columns: minmax(0, 1fr); }
.col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-12 { grid-column: 1 / -1; }

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-card);
  min-width: 0;
  overflow: hidden;
}
.card__head {
  display: flex; align-items: center; gap: calc(var(--u) * 2);
  padding: calc(var(--u) * 4) calc(var(--u) * 4) calc(var(--u) * 2);
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  text-transform: none;
}
.card__head .ico { color: var(--accent); }
.card__head .btn { min-height: 32px; padding: 0 calc(var(--u) * 3); font-size: 12px; background: var(--surface-2); }
.card__tools { margin-left: auto; display: flex; align-items: center; gap: var(--u); font-size: 13px; color: var(--muted); }
.card__body { padding: calc(var(--u) * 2) calc(var(--u) * 4) calc(var(--u) * 4); }
.card__body--flush { padding: 0 0 calc(var(--u) * 2); }

/* --- 8. Показатели ------------------------------------------------------- */
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat__label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; }
.stat__value { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.stat__value--lg { font-size: 30px; }
.stat__value--sm { font-size: 18px; }
.stat__hint { font-size: 12.5px; color: var(--faint); display: flex; align-items: center; gap: var(--u); flex-wrap: wrap; }
.stat__hint > .progress { flex: 1; min-width: 70px; }

.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.stat-row > * { min-width: 0; padding: calc(var(--u) * 4); background: var(--surface); }

/* Карточки счетов лентой — как в референсе */
.wallets {
  display: flex; gap: calc(var(--u) * 3);
  overflow-x: auto; padding: 0 calc(var(--u) * 5) calc(var(--u) * 4);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.wallets::-webkit-scrollbar { display: none; }
.wallet {
  flex: 0 0 200px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: calc(var(--u) * 2);
  padding: calc(var(--u) * 4);
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--sh-card);
}
.wallet__top { display: flex; align-items: center; justify-content: space-between; }
.wallet__name { font-size: 12.5px; color: var(--muted); }
.wallet__sum { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.wallet__foot { display: flex; align-items: center; gap: var(--u); }
.wallet__btn {
  flex: 1; min-height: 34px; border: 0; cursor: pointer;
  border-radius: var(--pill); background: var(--surface-2); color: var(--text);
  font-size: 12.5px; font-weight: 600;
}

/* --- 9. Типографика ------------------------------------------------------ */
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-weight: 700; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.upper { text-transform: uppercase; letter-spacing: .06em; }
.center { text-align: center; }
.right { text-align: right; }
.strike { text-decoration: line-through; opacity: .6; }
.amount--in { color: var(--pos); }
.amount--out { color: var(--text); }

/* --- 10. Значки, чипы, плитки -------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px calc(var(--u) * 2);
  border-radius: var(--pill);
  background: var(--surface-2); color: var(--muted);
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.badge--fill { background: var(--accent-dim); color: var(--accent-text); }
.badge--pos { background: var(--pos-dim); color: var(--pos); }
.badge--neg { background: var(--neg-dim); color: var(--neg); }

.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--u);
  min-height: 36px; padding: 0 calc(var(--u) * 4);
  border-radius: var(--pill);
  background: var(--surface-2); border: 1px solid transparent;
  color: var(--muted); cursor: pointer;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip.is-on { background: var(--dark-pill); border-color: transparent; color: var(--on-accent); }
:root[data-theme="dark"] .chip.is-on { color: var(--on-accent); }
.chips { display: flex; flex-wrap: wrap; gap: var(--u); }

/* Цветные плитки категорий: цвет выбирается по имени иконки */
.tile {
  width: 42px; height: 42px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs);
  background: var(--tile-3-bg); color: var(--tile-3-fg);
}
.tile--c1 { background: var(--tile-1-bg); color: var(--tile-1-fg); }
.tile--c2 { background: var(--tile-2-bg); color: var(--tile-2-fg); }
.tile--c3 { background: var(--tile-3-bg); color: var(--tile-3-fg); }
.tile--c4 { background: var(--tile-4-bg); color: var(--tile-4-fg); }
.tile--c5 { background: var(--tile-5-bg); color: var(--tile-5-fg); }
.tile--c6 { background: var(--tile-6-bg); color: var(--tile-6-fg); }
.tile--fill { background: var(--grad-accent); color: #fff; }
:root[data-theme="dark"] .tile--fill { color: var(--on-accent); }
.tile--lg { width: 50px; height: 50px; border-radius: var(--r-sm); }

/* --- 11. Списки и таблицы ------------------------------------------------ */
.list { list-style: none; margin: 0; padding: 0; }
.list__item {
  display: flex; align-items: center; gap: calc(var(--u) * 3);
  flex-wrap: wrap;
  padding: calc(var(--u) * 3) calc(var(--u) * 4);
}
.list__item + .list__item { border-top: 1px solid var(--line); }
.list__main { min-width: 0; flex: 1; }
.list__title { display: flex; align-items: center; gap: var(--u); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.list__sub { font-size: 12.5px; color: var(--faint); display: flex; gap: calc(var(--u) * 1.5); flex-wrap: wrap; }
.list__side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.list__amount { font-size: 15px; font-weight: 700; white-space: nowrap; letter-spacing: -0.02em; }
.list__actions { display: flex; gap: var(--u); width: 100%; justify-content: flex-end; }
.list__actions--secondary { display: none; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: calc(var(--u) * 3); text-align: left; }
.table th { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.table tbody tr { border-top: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }

.day-sep {
  display: flex; align-items: center; gap: calc(var(--u) * 2);
  padding: calc(var(--u) * 4) calc(var(--u) * 4) var(--u);
  color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.day-sep__sum { margin-left: auto; }

/* --- 12. Прогресс -------------------------------------------------------- */
.progress {
  position: relative; height: 8px;
  border-radius: var(--pill);
  background: var(--surface-2);
  overflow: hidden;
}
.progress__fill { height: 100%; border-radius: var(--pill); background: var(--grad-progress); transition: width .5s cubic-bezier(.32,.72,0,1); }
.progress__fill--low { background: linear-gradient(90deg, #f6cddc, #c79ad6); }
.progress__fill--full { background: linear-gradient(90deg, #f0a6a6, var(--neg)); }
.progress--lg { height: 12px; }
.progress-row { display: flex; align-items: center; gap: calc(var(--u) * 2); }
.progress-row .progress { flex: 1; }

/* --- 13. Графики --------------------------------------------------------- */
.spark { width: 100%; height: auto; display: block; border-radius: var(--r-sm); }

.donut { position: relative; width: 100%; max-width: 220px; margin: 0 auto; }
.donut__svg { width: 100%; height: auto; }
.donut__seg { transition: opacity .2s ease; }
.donut__center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.donut__caption { font-size: 11.5px; color: var(--muted); }
.donut__value { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }
.donut__legend { display: grid; gap: calc(var(--u) * 2); margin-top: calc(var(--u) * 4); }
.donut__row { display: flex; align-items: center; gap: calc(var(--u) * 2); font-size: 13.5px; }
.donut__dot { width: 10px; height: 10px; border-radius: var(--pill); flex: none; }
.donut__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.donut__sum { color: var(--muted); font-weight: 700; }

.gauge { position: relative; width: 100%; max-width: 300px; margin: 0 auto; }
.gauge__svg { width: 100%; height: auto; }
.gauge__center {
  position: absolute; left: 0; right: 0; bottom: 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
}
.gauge__caption { font-size: 12.5px; color: var(--muted); }
.gauge__value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
/* Пилюля с текущей суммой — под крупной цифрой, чтобы не лезть на шкалу. */
.gauge__marker {
  margin-top: calc(var(--u) * 1.5);
  background: var(--dark-pill); color: var(--on-accent);
  font-size: 12px; font-weight: 700;
  padding: 4px calc(var(--u) * 3); border-radius: var(--pill);
}
.gauge__note { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: calc(var(--u) * 2); }
:root[data-theme="dark"] .gauge__marker { color: var(--on-accent); }

.bars { display: flex; align-items: stretch; gap: calc(var(--u) * 1.5); height: 160px; }
.bars__col { flex: 1; display: flex; flex-direction: column; gap: var(--u); min-width: 0; }
.bars__stack { display: flex; align-items: flex-end; justify-content: center; gap: 3px; flex: 1; }
.bars__bar { width: 42%; border-radius: var(--pill); min-height: 4px; }
.bars__bar--in { background: var(--surface-3); }
.bars__bar--out { background: var(--grad-progress); }
.bars__label { font-size: 11px; text-align: center; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars-scroll { overflow-x: auto; padding-bottom: var(--u); }

.hbar { display: grid; grid-template-columns: 42px 1fr auto; gap: calc(var(--u) * 3); align-items: center; }
.hbar + .hbar { margin-top: calc(var(--u) * 3); }
.hbar__track { height: 8px; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; }
.hbar__fill { height: 100%; border-radius: var(--pill); background: var(--grad-progress); }
.hbar__name { font-size: 13.5px; font-weight: 600; }

.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.heat__cell {
  aspect-ratio: 1; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; color: var(--faint);
  background: var(--surface-2);
}
.heat__cell--l0 { background: var(--surface-2); }
.heat__cell--l1 { background: #ecdff2; color: #6f4f7d; }
.heat__cell--l2 { background: #d6bde3; color: #4a2a56; }
.heat__cell--l3 { background: #ab7cc0; color: #fff; }
.heat__cell--l4 { background: var(--accent); color: #fff; }
.heat__cell--void { background: transparent; }
:root[data-theme="dark"] .heat__cell--l1 { background: rgba(196,154,214,.2); color: var(--accent-2); }
:root[data-theme="dark"] .heat__cell--l2 { background: rgba(196,154,214,.38); color: #f3edf6; }
:root[data-theme="dark"] .heat__cell--l3 { background: rgba(196,154,214,.62); color: #1b1420; }
:root[data-theme="dark"] .heat__cell--l4 { background: var(--accent); color: #1b1420; }
.heat__head { font-size: 10px; font-weight: 700; text-align: center; color: var(--faint); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend__box { width: 12px; height: 12px; border-radius: 4px; background: var(--surface-3); flex: none; }
.legend__box--out { background: var(--grad-progress); }
.legend__box--in { background: var(--surface-3); }

.share { display: flex; height: 10px; border-radius: var(--pill); overflow: hidden; gap: 2px; background: var(--surface-2); }
.share__seg { height: 100%; }

/* --- 14. Формы ----------------------------------------------------------- */
.form { display: grid; gap: calc(var(--u) * 4); }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 4); }
.field { display: flex; flex-direction: column; gap: calc(var(--u) * 1.5); min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, .textarea {
  width: 100%; min-height: 52px;
  padding: 0 calc(var(--u) * 4);
  background: var(--surface-2); color: var(--text);
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: 15px;
  transition: border-color .18s ease, background .18s ease;
}
.textarea { padding: calc(var(--u) * 3) calc(var(--u) * 4); min-height: 92px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input--amount { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; min-height: 66px; }
.field__hint { font-size: 12px; color: var(--faint); }
.field__err { font-size: 12.5px; font-weight: 600; color: var(--neg); }

.switch { display: flex; align-items: center; gap: calc(var(--u) * 3); cursor: pointer; min-height: 40px; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__box { width: 46px; height: 27px; flex: none; position: relative; border-radius: var(--pill); background: var(--surface-3); transition: background .2s ease; }
.switch__box .ico { display: none; }
.switch__box::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: var(--pill);
  background: #fff; box-shadow: 0 2px 6px rgba(40,20,50,.25);
  transition: transform .2s cubic-bezier(.32,.72,0,1);
}
.switch input:checked + .switch__box { background: var(--accent); }
.switch input:checked + .switch__box::after { transform: translateX(19px); }
.switch input:focus-visible + .switch__box { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: var(--pill); }
.seg__btn {
  flex: 1; min-height: 40px; padding: 0 var(--u);
  border: 0; background: transparent; color: var(--muted);
  border-radius: var(--pill); cursor: pointer;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .2s ease, color .2s ease;
}
.seg__btn.is-on { background: var(--dark-pill); color: var(--on-accent); box-shadow: var(--sh-card); }

.icon-picker {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: var(--u); max-height: 168px; overflow-y: auto;
  padding: var(--u); background: var(--surface-2); border-radius: var(--r-sm);
}
.icon-picker__btn {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer;
  border-radius: var(--r-xs); color: var(--muted);
}
.icon-picker__btn.is-on { background: var(--accent); color: #fff; }

/* --- 15. Выпадающий список ----------------------------------------------- */
.dd { position: relative; min-width: 0; }
.dd__btn {
  width: 100%; min-height: 52px;
  display: flex; align-items: center; gap: calc(var(--u) * 2);
  padding: 0 calc(var(--u) * 3) 0 calc(var(--u) * 4);
  background: var(--surface-2); color: var(--text);
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: 15px; text-align: left; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.dd__btn.is-empty .dd__value { color: var(--faint); }
.dd__btn[aria-expanded="true"] { border-color: var(--accent); background: var(--surface); }
.dd__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dd__icon { display: inline-flex; color: var(--accent-text); flex: none; }
.dd__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd__chev { display: inline-flex; color: var(--faint); flex: none; transition: transform .22s cubic-bezier(.32,.72,0,1); }
.dd__btn[aria-expanded="true"] .dd__chev { transform: rotate(180deg); color: var(--accent); }

.dd-pop {
  position: fixed; z-index: 70;
  max-height: 320px; overflow: hidden;
  display: flex; flex-direction: column;
  padding: var(--u);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-pop);
  transform-origin: top center;
  animation: dd-in .18s cubic-bezier(.32,.72,0,1) both;
}
.dd-pop--up { transform-origin: bottom center; }
.dd-pop.is-closing { animation: dd-out .12s ease both; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-6px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes dd-out { to { opacity: 0; transform: translateY(-4px) scale(.99) } }
.dd-pop__list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.dd-pop__title { padding: calc(var(--u) * 2) calc(var(--u) * 3) calc(var(--u) * 3); font-size: 17px; font-weight: 700; }
.dd-opt {
  display: flex; align-items: center; gap: calc(var(--u) * 2);
  width: 100%; min-height: 48px;
  padding: 0 calc(var(--u) * 3);
  background: transparent; border: 0; border-radius: var(--r-xs);
  color: var(--text); font-size: 15px; text-align: left; cursor: pointer;
}
.dd-opt__icon { display: inline-flex; color: var(--faint); flex: none; }
.dd-opt__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-opt__note { color: var(--faint); font-size: 13px; }
.dd-opt > .ico { color: var(--accent); }
.dd-opt.is-on { background: var(--accent-dim); color: var(--accent-text); }
.dd-opt.is-on .dd-opt__icon { color: var(--accent-text); }
.dd-opt:focus-visible { outline: none; background: var(--surface-2); }

.dd-pop--sheet {
  left: 0; right: 0; bottom: 0; top: auto;
  width: auto !important; max-height: 76vh;
  padding: calc(var(--u) * 3) calc(var(--u) * 3) calc(var(--u) * 3 + var(--safe-b));
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  animation: sheet-in .24s cubic-bezier(.32,.72,0,1) both;
}
.dd-pop--sheet.is-closing { animation: sheet-out .16s ease both; }
@keyframes sheet-in { from { transform: translateY(100%) } to { transform: none } }
@keyframes sheet-out { to { transform: translateY(30%); opacity: 0 } }
.dd-pop--sheet .dd-opt { min-height: 54px; font-size: 16px; }
.dd-backdrop {
  position: fixed; inset: 0; z-index: 69;
  background: rgba(30, 15, 40, .45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: backdrop-in .2s ease both;
}
.dd-backdrop.is-closing { animation: dd-out .14s ease both; }

/* --- 16. Модалка --------------------------------------------------------- */
.modal-root {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(30, 15, 40, .48);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: backdrop-in .2s ease both;
}
@keyframes backdrop-in { from { opacity: 0 } to { opacity: 1 } }
.modal-root[hidden] { display: none; }
.modal {
  width: 100%; max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--sheet);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: var(--sh-pop);
  animation: sheet-in .24s cubic-bezier(.32,.72,0,1) both;
}
.modal__head {
  display: flex; align-items: center; gap: calc(var(--u) * 2);
  padding: calc(var(--u) * 5) calc(var(--u) * 5) calc(var(--u) * 2);
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em;
}
.modal__head .ico { color: var(--accent); }
.modal__close {
  margin-left: auto; background: var(--surface-2); border: 0;
  border-radius: var(--pill); cursor: pointer; color: var(--muted);
  min-width: 36px; min-height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.modal__close .ico { color: inherit; }
.modal__body { padding: calc(var(--u) * 2) calc(var(--u) * 5) calc(var(--u) * 5); overflow-y: auto; flex: 1; }
.modal__foot {
  display: flex; gap: calc(var(--u) * 2); justify-content: flex-end;
  padding: calc(var(--u) * 3) calc(var(--u) * 5);
  padding-bottom: calc(var(--u) * 5 + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--sheet);
}
.modal__foot .btn { flex: 1; }
.modal__foot .grow { display: none; }

.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--u) * 3); }
.menu-grid__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--u);
  padding: calc(var(--u) * 5) var(--u);
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--r); font-size: 13px; font-weight: 600; color: var(--muted);
}
.menu-grid__item .ico { color: var(--faint); }
.menu-grid__item.is-on { background: var(--accent-dim); color: var(--accent-text); }
.menu-grid__item.is-on .ico { color: var(--accent); }

/* --- 17. Тосты ----------------------------------------------------------- */
.toasts {
  position: fixed; z-index: 80;
  left: calc(var(--u) * 4); right: calc(var(--u) * 4);
  bottom: calc(var(--safe-b) + var(--nav-h) + var(--u) * 6);
  display: flex; flex-direction: column; gap: var(--u);
}
.toast {
  display: flex; align-items: center; gap: calc(var(--u) * 2);
  padding: calc(var(--u) * 3) calc(var(--u) * 4);
  background: var(--dark-pill); color: var(--on-accent);
  border-radius: var(--r); box-shadow: var(--sh-pop);
  font-size: 13.5px;
  animation: sheet-in .2s ease both;
}
.toast .ico { color: currentColor; }
.toast__act { margin-left: auto; background: rgba(255,255,255,.16); color: inherit; }

/* --- 18. Пустое состояние ------------------------------------------------ */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 2);
  padding: calc(var(--u) * 7) calc(var(--u) * 3); text-align: center;
}
.empty__art {
  width: 68px; height: 68px; border-radius: var(--pill);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim); color: var(--accent);
  margin-bottom: var(--u);
}
.empty__title { font-size: 16px; font-weight: 700; }
.empty__text { font-size: 13px; color: var(--muted); max-width: 42ch; }

/* --- 19. Экран входа ----------------------------------------------------- */
.auth {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--u) * 5);
  background: var(--bg); background-image: var(--grad-bg);
  overflow-y: auto;
}
body.is-auth { overflow: hidden; }
body.is-auth .topbar, body.is-auth .shell, body.is-auth .nav, body.is-auth .fab { display: none; }
.auth__card {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: calc(var(--u) * 3);
  padding: calc(var(--u) * 7) calc(var(--u) * 6) calc(var(--u) * 6);
  background: var(--sheet); border-radius: var(--r-lg);
  box-shadow: var(--sh-pop);
  animation: sheet-in .3s cubic-bezier(.32,.72,0,1) both;
}
.auth__brand {
  width: 56px; height: 56px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-accent); color: #fff;
  box-shadow: var(--sh-card);
}
.auth__title { font-size: 26px; letter-spacing: -0.03em; }
.auth__sub { font-size: 13.5px; color: var(--muted); margin: calc(var(--u) * -2) 0 var(--u); }
.auth__error { font-size: 13px; font-weight: 600; color: var(--neg); min-height: 18px; }
.auth__note { font-size: 12px; color: var(--faint); margin: 0; }

/* --- 20. Анимации -------------------------------------------------------- */
:root { --ease-out: cubic-bezier(.32,.72,0,1); --ease-soft: cubic-bezier(.4,0,.2,1); }

@keyframes rise-in { from { opacity: 0; transform: translateY(14px) scale(.99) } to { opacity: 1; transform: none } }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@keyframes ripple-out { from { transform: scale(0); opacity: .3 } to { transform: scale(1); opacity: 0 } }

.anim-rise { animation: rise-in .44s var(--ease-out) both; animation-delay: var(--d, 0ms); }
.anim-fade { animation: fade-in .34s var(--ease-out) both; animation-delay: var(--d, 0ms); }
.hbar__fill, .bars__bar { transition: width .55s var(--ease-out), height .55s var(--ease-out); }

/* .fab не трогаем: у неё собственный position: fixed */
.btn, .chip, .nav__item, .dd-opt, .menu-grid__item, .seg__btn, .icon-picker__btn, .wallet__btn {
  position: relative; overflow: hidden;
}
.fab { overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; animation: ripple-out .5s var(--ease-soft) forwards; }
.btn--primary .ripple, .fab .ripple, .seg__btn.is-on .ripple, .chip.is-on .ripple { background: #fff; }

.chip:active, .nav__item:active, .menu-grid__item:active, .dd__btn:active, .wallet__btn:active { transform: scale(.97); }
.chip, .nav__item, .menu-grid__item, .dd__btn, .tile, .list__item, .wallet {
  transition: transform .16s var(--ease-soft), background .2s ease, color .2s ease, box-shadow .2s ease;
}
.card { transition: box-shadow .25s ease, transform .2s var(--ease-soft); }
.list__item:hover .tile { transform: scale(1.05); }
.heat__cell { transition: transform .16s var(--ease-out), background .2s ease; }
.heat__cell:hover { transform: scale(1.12); }
@keyframes value-swap { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: none } }
.period__label.is-swapping { animation: value-swap .26s var(--ease-out); }

@media (pointer: coarse) {
  .btn--sm, .card__head .btn { min-height: 40px; }
  .btn--sm.btn--icon { min-width: 40px; }
  .chip { min-height: 40px; }
}

/* --- 21. Утилиты --------------------------------------------------------- */
.row { display: flex; align-items: center; gap: calc(var(--u) * 2); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--tight { gap: var(--u); }
.stack { display: grid; gap: calc(var(--u) * 3); }
.stack--lg { gap: calc(var(--u) * 5); }
.mt { margin-top: calc(var(--u) * 3); }
.mb { margin-bottom: calc(var(--u) * 3); }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: calc(var(--u) * 4) 0; }
.divider--dashed { background: none; border-top: 1px dashed var(--line-2); }
.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; }
.nowrap { white-space: nowrap; }
.only-wide { display: none !important; }
.range-foot { display: grid; gap: calc(var(--u) * 2); }
.range-foot .seg { width: 100%; }

/* ==========================================================================
 * ПЛАНШЕТ: от 640px
 * ====================================================================== */
@media (min-width: 640px) {
  body { font-size: 15.5px; }
  h1 { font-size: 26px; }

  .topbar { gap: calc(var(--u) * 4); padding: calc(var(--u) * 4) calc(var(--u) * 7) var(--u); }
  .brand__text { display: block; }
  .btn__text { display: inline; }
  .period__label { min-width: 168px; font-size: 14px; }
  .hello { padding: 0 calc(var(--u) * 7) calc(var(--u) * 5); }
  .wallets { padding: 0 calc(var(--u) * 7) calc(var(--u) * 5); }

  .view { padding: calc(var(--u) * 6) calc(var(--u) * 7); padding-bottom: calc(var(--nav-h) + 112px); }
  .page-head { margin-bottom: calc(var(--u) * 5); }
  .page-head__sub { width: auto; order: 0; margin-top: 0; }

  .grid { gap: calc(var(--u) * 5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-12 { grid-column: 1 / -1; }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 1; }

  .stat-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .stat__value { font-size: 24px; }
  .stat__value--lg { font-size: 34px; }

  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--wide { grid-column: 1 / -1; }

  .list__item { padding: calc(var(--u) * 3) calc(var(--u) * 5); }
  .bars { height: 190px; }
  .only-wide { display: inline-flex !important; }

  .modal-root { align-items: center; padding: calc(var(--u) * 6); }
  .modal { max-width: 560px; max-height: 86vh; border-radius: var(--r-lg); animation: pop-in .2s var(--ease-out) both; }
  @keyframes pop-in { from { transform: scale(.97); opacity: 0 } to { transform: none; opacity: 1 } }
  .modal--wide { max-width: 780px; }
  .modal__foot { padding-bottom: calc(var(--u) * 5); }
  .modal__foot .btn { flex: none; }
  .modal__foot .grow { display: block; flex: 1; }

  .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toasts { left: auto; right: calc(var(--u) * 6); max-width: 380px; }
  .range-foot { grid-template-columns: minmax(0, 340px) 1fr; align-items: center; }
  .range-foot > .tiny { text-align: right; }
}

/* ==========================================================================
 * ДЕСКТОП: от 1024px — боковое меню и 12 колонок
 * ====================================================================== */
@media (min-width: 1024px) {
  :root { --topbar-h: 76px; }

  #quick-add { display: inline-flex; }
  .fab { display: none; }

  .shell { display: flex; align-items: flex-start; gap: calc(var(--u) * 5); padding: 0 calc(var(--u) * 7) calc(var(--u) * 7); }

  .nav {
    position: sticky; top: calc(var(--u) * 4);
    left: auto; right: auto; bottom: auto;
    width: 244px; flex: none; height: auto;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 2px; padding: calc(var(--u) * 3);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--sh-card);
  }
  .nav__item {
    display: flex; flex: none;
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: calc(var(--u) * 3);
    padding: calc(var(--u) * 3);
    border-radius: var(--r-sm);
    font-size: 14px; text-align: left; width: 100%;
  }
  .nav__item--more, .nav__gap { display: none; }
  .nav__item.is-active { background: var(--grad-accent); color: #fff; box-shadow: var(--sh-card); }
  :root[data-theme="dark"] .nav__item.is-active { color: var(--on-accent); }
  .nav__label--short { display: none; }
  .nav__label--full { display: block; }
  .nav__key {
    display: block; margin-left: auto;
    font-size: 11px; color: var(--faint);
    background: var(--surface-2); border-radius: 6px; padding: 1px 6px;
  }
  .nav__item.is-active .nav__key { background: rgba(255,255,255,.18); color: #fff; }
  .nav__spacer { display: block; flex: 1; min-height: calc(var(--u) * 3); }
  .nav__note { display: block; font-size: 12px; color: var(--faint); padding: calc(var(--u) * 3); border-top: 1px solid var(--line); }

  .view {
    flex: 1; min-width: 0;
    border-radius: var(--r-lg);
    padding: calc(var(--u) * 6);
    padding-bottom: calc(var(--u) * 8);
    min-height: auto;
  }
  /* Площадка выравнивается по той же сетке, что и «шторка» с меню. */
  .stage { padding: 0 calc(var(--u) * 7); }
  .hello { padding: 0 0 calc(var(--u) * 4); }
  .wallets { padding: 0 0 calc(var(--u) * 5); }
  .toasts { bottom: calc(var(--u) * 5); }

  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .col-3 { grid-column: span 3; }
  .col-4 { grid-column: span 4; }
  .col-5 { grid-column: span 5; }
  .col-6 { grid-column: span 6; }
  .col-7 { grid-column: span 7; }
  .col-8 { grid-column: span 8; }

  .list__item { flex-wrap: nowrap; }
  .list__actions { width: auto; }
  .list__actions .btn { flex: none; }
  .list__actions--secondary { display: flex; }
}

@media (hover: hover) and (pointer: fine) {
  .nav__item:hover { color: var(--text); background: var(--surface-2); }
  .nav__item.is-active:hover { color: #fff; }
  .list__item:hover { background: var(--surface-2); }
  .table tbody tr:hover { background: var(--surface-2); }
  .icon-picker__btn:hover { background: var(--surface-3); color: var(--text); }
  .menu-grid__item:hover { background: var(--surface-3); color: var(--text); }
  .modal__close:hover { background: var(--surface-3); color: var(--text); }
  .chip:hover { background: var(--surface-3); color: var(--text); }
  .chip.is-on:hover { background: var(--dark-pill); color: var(--on-accent); }
  .seg__btn:hover:not(.is-on) { color: var(--text); }
  .card:hover { box-shadow: 0 14px 34px rgba(63, 32, 74, .12); }
  .wallet:hover { transform: translateY(-2px); }
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .list__actions--secondary { opacity: 0; transition: opacity .16s ease; }
  .list__item:hover .list__actions--secondary,
  .list__item:focus-within .list__actions--secondary { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .topbar, .nav, .fab, .toasts, .page-head__actions, .card__tools, .list__actions, .hello { display: none !important; }
  body { background: #fff; }
  .view { box-shadow: none; border-radius: 0; padding: 0; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
}
