/* ============================================================
   Трекер — один слой стилей, одна система.

   Цвет: глубокий фон, один уровень поверхностей, один уровень
   интерактивных элементов, тонкие полупрозрачные границы.
   Один акцент (мягкая мята) + семантика: расход/минус и долг.
   Типографика: одна шкала, цифры всегда tabular-nums.
   Ритм: отступы кратны 4, три радиуса на всё приложение.
   ============================================================ */

:root {
  color-scheme: dark;            /* нативные пикеры и селекты — в тёмной теме */

  /* --- Поверхности --- */
  --bg:          #0A0A0C;
  --surface:     #141417;
  --raised:      #1E1E24;
  --raised-2:    #26262E;
  --line:        rgba(255, 255, 255, .06);
  --line-strong: rgba(255, 255, 255, .11);

  /* --- Текст --- */
  --text:   #F3F3F6;
  --text-2: #A8A8B2;
  --text-3: #70707B;

  /* --- Акцент и семантика --- */
  --accent:      #7BD3A8;
  --accent-ink:  #06130D;
  --accent-soft: rgba(123, 211, 168, .12);
  --danger:      #EE8477;
  --danger-soft: rgba(238, 132, 119, .10);
  --warn:        #E0B26A;
  --warn-soft:   rgba(224, 178, 106, .10);

  /* --- Радиусы: три на всё --- */
  --r-card: 20px;
  --r-ctl:  12px;
  --r-pill: 999px;

  /* --- Отступы: кратны 4 --- */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px;

  /* --- Типографика --- */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --fs-display: 42px;
  --fs-h1:      30px;
  --fs-h2:      17px;
  --fs-body:    15px;
  --fs-note:    13.5px;
  --fs-meta:    12px;

  /* --- Движение --- */
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- База ---------- */
* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { margin: 0; user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }

/* Один тихий источник света сверху — глубина без «стекла» */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background: radial-gradient(120% 52% at 50% -12%, rgba(123, 211, 168, .07), transparent 62%);
}

h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.full { width: 100%; }
.tnum { font-variant-numeric: tabular-nums; }
.in  { color: var(--accent); }
.out { color: var(--danger); }

/* ---------- Каркас ---------- */
#app {
  position: relative; z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(var(--s3), env(safe-area-inset-top)) var(--s4) 120px;
}

.view { display: flex; flex-direction: column; gap: var(--s3); }
.stack { display: flex; flex-direction: column; gap: var(--s3); }

