/* =====================================================================
   Forma — тёмный стиль: глубокий фон, стеклянные карточки,
   неоново-салатовый акцент, широкий шрифт Unbounded для заголовков
   ===================================================================== */
:root {
  --bg: #0a0c11;
  --card-top: #1b202b;
  --card-bottom: #12151c;
  --card-solid: #161a22;
  --border: rgba(var(--ink), 0.07);
  --border-strong: rgba(var(--ink), 0.12);
  --input: rgba(var(--ink), 0.045);
  --text: #f3f5f8;
  --muted: #8b93a7;
  --lime: #b4f53c;
  --lime-text: #b4f53c; /* салатовый для текста: в светлой теме темнее, чтобы читался */
  --ink: 255, 255, 255; /* «стекло» поверх фона: в тёмной теме — белое, в светлой — тёмное */
  --lime-2: #6fdc3a;
  --purple: #9b6bff;
  --danger: #ff5a4f;
  --grad-lime: linear-gradient(90deg, #c2f74a 0%, #6fdc3a 100%);
  --grad-plus: radial-gradient(circle at 30% 30%, #d6ff6a 0%, #8ee043 45%, #9b6bff 100%);
  --radius: 20px;
  --nav-space: 104px; /* место под нижнюю панель */
  --font-head: 'Unbounded', 'Manrope', -apple-system, sans-serif;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { background: var(--bg); touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(600px 400px at 100% -10%, rgba(155, 107, 255, 0.14), transparent 60%),
    radial-gradient(500px 360px at -10% 30%, rgba(180, 245, 60, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(var(--nav-space) + env(safe-area-inset-bottom, 0px));
}

button, input, textarea { font-family: inherit; }
button { color: inherit; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Шапка ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
}
.logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}
.logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
  margin-bottom: 7px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.streak-pill {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--input);
  border: 1px solid var(--border);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
}
.avatar-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(180, 245, 60, 0.6);
  background: var(--card-solid);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Экраны ---------- */
.screen { padding: 4px 16px 24px; }

.page-title, .title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  margin: 6px 0 14px;
  letter-spacing: -0.3px;
}
.title { margin: 2px 0 12px; }
.title.small { font-size: 17px; margin: 2px 0 0; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--lime-text);
}
.eyebrow.light { color: rgba(255, 255, 255, 0.75); }

.section-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  margin: 22px 0 10px;
}

