/* ============================================================
   Мелочи
   ============================================================ */

.avatar-face {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.note-full {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-2);
  white-space: pre-wrap;
  background: var(--panel-soft);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  max-height: 42vh;
  overflow-y: auto;
}

#sheet-viewer .row { border: none; }
#sheet-viewer .sheet-title {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* строка-кнопка внутри панели не должна выглядеть как кнопка */
button.row { font: inherit; color: inherit; cursor: pointer; }
button.row:active { background: var(--panel-soft); }

/* на широком экране (десктоп/веб-версия Telegram) держим телефонную ширину */
@media (min-width: 520px) {
  body::before { background: var(--bg-wide); }
  #app {
    box-shadow: 0 0 60px rgba(var(--shadow-rgb), 0.12);
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 40%, var(--bg-bottom) 100%);
  }
}

/* ---------- финальная подгонка под макет ---------- */

/* заголовок ближайшего события — строго в одну строку, как в макете */
.event-hero-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* «Потрачено в этом» / «Осталось» должны помещаться рядом с бубликом */
.progress-card .mini-label { font-size: 11px; }
.progress-card .progress-value { font-size: 19px; }
#budget-donut { width: 78px; height: 78px; }

/* «через 10 дней» в списке событий не должно съедать название */
#events-list .event-hero-left { font-size: 12px; margin-top: 0; }
#events-list .row { gap: 10px; }

/* обёртка позиционирования для строки события — как у .todo-item; сама .row
   уезжает влево свайпом и открывает .row-actions с удалением под ней */
.event-item { position: relative; overflow: hidden; }
.event-item + .event-item { border-top: 1px solid var(--line); }
.event-item .row {
  position: relative;
  z-index: 1;
  background: var(--panel);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  touch-action: pan-y;
}
.row-actions {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 64px;
  display: flex;
}
.row-actions button {
  flex: 1;
  border: none;
  background: var(--panel);
  color: var(--pink-deep);
  display: flex; align-items: center; justify-content: center;
}
.row-actions svg { width: 18px; height: 18px; }

/* сердце-водяной знак на карточке баланса — тише и ближе к краю */
.balance-heart { right: -30px; top: 14px; width: 132px; height: 124px; }

/* ============================================================
   Цифры: короткий «толчок» в момент, когда сумма докручивается
   ============================================================ */
/* «Доходы»/«Расходы» — инлайновые <b>, а к ним transform не применяется */
.balance-split b { display: inline-block; }
.num-bump { animation: num-bump 0.45s ease; transform-origin: left center; }
@keyframes num-bump {
  0% { transform: scale(1); }
  32% { transform: scale(1.055); }
  100% { transform: scale(1); }
}

/* Кружок дела: короткий «поп» в момент, когда дело отмечено сделанным */
.todo-check { position: relative; }
.todo-check.check-pop { animation: check-pop 0.46s cubic-bezier(0.23, 1, 0.32, 1); }
/* и расходящееся кольцо вокруг него — как круги по воде */
.todo-check::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--pink);
  opacity: 0;
  pointer-events: none;
}
.todo-check.check-pop::after { animation: check-ring 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes check-ring {
  0% { opacity: 0.6; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.9); }
}
@keyframes check-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* Салют за сделанное дело: слой поверх всего, клики сквозь него проходят */
.confetti-layer {
  position: fixed; inset: 0;
  z-index: 9000;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  font-size: 15px; line-height: 1;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .num-bump { animation: none; }
  .view.anim-in { animation: none; }
  .todo-check.check-pop { animation: none; }
  .todo-check.check-pop::after { animation: none; }
  .confetti-layer { display: none; }
  .todo-content.just-done { animation: none; }
  .todo-progress.shine .todo-progress-fill { animation: none; }
}
