/* ===== Экраны ===== */

.screen { display: flex; flex-direction: column; gap: var(--sp-4); animation: fade-up 0.28s ease; }

/* Приветствие */
.screen--welcome { text-align: center; gap: var(--sp-5); padding-top: var(--sp-4); }

.welcome__top { display: flex; align-items: center; gap: var(--sp-3); text-align: left; }

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.brand-mark svg { width: 34px; height: 34px; }

.welcome__title { font-size: 21px; }
.welcome__subtitle { font-size: 13.5px; color: var(--muted); }

.welcome__scene {
  position: relative;
  height: 230px;
  margin: var(--sp-2) 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  box-shadow: inset -8px -12px 24px rgba(76, 60, 110, 0.22), 0 18px 34px rgba(76, 60, 110, 0.18);
}
.orb--big {
  width: 132px; height: 132px; left: 50%; top: 34px; margin-left: -66px;
  background: radial-gradient(circle at 32% 26%, #ffffff 0%, #efe8fb 34%, #c9b6ee 100%);
  animation: floaty 6s ease-in-out infinite;
}
.orb--mid {
  width: 66px; height: 66px; left: 24px; top: 118px;
  background: radial-gradient(circle at 32% 28%, #ffffff, #d9f0e5 45%, #9ed7bd 100%);
  animation: floaty 5.4s ease-in-out infinite reverse;
}
.orb--small {
  width: 46px; height: 46px; right: 30px; top: 24px;
  background: radial-gradient(circle at 32% 28%, #ffffff, #f8dcc4 48%, #e6b48c 100%);
  animation: floaty 7s ease-in-out infinite;
}

.shape { position: absolute; }
.shape--ring {
  width: 96px; height: 96px; right: 16px; top: 128px;
  border-radius: 50%;
  border: 10px solid rgba(125, 106, 201, 0.18);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.7);
}
.shape--blob {
  width: 54px; height: 44px; left: 74px; top: 16px;
  border-radius: 26px 18px 24px 16px;
  background: linear-gradient(140deg, #dcebf7, #b7d6ee);
  box-shadow: var(--shadow-md);
}
.shape--coin {
  width: 38px; height: 38px; left: 46%; top: 158px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fffdf6, #f3d9a8 60%, #d9b273 100%);
  box-shadow: var(--shadow-md);
}

.welcome__text h2 { font-size: 26px; margin-bottom: 6px; }
.welcome__text p { color: var(--graphite-2); font-size: 15.5px; }

.welcome__actions { margin-top: var(--sp-2); }

/* Главная */
.home__head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.home__greeting { font-size: 14px; color: var(--muted); }
.home__month { font-size: 22px; }

.month-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--r-pill);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}
.month-switch__label { font-size: 14.5px; font-weight: 600; padding: 0 4px; }
.month-switch .btn--icon { min-width: 38px; min-height: 38px; background: transparent; box-shadow: none; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.section-head h2 { font-size: 18px; }

.link-btn {
  background: none;
  border: none;
  color: var(--lav-600);
  font-size: 14.5px;
  font-weight: 600;
  padding: 8px 4px;
  min-height: 44px;
}

.source-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-md);
  transition: transform 0.16s ease;
}
.source-card:active { transform: scale(0.985); }
.source-card--lavender { background: linear-gradient(140deg, rgba(255,255,255,0.9), rgba(239,232,251,0.85)); }
.source-card--mint { background: linear-gradient(140deg, rgba(255,255,255,0.9), rgba(217,240,229,0.85)); }
.source-card--peach { background: linear-gradient(140deg, rgba(255,255,255,0.9), rgba(248,220,196,0.85)); }
.source-card--sky { background: linear-gradient(140deg, rgba(255,255,255,0.9), rgba(220,235,247,0.85)); }
.source-card--sand { background: linear-gradient(140deg, rgba(255,255,255,0.9), rgba(240,229,209,0.85)); }
.source-card--archived { opacity: 0.62; }

.source-card__icon {
  width: 46px; height: 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  display: grid; place-items: center;
  font-size: 22px;
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}
.source-card__body { flex: 1 1 auto; min-width: 0; }
.source-card__name { font-weight: 650; font-size: 16px; }
.source-card__meta { font-size: 13px; color: var(--muted); }
.source-card__amount { font-weight: 700; font-size: 17px; text-align: right; }
.source-card__spark { display: block; margin-left: auto; margin-top: 4px; }

