/* ===== Шрифт ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== Темы ===== */
:root {
  --bg: #f7f8f6; --card: #ffffff; --text: #18201e; --text-2: #69736f;
  --accent: #0f766e; --accent-soft: rgba(15,118,110,.10); --accent-hover: #0b5f59;
  --border: rgba(24,32,30,.10); --stroke: rgba(24,32,30,.10);
  --danger: #c2413b; --ok: #188255;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(18, 32, 29, .04);
  --shadow-md: 0 1px 2px rgba(18, 32, 29, .05), 0 8px 24px rgba(18, 32, 29, .04);
  --shadow-lg: 0 20px 50px rgba(18, 32, 29, .12);
  --income: #188255; --expense: #c2413b;
}
html[data-theme="dark"] {
  --bg: #101413; --card: #171d1b; --text: #edf3f0; --text-2: #8da09a;
  --accent: #2dd4bf; --accent-soft: rgba(45,212,191,.12); --accent-hover: #14b8a6;
  --border: rgba(237,243,240,.10); --stroke: rgba(237,243,240,.10);
  --danger: #fb716d; --ok: #63d49d;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.3); --shadow-md: 0 4px 16px rgba(0,0,0,.36); --shadow-lg: 0 12px 40px rgba(0,0,0,.46);
}
html[data-theme="ocean"] {
  --bg: #edf3f8; --card: #ffffff; --text: #1a2d3d; --text-2: #6a8499;
  --accent: #3a7ca5; --accent-soft: rgba(58,124,165,.10); --accent-hover: #2d6a91;
  --border: rgba(20,60,90,.08); --stroke: rgba(20,60,90,.08); --danger: #c84a2a; --ok: #3a7a6a;
}
html[data-theme="forest"] {
  --bg: #eef4ec; --card: #ffffff; --text: #1e2e1c; --text-2: #7a8f76;
  --accent: #4a8a52; --accent-soft: rgba(74,138,82,.10); --accent-hover: #3a7a42;
  --border: rgba(30,70,30,.08); --stroke: rgba(30,70,30,.08); --danger: #c05028; --ok: #4a8a52;
}
html[data-theme="graphite"] {
  --bg: #14161a; --card: #1e2128; --text: #e8eaee; --text-2: #7a8494;
  --accent: #7c9fd4; --accent-soft: rgba(124,159,212,.14); --accent-hover: #6c8fc4;
  --border: rgba(255,255,255,.08); --stroke: rgba(255,255,255,.08);
  --danger: #e87060; --ok: #5bba6a;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.3); --shadow-md: 0 4px 16px rgba(0,0,0,.36); --shadow-lg: 0 12px 40px rgba(0,0,0,.46);
}

/* Детский режим — яркие дружелюбные цвета, крупнее шрифт */
html[data-theme="kids"] {
  --bg: #FFF8E7; --card: #FFFFFF; --text: #2D2D2D; --text-2: #6B6B6B;
  --accent: #FF8A4C; --accent-soft: rgba(255,138,76,.16); --accent-hover: #FF6A2C;
  --border: rgba(0,0,0,.06); --stroke: rgba(0,0,0,.06);
  --danger: #E63946; --ok: #06A77D;
  --shadow-sm: 0 2px 6px rgba(255,138,76,.18); --shadow-md: 0 6px 22px rgba(255,138,76,.22); --shadow-lg: 0 14px 44px rgba(255,138,76,.26);
}
html[data-theme="kids"] body { font-size: 16px; }
html[data-theme="kids"] .glass-card { border-radius: 20px; }
html[data-theme="kids"] .btn-primary { border-radius: 14px; font-weight: 700; }
html[data-theme="kids"] .topbar-title { font-weight: 800; }