/* ---------- Карточки ---------- */
.card {
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(var(--ink), 0.04);
}
.card-hero { padding-bottom: 14px; }
.card-label {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.card-head { margin-bottom: 10px; }
.card-head .card-label { margin-bottom: 2px; }
.card-hint { color: var(--muted); font-size: 12px; }
.optional { color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- Статистика (3 плитки) ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 8px;
  text-align: center;
}
.stat-icon {
  width: 34px; height: 34px;
  margin: 0 auto 6px;
  border-radius: 11px;
  background: rgba(var(--ink), 0.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.stat-num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
}
.stat-num.accent { color: var(--lime-text); text-shadow: 0 0 18px rgba(180, 245, 60, 0.35); }
.stat-label { color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.2; }

/* ---------- Поля ввода ---------- */
textarea, input[type="text"], input[type="number"] {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--input);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  resize: none;
  transition: border-color 0.15s ease;
}
textarea:focus, input[type="text"]:focus, input[type="number"]:focus { border-color: rgba(180, 245, 60, 0.55); }
::placeholder { color: #5f6778; }
/* убираем стрелочки у числовых полей — на телефоне они только мешают */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Переключатели (сегменты) ---------- */
.segmented {
  display: flex;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px;
  margin: 0 0 12px;
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg-btn.active { background: var(--grad-lime); color: #0b0d10; }

/* ---------- Выбор даты ---------- */
.date-picker-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip.active { background: var(--grad-lime); color: #0b0d10; border-color: transparent; }
.date-input-wrap {
  display: flex; align-items: center; gap: 6px;
  flex: 1 1 150px;
  font-size: 14px;
}
.date-input-wrap input[type="date"] {
  flex: 1; min-width: 0;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color-scheme: dark;
}

/* ---------- Строки: беговые отрезки ---------- */
.set-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 30px;
  gap: 6px;
  margin-bottom: 8px;
}
.set-row input { padding: 10px 8px; font-size: 14px; border-radius: 12px; }

/* ---------- Строки: силовая / ОФП ---------- */
.ex-row {
  border: 1px solid var(--border);
  background: rgba(var(--ink), 0.025);
  border-radius: 16px;
  padding: 8px;
  margin-bottom: 8px;
}
.ex-top { display: grid; grid-template-columns: 1fr 30px; gap: 6px; margin-bottom: 6px; }
.ex-bottom { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ex-row input { padding: 10px; font-size: 14px; border-radius: 12px; }

.row-del {
  border: none; background: none;
  color: var(--danger);
  font-size: 15px;
  cursor: pointer;
  padding: 0;
}
.add-btn {
  width: 100%;
  padding: 11px;
  border-radius: 14px;
  border: 1px dashed rgba(180, 245, 60, 0.4);
  background: rgba(180, 245, 60, 0.05);
  color: var(--lime-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Ползунки ---------- */
.slider-row { margin: 6px 0 14px; }
.slider-row:last-child { margin-bottom: 4px; }
.slider-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; color: var(--muted); }
.slider-top b { color: var(--text); font-family: var(--font-head); font-size: 14px; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5a4f, #ffc14d 50%, var(--lime));
  outline: none;
}
/* самочувствие: плохо (красный) → отлично (зелёный) */
input[type="range"].range-good { background: linear-gradient(90deg, #ff5a4f, #ffc14d 50%, var(--lime)); }
/* нагрузка: легко (зелёный) → на пределе (красный) */
input[type="range"].range-load { background: linear-gradient(90deg, var(--lime), #ffc14d 50%, #ff5a4f); }
.slider-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.slider-hint { font-size: 12px; margin-top: 6px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px rgba(var(--ink), 0.3);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--bg);
}

/* ---------- Умный ввод ---------- */
.smart-card {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, var(--card-top), var(--card-bottom)) padding-box,
    linear-gradient(120deg, rgba(180, 245, 60, 0.7), rgba(155, 107, 255, 0.7)) border-box;
}
.smart-hint { margin: -4px 0 10px; }
.smart-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(90deg, #9b6bff, #6f8bff);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(155, 107, 255, 0.3);
}
.smart-btn:disabled { opacity: 0.6; }

/* ---------- Пульс ---------- */
.hr-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hr-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.hr-field input { padding: 10px 6px; text-align: center; font-size: 15px; }
.hr-hint { font-size: 12px; margin-top: 8px; line-height: 1.35; }

/* ---------- Переключатель «Показывать друзьям» ---------- */
.toggle-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
  font-size: 14px;
  cursor: pointer;
}
.toggle-row input { display: none; }
.toggle {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: rgba(var(--ink), 0.12);
  position: relative;
  transition: background 0.2s ease;
  flex: 0 0 auto;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.toggle-row input:checked + .toggle { background: var(--lime-2); }
.toggle-row input:checked + .toggle::after { transform: translateX(18px); }

/* ---------- Кнопки ---------- */
.primary-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px;
  border-radius: 999px;
  border: none;
  background: var(--grad-lime);
  color: #0b0d10;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  margin-top: 6px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(140, 230, 60, 0.25);
}
.primary-btn:disabled { opacity: 0.6; }
.primary-btn:active { transform: scale(0.99); }
.plus-ico { font-size: 20px; line-height: 1; }

.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.ghost-btn {
  flex: 1;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(var(--ink), 0.04);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ghost-btn.danger { color: var(--danger); border-color: rgba(255, 90, 79, 0.35); }

.small-btn {
  padding: 12px 16px;
  border-radius: 14px;
  border: none;
  background: var(--grad-lime);
  color: #0b0d10;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.round-btn {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-solid);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease;
}
.round-btn:disabled { opacity: 0.3; cursor: default; }
.round-btn:active { opacity: 0.7; }

.status-msg { text-align: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.empty-hint { color: var(--muted); font-size: 13px; padding: 8px 2px; }

/* ---------- Карточка «запись сохранена» ---------- */
.done-card { border-color: rgba(180, 245, 60, 0.25); }
.done-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.done-summary { white-space: pre-line; font-size: 14px; line-height: 1.6; color: #d9dde6; }
.done-hint { text-align: center; margin-top: 12px; font-size: 12px; }

/* ---------- Fom ---------- */
.fom-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 8px;
  background: var(--grad-plus);
  color: #0b0d10;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
}
.fom-badge.big { width: 42px; height: 42px; border-radius: 14px; font-size: 20px; }
.ai-box {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}
.ai-box-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.ai-box-big { margin-top: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.ai-box-big strong { color: var(--lime-text); }

/* ---------- Профиль: большое фото ---------- */
.profile-hero {
  position: relative;
  height: 300px;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: 12px;
  background-color: var(--card-solid);
  background-size: cover;
  background-position: center;
  /* тонкая аккуратная рамка тенью — без яркой полосы по краю фото */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 40px rgba(0, 0, 0, 0.45);
}
/* мягкая «мутность» снизу фото — под именем */
.profile-hero::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 48%;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 65%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 65%);
}
.profile-hero.no-photo {
  background-image:
    radial-gradient(circle at 25% 25%, rgba(180, 245, 60, 0.5), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(155, 107, 255, 0.55), transparent 55%);
}
.profile-hero-shade {
  position: absolute; inset: -2px;
  background: linear-gradient(180deg, rgba(10, 12, 17, 0) 42%, rgba(10, 12, 17, 0.45) 70%, rgba(10, 12, 17, 0.88) 100%);
}
.profile-hero-bottom {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; align-items: flex-start;
}
/* вид спорта — строка над именем */
.hero-sport {
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: #d9c8ff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-align: left;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.hero-sport { cursor: pointer; }
.hero-sport.empty { color: rgba(255, 255, 255, 0.75); text-decoration: underline dashed rgba(255, 255, 255, 0.4); text-underline-offset: 4px; }
.profile-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  margin: 4px 0 8px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  word-break: break-word;
}
.profile-tags { display: flex; gap: 6px; flex-wrap: wrap; max-width: 100%; }
.profile-tags::-webkit-scrollbar { display: none; }
.profile-tags .tag { flex: 0 0 auto; white-space: nowrap; }

/* фирменная синяя галочка */
.verified { width: 0.8em; height: 0.8em; margin-left: 6px; vertical-align: -0.06em; flex: 0 0 auto; }
.friend-name .verified { width: 16px; height: 16px; margin-left: 4px; vertical-align: -3px; }
.tag {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(180, 245, 60, 0.6);
  color: var(--lime-text);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.photo-btn {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  cursor: pointer;
}
.photo-btn:active { transform: scale(0.94); }

/* ---------- Меню «Фото» ---------- */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 50;
  display: flex; align-items: flex-end;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
}
.sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--card-solid);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 16px;
}
.sheet-title { text-align: center; font-weight: 700; margin-bottom: 12px; }
.sheet-btn {
  width: 100%;
  padding: 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(var(--ink), 0.05);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.sheet-btn.muted-btn { background: transparent; border-color: transparent; color: var(--muted); margin-bottom: 0; }

/* ---------- Календарь ---------- */
.cal-header { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 10px; }
.cal-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-weekdays span { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.cal-cell {
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 12px;
  background: rgba(var(--ink), 0.04);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
}
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.has-training { background: var(--grad-lime); color: #0b0d10; font-weight: 800; }
.cal-cell.has-rest { background: transparent; box-shadow: inset 0 0 0 2px rgba(155, 107, 255, 0.7); }
.cal-cell.today { outline: 2px solid #fff; outline-offset: 1px; }
.cal-cell.future { opacity: 0.3; cursor: default; }
.cal-cell.too-old { opacity: 0.4; }
.cal-cell:not(.future):not(.empty):active { opacity: 0.7; }
.cal-legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 12px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.dot-training { background: var(--grad-lime); }
.dot-rest { box-shadow: inset 0 0 0 2px rgba(155, 107, 255, 0.8); }
.cal-summary { text-align: center; margin-top: 8px; }
.cal-help { text-align: center; margin-top: 6px; font-size: 12px; }

/* ---------- Последние записи ---------- */
.history-item {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}
.history-ico {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}
.history-ico.tr { background: rgba(180, 245, 60, 0.12); }
.history-ico.rs { background: rgba(155, 107, 255, 0.15); }
.history-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.history-date { font-weight: 700; font-size: 14px; }
.history-sub { color: var(--muted); font-size: 12px; }
.history-arrow { color: var(--muted); font-size: 22px; }
.history-item:active { opacity: 0.7; }

/* ---------- Друзья ---------- */
.add-friend-row { display: flex; gap: 8px; margin-top: 10px; }
.add-friend-row input { flex: 1 1 auto; min-width: 0; }
.friend-item {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
}
.friend-ava {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--grad-plus);
  color: #0b0d10;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  flex: 0 0 auto;
}
.friend-name { flex: 1; font-weight: 700; min-width: 0; }
.friend-streak { font-family: var(--font-head); font-weight: 600; }
.friend-actions { display: flex; gap: 6px; }
.mini-btn { border: none; border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.mini-btn.accept { background: var(--grad-lime); color: #0b0d10; }
.mini-btn.decline { background: rgba(255, 90, 79, 0.15); color: var(--danger); }

/* ---------- Чат с Fom ---------- */
.chat-section {
  display: flex;
  flex-direction: column;
  /* высота экрана минус шапка и нижняя панель — строка ввода всегда видна */
  height: calc(var(--app-h, 100vh) - 64px - var(--nav-space) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  padding-bottom: 8px;
}
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--border);
}
.chat-head-name { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
}
.chat-empty { color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; margin: auto 10px; }
.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.chat-bubble.user { align-self: flex-end; background: var(--grad-lime); color: #0b0d10; border-bottom-right-radius: 6px; font-weight: 600; }
.chat-bubble.assistant { align-self: flex-start; background: var(--card-solid); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.chat-bubble.assistant strong { color: var(--lime-text); }
.chat-bubble.typing { color: var(--muted); }

/* строка ввода — как в мессенджере */
.chat-input-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-input-row textarea {
  flex: 1 1 auto; min-width: 0; border-radius: 22px; padding: 11px 18px;
  resize: none; overflow-y: hidden; min-height: 44px; max-height: 132px;
  line-height: 1.4; font-size: 16px; box-sizing: border-box; display: block;
}
.chat-input-row textarea.scrolling { overflow-y: auto; }
.send-btn {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--grad-lime);
  color: #0b0d10;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
}
.send-btn svg { margin-left: 2px; }
.send-btn:active { opacity: 0.7; }

/* ---------- Шапка экрана редактирования ---------- */
.screen-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }

/* ---------- Нижняя панель (всегда внизу, не двигается) ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: min(calc(100% - 24px), 440px);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px;
  border-radius: 26px;
  background: rgba(20, 23, 31, 0.82);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 40;
}
.nav-btn {
  flex: 1;
  height: 100%;
  border: none;
  background: none;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s ease;
}
.nav-btn.active { color: var(--lime-text); }
.nav-btn.active svg { filter: drop-shadow(0 0 6px rgba(180, 245, 60, 0.6)); }
.nav-plus {
  flex: 0 0 auto;
  width: 60px; height: 60px;
  margin: 0 4px;
  transform: translateY(-14px);
  border-radius: 50%;
  border: 4px solid var(--bg);
  background: var(--grad-plus);
  color: #0b0d10;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(155, 107, 255, 0.45), 0 0 18px rgba(180, 245, 60, 0.35);
  transition: transform 0.15s ease;
}
.nav-plus:active { transform: translateY(-14px) scale(0.94); }
.nav-plus.active { box-shadow: 0 6px 28px rgba(155, 107, 255, 0.6), 0 0 26px rgba(180, 245, 60, 0.6); }

/* =====================================================================
   Друзья: лента, профиль друга, реакции, комментарии, активность
   ===================================================================== */
.ghost-btn.wide { display: block; width: 100%; margin-top: 12px; }

/* значки с числом новых событий */
.nav-btn { position: relative; }
.nav-badge {
  position: absolute;
  top: 8px; left: calc(50% + 6px);
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-style: normal;
  font-size: 10px; font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px #10131a;
}
.tab-badge {
  display: inline-block;
  min-width: 18px; height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px; font-weight: 800;
  line-height: 18px;
}

/* аватарки: фото поверх буквы (если фото не загрузилось — видна буква) */
.friend-ava { position: relative; overflow: hidden; }
.friend-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.friend-ava.small { width: 30px; height: 30px; font-size: 13px; }

/* список друзей — строки нажимаются */
.friend-item.clickable { width: 100%; text-align: left; color: var(--text); cursor: pointer; font-family: inherit; }
.friend-item.clickable:active { opacity: 0.75; }
.friend-sub { display: block; font-weight: 500; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Карточка тренировки в ленте ---------- */
.wk-card { padding: 14px; transition: box-shadow 0.4s ease; }
.wk-head { display: flex; align-items: center; gap: 10px; }
.wk-head-main { min-width: 0; flex: 1; }
.wk-author {
  display: block;
  padding: 0; border: none; background: none;
  color: var(--text);
  font-weight: 800; font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.wk-author .verified { width: 15px; height: 15px; margin-left: 4px; vertical-align: -2px; }
.wk-date { color: var(--muted); font-size: 12px; margin-top: 2px; }
.wk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.wk-chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(var(--ink), 0.05);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 800;
}
.wk-body { white-space: pre-line; font-size: 14px; line-height: 1.55; color: #d9dde6; margin-top: 10px; }
.wk-card.flash { box-shadow: 0 0 0 2px var(--lime), 0 0 28px rgba(180, 245, 60, 0.35); }

/* ---------- Реакции ---------- */
.social { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.react-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.react-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(var(--ink), 0.04);
  color: var(--text);
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.react-btn .react-emoji { font-size: 16px; line-height: 1; filter: grayscale(0.6); opacity: 0.75; transition: filter 0.15s, opacity 0.15s; }
.react-btn.has .react-emoji, .react-btn.mine .react-emoji { filter: none; opacity: 1; }
.react-btn.mine { background: rgba(180, 245, 60, 0.14); border-color: rgba(180, 245, 60, 0.7); color: var(--lime-text); }
.react-btn:active { transform: scale(0.92); }
.react-btn.comment-btn { margin-left: auto; }
.react-btn.pop .react-emoji { animation: react-pop 0.45s ease; }
@keyframes react-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.6) rotate(-10deg); }
  100% { transform: scale(1); }
}

/* ---------- Комментарии ---------- */
.thread { margin-top: 12px; }
.thread-loading, .thread-empty { font-size: 13px; padding: 4px 2px 8px; }
.who-reacted { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.who-reacted .verified { width: 12px; height: 12px; margin-left: 2px; vertical-align: -2px; }
.comment { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 10px; }
.comment-main {
  flex: 1; min-width: 0;
  background: rgba(var(--ink), 0.05);
  border-radius: 4px 14px 14px 14px;
  padding: 8px 11px;
}
.comment-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 2px; }
.comment-top .verified { width: 13px; height: 13px; margin-left: 3px; vertical-align: -2px; }
.comment-text { font-size: 14px; line-height: 1.4; word-break: break-word; }
.comment-del { border: none; background: none; color: var(--muted); font-size: 13px; padding: 6px 2px; cursor: pointer; }
.comment-form { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.comment-form input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; font-size: 14px; }
.send-btn.small { width: 38px; height: 38px; }

/* ---------- Активность ---------- */
.activity-card { border-color: rgba(155, 107, 255, 0.35); }
.activity-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 4px;
  border: none; border-radius: 12px;
  background: none;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}
.activity-item + .activity-item { border-top: 1px solid var(--border); border-radius: 0; }
.activity-item.unread .activity-text::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  vertical-align: 1px;
}
.activity-text { flex: 1; min-width: 0; }
.activity-text .verified { width: 13px; height: 13px; margin-left: 2px; vertical-align: -2px; }
.activity-time { flex: 0 0 auto; font-size: 11px; }

/* ---------- Пустая лента ---------- */
.empty-feed { text-align: center; padding: 26px 18px; }
.empty-feed-ico { font-size: 34px; margin-bottom: 8px; }
.empty-feed-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.empty-feed .muted { line-height: 1.45; }

/* ---------- Календарь друга ---------- */
.cal-cell.readonly:disabled { cursor: default; }
/* закрытый день: видно, что он был, но без подробностей — с замочком */
.cal-cell.locked { position: relative; }
.cal-cell.has-training.locked { background: rgba(180, 245, 60, 0.28); color: var(--text); box-shadow: inset 0 0 0 1.5px rgba(180, 245, 60, 0.75); }
.cal-cell.locked::after {
  content: '🔒';
  position: absolute;
  top: 1px; right: 2px;
  font-size: 9px;
  line-height: 1;
}

/* ---------- Приватность ---------- */
.privacy-row { margin-top: 8px; }
.privacy-hint { font-size: 12px; line-height: 1.4; margin-top: 8px; }

/* метка «рекорд серии» — спокойнее основной */
.tag.tag-soft { border-color: rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.85); }
.tag-btn { font-family: inherit; cursor: pointer; }
.tag-btn:active { opacity: 0.7; }

/* ---------- Обрезка фото ---------- */
.crop-backdrop { z-index: 60; align-items: center; }
.crop-sheet { max-width: 420px; margin: 0 auto; }
.crop-view {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 20px;
  background: #000;
  touch-action: none; /* палец двигает фото, а не страницу */
  cursor: grab;
}
.crop-view img {
  position: absolute; left: 0; top: 0;
  max-width: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  transform-origin: 0 0;
}
/* подсказка: круг, который увидят в аватарке, остальное чуть затемнено */
.crop-guide {
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: -2px;
  pointer-events: none;
}
.crop-zoom-row { display: flex; align-items: center; gap: 10px; margin: 14px 4px 6px; color: var(--muted); font-weight: 800; }
.crop-zoom { flex: 1; background: rgba(255, 255, 255, 0.15) !important; }
.crop-hint { text-align: center; font-size: 12px; margin-bottom: 4px; }
.crop-save { background: var(--grad-lime); color: #0b0d10; border-color: transparent; }
.crop-save:disabled { opacity: 0.6; }

/* ---------- Компактная шапка профиля ---------- */
.mini-head {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  left: 50%;
  width: min(calc(100% - 24px), 440px);
  margin-left: calc(min(calc(100% - 24px), 440px) / -2);
  z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: 22px;
  background: rgba(20, 23, 31, 0.82);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}
.mini-head.shown { pointer-events: auto; }
.mini-main { min-width: 0; }
.mini-name { font-family: var(--font-head); font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-name .verified { width: 15px; height: 15px; margin-left: 4px; vertical-align: -2px; }
.mini-stats { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.mini-ava {
  position: relative;
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--grad-plus);
  color: #0b0d10;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700;
  box-shadow: 0 0 0 2px var(--lime);
  transition: transform 0.05s linear;
}
.mini-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Жест «назад» ---------- */
.swipe-back {
  position: fixed;
  left: 0; top: 50%;
  z-index: 70;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(var(--ink), 0.12);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: translate(-40px, -50%) scale(0.7);
  pointer-events: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.swipe-back.ready { background: var(--grad-lime); color: #0b0d10; border-color: transparent; }

/* ---------- Вид спорта ---------- */
.sport-sheet { max-height: 86vh; overflow-y: auto; }
.sport-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.sport-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(var(--ink), 0.04);
  color: var(--text);
  font-size: 14px; font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.sport-chip span { font-size: 18px; }
.sport-chip.active { background: rgba(180, 245, 60, 0.14); border-color: rgba(180, 245, 60, 0.75); color: var(--lime-text); }
.sport-sub { margin-bottom: 8px; }
.discipline-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
#disciplineInput { width: 100%; margin-bottom: 4px; }

/* ---------- Подпись у синей галочки ---------- */
.verified { cursor: pointer; }
.badge-tip {
  position: fixed;
  z-index: 80;
  display: none;
  padding: 8px 14px;
  border-radius: 12px;
  background: #2AABEE;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(42, 171, 238, 0.45);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.85);
  transform-origin: var(--arrow-x, 50%) 100%;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.badge-tip.below { transform-origin: var(--arrow-x, 50%) 0; transform: translateY(-6px) scale(0.85); }
.badge-tip.show { opacity: 1; transform: none; }
/* хвостик-стрелочка к галочке */
.badge-tip::after {
  content: '';
  position: absolute;
  left: var(--arrow-x, 50%);
  bottom: -5px;
  width: 10px; height: 10px;
  margin-left: -5px;
  background: #2AABEE;
  transform: rotate(45deg);
  border-radius: 2px;
}
.badge-tip.below::after { bottom: auto; top: -5px; }

/* ---------- Розыгрыши ---------- */
.gift-card {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, var(--card-top), var(--card-bottom)) padding-box,
    linear-gradient(120deg, rgba(255, 196, 77, 0.75), rgba(155, 107, 255, 0.7)) border-box;
}
.gift-head { display: flex; justify-content: space-between; align-items: center; }
.gift-head .card-label { margin-bottom: 0; }
.gift-rules-btn {
  border: 1px solid var(--border-strong);
  background: rgba(var(--ink), 0.05);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.gift-sub { margin: 4px 0 10px; }
.gift-row {
  padding: 12px;
  border-radius: 16px;
  background: rgba(var(--ink), 0.04);
  border: 1px solid var(--border);
  margin-top: 8px;
}
.gift-row.month { background: linear-gradient(135deg, rgba(155, 107, 255, 0.16), rgba(255, 196, 77, 0.08)); border-color: rgba(155, 107, 255, 0.35); }
.gift-row.in { border-color: rgba(180, 245, 60, 0.55); }
.gift-row-top { display: flex; align-items: center; gap: 10px; }

.gift-row-main { flex: 1; min-width: 0; }
.gift-title { font-weight: 800; font-size: 14px; }
.gift-title .muted { font-weight: 600; font-size: 12px; }
.gift-when { font-size: 12px; color: #ffc44d; font-weight: 700; margin-top: 2px; }
.gift-badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(180, 245, 60, 0.14);
  border: 1px solid rgba(180, 245, 60, 0.6);
  color: var(--lime-text);
  font-size: 12px; font-weight: 800;
}
.gift-bar { height: 6px; border-radius: 999px; background: rgba(var(--ink), 0.08); margin-top: 10px; overflow: hidden; }
.gift-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffc44d, var(--lime)); }
.gift-row.month .gift-bar i { background: linear-gradient(90deg, var(--purple), #ffc44d); }
.gift-status { font-size: 12px; color: var(--muted); margin-top: 6px; }
.gift-status.ok { color: var(--lime-text); font-weight: 700; }
.gift-sheet { max-height: 86vh; overflow-y: auto; }
.gift-rules p { font-size: 14px; line-height: 1.45; color: #d9dde6; margin: 0 0 10px; }
.gift-winners { margin: 12px 0 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.gift-winner { font-size: 14px; padding: 4px 0; }

/* ---------- Вторая тренировка за день ---------- */
.done-block + .done-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.done-block-title { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.done-block .ai-box { margin-top: 10px; }
.add-second-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(180, 245, 60, 0.6);
  background: rgba(180, 245, 60, 0.07);
  color: var(--lime-text);
  font-size: 14px; font-weight: 800;
  cursor: pointer;
}
.add-second-btn:active { transform: scale(0.99); }
/* во второй тренировке нельзя выбрать «Отдых» */
.second-mode [data-f="typeSwitch"] [data-type="rest"] { display: none; }
#editFormFields [data-f="repeatBtn"] { display: none; }
/* в календаре — маленькая метка «×2» на днях с двумя тренировками */
.cal-cell.double { position: relative; }
.cal-cell.double::after {
  content: '×2';
  position: absolute;
  top: 1px; right: 3px;
  font-size: 8px; font-weight: 900;
  color: #0b0d10;
}
#editSessionSwitch { margin-bottom: 12px; }

/* ---------- Анкета для Fom ---------- */
.athlete-card { border-color: rgba(155, 107, 255, 0.3); }
.athlete-summary { white-space: pre-line; font-size: 14px; line-height: 1.5; margin: 8px 0 4px; color: #d9dde6; }
.athlete-note { font-size: 12px; }
.athlete-note.center { text-align: center; margin: -6px 0 12px; }
.athlete-sheet { max-height: 88vh; overflow-y: auto; }
.af-label { margin: 14px 0 8px; }
.af-sex { margin-bottom: 4px; }
.af-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.af-grid input { padding: 10px 6px; text-align: center; font-size: 15px; }
.athlete-sheet textarea { width: 100%; }
.athlete-sheet .btn-row { margin-top: 16px; }


/* =====================================================================
   Наши иконки
   ===================================================================== */
.ico { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -0.2em; overflow: visible; }
.stat-icon .ico { width: 21px; height: 21px; }
.streak-pill .ico { width: 17px; height: 17px; }
.card-label .ico { width: 20px; height: 20px; }
.date-input-wrap .ico { width: 20px; height: 20px; color: var(--muted); margin-bottom: 8px; }
.history-ico .ico { width: 21px; height: 21px; }
.seg-btn .ico { width: 18px; height: 18px; vertical-align: -0.25em; }
.seg-btn.active .ico { color: #0b0d10; }
.ghost-btn .ico { width: 17px; height: 17px; vertical-align: -0.22em; }
.tag .ico, .mini-stats .ico, .friend-streak .ico, .gift-badge .ico, .gift-status .ico { width: 1.05em; height: 1.05em; vertical-align: -0.18em; }
.sheet-title .ico { width: 20px; height: 20px; vertical-align: -0.22em; }
.gift-rules .ico, .gift-sub .ico, .athlete-summary .ico, .wk-date .ico, .gift-winner .ico { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
.done-title { display: flex; align-items: center; gap: 8px; }
.done-title .ico { width: 22px; height: 22px; }
.done-block-title { display: flex; align-items: center; gap: 6px; }
.done-block-title .ico { width: 18px; height: 18px; }
.gift-title .ico { width: 16px; height: 16px; vertical-align: -0.2em; }

/* =====================================================================
   Барабан подарков в розыгрыше
   ===================================================================== */
.gift-slot {
  position: relative;
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(255, 196, 77, 0.45);
  background: radial-gradient(circle at 50% 35%, rgba(255, 196, 77, 0.22), rgba(var(--ink), 0.03) 70%);
  box-shadow: inset 0 0 14px rgba(255, 196, 77, 0.15), 0 0 16px rgba(255, 196, 77, 0.12);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
}
.gift-row.month .gift-slot {
  border-color: rgba(155, 107, 255, 0.6);
  background: radial-gradient(circle at 50% 35%, rgba(155, 107, 255, 0.3), rgba(var(--ink), 0.03) 70%);
  box-shadow: inset 0 0 14px rgba(155, 107, 255, 0.2), 0 0 18px rgba(155, 107, 255, 0.2);
}
/* блик сверху и снизу — как у настоящего барабана */
.gift-slot::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 12, 17, 0.55), transparent 30%, transparent 70%, rgba(10, 12, 17, 0.55));
  pointer-events: none;
}
.gift-slot-item {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  line-height: 1;
}
.gift-slot-item.in { animation: slot-in 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.gift-slot-item.out { animation: slot-out 0.38s ease-in both; }
.gift-slot-item.fast.in { animation-duration: 0.12s; animation-timing-function: linear; }
.gift-slot-item.fast.out { animation-duration: 0.12s; animation-timing-function: linear; }
@keyframes slot-in { from { transform: translateY(100%); filter: blur(2px); } to { transform: none; filter: none; } }
@keyframes slot-out { from { transform: none; } to { transform: translateY(-100%); filter: blur(2px); } }
.gift-slot:active { transform: scale(0.95); }
.gift-maybe { font-size: 12px; color: var(--muted); margin-top: 2px; }
.gift-maybe b { color: var(--text); font-weight: 700; }

/* =====================================================================
   Наше окно-сообщение
   ===================================================================== */
.dlg-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(5, 6, 10, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: dlg-fade 0.18s ease both;
}
.dlg-backdrop.closing { animation: dlg-fade-out 0.16s ease both; }
.dlg {
  width: min(100%, 340px);
  padding: 22px 20px 16px;
  border-radius: 26px;
  text-align: center;
  background: linear-gradient(180deg, #1f2533, #141820);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(155, 107, 255, 0.12);
  animation: dlg-pop 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.dlg-backdrop.closing .dlg { animation: dlg-pop-out 0.16s ease both; }
.dlg-icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--ink), 0.06);
  border: 1px solid var(--border);
  color: #cfd5e2;
}
.dlg-icon .ico { width: 30px; height: 30px; }
.dlg-title { font-family: var(--font-head); font-weight: 700; font-size: 17px; line-height: 1.25; margin-bottom: 8px; }
.dlg-text { color: #c3c9d6; font-size: 14px; line-height: 1.5; }
.dlg-btns { display: flex; gap: 8px; margin-top: 18px; }
.dlg-btn {
  flex: 1;
  padding: 13px 10px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: rgba(var(--ink), 0.05);
  font-weight: 700; font-size: 15px;
  cursor: pointer;
}
.dlg-btn.main { background: var(--grad-lime); color: #0b0d10; border-color: transparent; }
.dlg-btn.main.danger { background: var(--danger); color: #fff; }
.dlg-btn:active { transform: scale(0.97); }
@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlg-fade-out { to { opacity: 0; } }
@keyframes dlg-pop { from { opacity: 0; transform: scale(0.9) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes dlg-pop-out { to { opacity: 0; transform: scale(0.95); } }

/* =====================================================================
   Клавиатура открыта: прячем нижнюю панель, чат — на всю высоту
   ===================================================================== */
.bottom-nav { transition: opacity 0.15s ease, transform 0.15s ease; }
body.kb-open .bottom-nav { opacity: 0; pointer-events: none; transform: translate(-50%, 24px); visibility: hidden; }
body.kb-open { padding-bottom: 24px; }
body.kb-open .swipe-back { display: none; }
body.chat-open.kb-open .topbar { display: none; }
body.chat-open.kb-open .chat-section {
  height: calc(var(--app-h, 100vh) - env(safe-area-inset-top, 0px) - 12px);
  padding-top: 8px;
}
body.chat-open.kb-open { padding-bottom: 0; }

/* =====================================================================
   Знакомство с приложением
   ===================================================================== */
.tour.consent { z-index: 95; }
.tour.policy { z-index: 96; }
.consent-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 36px 22px 12px; line-height: 1.5; }
.consent-body .title { margin: 4px 0 12px; }
.consent-body h3 { margin: 18px 0 4px; font-size: 15px; }
.consent-body p { margin: 0 0 8px; color: var(--muted, inherit); }
.consent-list { margin: 8px 0 12px; padding-left: 18px; }
.consent-list li { margin-bottom: 6px; }
.consent-check { margin-top: 16px; }
.consent > .tour-next { margin: 8px 22px 0; }
.tour {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 0 calc(20px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(500px 380px at 100% 0%, rgba(155, 107, 255, 0.22), transparent 60%),
    radial-gradient(460px 360px at 0% 100%, rgba(180, 245, 60, 0.12), transparent 60%),
    var(--bg);
  animation: dlg-fade 0.3s ease both;
}
.tour.closing { animation: dlg-fade-out 0.25s ease both; }
.tour-skip {
  align-self: flex-end;
  margin-right: 16px;
  border: none; background: none;
  color: var(--muted);
  font-size: 14px; font-weight: 700;
  padding: 8px 4px;
  cursor: pointer;
}
.tour-track {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tour-track::-webkit-scrollbar { display: none; }
.tour-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 0 30px;
}
.tour-art {
  width: 128px; height: 128px;
  margin-bottom: 28px;
  border-radius: 40px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 60px rgba(155, 107, 255, 0.18);
  color: #cfd5e2;
}
.tour-art .ico { width: 64px; height: 64px; }
.tour-logo { font-family: var(--font-head); font-weight: 700; font-size: 26px; display: flex; align-items: flex-end; gap: 3px; }
.tour-fom { width: 64px; height: 64px; font-size: 30px; border-radius: 20px; }
.tour-title { font-family: var(--font-head); font-weight: 700; font-size: 23px; line-height: 1.2; margin-bottom: 12px; }
.tour-text { color: #c3c9d6; font-size: 15px; line-height: 1.55; max-width: 340px; }
.tour-fill { margin-top: 20px; }
.tour-dots { display: flex; justify-content: center; gap: 7px; margin: 14px 0 16px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 999px; background: rgba(var(--ink), 0.18); transition: width 0.2s ease, background 0.2s ease; }
.tour-dots i.on { width: 22px; background: var(--lime); box-shadow: 0 0 10px rgba(180, 245, 60, 0.6); }
.tour-next { margin: 0 20px; width: auto; }

/* ---------- Поддержка (внизу профиля) ---------- */
.support-card { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.support-ico {
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(155, 107, 255, 0.14);
  border: 1px solid rgba(155, 107, 255, 0.3);
  color: #cfd5e2;
}
.support-ico .ico { width: 22px; height: 22px; }
.support-main { flex: 1; min-width: 0; }
.support-title { font-weight: 800; font-size: 15px; margin-bottom: 2px; }

/* =====================================================================
   Старты и личные рекорды
   ===================================================================== */
.seg-3 .seg-btn { padding: 10px 4px; font-size: 13px; white-space: nowrap; }
.seg-3 .seg-btn .ico { width: 16px; height: 16px; }
.comp-card { border-color: rgba(255, 196, 77, 0.4); background: linear-gradient(180deg, rgba(255, 196, 77, 0.08), var(--card-bottom) 60%); }
.comp-sub { margin: 12px 0 8px; font-size: 13px; color: var(--muted); }
.comp-chips {
  display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px 10px; padding: 0 16px 2px;
}
.comp-chips::-webkit-scrollbar { display: none; }
.comp-chips .chip { flex: 0 0 auto; white-space: nowrap; }
.comp-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 12px; }
.comp-row .hr-field .optional { font-style: normal; font-size: 11px; }
.pb-badge {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffe98a, #ffae1f);
  color: #0b0d10;
  font-size: 11px; font-weight: 800;
  box-shadow: 0 0 14px rgba(255, 196, 77, 0.45);
}
/* день со стартом в календаре — золотая обводка */
.cal-cell.has-comp { box-shadow: inset 0 0 0 2px #ffc44d, 0 0 12px rgba(255, 196, 77, 0.35); }

.records-empty { font-size: 13px; line-height: 1.45; }
.record-row {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  padding: 10px 0;
  border: none; border-top: 1px solid var(--border);
  background: none;
  cursor: pointer;
}
.record-row:first-child { border-top: none; padding-top: 2px; }
.record-disc { flex: 0 0 92px; font-size: 13px; font-weight: 700; color: var(--muted); }
.record-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.record-res { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: #ffd15a; }
.record-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Повторить прошлую тренировку ---------- */
.repeat-btn {
  width: 100%;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(180, 245, 60, 0.45);
  background: rgba(180, 245, 60, 0.05);
  color: var(--lime-text);
  font-weight: 700; font-size: 14px;
  cursor: pointer;
}
.repeat-btn:active { transform: scale(0.98); }
.repeat-sheet { max-height: 80vh; overflow-y: auto; }
.repeat-hint { font-size: 13px; margin: -4px 0 12px; }
.center { text-align: center; }
.repeat-row {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  padding: 10px;
  margin-bottom: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(var(--ink), 0.03);
  cursor: pointer;
}
.repeat-row:active { background: rgba(180, 245, 60, 0.08); }
.repeat-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* =====================================================================
   Графики по неделям
   ===================================================================== */
.charts-card { position: relative; }
.charts-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.chart-block { margin-top: 12px; }
.chart-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.chart-title .muted { font-weight: 500; font-size: 12px; }
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.c-grid { stroke: #252b37; stroke-width: 1; }
.c-axis { fill: #6f7789; font-size: 10px; font-family: var(--font); }
.c-axis.c-now { fill: var(--text); font-weight: 700; }
.c-val { fill: var(--text); font-size: 11px; font-weight: 700; font-family: var(--font); }
.c-bar { transition: opacity 0.15s ease; }
.c-bar.dim { opacity: 0.35; }
.c-hit { cursor: pointer; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 2px 0 2px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.key-feel { background: #5ea818; }
.key-rpe { background: #9b6bff; }
.chart-tip {
  position: absolute; z-index: 5;
  padding: 7px 10px;
  border-radius: 10px;
  background: #242a37;
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 12px; white-space: nowrap;
  pointer-events: none;
}
.chart-tip b { font-weight: 800; }
.chart-empty { padding: 10px 0; }
.charts-card.empty .chart-block:not(:first-of-type), .charts-card.empty .charts-head .gift-rules-btn { display: none; }
.chart-table { margin-top: 14px; overflow-x: auto; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.chart-table th { text-align: left; color: var(--muted); font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.chart-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); white-space: nowrap; }

/* картинка подарка в барабане */
.gift-slot-item img { width: 40px; height: 40px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4)); }

/* в своём профиле серия и фото уже крупно на экране — в шапке их не дублируем */
.topbar-right { transition: opacity 0.2s ease; }
body[data-screen="profileScreen"] .topbar-right { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- Файл с часов ---------- */
.watch-row { display: flex; gap: 8px; margin-top: 8px; }
.watch-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(155, 107, 255, 0.35);
  background: rgba(155, 107, 255, 0.08);
  color: #c9b5ff;
  font-weight: 700; font-size: 13px;
  cursor: pointer;
}
.watch-btn:disabled { opacity: 0.6; }
.watch-help {
  flex: 0 0 40px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(var(--ink), 0.04);
  color: var(--muted);
  font-weight: 800; font-size: 15px;
  cursor: pointer;
}
.watch-sheet { max-height: 86vh; overflow-y: auto; }
.watch-steps { margin: 4px 0 12px; padding-left: 22px; }
.watch-steps li { font-size: 14px; line-height: 1.45; color: #d9dde6; margin-bottom: 8px; }
.watch-note { font-size: 13px; line-height: 1.45; margin-bottom: 8px; }

/* ---------- Иконка на нажатой кнопке: целиком тёмная, чтобы салатовые детали не сливались ---------- */
.seg-btn.active .ico [fill^="url"], .chip.active .ico [fill^="url"] { fill: #0b0d10; }
.seg-btn.active .ico [stroke^="url"], .chip.active .ico [stroke^="url"] { stroke: #0b0d10; }

/* ---------- Плавная нижняя панель ---------- */
.nav-indicator {
  position: absolute;
  left: 0; bottom: 7px;
  width: 28px; height: 3px;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(180, 245, 60, 0.8);
  transition: transform 0.38s cubic-bezier(0.3, 1.3, 0.5, 1), opacity 0.2s ease;
  pointer-events: none;
}
.nav-indicator.off { opacity: 0; }
.nav-btn svg, .nav-btn span { transition: transform 0.25s ease, color 0.2s ease; }
.nav-btn.active svg { transform: translateY(-2px) scale(1.08); }
.screen.screen-in { animation: screen-in 0.28s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.screen.screen-in.from-right { --from: 26px; }
.screen.screen-in.from-left { --from: -26px; }
.screen.screen-in.from-none { --from: 0px; }
@keyframes screen-in { from { opacity: 0; transform: translateX(var(--from, 0)); } to { opacity: 1; transform: none; } }

/* ---------- Поделиться: карточка для сторис ---------- */
.share-sheet { max-height: 92vh; overflow-y: auto; }
.share-preview {
  width: min(58vw, 240px);
  aspect-ratio: 9 / 16;
  margin: 0 auto 10px;
  border-radius: 18px;
  overflow: hidden;
  background: #0a0c11;
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(155, 107, 255, 0.15);
}
.share-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.share-main { margin: 6px 0 8px; }

/* =====================================================================
   Волна 1: утро, старты, челлендж, достижения, лимит чата
   ===================================================================== */
.chat-limit { text-align: center; font-size: 12px; color: var(--muted); padding: 0 0 8px; }
.chat-limit.empty { color: #ffc44d; font-weight: 700; }

.morning-card { border-color: rgba(255, 196, 77, 0.35); background: linear-gradient(180deg, rgba(255, 196, 77, 0.07), var(--card-bottom) 70%); }
.morning-close { border: none; background: none; color: var(--muted); font-size: 16px; padding: 4px 6px; cursor: pointer; }
.morning-q { font-size: 12px; font-weight: 700; color: var(--muted); margin: 6px 0 6px; }
.morning-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.morning-chips .chip { flex: 1 1 auto; text-align: center; padding: 8px 6px; }
.morning-chips.mood .chip { font-size: 20px; padding: 6px; }
.morning-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; margin-top: 10px; }
.morning-save { padding: 12px; }
.morning-sum { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.morning-sum .ico { width: 20px; height: 20px; }
.morning-warn { margin-top: 8px; font-size: 13px; line-height: 1.4; color: #ffc44d; display: flex; gap: 8px; align-items: flex-start; }
.morning-warn .ico { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }

.countdown-card {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  text-align: left;
  cursor: pointer;
  border-color: rgba(255, 196, 77, 0.45);
  background: linear-gradient(120deg, rgba(255, 196, 77, 0.14), rgba(155, 107, 255, 0.1));
  color: var(--text);
  font-family: inherit;
}
.cd-num { font-family: var(--font-head); font-weight: 700; font-size: 30px; color: #ffd15a; min-width: 44px; text-align: center; }
.cd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cd-when { font-weight: 800; font-size: 15px; }
.cd-name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.countdown-card > .ico { width: 26px; height: 26px; }

.challenge-left { font-size: 12px; }
.ch-row { margin-top: 10px; }
.ch-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ch-top .ico { width: 17px; height: 17px; }
.ch-label { flex: 1; font-weight: 700; }
.ch-val { color: var(--muted); font-weight: 700; font-size: 12px; }
.ch-row .gift-bar { margin-top: 6px; }
.ch-row.done .ch-val { color: var(--lime-text); }
.ch-row.done .gift-bar i { background: var(--grad-lime); }

.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ach {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(var(--ink), 0.03);
  text-align: center;
  opacity: 0.45;
  filter: grayscale(1);
}
.ach.on { opacity: 1; filter: none; border-color: rgba(180, 245, 60, 0.35); background: rgba(180, 245, 60, 0.05); }
.ach-ico { width: 40px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: rgba(var(--ink), 0.06); color: #cfd5e2; }
.ach-ico .ico { width: 22px; height: 22px; }
.ach-title { font-size: 12px; font-weight: 800; line-height: 1.2; }
.ach-desc { font-size: 10.5px; color: var(--muted); line-height: 1.2; }

.start-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.start-row:first-child { border-top: none; padding-top: 2px; }
.start-row.past { opacity: 0.5; }
.start-date { flex: 0 0 48px; display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.start-date b { font-family: var(--font-head); font-size: 20px; color: var(--text); line-height: 1.1; }
.start-name { font-size: 14px; }
.start-left { font-size: 12px; font-weight: 800; color: #ffd15a; white-space: nowrap; }
.start-sheet input[type="text"] { margin-bottom: 10px; }
.st-date { margin-bottom: 4px; }
.st-date input[type="date"] {
  width: 100%;
  border: 1px solid var(--border); background: var(--input); color: var(--text);
  border-radius: 14px; padding: 12px 14px; font-size: 15px; font-family: inherit;
}
.st-goal { margin-top: 0; }
#startsList, #achievementsGrid { margin-top: 12px; }

/* =====================================================================
   Группы, тренер, приглашения
   ===================================================================== */
#friendsTabs .seg-btn { padding: 10px 4px; }
.invite-card { border-color: rgba(155, 107, 255, 0.4); background: linear-gradient(135deg, rgba(155, 107, 255, 0.14), var(--card-bottom) 70%); }
.invite-text { font-size: 13px; line-height: 1.45; }
.invite-text b { color: var(--text); }
.invite-stats { font-size: 13px; margin: 10px 0 2px; color: #c3c9d6; }
.invite-stats b { color: var(--lime-text); }
.group-row { margin-bottom: 8px; }
.group-actions { margin: 4px 0 10px; }
.group-coach-note { font-size: 12.5px; line-height: 1.45; margin: -2px 2px 12px; }
.rank-row {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  text-align: left;
  color: var(--text);
  font-family: inherit;
}
button.rank-row { cursor: pointer; }
.rank-row.me { border-color: rgba(180, 245, 60, 0.45); }
.rank-n { width: 22px; text-align: center; font-family: var(--font-head); font-weight: 700; color: var(--muted); }
.rank-n.top { color: #ffd15a; }
.rank-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rank-name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-streak { font-family: var(--font-head); font-weight: 600; font-size: 13px; white-space: nowrap; }
.rank-streak .ico { width: 14px; height: 14px; vertical-align: -0.15em; }
.rank-hint { font-size: 11.5px; text-align: center; margin: 8px 0 14px; }
.coach-tag { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 999px; background: rgba(155, 107, 255, 0.2); color: #c9b5ff; vertical-align: 1px; }
.gc-kind { margin: 10px 0 8px; }
.gc-hint { font-size: 12.5px; line-height: 1.45; margin-bottom: 12px; }
#groupCreateSheet input[type="text"], #groupJoinSheet input[type="text"] { margin-bottom: 4px; }
.private-wk { border-style: dashed; }
.private-wk .wk-date::after { content: ' · 🔒 закрытая'; color: var(--muted); }
.member-well .morning-sum { font-size: 14px; }

.sport-note { font-size: 13px; margin: -4px 0 12px; }

/* ---------- Личный рекорд на карточке старта ---------- */
.wk-chip.pb-chip {
  display: inline-flex; align-items: center; gap: 5px;
  color: #ffd15a;
  background: rgba(255, 209, 90, 0.12);
  border-color: rgba(255, 209, 90, 0.45);
  box-shadow: 0 0 14px rgba(255, 209, 90, 0.18);
}
.wk-chip.pb-chip .ico, .wk-chip.pb-chip svg { width: 13px; height: 13px; }
#fpRecordsCard { margin-top: 14px; }

/* ---------- Кто видит запись ---------- */
.vis-block { margin-top: 14px; }
.vis-label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 8px 2px; }
.vis-seg { margin-bottom: 0; }
.vis-picked {
  display: flex; align-items: center; gap: 6px; width: 100%;
  margin-top: 10px; padding: 10px 12px;
  border-radius: 14px; border: 1px dashed rgba(180, 245, 60, 0.4);
  background: rgba(180, 245, 60, 0.06); color: var(--text);
  font-size: 13px; text-align: left; cursor: pointer;
}
.vis-picked b { font-weight: 700; }
.vis-picked .ico { width: 16px; height: 16px; flex: none; }
.vis-edit { margin-left: auto; color: var(--lime-text); font-weight: 700; }
.friend-pick-sheet { max-height: 80vh; display: flex; flex-direction: column; }
.friend-pick-hint { margin: -4px 0 10px; }
#friendPickList { overflow-y: auto; flex: 1; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.friend-pick-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--input);
  cursor: pointer; text-align: left;
}
.friend-pick-row .friend-ava { width: 36px; height: 36px; flex: none; }
.friend-pick-name { flex: 1; font-weight: 600; font-size: 15px; }
.friend-pick-check {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-strong); display: grid; place-items: center;
}
.friend-pick-check .ico { width: 16px; height: 16px; opacity: 0; }
.friend-pick-row.on { border-color: rgba(180, 245, 60, 0.5); background: rgba(180, 245, 60, 0.07); }
.friend-pick-row.on .friend-pick-check { background: var(--lime); border-color: var(--lime-text); }
.friend-pick-row.on .friend-pick-check .ico { opacity: 1; color: #0b0d10; }
.friend-pick-empty { padding: 16px 8px; line-height: 1.45; }
.primary-sheet-btn { background: var(--grad-lime); color: #0b0d10; border: none; }

/* ---------- Первопроходец (первые 10 пользователей) ---------- */
.tag.tag-pioneer {
  display: inline-flex; align-items: center; gap: 5px;
  color: #0b0d10; font-weight: 800;
  background: linear-gradient(90deg, #ffe07a, #ffb84d);
  border-color: transparent;
  box-shadow: 0 0 16px rgba(255, 200, 90, 0.35);
}
.tag.tag-pioneer .ico { width: 14px; height: 14px; color: #0b0d10; }
.ach.ach-special {
  border-color: rgba(255, 200, 90, 0.6) !important;
  background: linear-gradient(160deg, rgba(255, 214, 110, 0.18), rgba(255, 184, 77, 0.04)) !important;
  box-shadow: 0 0 22px rgba(255, 200, 90, 0.18);
}
.ach.ach-special .ach-title { color: #ffd15a; }

/* =====================================================================
   Светлая тема — включается в «Настройках» (html[data-theme="light"])
   ===================================================================== */
html[data-theme="light"] {
  --bg: #f3f4ef;
  --card-top: #ffffff;
  --card-bottom: #fbfbf8;
  --card-solid: #ffffff;
  --border: rgba(20, 24, 34, 0.09);
  --border-strong: rgba(20, 24, 34, 0.15);
  --input: rgba(20, 24, 34, 0.045);
  --text: #151820;
  --muted: #687080;
  --lime-text: #4f7d0b;
  --purple: #7a4ef0;
  --ink: 20, 24, 34;
  color-scheme: light;
}
html[data-theme="light"] body {
  background:
    radial-gradient(600px 400px at 100% -10%, rgba(155, 107, 255, 0.10), transparent 60%),
    radial-gradient(500px 360px at -10% 30%, rgba(180, 245, 60, 0.14), transparent 60%),
    var(--bg);
}
html[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(20, 24, 34, 0.04), 0 6px 20px rgba(20, 24, 34, 0.04); }
html[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 30px rgba(20, 24, 34, 0.12);
}
html[data-theme="light"] .stat-num.accent { text-shadow: none; }
html[data-theme="light"] .cal-cell.today { outline-color: #151820; }
html[data-theme="light"] .dlg { background: linear-gradient(180deg, #ffffff, #f5f6f1); box-shadow: 0 24px 60px rgba(20, 24, 34, 0.25); }
html[data-theme="light"] .dlg-backdrop { background: rgba(30, 34, 44, 0.35); }
html[data-theme="light"] .sheet-backdrop { background: rgba(30, 34, 44, 0.35); }
html[data-theme="light"] .c-grid { stroke: #e3e5de; }
html[data-theme="light"] .c-axis { fill: #7a8190; }
html[data-theme="light"] .chart-tip { background: #ffffff; box-shadow: 0 8px 24px rgba(20, 24, 34, 0.15); }
html[data-theme="light"] .record-res { color: #b7791f; }
html[data-theme="light"] .wk-chip.pb-chip { color: #9a6410; background: rgba(255, 200, 90, 0.2); }
html[data-theme="light"] .ach.ach-special .ach-title { color: #9a6410; }
html[data-theme="light"] .logo-dot, html[data-theme="light"] .dot-glow { filter: none; }
html[data-theme="light"] input, html[data-theme="light"] textarea { color: var(--text); }
html[data-theme="light"] ::placeholder { color: #9aa1ae; }
html[data-theme="light"] .vis-picked { background: rgba(180, 245, 60, 0.14); border-color: rgba(79, 125, 11, 0.4); }
html[data-theme="light"] .friend-pick-row.on { background: rgba(180, 245, 60, 0.16); border-color: rgba(79, 125, 11, 0.45); }
/* шестерёнка настроек — в левом верхнем углу шапки профиля */
.photo-btn.settings-btn { right: auto; left: 12px; }
/* светлая тема: светлые тексты тёмной темы → тёмные */
html[data-theme="light"] .done-summary,
html[data-theme="light"] .wk-body,
html[data-theme="light"] .gift-rules p,
html[data-theme="light"] .athlete-summary,
html[data-theme="light"] .watch-steps li { color: #2b303b; }
html[data-theme="light"] .dlg-text, html[data-theme="light"] .tour-text, html[data-theme="light"] .invite-stats { color: #4a5160; }
html[data-theme="light"] .dlg-title, html[data-theme="light"] .tour-title { color: var(--text); }
html[data-theme="light"] .gift-when, html[data-theme="light"] .chat-limit.empty, html[data-theme="light"] .morning-warn { color: #b26a00; }
html[data-theme="light"] .cd-num, html[data-theme="light"] .start-left, html[data-theme="light"] .rank-n.top { color: #b7791f; }
html[data-theme="light"] .coach-tag { color: #6a3fd6; }
html[data-theme="light"] .mini-head { background: rgba(255, 255, 255, 0.9); box-shadow: 0 10px 30px rgba(20, 24, 34, 0.14); }
/* шапка профиля в светлой теме — остаётся «фото-карточкой» с тёмным низом, чтобы белый текст читался */
html[data-theme="light"] .profile-hero.no-photo {
  background-color: #2a2f3d;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(180, 245, 60, 0.55), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(155, 107, 255, 0.6), transparent 55%);
}
html[data-theme="light"] .profile-hero-name, html[data-theme="light"] .profile-name { color: #ffffff; }
html[data-theme="light"] .dlg-icon { color: #4a5160; }
html[data-theme="light"] .watch-btn { color: #6a3fd6; }

/* =====================================================================
   Совместные пробежки
   ===================================================================== */
.seg-4 .seg-btn { padding: 10px 2px; font-size: 13px; white-space: nowrap; }
.runs-head { display: flex; flex-direction: column; gap: 10px; }
.runs-city {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border: none; background: none; cursor: pointer;
  font-size: 17px; color: var(--text);
}
.runs-city b { font-family: var(--font-head); font-weight: 700; }
.runs-hint { line-height: 1.45; }
.runs-empty { line-height: 1.6; }
.runs-other { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.run-card { cursor: pointer; }
.run-card.joined { border-color: rgba(180, 245, 60, 0.45); }
.run-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.run-when { font-family: var(--font-head); font-weight: 700; font-size: 17px; }
.run-mine { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(155, 107, 255, 0.18); color: var(--purple); }
.run-place { margin-top: 6px; font-weight: 700; font-size: 15px; }
.run-place.big { margin-top: 0; font-size: 17px; }
.run-desc { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.run-bottom { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.run-faces { display: flex; align-items: center; flex: 1; min-width: 0; }
.run-faces .friend-ava { width: 28px; height: 28px; font-size: 12px; margin-right: -8px; box-shadow: 0 0 0 2px var(--card-solid); }
.run-going { margin-left: 16px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.run-msgs { font-size: 13px; color: var(--muted); white-space: nowrap; }
.run-go {
  padding: 9px 16px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--grad-lime); color: #0b0d10; font-weight: 800; font-size: 14px; white-space: nowrap;
}
.run-go.on { background: rgba(180, 245, 60, 0.14); color: var(--lime-text); border: 1px solid rgba(180, 245, 60, 0.6); }
.run-go:disabled { opacity: 0.5; }
.run-author { margin-top: 10px; font-size: 14px; color: var(--muted); }
.run-author-btn { font-weight: 700; color: var(--text); }
.run-members-title { margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--muted); }
.run-members { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.run-member { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--input); border: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.run-member .friend-ava { width: 26px; height: 26px; font-size: 11px; }
.run-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.run-actions .ghost-btn, .run-actions .primary-btn { width: 100%; }
.run-messages { max-height: none; min-height: 60px; padding: 4px 0 10px; }
.run-msg {
  align-self: flex-start; max-width: 82%;
  padding: 8px 12px; border-radius: 16px 16px 16px 6px;
  background: var(--card-solid); border: 1px solid var(--border);
}
.run-msg.mine { align-self: flex-end; border-radius: 16px 16px 6px 16px; background: rgba(180, 245, 60, 0.14); border-color: rgba(180, 245, 60, 0.4); }
.run-msg-name { font-size: 12px; font-weight: 800; color: var(--purple); margin-bottom: 2px; }
.run-msg-text { font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.run-msg-time { font-size: 11px; color: var(--muted); margin-top: 3px; text-align: right; }
.run-chat-empty { padding: 10px 12px; line-height: 1.45; }
.run-input-row { margin-top: 4px; }
.run-safety { margin-top: 10px; font-size: 12px; line-height: 1.45; text-align: center; }
.run-report { display: block; margin: 8px auto 0; font-size: 13px; color: var(--muted); }
.rn-row { display: flex; gap: 8px; }
.rn-row .hr-field { flex: 1; }
.city-chips { margin-top: 10px; }
.link-btn { background: none; border: none; padding: 0; cursor: pointer; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.run-author-btn { text-decoration: none; }
/* поля даты и времени в окнах (старт, рекорд, пробежка) — в стиле остальных полей */
input[type="date"], input[type="time"] {
  width: 100%; min-width: 0;
  border: 1px solid var(--border);
  background: var(--input);
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 15px; font-family: inherit;
  color: var(--text);
  color-scheme: dark;
  outline: none;
}
html[data-theme="light"] input[type="date"], html[data-theme="light"] input[type="time"] { color-scheme: light; }
html[data-theme="light"] .date-input-wrap input[type="date"] { color-scheme: light; }

/* ---------- Окно «Позвать на пробежку» ---------- */
.run-sheet { max-height: 88vh; overflow-y: auto; }
.rn-block { margin-bottom: 14px; }
.rn-label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 8px 2px; }
.rn-block input[type="text"] { margin: 0; }
.rn-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rn-day {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; padding: 8px 4px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--input);
  color: var(--text); cursor: pointer; text-align: center;
}
.rn-day b { font-size: 13px; font-weight: 800; }
.rn-day span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rn-day.active, .rn-time.active { background: var(--grad-lime); border-color: transparent; color: #0b0d10; }
.rn-day.active span { color: rgba(11, 13, 16, 0.7); }
.rn-times, .rn-max { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rn-max { margin-top: 0; }
.rn-time {
  position: relative; overflow: hidden;
  padding: 9px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--input);
  color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
/* системные поля даты и времени спрятаны под «плашками» — нажатие открывает выбор, но выглядят как наши кнопки */
.rn-day-other input, .rn-time-own input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: none; padding: 0; margin: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
/* Safari (Telegram на Mac и iPhone): у полей даты своя высота и текст по центру — выравниваем */
.st-date input[type="date"], #rcDate {
  -webkit-appearance: none; appearance: none;
  min-height: 46px; text-align: left; display: block;
}
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.rn-times, .rn-max { display: grid; grid-template-columns: repeat(5, 1fr); }
.rn-times .rn-time, .rn-max .rn-time { padding: 10px 2px; text-align: center; white-space: nowrap; }
.rn-day b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* свой выбор времени */
#timeSheet { z-index: 60; }
.tp-value { margin-left: 6px; font-family: var(--font-head); color: var(--lime-text); }
.tp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 14px; }
.tp-grid .rn-time { padding: 10px 0; text-align: center; }
/* тренировка друга за день — окошко */
.day-sheet { max-height: 86vh; overflow-y: auto; }
.day-sheet .wk-card { margin-bottom: 10px; }
/* время тренировки в форме */
.wt-row { display: flex; align-items: center; gap: 8px; }
.wt-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 8px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--input); color: var(--text);
}
.wt-btn span { font-size: 11px; color: var(--muted); font-weight: 700; }
.wt-btn b { font-family: var(--font-head); font-size: 18px; font-variant-numeric: tabular-nums; color: var(--muted); }
.wt-btn.set { border-color: rgba(180, 245, 60, 0.5); }
.wt-btn.set b { color: var(--text); }
.wt-dash { color: var(--muted); }
.wt-clear { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--input); color: var(--muted); cursor: pointer; flex: none; }
#editFeedback { margin-top: 12px; } #editFeedback.flash { box-shadow: 0 0 0 2px var(--lime), 0 0 28px rgba(180, 245, 60, 0.3); transition: box-shadow 0.4s; }

/* ---------- Цели на месяц ---------- */
.goal-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.goal-row:first-child { border-top: none; padding-top: 4px; }
.goal-ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--input); flex: none; }
.goal-ico .ico { width: 20px; height: 20px; }
.goal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.goal-title { font-size: 14.5px; }
.goal-now { font-size: 12.5px; color: var(--muted); }
.goal-bar { height: 6px; border-radius: 999px; background: rgba(var(--ink), 0.08); overflow: hidden; margin-top: 3px; }
.goal-bar i { display: block; height: 100%; border-radius: 999px; background: var(--grad-lime); transition: width 0.4s ease; }
.goal-row.done .goal-title { color: var(--lime-text); }
.goal-act {
  flex: none; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--input); color: var(--text); font-weight: 800; cursor: pointer;
}
.goal-row.done .goal-check { background: var(--grad-lime); color: #0b0d10; border-color: transparent; }
.goal-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.goal-kinds .rn-day b { font-size: 13px; }

/* ---------- Место тренировки ---------- */
.place-input-wrap { display: flex; align-items: center; gap: 8px; }
.place-input-wrap input { flex: 1; min-width: 0; }
.place-suggest {
  margin-top: 6px; border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--card-solid); overflow: hidden;
}
.place-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.place-opt:last-child { border-bottom: 0; }
.place-opt b { font-size: 14px; }
.place-opt span { font-size: 12px; color: var(--muted); }
.place-chips { margin-top: 10px; }
.chip-ico { display: inline-flex; align-items: center; gap: 6px; }
.chip-ico .ico { width: 16px; height: 16px; }
.place-row { display: flex; align-items: flex-end; gap: 12px; margin-top: 10px; }
.place-alt { flex: 0 0 132px; }
.place-alt > span { display: inline-flex; align-items: center; gap: 4px; }
.place-alt > span .ico { width: 14px; height: 14px; }
.place-camp { margin-top: 0; padding-bottom: 10px; }

/* ---------- Кабинет тренера ---------- */
#groupTabs.seg-3 .seg-btn { font-size: 13px; }
.group-task { border-color: rgba(155, 107, 255, 0.35); }
.group-task-at { font-weight: 500; font-size: 12px; }
.group-task-text { white-space: pre-line; font-size: 14px; line-height: 1.45; margin-top: 6px; }
.coach-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
#mcTiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.coach-tile {
  background: var(--card-solid); border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.coach-tile b { font-family: var(--font-head); font-size: 17px; white-space: nowrap; }
#mcTiles .coach-tile b { font-size: 14px; }
.coach-tile span { font-size: 11px; color: var(--muted); }
.coach-tile.warn { background: rgba(255, 154, 60, 0.12); border-color: rgba(255, 154, 60, 0.4); }
.coach-tile.warn b { color: #ffb066; }
.coach-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.coach-actions .ghost-btn { font-size: 13px; padding: 12px 8px; }
.coach-filter { margin-bottom: 10px; }
.coach-row {
  display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left;
  padding: 12px 14px; margin-bottom: 10px; border-radius: 18px; cursor: pointer; font: inherit; color: var(--text);
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom)); border: 1px solid var(--border);
}
.coach-row-top { display: flex; align-items: center; gap: 12px; }
.coach-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.coach-row-name { font-weight: 700; font-size: 15px; }
.coach-row-last { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coach-row-km { display: flex; flex-direction: column; align-items: flex-end; }
.coach-row-km b { font-family: var(--font-head); font-size: 15px; }
.coach-row-km span { font-size: 11px; color: var(--muted); }
.coach-row-flags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.coach-flag { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--input); }
.coach-flag.ok { background: rgba(180, 245, 60, 0.14); color: var(--lime-text); }
.coach-flag.warn { background: rgba(255, 154, 60, 0.16); color: #ffb066; }
.coach-flag.bad { background: rgba(255, 90, 79, 0.16); color: #ff8a80; }
.coach-flag.camp { background: rgba(155, 107, 255, 0.18); color: #c4a8ff; }
.coach-row-meta { font-size: 12px; color: var(--muted); }
.coach-digest-text { white-space: pre-line; font-size: 14px; line-height: 1.5; max-height: 55vh; overflow-y: auto; margin-bottom: 12px; }
.mc-week-head, .mc-fom-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mc-fom-head { justify-content: flex-start; align-items: center; }
.mc-week-head .muted { font-size: 12px; }
.mc-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 112px; margin-top: 10px; }
.mc-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.mc-bar.future { opacity: 0.35; }
.mc-bar-km { font-size: 10px; color: var(--muted); }
.mc-bar-fill { width: 100%; border-radius: 6px; }
.mc-bar-wd { font-size: 11px; color: var(--muted); font-weight: 600; }
.mc-fom { border-color: rgba(155, 107, 255, 0.35); }
.mc-fom-text { font-size: 14px; line-height: 1.5; margin: 10px 0 12px; white-space: pre-line; }
.mc-msg textarea { margin: 8px 0 10px; }
.mc-msgs { font-size: 12px; margin-top: 10px; line-height: 1.5; }
html[data-theme="light"] .coach-flag.warn, html[data-theme="light"] .coach-tile.warn b { color: #b8570a; }
html[data-theme="light"] .coach-flag.bad { color: #c62f25; }
html[data-theme="light"] .coach-flag.camp { color: #6a3fd6; }

/* ---------- Здоровье ---------- */
.health-entry {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  font: inherit; color: var(--text);
}
.health-entry-ico { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: rgba(255, 90, 79, 0.12); flex: none; }
.health-entry-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.health-entry-title { font-weight: 700; font-size: 16px; }
.health-entry-sub { font-size: 12px; color: var(--muted); }
#healthTabs { margin-bottom: 12px; }
.health-note { font-size: 12px; line-height: 1.4; margin: 10px 2px 16px; }
.food-daynav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.food-daylabel { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.food-daylabel b { font-size: 16px; }
.food-daylabel .muted { font-size: 12px; }
.food-daynav .round-btn:disabled { opacity: 0.3; }
.food-tiles .coach-tile span { line-height: 1.25; }
.food-actions { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; margin-bottom: 12px; }
.food-photo-btn { cursor: pointer; margin: 0; }
.meal-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--card-solid); border: 1px solid var(--border); border-radius: 16px;
}
.meal-thumb { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; }
.meal-thumb-empty { display: flex; align-items: center; justify-content: center; background: var(--input); font-size: 22px; }
.meal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meal-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-sub { font-size: 12px; color: var(--muted); }
.meal-preview { width: 100%; max-height: 180px; object-fit: cover; border-radius: 14px; margin-bottom: 10px; }
.meal-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 10px 0 6px; }
.meal-nums .hr-field span { font-size: 11px; }
.meal-items { font-size: 12px; line-height: 1.4; white-space: pre-line; margin-bottom: 6px; }
#mealDescribe .ghost-btn { margin-top: 8px; }
.blood-row .blood-off { color: #ffb066; font-weight: 700; }
.blood-sheet { max-height: 88vh; overflow-y: auto; }
.blood-scan-btn { cursor: pointer; margin-bottom: 6px; font-size: 14px; }
.blood-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 10px; }
.blood-meta input { width: 100%; box-sizing: border-box; }
.blood-head { display: grid; grid-template-columns: 1.3fr 0.6fr 0.75fr 1.1fr 28px; gap: 6px; font-size: 11px; padding: 0 2px 4px; }
.blood-row-edit { display: grid; grid-template-columns: 1.3fr 0.6fr 0.75fr 1.1fr 28px; gap: 6px; align-items: center; margin-bottom: 6px; }
.blood-row-edit input { min-width: 0; padding: 9px 6px; font-size: 13px; }
.blood-row-edit .br-unit { font-size: 12px; padding: 9px 4px; }
.br-ref { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.br-del { width: 28px; height: 28px; }
#bloodPresets { margin: 6px 0 10px; }
.bv-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.bv-name { display: flex; flex-direction: column; font-size: 14px; }
.bv-name small { font-size: 11px; color: var(--muted); }
.bv-val { text-align: right; font-size: 13px; display: flex; flex-direction: column; align-items: flex-end; }
.bv-val b { font-size: 15px; }
.bv-val em { font-style: normal; font-size: 11px; font-weight: 700; }
.bv-row.low .bv-val em, .bv-row.high .bv-val em, .bv-row.low .bv-val b, .bv-row.high .bv-val b { color: #ffb066; }
.bv-prev { font-size: 11px; color: var(--muted); }
#bloodViewSheet .mc-fom { margin-top: 12px; }
.rusada-card { border-color: rgba(180, 245, 60, 0.35); }
.rusada-text { font-size: 13px; line-height: 1.5; margin: 8px 0 12px; }
.supp-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.supp-main { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.supp-main .muted { font-size: 12px; }
.supp-add { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
html[data-theme="light"] .blood-row .blood-off, html[data-theme="light"] .bv-row.low .bv-val b, html[data-theme="light"] .bv-row.high .bv-val b,
html[data-theme="light"] .bv-row.low .bv-val em, html[data-theme="light"] .bv-row.high .bv-val em { color: #b8570a; }
.blood-scan-hint { font-size: 12px; line-height: 1.4; margin: 0 2px 8px; text-align: center; }
.cal-summary.cal-hidden-note { color: var(--text); font-weight: 600; }
.fb-refresh { margin-left: auto; border: 1px solid var(--border); background: var(--input); color: var(--text); border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.fb-refresh:disabled { opacity: 0.5; }
#editFeedback .ai-box-title { display: flex; align-items: center; gap: 8px; }

/* ---------- Компоновка: главная без лишнего ---------- */
/* серия и тренировки — одной тонкой строкой, чтобы запись тренировки была сразу видна */
.stats-row.stats-compact { gap: 6px; margin-bottom: 12px; }
.stats-row.stats-compact .stat { display: flex;
  flex-direction: row; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px; border-radius: 14px; min-height: 0; text-align: left;
}
.stats-row.stats-compact .stat-icon { width: 24px; height: 24px; border-radius: 8px; margin: 0; flex: none; }
.stats-row.stats-compact .stat-icon .ico { width: 15px; height: 15px; }
.stats-row.stats-compact .stat-num { font-size: 18px; line-height: 1; margin: 0; }
.stats-row.stats-compact .stat-label { font-size: 10px; margin: 0; line-height: 1.15; }
/* необязательные блоки формы — в кнопки */
.opt-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 2px 14px; }
.opt-chips-label { font-size: 13px; color: var(--muted); width: 100%; }
.opt-chip { display: inline-flex; align-items: center; gap: 6px; }
.opt-chip .ico { width: 16px; height: 16px; }
/* меню разделов в профиле */
.menu-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.menu-group .health-entry { margin: 0; }
.gifts-ico { background: rgba(155, 107, 255, 0.14); }
.ach-count { font-weight: 600; font-size: 13px; margin-left: 4px; }
#giftsScreen .gift-card { margin-top: 4px; }

.gift-more { margin-top: 6px; }
.gift-more summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