.view-head { padding: var(--s2) var(--s1) var(--s2); }
.view-head h1 {
  font-size: var(--fs-h1);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.12;
}
.view-sub {
  margin-top: 6px;
  font-size: var(--fs-note);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* Появление экрана: короткий подъём, без каскада */
.view.enter { animation: rise .34s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Карточка ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.card-head h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -.01em;
}
.meta {
  font-size: var(--fs-meta);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.metric-sm {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.body-text {
  font-size: var(--fs-note);
  color: var(--text-2);
  line-height: 1.5;
}

/* ---------- Цель: главная цифра ---------- */
.hero { padding: var(--s5) var(--s5) var(--s4); }

.hero-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.hero-label {
  position: relative;
  padding-left: 14px;
  font-size: var(--fs-note);
  color: var(--text-2);
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero-label::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 6px; height: 6px; margin-top: -3px;
  border-radius: var(--r-pill);
  background: var(--accent);
}
.link {
  background: none; border: none; padding: 4px 0;
  font-size: var(--fs-note); font-weight: 500;
  color: var(--accent); cursor: pointer;
}
.link:active { opacity: .6; }

.hero-num {
  display: flex; align-items: baseline; gap: 6px;
  font-size: var(--fs-display);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.hero-cur {
  font-size: 20px; font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}
.hero-line {
  margin-top: 6px;
  font-size: var(--fs-note);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.track {
  height: 8px;
  margin-top: var(--s5);
  background: var(--raised);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.track-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-pill);
  transition: width .8s var(--ease);
}
.hero-foot {
  display: flex; justify-content: space-between; gap: var(--s3);
  margin-top: var(--s2);
  font-size: var(--fs-meta);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.hero-foot #goal-pct { color: var(--accent); font-weight: 600; }

.hero-safe {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s3);
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-size: var(--fs-note);
  color: var(--text-2);
}
.hero-safe b {
  font-size: 15px; font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- Действия ---------- */
.actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2);
  margin-top: var(--s1);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 50px;
  padding: 0 var(--s4);
  border: 1px solid transparent;
  border-radius: var(--r-ctl);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
  background: var(--raised);
  cursor: pointer;
  transition: transform .12s var(--ease), background .18s ease,
              opacity .18s ease, border-color .18s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .38; cursor: default; transform: none; }

.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:active { background: #8CDCB3; }
.btn-raised { background: var(--raised); color: var(--text); }
.btn-raised:active { background: var(--raised-2); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-2);
  font-weight: 500;
}

.btn-mini {
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--raised);
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: var(--fs-meta);
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s var(--ease), background .18s ease, color .18s ease;
}
.btn-mini:active { transform: scale(.96); }
.btn-mini.confirming { background: var(--accent-soft); color: var(--accent); }

.btn-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--r-ctl);
  color: var(--text-3); cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.btn-icon:active { background: var(--raised); color: var(--text); }

/* ---------- Долги: отдельная тихая строка ---------- */
.debt-line {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
  width: 100%; min-height: 44px;
  margin-top: var(--s1);
  padding: 0 14px;
  background: var(--warn-soft);
  border: 1px solid rgba(224, 178, 106, .18);
  border-radius: var(--r-ctl);
  color: var(--warn);
  font-size: var(--fs-note);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .12s var(--ease);
}
.debt-line:active { transform: scale(.99); background: rgba(224, 178, 106, .15); }
.debt-line .debt-count { color: rgba(224, 178, 106, .7); font-weight: 500; }

/* ---------- Чек-ин: строки, а не коробки ---------- */
.entries { display: flex; flex-direction: column; gap: 2px; margin: 0 -10px; }

.entry {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%;
  padding: 12px 10px;
  background: transparent;
  border: none;
  border-radius: var(--r-ctl);
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: background .18s ease, transform .12s var(--ease);
}
.entry:active { background: var(--raised); transform: scale(.995); }
.entry:disabled { cursor: default; opacity: .55; }
.entry:disabled:active { background: transparent; transform: none; }

.entry-mark {
  position: relative;
  width: 22px; height: 22px; flex-shrink: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-pill);
  transition: border-color .2s ease, background .2s ease;
}
.entry-mark::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 8px; height: 8px;
  border-radius: var(--r-pill);
  background: var(--accent);
  transform: scale(0);
  transition: transform .22s var(--ease);
}
.entry-mark.done { border-color: rgba(123, 211, 168, .45); background: var(--accent-soft); }
.entry-mark.done::after { transform: scale(1); }