/* Океанский глубокий — для взрослого «sea» вида */
html[data-theme="berry"] {
  --bg: #FFF5F7; --card: #FFFFFF; --text: #2D1B2E; --text-2: #6B5566;
  --accent: #C2185B; --accent-soft: rgba(194,24,91,.10); --accent-hover: #A91550;
  --border: rgba(0,0,0,.08); --stroke: rgba(0,0,0,.08);
  --danger: #D32F2F; --ok: #2E7D32;
  --shadow-sm: 0 1px 4px rgba(194,24,91,.10); --shadow-md: 0 4px 16px rgba(194,24,91,.14); --shadow-lg: 0 12px 40px rgba(194,24,91,.18);
}

/* ===== Сброс и базовые стили ===== */
*, *::before, *::after { box-sizing: border-box; }
html {
  /* Запрещаем горизонтальное растягивание (резинку) — Safari/iOS PWA */
  overflow-x: clip;
  /* Защищает от показа Safari chrome при overscroll'е */
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-size: 15px; line-height: 1.45;
  overflow-x: clip;
  overscroll-behavior: none;
  /* Полная высота для standalone PWA (без адресной строки) */
  min-height: 100vh;
  min-height: 100dvh;
}
input, select, button, textarea { font-family: inherit; font-size: 15px; }
[hidden] { display: none !important; }
/* Тёмный текст под status-bar = переопределяется темой; если black-translucent — фон body виден за status-bar */
@supports (padding-top: env(safe-area-inset-top)) {
  body { padding-top: 0; } /* контент сам сдвинется через topbar */
}

/* ===== Экран входа ===== */
.login-screen {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: var(--bg);
}
.login-card {
  background: var(--card); border-radius: 16px; padding: 34px 26px 26px;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0;
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 14px;
  background: var(--accent); border-radius: 14px;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(15,118,110,.24);
}
.login-logo svg { width: 36px; height: 36px; }
.login-card h1 { margin: 0 0 16px; font-size: 22px; font-weight: 800; letter-spacing: 0; }
.login-sub { margin: 0 0 12px; color: var(--text-2); font-size: 13px; }
#auth-tabs { margin-bottom: 16px; }

.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card input {
  width: 100%; display: block;
  padding: 13px 15px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--bg); color: var(--text);
  transition: border-color .15s;
  outline: none;
}
.login-card input:focus { border-color: var(--accent); background: var(--card); }
.login-card .btn-primary { width: 100%; display: block; margin-top: 4px; }
.login-card .btn-ghost { width: 100%; display: block; }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 8px 0 0; }
#auth-tabs { margin-bottom: 16px; }

/* ===== Топбар ===== */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px;
  padding-top: calc(11px + env(safe-area-inset-top));
  background: rgba(255,255,255,.88); border-bottom: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: blur(18px);
}
.topbar-brand { display: flex; align-items: center; gap: 8px; }
.topbar-icon {
  width: 30px; height: 30px; background: var(--accent); border-radius: 8px;
  display: grid; place-items: center; flex: none;
}
.topbar-icon svg { width: 18px; height: 18px; }
.topbar-title { font-weight: 800; font-size: 17px; letter-spacing: 0; }
.topbar-who {
  color: var(--text-2); font-size: 13px; font-weight: 500;
  background: var(--accent-soft); padding: 4px 10px; border-radius: 999px;
}

/* ===== Контент ===== */
#tab-root {
  max-width: 760px; margin: 0 auto;
  padding: 14px 14px 110px;
  display: flex; flex-direction: column; gap: 12px;
}
.section-title { font-weight: 750; font-size: 15px; letter-spacing: 0; margin: 0 0 2px; }

/* ===== Карточка ===== */
.glass-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-md);
}

/* ===== Кнопки ===== */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 12px 18px;
  font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 8px 18px rgba(15,118,110,.18);
  transition: transform .12s, background .15s, box-shadow .15s;
  letter-spacing: 0;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 10px 22px rgba(15,118,110,.22); }
.btn-primary:active { transform: scale(.97); }

