:root {
  --bg: #0d0f0d;
  --bg-card: #181b18;
  --bg-card-2: #222522;
  --accent: #c9ff3d;
  --accent-dim: #8fbf1f;
  --text: #ffffff;
  --text-dim: #9b9f99;
  --border: #292c28;
  --danger: #ff5c5c;
  --success: #73d673;
  --warning: #ffb84d;
  --radius-card: 18px;
  --radius-btn: 15px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  color-scheme: dark;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 16px 90px;
  position: relative;
}

.screen { padding-top: 16px; }

/* ---------- Home hero ---------- */
.hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  height: 220px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-end;
}
.hero-photo {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(198,255,61,0.25), transparent 60%),
    linear-gradient(160deg, #1b1b1b 0%, #0d0d0d 70%);
}
.hero-photo::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 160px;
  height: 200px;
  background: linear-gradient(180deg, rgba(198,255,61,0.15), transparent);
  border-radius: 50% 50% 0 0;
  filter: blur(2px);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 35%;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13,13,13,0.45) 0%,
    rgba(13,13,13,0.05) 18%,
    rgba(13,13,13,0.05) 30%,
    rgba(13,13,13,0.9) 100%
  );
}

/* ---------- Hero used as header on sub-screens (Тренировки, Прогресс) ---------- */
.hero-sub-screen { align-items: flex-end; }
.hero-topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
}
.back-btn-overlay {
  background: rgba(13,13,13,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-color: rgba(255,255,255,0.15);
}

#screen-workouts .hero-img { object-position: 50% 20%; }
#screen-progress .hero-img { object-position: center; }
#screen-checkin .hero-img { object-position: center 30%; }
#screen-nutrition .hero-img { object-position: center 70%; }

.hero-text {
  position: relative;
  padding: 20px;
  z-index: 1;
}
.hero-greeting {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.15;
}
.hero-sub {
  color: var(--accent);
  font-weight: 600;
  margin-top: 6px;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
}
.hero-sub-screen .hero-sub {
  color: rgba(255,255,255,0.75);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  font-size: 14px;
}

/* ---------- Daily quote ---------- */
.quote-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  font-style: italic;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 16px;
}

/* ---------- Goal card ---------- */
.goal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
}
.goal-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.goal-card-label-group { display: flex; align-items: center; gap: 10px; }
.goal-card-label { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.5px; }
#goal-card-title { font-weight: 700; font-size: 14px; }
.goal-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.goal-progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s ease; }
.goal-card-numbers { font-size: 12px; color: var(--text-dim); }
.goal-card.completed { border-color: var(--accent); background: rgba(198,255,61,0.06); cursor: default; }

/* ---------- Modal (окно после выбора тарифа и т.п.) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
  padding: 26px 22px; width: 100%; max-width: 340px; text-align: center;
}
.modal-icon { width: 52px; height: 52px; border-radius: 16px; background: rgba(201,255,61,0.12); color: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.modal-card h3 { margin: 0 0 10px; font-size: 17px; }
.modal-card p { margin: 0 0 20px; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.modal-card .btn-primary, .modal-card .btn-outline { margin-bottom: 10px; }
.modal-card .btn-outline:last-child, .modal-card .btn-primary:last-child { margin-bottom: 0; }

/* ---------- ИИ-консультант ---------- */
.ai-chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
  max-height: 55vh;
  overflow-y: auto;
  margin-bottom: 12px;
}
.ai-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.ai-chat-msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: #0d0f0d;
  border-bottom-right-radius: 4px;
}
.ai-chat-msg-ai {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.ai-chat-input-row { display: flex; gap: 8px; }
.ai-chat-input-row input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
}
.ai-chat-input-row .btn-primary {
  width: 48px;
  padding: 0;
  margin-bottom: 0;
  font-size: 18px;
  flex-shrink: 0;
}

/* ---------- Nutrition add row ---------- */
.nutrition-add-row { display: flex; gap: 10px; margin-bottom: 4px; }
.nutrition-add-row .btn-outline { margin-bottom: 0; flex: 1; }
.nutrition-add-row .btn-primary { margin-bottom: 0; flex: 1; }
.file-label-inline { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.nutrition-entry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13px;
}
.nutrition-entry-row img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.nutrition-entry-del {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  padding: 4px 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.nutrition-entry-del:hover { color: var(--danger); }

/* ---------- Rest day / extra cardio ---------- */
.rest-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  text-align: center;
  margin: 8px 0 20px;
}
.rest-day-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.rest-day-title .icon { color: var(--accent); }
.rest-day-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; line-height: 1.4; }
#cardio-form { text-align: left; margin-top: 14px; }

