:root {
  /* Фирменные цвета СОТА (мёд/соты) */
  --honey: #ffb300;
  --honey-dark: #ff8f00;
  --honey-soft: #fff3d6;

  /* Значения по умолчанию (перекрываются темой Telegram из app.js) */
  --bg: #ffffff;
  --bg-secondary: #f5f6f8;
  --text: #101317;
  --text-muted: #8a8f99;
  --card: #ffffff;
  --border: #ececf0;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

/* ── Вкладки ─────────────────────────────── */
.tab { display: none; }
.tab.active { display: block; }

/* ── Галерея ─────────────────────────────── */
.gallery { position: relative; background: var(--bg-secondary); }
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  height: 240px;
  object-fit: cover;
  width: 100%;
}
.gallery-dots {
  position: absolute;
  bottom: 12px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.5);
  transition: .2s;
}
.dot.active { background: var(--honey); width: 20px; border-radius: 4px; }

/* ── Карточки ────────────────────────────── */
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  margin: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
h1 { font-size: 21px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.badge {
  background: var(--honey-soft);
  color: var(--honey-dark);
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  white-space: nowrap;
}
.muted { color: var(--text-muted); font-size: 14px; }
.small { font-size: 12px; }
.center { text-align: center; }
.desc { margin: 12px 0; font-size: 14px; line-height: 1.5; }

/* ── Статистика ──────────────────────────── */
.stat-row, .portfolio-summary { display: flex; gap: 12px; margin: 16px 0; }
.stat {
  flex: 1;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 12px;
}
.stat-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 16px; font-weight: 700; }
.stat-value.big { font-size: 20px; }

/* ── Прогресс-бар ────────────────────────── */
.progress-block { margin: 16px 0; }
.progress-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.progress-bar { height: 10px; background: var(--bg-secondary); border-radius: 20px; overflow: hidden; }
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--honey), var(--honey-dark));
  border-radius: 20px;
  transition: width .6s ease;
}

/* ── Кнопки ──────────────────────────────── */
.btn-primary {
  width: 100%;
  border: none;
  background: var(--honey);
  color: #1a1300;
  font-size: 16px; font-weight: 700;
  padding: 15px; border-radius: 14px;
  cursor: pointer;
  margin-top: 8px;
  transition: transform .1s, opacity .2s;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

/* ── Портфель ────────────────────────────── */
.accruals { list-style: none; }
.accrual {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.accrual:last-child { border-bottom: none; }
.accrual-date { font-size: 13px; color: var(--text-muted); }
.accrual-note { font-size: 14px; }
.accrual-amount { font-weight: 700; color: #1aab53; }

/* ── Модальный поток (bottom sheet) ──────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  align-items: flex-end;
  z-index: 100;
}
.overlay.open { display: flex; }
.sheet {
  display: none;
  width: 100%;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  position: relative;
  animation: slideUp .25s ease;
}
.sheet.active { display: block; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg-secondary); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 15px; color: var(--text-muted); cursor: pointer;
}

/* ── Счётчик ─────────────────────────────── */
.counter { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 22px 0 8px; }
.counter-btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--honey);
  background: transparent; color: var(--honey-dark);
  font-size: 26px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.counter-btn:active { background: var(--honey-soft); }
.counter-value { font-size: 40px; font-weight: 800; min-width: 60px; text-align: center; }

.total-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; margin: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.total-value { font-size: 22px; font-weight: 800; color: var(--honey-dark); }

/* ── Оферта / чекбокс ────────────────────── */
.oferta-text { max-height: 200px; overflow-y: auto; font-size: 14px; line-height: 1.55; margin-bottom: 16px; }
.oferta-text p { margin-bottom: 10px; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; margin-bottom: 18px; cursor: pointer; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--honey); flex-shrink: 0; margin-top: 1px; }

/* ── QR ──────────────────────────────────── */
.qr-wrap { display: flex; justify-content: center; margin: 18px 0; }
.qr { width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 8px; }

/* ── Успех ───────────────────────────────── */
.done-icon { font-size: 56px; text-align: center; margin: 10px 0 4px; }

/* ── Нижняя навигация ────────────────────── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
}
.tabbar-item {
  flex: 1; border: none; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; color: var(--text-muted); cursor: pointer;
}
.tabbar-item.active { color: var(--honey-dark); }
.tabbar-icon { font-size: 20px; filter: grayscale(1); opacity: .6; }
.tabbar-item.active .tabbar-icon { filter: none; opacity: 1; }