.btn-ghost {
  background: transparent; color: var(--text); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 10px 16px; cursor: pointer;
  font-weight: 500; font-size: 14px;
  transition: background .12s, border-color .12s;
}
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.icon-btn {
  background: transparent; border: none; color: var(--text-2);
  cursor: pointer; padding: 7px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }

/* ===== Поля ввода ===== */
input.fld, select.fld, textarea.fld {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: #fbfcfb; color: var(--text);
  outline: none; transition: border-color .15s, background .15s;
  display: block;
}
input.fld:focus, select.fld:focus, textarea.fld:focus {
  border-color: var(--accent); background: var(--card);
}
label.lbl { display: block; font-size: 11px; font-weight: 700; color: var(--text-2); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .4px; }

/* ===== KPI ===== */
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 12px;
  box-shadow: var(--shadow-sm);
}
.kpi .lab { font-size: 10px; font-weight: 750; color: var(--text-2); text-transform: uppercase; letter-spacing: .35px; }
.kpi .val { font-size: 19px; font-weight: 800; margin-top: 5px; letter-spacing: 0; }
.kpi.income .val { color: var(--ok); }
.kpi.expense .val { color: var(--danger); }

/* ===== Строки операций ===== */
.tx {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.tx:last-child { border-bottom: none; }
.tx[data-act] { cursor: pointer; margin: 0 -4px; padding: 11px 8px; border-radius: 10px; }
.tx[data-act]:hover { background: var(--accent-soft); }
.tx .ic {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-soft); display: grid; place-items: center;
  font-size: 19px; flex: none;
}
.tx .mid { flex: 1; min-width: 0; }
.tx .mid b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .mid small { color: var(--text-2); font-size: 12px; }
.tx .amt { font-weight: 700; white-space: nowrap; font-size: 15px; }
.tx .amt.income { color: var(--ok); }
.tx .amt.expense { color: var(--danger); }
.author-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* ===== Chips ===== */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: background .12s, border-color .12s, color .12s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }

/* ===== Категории ===== */
.cat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--border);
}
.cat-row:last-child { border-bottom: none; }
.cat-row.arch { opacity: .45; }