/* ---------- Stat row ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat-row-2 { grid-template-columns: repeat(2, 1fr); }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
}
.stat-value { font-size: 22px; font-weight: 800; }
.stat-value-sm { font-size: 16px; font-weight: 700; }
.stat-value-sm.accent { color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #0d0d0d;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  cursor: pointer;
}
.btn-primary:active { background: var(--accent-dim); }

.btn-outline {
  width: 100%;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  cursor: pointer;
}
.btn-with-icon { display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ---------- List card (home) ---------- */
.list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
}
.list-card-icon { width: 38px; height: 38px; border-radius: 11px; background: rgba(201,255,61,0.12); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.list-card-body { flex: 1; }
.list-card-title { font-weight: 700; font-size: 15px; }
.list-card-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.tariff-card { cursor: default; align-items: flex-start; }
.btn-outline-sm {
  width: auto;
  flex-shrink: 0;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 0;
  cursor: pointer;
  white-space: nowrap;
}
.btn-outline-sm:disabled { opacity: 0.6; cursor: default; }
.list-card-plus, .list-card-arrow {
  color: var(--accent);
  font-weight: 800;
  font-size: 18px;
}
#checkin-banner { border-color: var(--accent-dim); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  padding: 4px 0 12px;
}
.back-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}
.topbar-title {
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
}
.topbar-spacer { width: 36px; }
.progress-sub { color: var(--text-dim); font-size: 13px; margin: -6px 0 14px; text-align: center; }

/* ---------- Day pills ---------- */
.day-pills {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}
.day-pills span {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  color: var(--text-dim);
}
.day-pills .active {
  background: var(--accent);
  color: #0d0d0d;
  font-weight: 800;
}