/* Список операций */
.ops { display: flex; flex-direction: column; gap: 8px; }

.op {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--r-md);
  padding: 12px var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.op__icon {
  width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,0.9);
  display: grid; place-items: center; font-size: 18px; flex: 0 0 auto;
}
.op__body { flex: 1 1 auto; min-width: 0; }
.op__name { font-weight: 600; font-size: 15px; }
.op__meta { font-size: 12.5px; color: var(--muted); }
.op__amount { font-weight: 700; font-size: 16px; white-space: nowrap; }
.op__edit { border: none; background: none; padding: 8px; min-width: 40px; min-height: 40px; color: var(--lav-600); }

/* Пустые состояния */
.empty { text-align: center; padding: var(--sp-5) var(--sp-4); }
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { font-size: 14.5px; margin-bottom: var(--sp-4); }

/* Подзаголовок экрана */
.sub-head { display: flex; align-items: center; gap: var(--sp-2); }
.sub-head__title { font-size: 19px; }

/* Аналитика */
.metric-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.metric {
  flex: 1 1 140px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.metric__label { font-size: 13px; color: var(--muted); }
.metric__value { font-size: 20px; font-weight: 700; margin-top: 2px; }

.insight {
  display: flex;
  gap: var(--sp-3);
  background: linear-gradient(140deg, rgba(239,232,251,0.9), rgba(255,255,255,0.85));
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-md);
  font-size: 14.5px;
  color: var(--graphite-2);
}

.bars { display: flex; flex-direction: column; gap: var(--sp-3); }
.bars__row { display: block; }
.bars__head { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: 14px; margin-bottom: 6px; }
.bars__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__track { height: 12px; border-radius: var(--r-pill); background: rgba(80,65,100,0.08); overflow: hidden; }
.bars__fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, #efe8fb, #a58ce0); transition: width 0.4s ease; }
.bars__share { font-size: 12.5px; color: var(--muted); }

.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); }

/* История */
.filters { display: flex; flex-direction: column; gap: var(--sp-2); }

/* Настройки */
.settings-group { display: flex; flex-direction: column; gap: var(--sp-3); }
.facts { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.facts__row { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: 14.5px; }
.facts__row dt { color: var(--muted); }
.facts__row dd { margin: 0; font-weight: 600; text-align: right; }

.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  font-size: 15px;
}
.pill.is-active { background: linear-gradient(160deg, #efe8fb, #ddd0f3); border-color: transparent; font-weight: 650; color: var(--lav-800); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 44px; height: 44px; border-radius: 14px; border: 2px solid transparent; box-shadow: var(--shadow-sm);
}
.swatch--lavender { background: linear-gradient(140deg, #efe8fb, #c9b6ee); }
.swatch--mint { background: linear-gradient(140deg, #d9f0e5, #9ed7bd); }
.swatch--peach { background: linear-gradient(140deg, #f8dcc4, #e6b48c); }
.swatch--sky { background: linear-gradient(140deg, #dcebf7, #b7d6ee); }
.swatch--sand { background: linear-gradient(140deg, #f0e5d1, #d9c39b); }
.swatch.is-active { border-color: var(--lav-600); }
.glyph {
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.75); font-size: 20px; line-height: 1;
}
.glyph.is-active { border-color: var(--lav-600); background: var(--lav-100); }

@media (max-width: 360px) {
  .home__month { font-size: 19px; }
  .total__amount { font-size: 32px; }
  .bottom-nav__label { font-size: 10.5px; }
  .card { padding: var(--sp-3); }
}

/* Ссылка-строка «Все операции»: крупная зона нажатия для пальца */
.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  width: 100%;
  min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.6);
  color: var(--graphite);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.link-row:active { transform: scale(0.99); }
.link-row .icon { color: var(--muted); }

/* Сравнение с прошлым месяцем: две колонки с читаемым расстоянием */
.compare {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-3);
  font-size: 14.5px;
  color: var(--graphite-2);
}
.compare span { white-space: nowrap; }

/* Стрелки переключения месяца заметнее */
.month-switch .btn--icon {
  min-width: 44px;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-sm);
  color: var(--lav-600);
  border: 1px solid var(--line);
}
.month-switch .btn--icon .icon { color: var(--lav-600); stroke: currentColor; }
.month-switch .btn--icon:active { transform: scale(0.94); }