/* ===== Утилиты ===== */
.empty { text-align: center; color: var(--text-2); padding: 28px 16px; font-size: 14px; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

/* ===== Темы-свотчи ===== */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-top: 12px; }
.theme-swatch {
  border: 1.5px solid var(--border); border-radius: 13px; padding: 8px;
  background: var(--card); color: var(--text); cursor: pointer; font-size: 11px;
  font-weight: 600; text-align: center; transition: border-color .12s;
}
.theme-swatch:hover { border-color: var(--accent); }
.theme-swatch.active { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.theme-swatch .sw { height: 30px; border-radius: 8px; margin-bottom: 6px; }

/* ===== Модалка ===== */
.fh-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: grid; place-items: end center;
  z-index: 400; padding: 0;
  animation: fadeIn .15s;
}
@media (min-width: 500px) {
  .fh-modal-overlay { place-items: center; padding: 20px; }
  .fh-modal { border-radius: 20px !important; max-height: 90vh !important; }
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.fh-modal {
  background: var(--card); border-radius: 20px 20px 0 0;
  padding: 14px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg); max-height: 92dvh;
  overflow-y: auto;
  animation: slideUp .2s cubic-bezier(.22,1,.36,1);
  position: relative;
}
.fh-modal-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 12px;
  cursor: grab;
  flex-shrink: 0;
}
@keyframes slideUp { from { transform: translateY(60px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

/* ===== SVG диаграмма ===== */
.legend { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.legend .li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .li .sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend .li .nm { flex: 1; font-weight: 500; }
.legend .li .vl { color: var(--text-2); font-size: 12px; }

/* ===== Нижняя навигация ===== */
.fh-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.fh-nav-btn {
  flex: 1; min-width: 0; max-width: 80px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 5px 2px;
  transition: color .15s;
}
.fh-nav-btn svg {
  width: 22px; height: 22px;
  padding: 5px; box-sizing: content-box;
  border-radius: 10px;
  transition: background .15s, color .15s;
}
.fh-nav-btn span { font-size: 10px; font-weight: 600; white-space: nowrap; }
@media (max-width: 360px) {
  .fh-nav-btn span { font-size: 9px; }
  .fh-nav-btn svg { padding: 4px; width: 20px; height: 20px; }
}
.fh-nav-btn.active { color: var(--accent); }
.fh-nav-btn.active svg { background: var(--accent-soft); }

@media (min-width: 760px) {
  .fh-nav {
    max-width: 760px; margin: 0 auto; left: 50%; transform: translateX(-50%);
    border: 1px solid var(--border); border-radius: 18px; bottom: 16px;
    width: calc(100% - 32px);
  }
}

/* ===== Pull-to-refresh ===== */
#ptr-indicator {
  position: fixed; left: 50%; top: 56px;
  transform: translate(-50%, -80px);
  z-index: 50;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  display: grid; place-items: center;
  color: var(--accent);
  transition: transform .25s ease;
  pointer-events: none;
}
#ptr-indicator svg { width: 22px; height: 22px; transition: transform .2s; }
#ptr-indicator.spinning svg { animation: ptr-spin 1s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ===== Свайпы на строках операций ===== */
.tx { position: relative; overflow: hidden; touch-action: pan-y; }
.tx.swiping { transition: none !important; }
.tx.swipe-reset { transition: transform .25s ease !important; transform: translateX(0) !important; }
.tx-swipe-bg {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  font-size: 14px; font-weight: 700; color: #fff;
  padding: 0 22px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
}
.tx-swipe-bg.edit  { justify-content: flex-start; background: linear-gradient(90deg, #2563EB 0%, #3B82F6 100%); }
.tx-swipe-bg.del   { justify-content: flex-end;   background: linear-gradient(270deg, #DC2626 0%, #EF4444 100%); }
.tx-swipe-bg.active { opacity: 1; }
.tx-swipe-bg span { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Иконочные кнопки в шапках вкладок ===== */
.tx-iconbtn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s, color .12s;
  position: relative;
}
.tx-iconbtn:hover { background: var(--accent-soft); color: var(--accent); }
.tx-iconbtn:active { transform: scale(.93); }
.tx-iconbtn svg { width: 20px; height: 20px; }
.tx-iconbtn.active { color: var(--accent); }
.tx-iconbtn.active::after {
  content: '';
  position: absolute; right: 6px; top: 6px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--card, #fff);
}

/* ===== FAB (Floating Action Button) ===== */
#fab-add {
  position: fixed;
  right: 16px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px rgba(201,111,74,.45), 0 2px 6px rgba(0,0,0,.12);
  z-index: 9;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .15s, box-shadow .2s, background .15s;
}
#fab-add:hover { background: var(--accent-hover); box-shadow: 0 10px 26px rgba(201,111,74,.55); }
#fab-add:active { transform: scale(.92); }
#fab-add svg { width: 26px; height: 26px; }

@media (min-width: 760px) {
  /* Поднимаем FAB ВЫШЕ плавающей панели навигации и прижимаем к правому краю контента */
  #fab-add {
    right: max(20px, calc((100% - 760px) / 2 + 20px));
    bottom: 92px;
    z-index: 11;
  }
}

/* Action sheet */
#fab-sheet {
  position: fixed; inset: 0;
  z-index: 99990;
  pointer-events: none;
}
#fab-sheet .fab-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .22s;
  pointer-events: auto;
}
#fab-sheet .fab-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--card, #fff);
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(0,0,0,.18);
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
  pointer-events: auto;
  max-width: 480px;
  margin: 0 auto;
}
#fab-sheet.open .fab-backdrop { opacity: 1; }
#fab-sheet.open .fab-card { transform: translateY(0); }

.fab-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 12px;
}
.fab-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .6px;
  text-align: center;
  margin-bottom: 12px;
}

