/* ══════════════════════════════════════════════
   ПЕРЕМЕННЫЕ — кошачья тема поверх Telegram
══════════════════════════════════════════════ */
:root {
  --accent:        #FF8C00;
  --accent-light:  rgba(255, 140, 0, 0.13);
  --protein-color: #F59E0B;
  --carbs-color:   #EF4444;
  --fat-color:     #10B981;
  --success:       #10B981;
  --danger:        #FF3B30;
  --premium:       #FFD700;

  /* Telegram адаптация (dark/light) */
  --bg:     var(--tg-theme-bg-color,           #1C1C1E);
  --bg2:    var(--tg-theme-secondary-bg-color, #2C2C2E);
  --text:   var(--tg-theme-text-color,         #FFFFFF);
  --hint:   var(--tg-theme-hint-color,         #8E8E93);
  --btn:    var(--tg-theme-button-color,       #FF8C00);
  --btn-t:  var(--tg-theme-button-text-color,  #FFFFFF);

  --radius:    18px;
  --radius-sm: 12px;
  --nav-h:     70px;
}

/* ══════════════════════════════════════════════
   СБРОС И БАЗА
══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, 'SF Pro Text', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; -webkit-tap-highlight-color: transparent; outline: none; }
input  { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }

/* ══════════════════════════════════════════════
   ЗАГРУЗОЧНЫЙ ЭКРАН
══════════════════════════════════════════════ */
.loading-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg);
  gap: 16px; z-index: 999;
  transition: opacity 0.3s;
}
.loading-cat  { font-size: 72px; animation: bounce 0.9s infinite alternate ease-in-out; }
.loading-text { color: var(--hint); font-size: 15px; letter-spacing: 0.3px; }
@keyframes bounce { to { transform: translateY(-14px); } }

/* Анимация появления контента */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card, .streak-card, .diary-section {
  animation: fadeInUp 0.35s ease both;
}
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }

.is-loading { opacity: 0.45; pointer-events: none; transition: opacity 0.2s; }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   APP — обёртка
══════════════════════════════════════════════ */
.app {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--tg-vh, 100dvh);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.hidden { display: none !important; }

/* ══════════════════════════════════════════════
   СТРАНИЦЫ
══════════════════════════════════════════════ */
.page {
  position: absolute; inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
  opacity: 1;
  transition: opacity 0.2s;
}
/* Профиль — slide-in overlay */
.page-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.32,.72,0,1);
  will-change: transform;
}
.page-overlay.open  { transform: translateX(0); }
.page-overlay.hidden { display: none !important; }

.page-content { padding: 0 16px 32px; }

/* ══════════════════════════════════════════════
   ШАПКА
══════════════════════════════════════════════ */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 8px;
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 10;
}
.header-brand { display: flex; align-items: center; gap: 6px; }
.brand-icon   { font-size: 22px; }
.brand-name   { font-size: 18px; font-weight: 700; }

.header-right {
  display: flex; align-items: center; gap: 8px;
}

.today-btn {
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px; font-weight: 700;
  transition: background 0.15s;
}
.today-btn:active { background: var(--accent); color: #fff; }

.profile-icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  color: var(--hint);
  transition: opacity 0.15s;
}
.profile-icon-btn:active { opacity: 0.7; }

.back-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}

/* ══════════════════════════════════════════════
   ПОЛОСКА ДАТ
══════════════════════════════════════════════ */
.date-strip-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 4px -16px 12px;
  padding: 0 16px;
}
.date-strip-wrap::-webkit-scrollbar { display: none; }

.date-strip {
  display: flex;
  gap: 6px;
  width: max-content;
  padding: 2px 0;
}

.date-pill {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  min-width: 48px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.date-pill.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255,140,0,0.4);
}
.date-pill:active { opacity: 0.8; }

.pill-letter { font-size: 11px; font-weight: 600; opacity: 0.7; }
.pill-num    { font-size: 17px; font-weight: 700; line-height: 1.2; }
.pill-kcal   { font-size: 10px; opacity: 0.6; margin-top: 2px; }
.date-pill.active .pill-letter,
.date-pill.active .pill-kcal { opacity: 0.85; }

/* ══════════════════════════════════════════════
   КАРТОЧКИ
══════════════════════════════════════════════ */
.card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

/* ══════════════════════════════════════════════
   КАРТОЧКА КАЛОРИЙ
══════════════════════════════════════════════ */
.calorie-card {
  padding: 18px 16px 14px;
  background: linear-gradient(135deg, var(--bg2) 0%, rgba(255,140,0,0.08) 100%);
  border: 1px solid rgba(255,140,0,0.12);
}