.entry-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.entry-title { font-size: var(--fs-body); font-weight: 500; }
.entry-sub {
  font-size: var(--fs-note); color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.entry-action {
  flex-shrink: 0;
  font-size: var(--fs-note);
  font-weight: 500;
  color: var(--accent);
}
.entry-action.muted { color: var(--text-3); }

/* ---------- Операции ---------- */
.tx-list { margin-top: calc(var(--s1) * -1); }
.tx {
  display: flex; align-items: center; gap: var(--s3);
  padding: 11px 0;
}
.tx + .tx { border-top: 1px solid var(--line); }
.tx-main { flex: 1; min-width: 0; }
.tx-title {
  font-size: 14.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tx-sub {
  margin-top: 2px;
  font-size: var(--fs-meta);
  color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tx-amt {
  font-size: 14.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.tx-del {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--r-pill);
  color: var(--text-3); opacity: .55; cursor: pointer;
  transition: opacity .18s ease, background .18s ease, color .18s ease;
}
.tx-del:active { opacity: 1; background: var(--raised); color: var(--text); }
.tx-del.confirming { opacity: 1; color: var(--accent); }

.empty {
  padding: var(--s5) 0 var(--s2);
  text-align: center;
  font-size: var(--fs-note);
  color: var(--text-3);
}

/* ---------- Состояние загрузки / ошибки ---------- */
.state {
  margin-top: var(--s6);
  padding: var(--s6) var(--s4);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--s4);
}
.state p { font-size: var(--fs-note); color: var(--text-3); }

/* ---------- Динамика ---------- */
canvas { display: block; width: 100%; }

.caption {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
  margin-top: var(--s3);
  font-size: var(--fs-meta);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.keys { display: inline-flex; gap: var(--s3); flex-shrink: 0; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.k-dot { width: 7px; height: 7px; border-radius: var(--r-pill); display: inline-block; }
.k-accent { background: var(--accent); }
.k-raw    { background: rgba(255, 255, 255, .28); }
.k-mute   { background: var(--text-3); }
.k-bar {
  width: 3px; height: 10px; border-radius: 2px;
  background: rgba(238, 132, 119, .8);
  display: inline-block;
}

.metrics {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--s2);
  padding: var(--s2) 0 var(--s1);
  text-align: center;
}
.metric {
  font-size: 26px; font-weight: 650;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.metric-label {
  margin-top: 2px;
  font-size: var(--fs-meta);
  color: var(--text-3);
}

.rows { margin-top: var(--s4); border-top: 1px solid var(--line); }
.row-line {
  display: flex; justify-content: space-between; gap: var(--s3);
  padding-top: var(--s3);
  font-size: var(--fs-note);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.row-line + .row-line { padding-top: var(--s2); }
.row-line span:last-child { font-weight: 600; }

.insights { display: flex; flex-direction: column; }
.insight {
  position: relative;
  padding: 10px 0 10px 16px;
  font-size: var(--fs-note);
  color: var(--text-2);
  line-height: 1.5;
}
.insight::before {
  content: "";
  position: absolute; left: 0; top: 17px;
  width: 4px; height: 4px; border-radius: var(--r-pill);
  background: var(--text-3);
}
.insight + .insight { border-top: 1px solid var(--line); }

/* ---------- Поля ---------- */
.field { display: block; }
.mt { margin-top: var(--s4); }
.field + .field, .field + .grid-2, .grid-2 + .field, .grid-2 + .btn { margin-top: var(--s4); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.grid-2 .field + .field { margin-top: 0; }

@media (max-width: 419px) {
  /* На iPhone 13 mini и уже — поля цели в одну колонку */
  .grid-2 { grid-template-columns: 1fr; }
}

.fld-label {
  display: block;
  margin: 0 0 var(--s2) 2px;
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--text-3);
}
.fld-label.mt { margin-top: var(--s5); }

.fld[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
}
.fld[type="date"]::-webkit-calendar-picker-indicator {
  opacity: .5;
  cursor: pointer;
}

.card > .btn.full { margin-top: var(--s5); }

.fld {
  width: 100%; min-height: 48px;
  padding: 0 14px;
  background: var(--raised);
  border: 1px solid transparent;
  border-radius: var(--r-ctl);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;              /* 16px — iOS не зумит при фокусе */
  outline: none;
  transition: border-color .18s ease, background .18s ease;
}
.fld::placeholder { color: var(--text-3); }
.fld:focus { border-color: rgba(123, 211, 168, .5); background: var(--raised-2); }

/* ---------- Таббар: плавающий, сплошной ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 0 var(--s3) calc(var(--s2) + env(safe-area-inset-bottom));
  pointer-events: none;
}
.tabbar-inner {
  pointer-events: auto;
  display: flex; gap: 2px;
  max-width: 456px;
  margin: 0 auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .48);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 48px;
  padding: 7px 0 6px;
  background: none; border: none;
  border-radius: var(--r-ctl);
  color: var(--text-3);
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .12s var(--ease);
}
.tab:active { transform: scale(.97); }
.tab .ico { width: 21px; height: 21px; stroke-width: 1.7; transition: color .2s ease; }
.tab.active { color: var(--text); background: rgba(255, 255, 255, .055); }
.tab.active .ico { color: var(--accent); }

/* ---------- Иконки ---------- */
.ico {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.ico-sm { width: 14px; height: 14px; stroke-width: 2; }
.ico-muted { color: var(--text-3); }

/* ---------- Лист (быстрый ввод) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .62);
  z-index: 50;
  animation: fade-in .2s ease;
}
.sheet {
  position: fixed; left: 50%; bottom: 0;
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  width: 100%; max-width: 480px;
  max-height: 92dvh;
  overflow: hidden;
  padding: 8px var(--s5) calc(var(--s2) + env(safe-area-inset-bottom));
  background: #16161A;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-card) var(--r-card) 0 0;
  box-shadow: 0 -28px 60px rgba(0, 0, 0, .55);
  z-index: 51;
  animation: slide-up .34s var(--ease);
}
.sheet-grabber, .sheet-head, .sheet-foot { flex-shrink: 0; }
.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -4px;
  padding: 0 4px var(--s1);
}
.sheet-foot {
  padding-top: var(--s4);
  background: #16161A;
}
.sheet-foot .btn { width: 100%; }
.sheet-grabber {
  width: 36px; height: 4px;
  margin: 4px auto 16px;
  background: rgba(255, 255, 255, .14);
  border-radius: var(--r-pill);
}
.sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s5);
}
.sheet-title { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.sheet-sub { margin-top: 3px; font-size: var(--fs-note); color: var(--text-3); }

@keyframes slide-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Ввод суммы ---------- */
.amount-row {
  display: flex; align-items: baseline; gap: var(--s2);
  padding: var(--s5) var(--s4);
  background: var(--raised);
  border: 1px solid transparent;
  border-radius: 16px;
  transition: border-color .18s ease;
}
.amount-row:focus-within { border-color: rgba(123, 211, 168, .4); }
.amount-row input {
  flex: 1; min-width: 0;
  padding: 0;
  background: none; border: none; outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 40px; font-weight: 650;
  letter-spacing: -.03em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.amount-row input::placeholder { color: var(--text-3); }
.amount-row .cur { font-size: 18px; color: var(--text-3); }

/* ---------- Шкала 1–5 одной пилюлей ---------- */
.seg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--raised);
  border-radius: 14px;
}
.seg button {
  min-height: 48px;
  background: none; border: none; border-radius: 10px;
  color: var(--text-2);
  font-size: var(--fs-body); font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .12s var(--ease);
}
.seg button:active { transform: scale(.96); }
.seg button.on {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  box-shadow: 0 4px 14px rgba(123, 211, 168, .18);
}
.seg-warn button.on {
  background: var(--warn);
  color: #1B1305;
  box-shadow: 0 4px 14px rgba(224, 178, 106, .16);
}
.seg-2 { grid-template-columns: 1fr 1fr; }
.scale-hint {
  margin-top: var(--s2);
  text-align: center;
  font-size: var(--fs-note);
  color: var(--accent);
  min-height: 18px;
}

/* ---------- Чипы категорий ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.amount-row + .chips { margin-top: var(--s4); }

/* ---------- Подсказка на графике ---------- */
.chart-box { position: relative; }
.chart-tip {
  position: absolute; top: 0;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 6px 10px;
  background: var(--raised-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: var(--fs-meta);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}
.chart-tip .tip-date { color: var(--text-3); }
.chart-tip b { font-weight: 600; color: var(--accent); }
.chart-tip .tip-muted { color: var(--text-3); }
.chip {
  min-height: 42px;
  padding: 0 15px;
  background: var(--raised);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: var(--fs-note); font-weight: 500;
  cursor: pointer;
  transition: background .18s ease, color .18s ease,
              border-color .18s ease, transform .12s var(--ease);
}
.chip:active { transform: scale(.96); }
.chip.on {
  background: var(--accent-soft);
  border-color: rgba(123, 211, 168, .35);
  color: var(--accent);
  font-weight: 600;
}
.chip.warn.on {
  background: var(--warn-soft);
  border-color: rgba(224, 178, 106, .35);
  color: var(--warn);
}

.sheet .field + .field { margin-top: var(--s4); }
.sheet .btn.full { margin: 0; }
.sheet-note {
  margin-top: var(--s4);
  text-align: center;
  font-size: var(--fs-meta);
  color: var(--text-3);
  line-height: 1.5;
}

/* ---------- Долги в списке ---------- */
.debt-row { display: flex; align-items: center; gap: var(--s3); padding: 12px 0; }
.debt-row + .debt-row { border-top: 1px solid var(--line); }

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: 92px;
  transform: translateX(-50%);
  max-width: 88vw;
  padding: 10px 16px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: var(--fs-note);
  text-align: center;
  z-index: 60;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  animation: toast-in .24s var(--ease);
}
.toast.err { color: var(--danger); border-color: rgba(238, 132, 119, .30); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Загрузка ---------- */
#load-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 70; opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
body.is-loading #load-bar { opacity: 1; }
#load-bar::after {
  content: ""; display: block;
  width: 40%; height: 100%;
  background: var(--accent);
  animation: load-slide 1.15s ease-in-out infinite;
}
@keyframes load-slide { from { transform: translateX(-100%); } to { transform: translateX(350%); } }

@media (min-width: 520px) {
  body { background: #08080A; }
}

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

::-webkit-scrollbar { width: 0; height: 0; }