.fab-opt {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 4px;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.fab-opt:hover:not([disabled]) { background: var(--bg, #f7f9fc); }
.fab-opt:active:not([disabled]) { background: var(--accent-soft); }
.fab-opt[disabled] { opacity: .45; cursor: not-allowed; }

.fab-opt-ic {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.fab-opt-ic svg { width: 20px; height: 20px; }

.fab-opt-lbl {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.fab-opt-lbl b { font-size: 15px; color: var(--text); font-weight: 600; }
.fab-opt-lbl small { font-size: 12px; color: var(--text-2); }

.fab-cancel {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  border-radius: 12px;
}
.fab-cancel:hover { background: var(--bg, #f7f9fc); color: var(--text); }

/* ===== Кнопки управления в "Ещё" ===== */
.manage-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 12px 6px;
  background: transparent; border: none; border-radius: 10px;
  cursor: pointer; text-align: left; font-family: inherit;
  color: var(--text);
  transition: background .12s;
}
.manage-btn:hover, .manage-btn:active { background: var(--accent-soft); }
.manage-btn .manage-ic {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.manage-btn .manage-label {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  font-weight: 600; font-size: 14px;
}
.manage-btn .manage-label small {
  font-weight: 400; font-size: 12px; color: var(--text-2);
}
.manage-btn .manage-arrow {
  color: var(--text-2); flex-shrink: 0;
}

/* ===== Мобильный вид KPI (2 колонки на маленьком экране) ===== */
@media (max-width: 400px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-row .kpi:first-child { grid-column: 1 / -1; }
  .kpi .val { font-size: 18px; }
}

/* ===== Verify-баннер ===== */
#verify-banner { background: linear-gradient(135deg,#0f766e,#188255); }

/* ===== Прогресс-бар целей ===== */
.goal-progress { height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.goal-progress-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width .5s cubic-bezier(.22,1,.36,1); }

/* ===== Переключатель иконок категорий ===== */
#icon-grid { scrollbar-width: thin; }
#icon-grid::-webkit-scrollbar { width: 4px; }
#icon-grid::-webkit-scrollbar-track { background: transparent; }
#icon-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ===== NashBudget redesign concept ===== */
.home-hero {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfa 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-md);
}
.home-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.home-eyebrow {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.home-balance {
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
  margin-top: 8px;
  color: var(--text);
}
.home-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.home-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.home-metric {
  background: #f7faf8;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  min-width: 0;
}
.home-metric span {
  display: block;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-metric b {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-metric.income b { color: var(--ok); }
.home-metric.expense b { color: var(--danger); }
.home-metric.forecast b { color: var(--accent); }
.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 -4px;
}
.home-section-head .section-title { margin: 0; }
.home-section-note {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.fh-nav {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 -10px 28px rgba(18, 32, 29, .06);
}
.fh-nav-btn {
  max-width: 86px;
}
.fh-nav-btn svg {
  border-radius: 9px;
}
.fh-nav-btn.active svg {
  background: var(--accent);
  color: #fff;
}

#fab-add {
  border-radius: 16px;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(15,118,110,.28), 0 2px 6px rgba(0,0,0,.10);
}
#fab-add:hover {
  background: var(--accent-hover);
  box-shadow: 0 14px 32px rgba(15,118,110,.34);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .fh-nav {
  background: rgba(23,29,27,.88);
}
html[data-theme="dark"] input.fld,
html[data-theme="dark"] select.fld,
html[data-theme="dark"] textarea.fld,
html[data-theme="dark"] .home-metric {
  background: rgba(255,255,255,.03);
}
html[data-theme="dark"] .home-hero {
  background: linear-gradient(180deg, #171d1b 0%, #141a18 100%);
}

@media (max-width: 400px) {
  .home-hero { padding: 16px; }
  .home-metrics { grid-template-columns: 1fr; }
  .home-metric {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }
  .home-metric b { margin-top: 0; }
}