.calorie-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.calorie-label  { font-size: 11px; font-weight: 600; color: var(--hint); letter-spacing: 0.5px; margin-bottom: 6px; }
.calorie-numbers { display: flex; align-items: baseline; gap: 4px; }
.calorie-eaten  { font-size: 36px; font-weight: 800; color: var(--text); }
.calorie-sep      { font-size: 20px; color: var(--hint); }
.calorie-norm     { font-size: 20px; color: var(--hint); }
.calorie-norm-val { font-size: 20px; color: var(--hint); }
.calorie-unit     { font-size: 14px; color: var(--hint); align-self: flex-end; margin-bottom: 2px; }

.calorie-remaining {
  font-size: 12px; font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
  opacity: 0.85;
}
.calorie-remaining.calorie-over { color: var(--danger); }

/* Кольцо калорий */
.ring-wrap {
  position: relative;
  width: 68px; height: 68px;
  flex-shrink: 0;
}
.progress-ring {
  width: 68px; height: 68px;
  transform: rotate(-90deg);
}
.ring-center-icon {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

/* SVG кольца */
.ring-track {
  fill: none;
  stroke: var(--bg);
  stroke-width: 6;
}
.ring-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 163.4; /* 2π×26 */
  stroke-dashoffset: 163.4;
  transition: stroke-dashoffset 0.6s ease;
}
.accent-ring  { stroke: var(--accent); }
.protein-ring { stroke: var(--protein-color); }
.carbs-ring   { stroke: var(--carbs-color); }
.fat-ring     { stroke: var(--fat-color); }

/* Мини кольца макросов */
.mini-ring {
  width: 44px; height: 44px;
  transform: rotate(-90deg);
  flex-shrink: 0;
}
.mini-ring .ring-track  { stroke-width: 5; }
.mini-ring .ring-fill   { stroke-dasharray: 106.8; /* 2π×17 */ stroke-dashoffset: 106.8; stroke-width: 5; }
/* Macro cards use --bg background, track needs contrast with --bg */
.macro-card .ring-track { stroke: rgba(255,255,255,0.1); }

/* Сетка макросов */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.macro-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.macro-label {
  font-size: 12px; font-weight: 600; color: var(--hint);
  line-height: 1.3; margin-bottom: 8px;
}

.macro-bottom {
  display: flex; align-items: center; justify-content: space-between;
}
.macro-val-wrap { display: flex; flex-direction: column; }
.macro-value  { font-size: 18px; font-weight: 700; }
.macro-target { font-size: 10px; color: var(--hint); opacity: 0.7; margin-top: 1px; }
.protein-text { color: var(--protein-color); }
.carbs-text   { color: var(--carbs-color); }
.fat-text     { color: var(--fat-color); }