/* ---------- Workout head ---------- */
.workout-head { margin-bottom: 16px; }
.workout-title { font-size: 24px; font-weight: 800; letter-spacing: 0.5px; }
.workout-meta { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 4px 0 10px;
}
/* ---------- Гиды (замеры / фото) ---------- */
.guide-card-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.guide-card-img { width: 100%; display: block; border-radius: 16px; border: 1px solid var(--border); }
.photo-guide-triptych { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.photo-guide-triptych img { width: 100%; display: block; border-radius: 12px; border: 1px solid var(--border); }
.photo-guide-checklist { display: flex; flex-direction: column; gap: 10px; }
.photo-guide-checklist div { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.photo-guide-checklist .icon { color: var(--accent); flex-shrink: 0; }

.exercise-list { display: flex; flex-direction: column; gap: 10px; }
.exercise-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}
.exercise-thumb {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: linear-gradient(160deg, #2a2a2a, #161616);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.exercise-info { flex: 1; min-width: 0; }
.exercise-name { font-weight: 700; font-size: 14px; }
.exercise-sets { color: var(--text-dim); font-size: 12px; margin-top: 2px; }

.weight-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.weight-input {
  width: 56px;
  background: #0d0d0d;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 700;
  -moz-appearance: textfield;
}
.weight-input::-webkit-outer-spin-button,
.weight-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.weight-input:focus {
  outline: none;
  border-color: var(--accent);
}
.weight-input::placeholder { color: var(--text-dim); }
.weight-unit { font-size: 11px; color: var(--text-dim); }
.prev-weight-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ---------- Week program (Тренировки → Вся неделя) ---------- */
.week-program-list { display: flex; flex-direction: column; gap: 10px; }
.week-program-day {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.week-program-day-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.week-program-day-name {
  font-weight: 800;
  font-size: 13px;
  color: var(--text-dim);
  width: 28px;
}
.week-program-day-name.is-today { color: var(--accent); }
.week-program-day-title { font-weight: 700; font-size: 14px; }
.week-program-exercises { display: flex; flex-direction: column; gap: 6px; }
.week-program-ex-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  padding-left: 38px;
}
.week-program-ex-row span:first-child { color: var(--text); }
.exercise-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  margin-left: auto;
  flex-shrink: 0;
}
.week-program-day-check { margin-left: auto; font-size: 15px; color: var(--text-dim); }
.week-program-day-check.done { color: var(--accent); }
.week-summary-header { margin-bottom: 18px; }
.week-summary-header span { font-size: 13px; font-weight: 700; display: block; margin-bottom: 8px; }

/* ---------- "Сегодня" на главном ---------- */
.today-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 16px;
}
.today-card-title { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.5px; margin-bottom: 10px; }
.today-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.today-mark { font-size: 16px; color: var(--text-dim); width: 18px; text-align: center; flex-shrink: 0; }
.today-mark.done { color: var(--accent); }
.today-row-text b { color: var(--text); }

/* ---------- Достижения ---------- */
.achievements-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.achievement-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; text-align: center; }
.achievement-card .icon-badge { margin: 0 auto 8px; }
.achievement-value { font-size: 18px; font-weight: 800; }
.achievement-label { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ---------- Настроение после тренировки ---------- */
.mood-row { display: flex; gap: 10px; margin-bottom: 20px; }
.mood-btn {
  flex: 1; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 14px 8px; cursor: pointer; color: var(--text-dim);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.mood-btn .icon { width: 24px; height: 24px; }
.mood-btn span { display: block; font-size: 11px; color: var(--text-dim); }
.mood-btn.selected { border-color: var(--accent); background: rgba(198,255,61,0.08); color: var(--accent); }
.mood-btn.selected span { color: var(--text); }

/* ---------- Экран результата ---------- */
.result-hero { text-align: center; margin-bottom: 20px; }
.result-hero-delta { font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.result-hero-period { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.result-hero-range { font-size: 14px; font-weight: 700; margin-top: 8px; }
.result-hero-stats { display: flex; justify-content: center; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.result-hero-stats > div { text-align: center; }
.result-hero-stats b { display: block; font-size: 16px; font-weight: 800; }
.result-hero-stats span { font-size: 11px; color: var(--text-dim); }
.exercise-check.done {
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- Segmented control ---------- */
.segmented {
  display: flex;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
}
.segmented span {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  border-radius: 9px;
  cursor: pointer;
}
.segmented span.active {
  background: var(--accent);
  color: #0d0d0d;
}

/* ---------- Calorie ring ---------- */
.calorie-ring-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}
.calorie-ring {
  --pct: 0;
  --ring-color: var(--accent);
  width: 110px; height: 110px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--border) 0);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: background 0.3s ease;
}
.calorie-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--bg-card);
}
.calorie-ring > * { position: relative; z-index: 1; }
.calorie-value { font-size: 22px; font-weight: 800; }
.calorie-goal { font-size: 10px; color: var(--text-dim); text-align: center; }
.macro-list { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.macro-row { font-size: 14px; display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.macro-row b { color: var(--text); margin-left: auto; }
.macro-value.over { color: var(--danger); }
.macro-value.under { color: var(--warning); }
.macro-dot { width: 10px; height: 10px; border-radius: 50%; }
.macro-b { background: #c6ff3d; }
.macro-f { background: #ffb84d; }
.macro-c { background: #4dc9ff; }

.meal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.meal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.meal-name { font-weight: 700; font-size: 14px; }
.meal-kcal { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

.hint-text {
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
  margin-top: 6px;
}
.tip-text {
  background: rgba(198,255,61,0.08);
  border: 1px solid rgba(198,255,61,0.25);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  color: var(--text);
  margin-bottom: 16px;
}

/* ---------- Weekly nutrition ---------- */
.week-day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.week-day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.week-day-name { font-weight: 700; font-size: 13px; width: 32px; }
.week-day-bar-wrap {
  flex: 1;
  height: 6px;
  background: #262626;
  border-radius: 4px;
  overflow: hidden;
}
.week-day-bar { height: 100%; border-radius: 4px; }
.week-day-bar.ok { background: var(--accent); }
.week-day-bar.over { background: var(--danger); }
.week-day-kcal { font-size: 12px; color: var(--text-dim); width: 64px; text-align: right; }
.week-day-kcal.missing { font-style: italic; opacity: 0.6; }
.week-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.week-day-card .week-day-row { background: none; border: none; padding: 0; cursor: pointer; }
.week-day-entries { margin-top: 8px; }
.week-day-entries .nutrition-entry-row { margin-bottom: 6px; }
.week-day-entries .nutrition-entry-row:last-child { margin-bottom: 0; }
.week-day-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}
.week-day-detail a { color: var(--accent); }

.week-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}
.week-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.week-summary-row:last-child { border-bottom: none; }
.week-summary-row .delta-over { color: var(--danger); font-weight: 700; }
.week-summary-row .delta-under { color: #4dc9ff; font-weight: 700; }
.week-summary-row .delta-ok { color: var(--accent); font-weight: 700; }

#week-verdict {
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}

/* ---------- Chart ---------- */
.chart {
  width: 100%;
  height: 100px;
  margin-bottom: 16px;
}

.banner-card {
  background: var(--bg-card-2);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-weight: 800;
  text-align: left;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.banner-card .icon { flex-shrink: 0; margin-top: 1px; }
.banner-card span { font-weight: 600; line-height: 1.4; }
.banner-card.warn { border-color: var(--warning); color: var(--warning); }

/* ---------- Check-in ---------- */
.checkin-field {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
}
.checkin-label { font-weight: 700; font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.checkin-label .icon { color: var(--accent); }
.scale-10 {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.scale-10 span {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.scale-10 span.selected {
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- Workout session ---------- */
.session-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}
.session-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.session-exercise-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.session-exercise-icon .icon { width: 26px; height: 26px; }
.session-exercise-name { font-size: 22px; font-weight: 800; }
.session-exercise-target { color: var(--text-dim); font-size: 14px; margin-top: 2px; margin-bottom: 14px; }

.session-sets-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.session-set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.session-set-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.session-set-weight, .session-set-reps { width: 64px; flex-shrink: 0; }

#session-rpe-block { margin-bottom: 20px; }

.session-comment {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  margin-bottom: 20px;
}

/* ---------- Workout complete ---------- */
.complete-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 40px;
}
.complete-check {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--accent);
  color: #0d0d0d;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.complete-check .icon { width: 40px; height: 40px; stroke-width: 2.2; }
.complete-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
}
.complete-wrap .stat-row { width: 100%; margin-bottom: 20px; }
.complete-quote {
  color: var(--text-dim);
  font-style: italic;
  font-size: 14px;
  margin-bottom: 28px;
}
.complete-wrap .btn-primary { width: 100%; }

/* ---------- Photo progress ---------- */
.photo-upload-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.photo-upload-slot {
  aspect-ratio: 3 / 4;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}
.photo-upload-icon {
  font-size: 24px;
  color: var(--accent);
  font-weight: 700;
}

.photo-compare-dates {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 10px;
}
.photo-compare-row { margin-bottom: 14px; }
.photo-compare-label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.photo-compare-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.photo-compare-img, .photo-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.photo-history-group { margin-bottom: 16px; }
.photo-history-date { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.photo-history-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-thumb-wrap { position: relative; }
.photo-thumb-delete {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(13,15,13,0.75); border: none; color: var(--text);
  font-size: 12px; line-height: 1; cursor: pointer;
}
.photo-thumb-delete:hover { background: var(--danger); }

/* ---------- Measurement form ---------- */
.measurement-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.measurement-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.measurement-form input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}
.measurement-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}
.measurement-row b { color: var(--text); }
.measurement-row:last-child { border-bottom: none; }
.measurement-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 15px; line-height: 1; padding: 4px 6px; cursor: pointer; border-radius: 6px;
}
.icon-btn:hover { color: var(--text); background: var(--bg-card-2); }

/* ---------- Анкета ---------- */
.anketa-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.anketa-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.anketa-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}
.anketa-section.is-health { border-color: rgba(255,93,93,0.4); }
.anketa-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  cursor: pointer;
}
.anketa-section-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #0d0d0d;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  flex-shrink: 0;
}
.anketa-section-num.done { background: var(--accent); border-color: var(--accent); color: #0d0d0d; }
.anketa-section-title { flex: 1; font-weight: 700; font-size: 14px; }
.anketa-section-warn { color: var(--danger); font-size: 16px; }
.anketa-section-chevron { color: var(--text-dim); transition: transform 0.2s ease; }
.anketa-section.open .anketa-section-chevron { transform: rotate(180deg); }

.anketa-section-body {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.anketa-field { display: flex; flex-direction: column; gap: 6px; }
.anketa-field label { font-size: 12px; color: var(--text-dim); }
.anketa-field input[type="text"], .anketa-field textarea {
  background: #0d0d0d;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}
.anketa-field textarea { resize: vertical; min-height: 50px; }
.anketa-save-btn { margin-top: 4px; }

/* ---------- Settings ---------- */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
}
.settings-row-title { font-weight: 700; font-size: 14px; }
.settings-row-sub { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

.switch { position: relative; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  display: block;
  width: 46px; height: 26px;
  background: var(--border);
  border-radius: 13px;
  position: relative;
  transition: background 0.2s ease;
}
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.2s ease, background 0.2s ease;
}
.switch input:checked + .switch-track { background: rgba(201,255,61,0.25); }
.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(20px);
  background: var(--accent);
}

/* ---------- Profile ---------- */
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #0d0d0d;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 22px;
  flex-shrink: 0;
}
.profile-name { font-weight: 800; font-size: 18px; }
.profile-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }

.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 12px;
}
.menu-item.health {
  border-color: var(--danger);
  color: var(--danger);
}
.menu-item.health .icon-badge { background: rgba(255,92,92,0.12); color: var(--danger); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 420px;
  margin: 0 auto;
  height: 70px;
  background: #131513;
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
}
.tab-icon { width: 22px; height: 22px; }

/* ---------- Иконки вместо эмодзи ---------- */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon-badge {
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(201,255,61,0.12); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-badge.sm { width: 26px; height: 26px; border-radius: 8px; }
.icon-inline { color: var(--accent); }
.icon-inline.dim { color: var(--text-dim); }
.icon-inline.warn { color: var(--warning); }
.tab.active { color: var(--accent); }

/* ---------- Доступ закрыт ---------- */
.subscription-gate-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.subscription-gate-card {
  max-width: 320px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.subscription-gate-icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: rgba(201,255,61,0.12); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.subscription-gate-icon .icon { width: 30px; height: 30px; }
.subscription-gate-title { font-size: 20px; font-weight: 800; }
.subscription-gate-text { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin-bottom: 10px; }