/* Мини-кольцо с иконкой */
.mini-ring-wrap {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.mini-ring-wrap .mini-ring { position: absolute; inset: 0; }
.mini-ring-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

/* ══════════════════════════════════════════════
   КАРТОЧКА СЕРИИ (СТРИК)
══════════════════════════════════════════════ */
.streak-card {
  background: linear-gradient(135deg, var(--bg2) 0%, rgba(255,140,0,0.05) 100%);
}

.streak-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px;
}
.streak-title  { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.streak-sub    { font-size: 12px; color: var(--hint); margin-bottom: 6px; }
.streak-bonus  { font-size: 13px; color: var(--accent); font-weight: 600; }

.streak-badge {
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px; font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
}

.week-dots {
  display: flex; justify-content: space-between;
}
.week-dot {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.week-dot-label { font-size: 10px; color: var(--hint); font-weight: 600; }
.week-dot-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
}
.week-dot-circle.active {
  background: var(--accent);
}
.week-dot-circle.active::after {
  content: '✓';
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.week-dot-circle.future { opacity: 0.35; }

/* ══════════════════════════════════════════════
   ДНЕВНИК (секции + карточки приёмов)
══════════════════════════════════════════════ */
.diary-section { margin-top: 4px; }

.meal-section { margin-bottom: 16px; }

.meal-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.meal-section-title {
  font-size: 14px; font-weight: 700; color: var(--hint);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.meal-section-right {
  display: flex; align-items: center; gap: 8px;
}
.meal-section-kcal {
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-light);
  border-radius: 10px;
  padding: 2px 8px;
}
.add-meal-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 20px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.add-meal-btn:active { background: var(--accent); color: #fff; }

.meal-item {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  transition: opacity 0.15s;
}
.meal-item:active { opacity: 0.8; }
.meal-item-left { flex: 1; min-width: 0; }
.meal-item-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.meal-item-macros { display: flex; gap: 8px; flex-wrap: wrap; }
.macro-tag {
  font-size: 11px; color: var(--hint);
  background: var(--bg);
  border-radius: 6px;
  padding: 2px 6px;
}

/* Миниатюра фото в записи дневника */
.meal-thumb {
  width: 52px; height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.meal-item-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.meal-kcal { font-size: 15px; font-weight: 700; color: var(--accent); }
.meal-edit-btn { color: var(--hint); opacity: 0.6; padding: 4px; }
.meal-edit-btn:active { color: var(--accent); opacity: 1; }
.meal-del-btn { color: var(--hint); opacity: 0.6; padding: 4px; }
.meal-del-btn:active { color: var(--danger); opacity: 1; }

.section-empty {
  font-size: 13px; color: var(--hint);
  padding: 10px 0;
  text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.empty-cat { font-size: 14px; opacity: 0.5; }

/* ══════════════════════════════════════════════
   НИЖНЯЯ НАВИГАЦИЯ — плавающая таблетка
══════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom)); left: 0; right: 0;
  display: flex; justify-content: center;
  z-index: 20;
  pointer-events: none;
}
.nav-pill {
  display: flex; align-items: center;
  background: var(--bg2);
  border-radius: 40px;
  padding: 8px 20px;
  gap: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  pointer-events: all;
}

.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--hint);
  padding: 4px 8px;
  border-radius: 12px;
  transition: color 0.15s;
  font-size: 10px; font-weight: 600;
}
.nav-btn.active { color: var(--accent); }
.nav-btn:active { opacity: 0.7; }

/* Центральная кнопка + */
.nav-center {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff !important;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(255,140,0,0.45);
  padding: 0;
  margin: -8px 0;
  position: relative;
}
.nav-center:active { transform: scale(0.94); }

.scan-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 18px; height: 18px;
  background: #FF3B30;
  color: #fff;
  font-size: 10px; font-weight: 800;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg2);
  line-height: 1;
}

/* ══════════════════════════════════════════════
   ШТОРКИ (bottom sheets)
══════════════════════════════════════════════ */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 30;
  opacity: 0;
  transition: opacity 0.25s;
}
.sheet-overlay.visible { opacity: 1; }

.bottom-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg2);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 31;
  padding: 12px 20px max(32px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(.32,.72,0,1);
  max-height: calc(var(--tg-dvh, 100vh) * 0.88);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.bottom-sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 36px; height: 4px;
  background: var(--hint);
  border-radius: 2px;
  margin: 0 auto 16px;
  opacity: 0.4;
  /* Расширяем зону касания для свайпа вниз */
  padding: 12px 40px;
  box-sizing: content-box;
  margin-left: auto; margin-right: auto;
  position: relative;
  left: 50%; transform: translateX(-50%);
}
.sheet-header {
  font-size: 17px; font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

/* Опции шторки анализа */
.sheet-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.sheet-option-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px; font-weight: 500;
  transition: opacity 0.15s;
  text-align: left;
}
.sheet-option-btn:active { opacity: 0.75; }
.option-icon  { font-size: 22px; flex-shrink: 0; }
.option-text  { display: flex; flex-direction: column; gap: 2px; }
.option-title { font-size: 15px; font-weight: 600; }
.option-sub   { font-size: 12px; color: var(--hint); }

.favorites-title {
  font-size: 13px; font-weight: 700; color: var(--hint);
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-bottom: 10px;
}
.favorites-list { display: flex; flex-direction: column; gap: 8px; }
.empty-hint { font-size: 14px; color: var(--hint); text-align: center; padding: 16px 0; }

/* Счётчик сканов в шторке анализа */
.scan-counter-row {
  margin: -8px 0 12px;
  padding: 0 4px;
}
.scan-counter-inner {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.scan-counter-text {
  font-size: 13px; color: var(--hint);
}
.scan-premium-tag {
  font-size: 11px; font-weight: 700;
  color: var(--premium);
  background: rgba(255,215,0,0.1);
  border-radius: 8px;
  padding: 2px 8px;
}
.scan-dots {
  display: flex; gap: 5px; flex-wrap: wrap;
}
.scan-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.2;
  transition: opacity 0.2s;
}
.scan-dot.used { opacity: 1; }

/* Недавние блюда */
.recent-meal-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  gap: 10px;
  width: 100%;
  text-align: left;
}
.recent-meal-left { flex: 1; min-width: 0; }
.recent-meal-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.recent-meal-macros { font-size: 11px; color: var(--hint); }
.recent-meal-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.recent-meal-kcal {
  font-size: 14px; font-weight: 700;
  color: var(--accent);
}
.recent-meal-add-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 20px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.1s, opacity 0.15s;
}
.recent-meal-add-btn:active { transform: scale(0.9); opacity: 0.85; }

/* ══════════════════════════════════════════════
   ШТОРКА РЕЗУЛЬТАТА АНАЛИЗА
══════════════════════════════════════════════ */
.result-sheet { padding-bottom: 40px; }

/* Миниатюра фото в шторке результата */
.result-thumb {
  display: block;
  width: 80px; height: 80px;
  border-radius: 14px;
  object-fit: cover;
  margin: 0 auto 12px;
}

.result-food-name {
  font-size: 20px; font-weight: 800;
  text-align: center; margin-bottom: 4px;
}
.result-weight { font-size: 13px; color: var(--hint); text-align: center; margin-bottom: 16px; }

.result-macros {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.result-macro {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
}
.result-macro-val  { font-size: 16px; font-weight: 800; }
.result-macro-label { font-size: 10px; color: var(--hint); margin-top: 2px; }

.result-advice {
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 16px;
  border-left: 3px solid var(--accent);
}
.result-advice::before { content: '🐱 '; }

/* Выбор типа приёма */
.meal-type-picker {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.meal-type-btn {
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.meal-type-btn.selected { background: var(--accent); color: #fff; }

/* ══════════════════════════════════════════════
   КНОПКИ
══════════════════════════════════════════════ */
.btn {
  display: block; width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700;
  text-align: center;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { opacity: 0.85; transform: scale(0.98); }

.btn-primary   { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--text); margin-top: 8px; }
.btn-danger    { background: rgba(255,59,48,0.12); color: var(--danger); margin-top: 8px; }

/* ══════════════════════════════════════════════
   СТРАНИЦА СТАТИСТИКИ
══════════════════════════════════════════════ */
.stats-period-picker {
  display: flex; gap: 8px;
  margin-bottom: 16px;
}
.period-btn {
  flex: 1; padding: 8px;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  text-align: center;
  color: var(--hint);
  transition: background 0.15s, color 0.15s;
}
.period-btn.active { background: var(--accent); color: #fff; }

.chart-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.chart-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.chart-wrap  { position: relative; height: 180px; }

.stats-summary {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 12px;
}
.stat-box {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: transform 0.15s;
}
.stat-box-val   { font-size: 22px; font-weight: 800; color: var(--accent); }
.stat-box-label { font-size: 11px; color: var(--hint); margin-top: 4px; }

/* ══════════════════════════════════════════════
   СТРАНИЦА ПРОФИЛЯ
══════════════════════════════════════════════ */
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin: 16px auto 8px;
}
.profile-name {
  text-align: center;
  font-size: 20px; font-weight: 700;
  margin-bottom: 4px;
}
.profile-premium {
  text-align: center;
  font-size: 13px;
  color: var(--premium);
  margin-bottom: 20px;
}

.profile-section-title {
  font-size: 12px; font-weight: 700;
  color: var(--hint); text-transform: uppercase; letter-spacing: 0.5px;
  margin: 16px 0 8px;
}

.profile-row {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px;
}
.profile-row:first-of-type { border-radius: var(--radius-sm) var(--radius-sm) 6px 6px; }
.profile-row:last-of-type  { border-radius: 6px 6px var(--radius-sm) var(--radius-sm); margin-bottom: 0; }
.profile-row:only-of-type  { border-radius: var(--radius-sm); }

.profile-row-label { font-size: 14px; color: var(--hint); }
.profile-row-value { font-size: 14px; font-weight: 600; }

/* Форма редактирования */
.edit-field {
  margin-bottom: 14px;
}
.edit-label {
  font-size: 12px; color: var(--hint); font-weight: 600;
  text-transform: uppercase; margin-bottom: 6px;
}
.edit-input {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.edit-input:focus { border-color: var(--accent); }
.edit-input.input-error { border-color: var(--danger); }
.edit-input.input-error:focus { border-color: var(--danger); }

/* Сетка макросов в форме ручного добавления */
.add-macros-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.add-macro-field .edit-label { font-size: 11px; }
.add-macro-field .edit-input { padding: 10px 8px; font-size: 14px; }

.edit-options {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.edit-option {
  padding: 8px 16px;
  background: var(--bg);
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.edit-option.selected { background: var(--accent); color: #fff; }

/* ══════════════════════════════════════════════
   УТИЛИТЫ
══════════════════════════════════════════════ */
.text-accent { color: var(--accent); }
.text-hint   { color: var(--hint); font-size: 13px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ══════════════════════════════════════════════
   TOAST УВЕДОМЛЕНИЯ
══════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 96px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px; font-weight: 600;
  z-index: 100;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════
   БАННЕР «ЗАПОЛНИ ПРОФИЛЬ»
══════════════════════════════════════════════ */
.profile-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--accent-light);
  border: 1px solid rgba(255,140,0,0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  gap: 10px;
}
.banner-text {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; line-height: 1.4;
  color: var(--text);
}
.banner-icon { font-size: 18px; flex-shrink: 0; }
.banner-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.banner-btn:active { opacity: 0.8; }
