/* Dofamin Dvizh — Cabinet styles */
/* Design: white + soft pink, Poppins, glassmorphism */

:root {
  --pink-50: #FFF0F5;
  --pink-100: #FFE4EC;
  --pink-200: #FFD4E0;
  --pink-accent: #FF7BA3;
  --pink-accent-hover: #FF5A8C;
  --ink: #1A1618;
  --ink-muted: #5E5A5C;
  --ink-faint: #9C989A;
  --surface: #FFFFFF;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --border: rgba(26, 22, 24, 0.08);
  --border-strong: rgba(26, 22, 24, 0.16);
  --success: #2F9E5B;
  --success-bg: #E6F7EC;
  --warning: #C97E18;
  --warning-bg: #FFF4E0;
  --shadow-sm: 0 1px 3px rgba(26, 22, 24, 0.04), 0 2px 12px rgba(255, 123, 163, 0.06);
  --shadow-md: 0 4px 24px rgba(26, 22, 24, 0.06), 0 2px 8px rgba(255, 123, 163, 0.08);
  --radius: 16px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--pink-accent); text-decoration: none; }
a:hover { color: var(--pink-accent-hover); text-decoration: underline; }

/* Background gradient */
.gradient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(at 15% 0%, var(--pink-100) 0px, transparent 40%),
    radial-gradient(at 85% 10%, var(--pink-50) 0px, transparent 50%),
    radial-gradient(at 50% 100%, var(--pink-50) 0px, transparent 55%),
    #FFFFFF;
}

/* Container */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top nav */
.top-nav {
  padding: 16px 0;
  background: var(--surface-glass);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--pink-accent);
  color: #FFF;
  font-size: 14px;
}
/* E-010 / E-035: бренд-лого (новая квадратная иконка с прозрачным фоном) */
.brand-logo {
  width: 40px;
  height: 40px;
  display: block;
  border-radius: 10px;
  filter: drop-shadow(0 2px 6px rgba(216, 76, 126, .22));
}
/* E-011: ссылка на админку */
.user-chip .admin-link {
  color: var(--pink-accent);
  font-size: 15px;
  text-decoration: none;
  margin-right: 2px;
}
.user-chip .admin-link:hover { transform: scale(1.15); }
.main-nav {
  display: flex;
  gap: 4px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  will-change: transform;
}
.nav-link .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.nav-link:hover {
  color: var(--ink);
  background: var(--pink-50);
  text-decoration: none;
  transform: translateY(-2px);
}
.nav-link:hover .nav-icon {
  transform: scale(1.15);
}
.nav-link:active {
  transform: translateY(0);
}
.nav-link.is-active {
  color: var(--pink-accent, #FF4F79);
  background: var(--pink-100);
  box-shadow: 0 2px 8px rgba(255, 79, 121, 0.18);
}
.nav-link.is-active .nav-icon {
  color: var(--pink-accent, #FF4F79);
}
@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .nav-link .nav-icon {
    transition: none;
  }
  .nav-link:hover {
    transform: none;
  }
  .nav-link:hover .nav-icon {
    transform: none;
  }
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 14px;
  border-radius: 999px;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  font-size: 14px;
}
.user-chip-name { color: var(--ink); font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--pink-50);
  color: var(--ink-muted);
  font-size: 18px;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--pink-100); color: var(--ink); text-decoration: none; }

/* Main */
/* E-051: padding-left/right вместо shorthand — иначе shorthand
   `padding: 32px 0 80px` перекрывал 20px от `.container` (одинаковая
   специфичность, `.main-content` идёт ниже) и текст заголовков вне
   карточек прилипал к краям экрана на мобильных. */
.main-content {
  padding-top: 32px;
  padding-bottom: 80px;
}
.page-header { margin-bottom: 24px; }
.page-title {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.page-sub {
  color: var(--ink-muted);
  font-size: 15px;
  margin: 0;
}

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.mt-24 { margin-top: 24px; }

@media (max-width: 900px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Card */
.card {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card.glass {
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-xl { padding: 28px; border-radius: var(--radius-lg); }
.card-wide { padding: 0; }

.card-head {
  margin-bottom: 12px;
}
.card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
/* E-056: card-label — теперь чёрный и полужирный (было: серый лёгкий).
   Размер поднят с 12px до 13px — чуть читаемее, но не ломает иерархию с большими
   kpi-value рядом. Применяется к заголовкам «Сегодня · привычки», «Меню», «Профиль»,
   «Премиум», «Подписка» и всем аналогичным eyebrow-заголовкам карточек по всему кабинету. */
.card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card-title-lg {
  font-size: 22px;
  font-weight: 600;
  margin: 4px 0 0;
  letter-spacing: -0.01em;
}
.card-desc {
  color: var(--ink-muted);
  font-size: 14px;
  margin: 4px 0 0;
}
.card-body {
  color: var(--ink);
  margin: 6px 0 16px;
  font-size: 15px;
}
.card-foot {
  display: block;
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 13px;
}
.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.card-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* KPI */
.kpi {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 4px 0 14px;
}
.kpi-value {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}
.kpi-divider {
  color: var(--ink-faint);
  font-weight: 500;
}
.kpi-unit {
  color: var(--ink-muted);
  font-size: 14px;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 18px 0 22px;
}
.kpi-cell { display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 12px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value-sm { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .kpi-row { grid-template-columns: 1fr 1fr; } }

/* Progress */
.progress {
  height: 6px;
  background: var(--pink-50);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pink-accent), #FF9FBB);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-trial { background: var(--warning-bg); color: var(--warning); }
.tag-muted { background: var(--pink-50); color: var(--ink-muted); }
.tag-lg { padding: 6px 14px; font-size: 13px; }

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s, color 0.15s;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn-primary {
  background: var(--pink-accent);
  color: #FFF;
  box-shadow: 0 2px 8px rgba(255, 123, 163, 0.3);
}
.btn-primary:hover { background: var(--pink-accent-hover); color: #FFF; text-decoration: none; transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--pink-50); color: var(--ink); text-decoration: none; }

/* Definition list */
.defs { display: flex; flex-direction: column; gap: 8px; }
.def {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.def:last-child { border-bottom: none; }
.def-k { color: var(--ink-muted); }
.def-v { color: var(--ink); font-weight: 500; text-align: right; }

/* Premium list */
.premium-list { display: flex; flex-direction: column; gap: 10px; }
.premium-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}
.premium-name { font-weight: 500; }

/* Price */
.price {
  font-size: 16px;
  font-weight: 600;
  color: var(--pink-accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Section head */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.section-aside { color: var(--ink-muted); font-size: 14px; }

/* Table */
.table-wrap { overflow-x: auto; }
.dfm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.dfm-table th {
  text-align: left;
  padding: 16px 22px;
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--surface-glass);
}
.dfm-table td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}
.dfm-table tr:last-child td { border-bottom: none; }
.dfm-table .right, .right { text-align: right; font-variant-numeric: tabular-nums; }

.muted { color: var(--ink-muted); font-size: 13px; }
.empty-state { padding: 40px; text-align: center; color: var(--ink-muted); }

/* Auth screen */
.auth-screen {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 40px 0;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  text-align: center;
  border-radius: var(--radius-lg);
}
.auth-hero { margin-bottom: 28px; }
.auth-mark {
  display: inline-grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--pink-accent);
  color: #FFF;
  font-size: 26px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(255, 123, 163, 0.32);
}
.auth-title {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.auth-sub { color: var(--ink-muted); margin: 0; font-size: 15px; }
.auth-widget {
  display: flex;
  justify-content: center;
  margin: 24px 0 16px;
  min-height: 48px;
}
.auth-divider {
  position: relative;
  text-align: center;
  margin: 24px 0 20px;
  color: var(--ink-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-divider span { background: transparent; padding: 0 10px; }

.auth-error {
  background: #FFECEC;
  color: #B4211D;
  border: 1px solid #FDC;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 20px;
  font-size: 14px;
  text-align: left;
}
.auth-error a { color: #B4211D; font-weight: 600; }
.auth-note {
  color: var(--ink-faint);
  font-size: 12px;
  margin: 22px 0 0;
  line-height: 1.6;
}
.auth-note a { color: var(--ink-muted); text-decoration: underline; }

/* Footer */
.page-footer {
  padding: 32px 0;
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.page-footer a { color: var(--ink-muted); }
.page-footer a:hover { color: var(--ink); }
.page-footer .dot { margin: 0 8px; color: var(--border-strong); }

/* Mobile tweaks */
@media (max-width: 600px) {
  .page-title { font-size: 26px; }
  .card { padding: 18px; }
  .card-xl { padding: 22px; }
  .kpi-value { font-size: 32px; }
  .nav-inner { gap: 10px; }
  .main-nav { gap: 0; }
  .nav-link { padding: 6px 10px; font-size: 13px; gap: 4px; }
  .nav-link .nav-icon { width: 14px; height: 14px; }
  .user-chip-name { display: none; }
  .user-chip { padding: 4px; }
}
/* On narrow desktop (900-1100px) hide labels — icons only */
@media (min-width: 901px) and (max-width: 1100px) {
  .nav-link .nav-label {
    display: none;
  }
  .nav-link {
    padding: 8px 10px;
  }
  .nav-link .nav-icon {
    width: 18px;
    height: 18px;
  }
}
/* ========== B3 additions ========== */

/* Nav toggle for mobile — E-026: иконка + подпись "Меню" + подсветка */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFE4EC 0%, #FFF0F5 100%);
  border: 1.5px solid rgba(255, 107, 157, 0.25);
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px rgba(255, 107, 157, 0.12);
  animation: navTogglePulse 2.4s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nav-toggle:active { transform: scale(0.96); }

.nav-toggle__icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 18px;
}
.nav-toggle__icon span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--brand, #FF6B9D);
  margin: 2px 0;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand, #FF6B9D);
  letter-spacing: 0.02em;
  line-height: 1;
}

@keyframes navTogglePulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(255, 107, 157, 0.12); }
  50%      { box-shadow: 0 2px 16px rgba(255, 107, 157, 0.35); }
}

/* Открытое состояние — анимация полосок в крестик, пульс стоп */
body.nav-open .nav-toggle {
  animation: none;
  background: var(--brand, #FF6B9D);
  border-color: var(--brand, #FF6B9D);
}
body.nav-open .nav-toggle__icon span { background: #fff; }
body.nav-open .nav-toggle__label { color: #fff; }
body.nav-open .nav-toggle__icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle__icon span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle__icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* E-026: пункт "Личный кабинет" — только на мобиле (на десктопе он в user-chip) */
.nav-link--mobile-only { display: none; }

/* KPI medium value (for text KPIs like "Новичок") */
.kpi-value-md {
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Week strip */
.week-strip {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}
.week-strip-lg {
  gap: 8px;
  justify-content: space-between;
  padding: 6px 0;
}
.week-cell {
  flex: 1;
  min-width: 28px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  background: var(--pink-50);
  position: relative;
}
.week-strip-lg .week-cell {
  min-width: 56px;
  font-size: 13px;
  gap: 2px;
  padding: 6px 0;
}
.week-cell-date { font-size: 16px; font-weight: 600; color: inherit; }
.week-cell-yes {
  background: var(--pink-accent);
  color: #FFF;
  border-color: var(--pink-accent);
}
.week-cell-yes .week-cell-label,
.week-cell-yes .week-cell-date { color: #FFF; }
.week-cell-no {
  background: #FFF0F0;
  color: #C32D2D;
  border-color: #FFC4C4;
}
.week-cell-none { background: var(--pink-50); color: var(--ink-faint); }
.week-cell.is-today { outline: 2px solid var(--ink); outline-offset: 2px; }

.legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch-yes { background: var(--pink-accent); }
.swatch-no { background: #FFC4C4; }
.swatch-none { background: var(--pink-50); border: 1px solid var(--border); }

/* Weight KPI */
.weight-kpi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 8px 0 14px;
}
.weight-kpi div { display: flex; flex-direction: column; gap: 2px; }
.weight-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  flex-wrap: wrap;
}
.weight-chart {
  width: 100%;
  height: 140px;
  margin-top: 8px;
}

/* Measurements */
.measurements { display: flex; flex-direction: column; gap: 8px; }
.measurement-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}
.measurement-label { color: var(--ink-muted); }
.measurement-value {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Habits */
.habits-list { display: flex; flex-direction: column; gap: 8px; }
.habit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface-glass);
  backdrop-filter: blur(10px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.habit-row.habit-done {
  background: linear-gradient(90deg, rgba(46, 158, 91, 0.05), rgba(255, 255, 255, 0.6));
  border-color: rgba(46, 158, 91, 0.2);
}
.habit-emoji { font-size: 24px; flex-shrink: 0; }
.habit-name { flex: 1; font-weight: 500; color: var(--ink); }
.habit-state { flex-shrink: 0; }

/* Heatmap */
.heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22px, 1fr));
  gap: 4px;
  margin: 8px 0 14px;
}
.heat-cell {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: var(--pink-50);
  border: 1px solid var(--border);
}
.heat-0 { background: var(--pink-50); }
.heat-1 { background: #FFE4EC; }
.heat-2 { background: #FFC4D9; }
.heat-3 { background: #FFA3BF; }
.heat-4 { background: #FF85AA; }
.heat-5 { background: var(--pink-accent); }
.heat-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.heat-legend .heat-cell {
  width: 14px;
  height: 14px;
  aspect-ratio: auto;
}
.heat-legend .muted { padding: 0 4px; }

/* Menu */
.menu-body {
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
}
.menu-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
  color: var(--ink);
}
.shopping-list { padding: 22px; }

/* Premium cards */
.premium-card { padding: 24px; }
.premium-title {
  display: flex;
  gap: 14px;
  align-items: center;
}
.premium-icon {
  font-size: 32px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--pink-50);
  flex-shrink: 0;
}
.premium-name-lg {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
.price-lg {
  font-size: 15px;
  font-weight: 600;
  color: var(--pink-accent);
  font-variant-numeric: tabular-nums;
}
.premium-status {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0 0;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 14px;
}

/* Referral link */
.ref-link-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 8px;
  flex-wrap: wrap;
}
.ref-link {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Poppins', monospace;
  font-size: 14px;
  color: var(--ink);
  word-break: break-all;
  display: flex;
  align-items: center;
}

/* Button small */
.btn-sm { padding: 8px 14px; font-size: 13px; }
.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}
.empty-inline {
  padding: 14px 0;
  color: var(--ink-muted);
  font-size: 14px;
}
.mt-16 { margin-top: 16px; }

/* Shorter brand on tighter screens */
@media (max-width: 1280px) {
  .brand-text { max-width: 140px; }
}
@media (max-width: 1100px) {
  .brand-text {
    font-size: 14px;
    line-height: 1.1;
  }
}
@media (max-width: 700px) {
  .brand-text { display: none; }
}

/* Nav — mobile (≤900px): hide links, show hamburger */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  /* E-026: на мобиле показываем пункт "Личный кабинет" в nav */
  .nav-link--mobile-only { display: flex; }
  /* E-008-fix: непрозрачный фон шапки на мобиле, чтобы контент страницы
     не просвечивал из-под неё при скролле. */
  .top-nav {
    background: #FFFFFF;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    /* E-008-fix: в закрытом состоянии padding=0 — иначе пункты торчат из-под шапки */
    padding: 0 20px;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    border-bottom: 0;
    transition: max-height 0.25s ease, padding 0.25s ease, border-bottom-width 0s ease 0.25s;
  }
  body.nav-open .main-nav {
    max-height: 600px;
    padding: 12px 20px 20px;
    border-bottom-width: 1px;
    transition: max-height 0.25s ease, padding 0.25s ease;
  }
  .main-nav .nav-link {
    padding: 12px 14px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    gap: 10px;
  }
  .main-nav .nav-link .nav-icon {
    width: 18px;
    height: 18px;
  }
  /* on mobile never hide labels */
  .main-nav .nav-link .nav-label {
    display: inline;
  }
  .main-nav .nav-link:hover {
    transform: none; /* no lift inside dropdown */
  }
}

@media (max-width: 600px) {
  .weight-kpi { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .week-strip-lg .week-cell { min-width: 36px; }
  .premium-card { padding: 18px; }
  .premium-icon { width: 44px; height: 44px; font-size: 24px; }
  .ref-link { font-size: 12px; }
  .ref-link-row .btn-primary { width: 100%; }
}
/* ========== B4 additions: auth forms ========== */

/* Auth tabs */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--pink-50);
  border-radius: 12px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(26,22,24,0.06);
}

/* Auth panels: show only the active one */
.auth-panel { display: none; }
.auth-panel.is-active { display: block; }

.auth-panel-lead {
  color: var(--ink-muted);
  font-size: 14px;
  margin: 0 0 18px;
  text-align: center;
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus {
  outline: none;
  border-color: var(--pink-accent);
  box-shadow: 0 0 0 3px rgba(255, 123, 163, 0.16);
}
.field-hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 2px;
}

.code-input {
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 20px !important;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.btn-full { width: 100%; }

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.auth-links a { color: var(--ink-muted); text-decoration: none; }
.auth-links a:hover { color: var(--pink-accent); text-decoration: underline; }

.auth-footnote {
  color: var(--ink-faint);
  font-size: 12px;
  margin: 24px 0 0;
  line-height: 1.6;
  text-align: center;
}
.auth-footnote a { color: var(--ink-muted); text-decoration: underline; }

.info-block {
  padding: 18px 20px;
  background: var(--pink-50);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 8px 0 20px;
  font-size: 14px;
  line-height: 1.6;
}
.info-block p { margin: 0 0 6px; }
.info-block p:last-child { margin-bottom: 0; }

.mt-12 { margin-top: 12px; }

/* Reset mobile tweaks */
@media (max-width: 600px) {
  .auth-tab { font-size: 12px; padding: 10px 4px; }
  .code-input { font-size: 18px !important; }
}
/* ========== B6 onboarding styles ========== */

.onb-wrap {
  max-width: 580px;
  margin: 24px auto;
  padding: 0 20px 60px;
}

.onb-progress {
  height: 4px;
  background: var(--pink-50);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.onb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink-accent), #FF9FBB);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.onb-step-indicator {
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 24px;
  font-variant-numeric: tabular-nums;
}

/* Each step is a card, shown one at a time */
.onb-form {
  position: relative;
}
.onb-step {
  display: none;
  background: var(--surface-glass);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
}
.onb-step.is-active { display: block; }

.onb-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--pink-accent);
  color: #FFF;
  font-weight: 600;
  font-size: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(255, 123, 163, 0.28);
}

.onb-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
.onb-sub {
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0 0 22px;
}

.onb-choice {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.onb-choice-col {
  grid-template-columns: 1fr;
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  gap: 6px;
  text-align: center;
}
.choice-card:hover {
  border-color: var(--pink-accent);
  background: var(--pink-50);
}
.choice-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-card:has(input:checked) {
  border-color: var(--pink-accent);
  background: linear-gradient(180deg, rgba(255, 123, 163, 0.08), transparent);
  box-shadow: inset 0 0 0 1px var(--pink-accent);
}

.choice-card-row {
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  padding: 16px 18px;
}

.choice-emoji {
  font-size: 32px;
  line-height: 1;
  color: var(--ink-muted);
}
.choice-card:has(input:checked) .choice-emoji { color: var(--pink-accent); }

.choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.choice-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.choice-desc {
  font-size: 13px;
  color: var(--ink-muted);
}

.onb-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}
.onb-actions .btn-primary {
  flex: 1;
}
.onb-actions .btn-secondary {
  flex: 0 0 auto;
  min-width: 100px;
}
.onb-actions .btn-full { flex: 1; }

/* Mobile */
@media (max-width: 600px) {
  .onb-wrap { margin-top: 12px; padding: 0 16px 40px; }
  .onb-step { padding: 28px 22px; }
  .onb-title { font-size: 22px; }
  .onb-choice { grid-template-columns: 1fr; }
}

/* =========================================================
   B7.1 — Progress CRUD (weight log + measurements forms)
   ========================================================= */

/* Flash messages (shared with other B7 sections) */
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  margin: 12px 0 20px;
  font-size: 14px;
  line-height: 1.4;
  backdrop-filter: blur(8px);
}
.flash-ok {
  background: rgba(67, 122, 34, 0.08);
  border: 1px solid rgba(67, 122, 34, 0.25);
  color: #2d5a17;
}
.flash-err {
  background: rgba(161, 44, 123, 0.08);
  border: 1px solid rgba(161, 44, 123, 0.25);
  color: #7a1f5a;
}
.flash-close {
  text-decoration: none;
  color: inherit;
  opacity: 0.55;
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
}
.flash-close:hover { opacity: 1; }

/* CRUD form shell */
.crud-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 123, 163, 0.25);
}
.crud-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.crud-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.crud-label {
  font-size: 13px;
  color: #6b6666;
  font-weight: 500;
}
.crud-form input[type="number"],
.crud-form input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid rgba(255, 123, 163, 0.2);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.crud-form input[type="number"]:focus,
.crud-form input[type="text"]:focus {
  outline: none;
  border-color: #FF7BA3;
  box-shadow: 0 0 0 3px rgba(255, 123, 163, 0.15);
}

/* Weight log list (recent entries) */
.weight-log-list {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 123, 163, 0.25);
}
.log-title {
  font-size: 14px;
  font-weight: 600;
  color: #6b6666;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.log-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.log-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 244, 248, 0.55);
  transition: background-color 0.15s ease;
}
.log-row:hover {
  background: rgba(255, 228, 236, 0.9);
}
.log-date {
  font-size: 13px;
  color: #6b6666;
  font-variant-numeric: tabular-nums;
}
.log-weight {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  font-variant-numeric: tabular-nums;
}
.log-delete-form {
  margin: 0;
  padding: 0;
}
.btn-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(161, 44, 123, 0.08);
  color: #7a1f5a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn-delete:hover {
  background: rgba(161, 44, 123, 0.18);
  transform: scale(1.08);
}

/* Measurements form */
.measurements-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.measurement-input-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.measurement-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.measurements-form input[type="number"] {
  padding: 9px 12px;
  font-size: 14px;
}
.measurement-cur {
  font-size: 11px;
  color: #9c9793;
  padding-left: 2px;
  min-height: 14px;
}
.measurements-form .mt-16 {
  margin-top: 16px;
  width: 100%;
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .crud-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .crud-row .btn-primary { width: 100%; }
  .measurements-grid { grid-template-columns: 1fr; }
  .log-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 10px;
  }
  .log-date { grid-column: 1; grid-row: 1; }
  .log-weight { grid-column: 1; grid-row: 2; }
  .log-delete-form { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

/* =========================================================
   B7.2 — Habits CRUD
   ========================================================= */

.habits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.habit-card {
  position: relative;
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(255, 123, 163, 0.15);
  border-radius: 16px;
  overflow: visible;
  transition: border-color 0.15s ease, transform 0.15s ease;
  backdrop-filter: blur(12px);
}
.habit-card:hover {
  border-color: rgba(255, 123, 163, 0.4);
}
.habit-card.habit-done {
  background: linear-gradient(135deg, rgba(255, 123, 163, 0.12), rgba(255, 228, 236, 0.5));
  border-color: rgba(255, 123, 163, 0.5);
}

.habit-toggle-form {
  margin: 0;
}
.habit-toggle {
  width: 100%;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px 68px 18px 18px; /* right padding reserves space for action icons */
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 16px;
  transition: background-color 0.15s ease;
}
.habit-toggle:hover {
  background: rgba(255, 228, 236, 0.35);
}
.habit-toggle:focus-visible {
  outline: 2px solid #FF7BA3;
  outline-offset: 2px;
}
.habit-card .habit-emoji {
  font-size: 24px;
  line-height: 1;
  display: inline-block;
}
.habit-card .habit-name {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  line-height: 1.3;
}
.habit-card.habit-done .habit-name {
  color: #2d5a17;
  font-weight: 600;
}
.habit-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 123, 163, 0.35);
  transition: all 0.2s ease;
}
.habit-done .habit-check {
  background: #FF7BA3;
  border-color: #FF7BA3;
}

/* Small action buttons — edit / hide. Always visible (subtle) so touch + keyboard work.
   Positioned above the toggle button so clicks land on the icons, not on toggle. */
.habit-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  opacity: 0.5;
  z-index: 2;
  transition: opacity 0.15s ease;
}
.habit-card:hover .habit-actions,
.habit-card:focus-within .habit-actions {
  opacity: 1;
}
.habit-action-form {
  margin: 0;
}
.habit-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: #6b6666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.habit-action-btn:hover {
  background: #fff;
  color: #FF7BA3;
}
.habit-action-btn.habit-action-hide:hover {
  color: #A12C7B;
}

/* Rename inline form — hidden by default */
.habit-rename-form {
  display: none;
  gap: 8px;
  padding: 0 14px 14px;
  border-top: 1px dashed rgba(255, 123, 163, 0.2);
  padding-top: 12px;
  margin-top: 2px;
}
.habit-rename-form.open {
  display: flex;
  flex-wrap: wrap;
}
.habit-rename-form input[type="text"] {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  border: 1.5px solid rgba(255, 123, 163, 0.25);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
}
.habit-rename-form input[type="text"]:focus {
  outline: none;
  border-color: #FF7BA3;
}

/* Add habit form */
.habit-add-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.habit-add-form .crud-field {
  width: 100%;
}
.habit-add-form input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid rgba(255, 123, 163, 0.2);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.habit-add-form input[type="text"]:focus {
  outline: none;
  border-color: #FF7BA3;
  box-shadow: 0 0 0 3px rgba(255, 123, 163, 0.15);
}
.emoji-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.emoji-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}
.emoji-option {
  position: relative;
  cursor: pointer;
}
.emoji-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.emoji-option > span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 244, 248, 0.5);
  border: 2px solid transparent;
  font-size: 22px;
  transition: all 0.15s ease;
}
.emoji-option > span:hover {
  background: rgba(255, 228, 236, 0.8);
}
.emoji-option input[type="radio"]:checked + span {
  background: rgba(255, 123, 163, 0.15);
  border-color: #FF7BA3;
  transform: scale(1.08);
}

/* Hidden habits — restore list */
.hidden-habits-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hidden-habit-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 244, 248, 0.5);
}
.habit-emoji-sm {
  font-size: 18px;
  opacity: 0.65;
}
.habit-name-muted {
  font-size: 14px;
  color: #6b6666;
}

/* Button size variant */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.2;
  border-radius: 8px;
}

/* Mobile */
@media (max-width: 600px) {
  .habits-grid { grid-template-columns: 1fr; }
  .habit-actions { opacity: 1; }
  .emoji-picker { grid-template-columns: repeat(6, 1fr); }
  .habit-rename-form { flex-direction: column; align-items: stretch; }
  .habit-rename-form input[type="text"] { width: 100%; }
}

/* =========================================================
   B7.3 — Workouts CRUD
   ========================================================= */

/* Attend-today card */
.attend-card .attend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.attend-card .attend-status {
  margin-top: 8px;
}
.attend-card.is-attended {
  background: linear-gradient(135deg, rgba(67, 122, 34, 0.08), rgba(255, 255, 255, 0.9));
  border: 1.5px solid rgba(67, 122, 34, 0.25);
}
.attend-actions .btn-primary,
.attend-actions .btn-secondary {
  padding: 10px 20px;
}

/* Add-workout form */
.workout-add-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.workout-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.workout-add-form select,
.workout-add-form input[type="number"],
.workout-add-form input[type="date"],
.workout-add-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid rgba(255, 123, 163, 0.2);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.workout-add-form select:focus,
.workout-add-form input:focus,
.workout-add-form textarea:focus {
  outline: none;
  border-color: #FF7BA3;
  box-shadow: 0 0 0 3px rgba(255, 123, 163, 0.15);
}
.workout-add-form textarea {
  resize: vertical;
  min-height: 56px;
}

/* Intensity radio group */
.intensity-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}
.intensity-fieldset .crud-label {
  margin-bottom: 8px;
  display: block;
}
.intensity-radios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.intensity-option {
  position: relative;
  cursor: pointer;
}
.intensity-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.intensity-option > span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 244, 248, 0.5);
  border: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: #6b6666;
  transition: all 0.15s ease;
  text-align: center;
}
.intensity-option:hover > span {
  background: rgba(255, 228, 236, 0.8);
}
.intensity-option input[type="radio"]:checked + span {
  background: rgba(255, 123, 163, 0.15);
  border-color: #FF7BA3;
  color: #111;
  font-weight: 600;
}

/* Workout log list */
.workout-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.workout-log-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 6px 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 244, 248, 0.45);
  border: 1px solid rgba(255, 123, 163, 0.1);
  transition: background-color 0.15s ease;
}
.workout-log-row:hover {
  background: rgba(255, 228, 236, 0.6);
}
.workout-log-head {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.workout-log-date {
  font-size: 13px;
  color: #6b6666;
  font-variant-numeric: tabular-nums;
}
.workout-log-main {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}
.workout-log-duration {
  font-weight: 600;
  color: #111;
  font-variant-numeric: tabular-nums;
}
.workout-log-intensity {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.workout-intensity-low   { background: rgba(189, 226, 231, 0.8); color: #1B474D; }
.workout-intensity-medium{ background: rgba(255, 197, 83, 0.35); color: #8a5a0f; }
.workout-intensity-high  { background: rgba(161, 53, 68, 0.15); color: #7a1f2a; }

.workout-log-note {
  color: #6b6666;
  font-size: 13px;
  font-style: italic;
}
.workout-type-badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 123, 163, 0.12);
  color: #7a1f5a;
  letter-spacing: 0.01em;
}
.workout-log-delete {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  margin: 0;
}

/* =========================================================
   E-012 — "Я был на тренировке" + шаги
   ========================================================= */

.attend-video-card {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #FFF0F5;
  border: 1px solid #FFD4E3;
}
.attend-video-card[data-state="done"] {
  background: rgba(189, 226, 231, 0.25);
  border-color: #BDE2E7;
}
.attend-video-idle {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.attend-video-hint {
  margin: 0;
  color: #4a4545;
  font-size: 14px;
  line-height: 1.45;
}
.attend-video-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.attend-video-form.is-hidden,
.attend-video-idle.is-hidden {
  display: none !important;
}
.attend-video-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.attend-video-actions .btn-primary,
.attend-video-actions .btn-secondary {
  flex: 1 1 180px;
}
.attend-video-done {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.attend-video-steps-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid #BDE2E7;
  color: #1B474D;
  font-size: 13px;
  font-weight: 600;
}
.attend-video-undo {
  margin: 0;
}
.attend-video-undo .btn-secondary {
  width: auto;
  padding: 8px 16px;
}

/* Бейдж типа dofamin_dvizh в истории */
.workout-type-dofamin_dvizh {
  background: linear-gradient(135deg, #FF7BA3 0%, #FFB3CB 100%);
  color: #FFFFFF;
}

.workout-log-steps {
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(189, 226, 231, 0.5);
  color: #1B474D;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 600px) {
  .attend-video-actions .btn-primary,
  .attend-video-actions .btn-secondary {
    flex-basis: 100%;
  }
}

/* Mobile */
@media (max-width: 720px) {
  .workout-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .attend-card .attend-row { flex-direction: column; align-items: stretch; }
  .attend-actions .btn-primary,
  .attend-actions .btn-secondary { width: 100%; }
  .intensity-radios { grid-template-columns: 1fr; }
  .workout-log-row { padding: 12px 14px; }
}

/* =========================================================
   B7.5 — Profile editing
   ========================================================= */

/* User chip becomes clickable link to /profile */
.user-chip-name {
  text-decoration: none;
  color: inherit;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.user-chip-name:hover {
  background: rgba(255, 123, 163, 0.12);
  color: #7a1f5a;
}
.user-chip-name.is-active {
  background: #FFE4EC;
  color: #7a1f5a;
  font-weight: 600;
}

/* Profile form */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.profile-form-grid .full-row {
  grid-column: 1 / -1;
}
.profile-form input[type="text"],
.profile-form input[type="number"],
.profile-form input[type="password"],
.profile-form select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid rgba(255, 123, 163, 0.2);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.profile-form input:focus,
.profile-form select:focus {
  outline: none;
  border-color: #FF7BA3;
  box-shadow: 0 0 0 3px rgba(255, 123, 163, 0.15);
}
.profile-form .btn-primary {
  align-self: flex-start;
  min-width: 220px;
}
.form-hint {
  margin: 0;
  font-size: 13px;
  color: #9c9793;
  font-style: italic;
}

/* Toggle switch (iOS-style) */
.profile-toggle-form { margin: 0; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}
.toggle-title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: #111;
  margin-bottom: 2px;
}
.toggle-sub {
  display: block;
  font-size: 13px;
  color: #6b6666;
}
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.switch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 123, 163, 0.2);
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.switch-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 0.2s ease;
}
.switch input[type="checkbox"]:checked + .switch-slider {
  background: #FF7BA3;
}
.switch input[type="checkbox"]:checked + .switch-slider::before {
  transform: translateX(20px);
}
.switch input[type="checkbox"]:focus-visible + .switch-slider {
  box-shadow: 0 0 0 3px rgba(255, 123, 163, 0.25);
}

/* Account info list */
.account-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.account-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 123, 163, 0.15);
  font-size: 14px;
}
.account-row:last-child {
  border-bottom: none;
}
.account-id {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #9c9793;
}

/* Mobile */
@media (max-width: 720px) {
  .profile-form-grid { grid-template-columns: 1fr; }
  .profile-form-grid .full-row { grid-column: 1; }
  .profile-form .btn-primary { width: 100%; }
  .account-row { grid-template-columns: 1fr; gap: 4px; }
}

/* =========================================================
   B8.1 — Menu generation: form, job progress, dish grid
   ========================================================= */

/* Generate form */
.menu-generate-card { margin-top: 8px; }
.menu-generate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
.menu-generate-form select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid rgba(255, 123, 163, 0.2);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.menu-generate-form select:focus {
  outline: none;
  border-color: #FF7BA3;
  box-shadow: 0 0 0 3px rgba(255, 123, 163, 0.15);
}
.menu-generate-form .btn-primary {
  align-self: flex-start;
  min-width: 240px;
  padding: 12px 24px;
}

/* Job progress card */
.menu-job-card {
  margin-top: 8px;
  background: linear-gradient(135deg, rgba(255, 123, 163, 0.08), rgba(255, 255, 255, 0.9));
  border: 1.5px solid rgba(255, 123, 163, 0.25);
}
.menu-job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.menu-job-stage {
  font-size: 14px;
  font-weight: 600;
  color: #7a1f5a;
}
.menu-progress {
  width: 100%;
  height: 8px;
  background: rgba(255, 123, 163, 0.15);
  border-radius: 4px;
  overflow: hidden;
}
.menu-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FF7BA3, #FF5788);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.menu-progress-bar.is-error {
  background: linear-gradient(90deg, #A12C7B, #7a1f5a);
}
.menu-job-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: #6b6666;
  font-style: italic;
}

/* Dishes grid */
.dishes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.dish-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid rgba(255, 123, 163, 0.12);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.dish-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 123, 163, 0.18);
}
.dish-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #FFF0F5, #FFE4EC);
  overflow: hidden;
}
.dish-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dish-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.dish-placeholder-icon {
  font-size: 42px;
  opacity: 0.5;
}
.dish-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dish-meal {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #FF7BA3;
}
.dish-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111;
  line-height: 1.3;
}
.dish-details {
  margin-top: 8px;
}
.dish-details summary {
  cursor: pointer;
  font-size: 13px;
  color: #7a1f5a;
  padding: 4px 0;
  user-select: none;
}
.dish-details[open] summary {
  color: #FF7BA3;
  font-weight: 600;
}
.dish-raw {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: rgba(255, 244, 248, 0.6);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: #333;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

/* Mobile */
@media (max-width: 600px) {
  .dishes-grid { grid-template-columns: 1fr; }
  /* E-008-fix: картинки блюд имеют соотношение ~16:9 (1376×768=1.79),
     сохраняем тоже соотношение в контейнере, чтобы текст по краям картинки не обрезался. */
  .dish-image-wrap { aspect-ratio: 16 / 9; }
  .menu-generate-form .btn-primary { width: 100%; }
}

/* =========================================================
   B8.2 — Shopping list (structured)
   ========================================================= */

.shopping-card { padding-top: 18px; }

.shopping-progress-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.shopping-progress {
  flex: 1;
  min-width: 200px;
  height: 8px;
  background: rgba(255, 123, 163, 0.15);
  border-radius: 4px;
  overflow: hidden;
}
.shopping-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FF7BA3, #FF5788);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.shopping-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-form { margin: 0; padding: 0; display: inline-block; }

.shopping-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.shopping-cat { padding: 6px 0; }
.shopping-cat-title {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 123, 163, 0.2);
  font-size: 14px;
  font-weight: 600;
  color: #7a1f5a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.shopping-cat-emoji { font-size: 18px; }
.shopping-cat-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
}

.shopping-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shopping-item {
  padding: 4px 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.shopping-item:hover {
  background: rgba(255, 244, 248, 0.5);
}
.shopping-item.is-checked {
  opacity: 0.55;
}
.shopping-item-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.shopping-check {
  width: 18px;
  height: 18px;
  accent-color: #FF7BA3;
  cursor: pointer;
  flex-shrink: 0;
}
.shopping-item-name {
  flex: 1;
  min-width: 0; /* allow flex child to shrink */
  font-size: 14px;
  color: #111;
  line-height: 1.35;
  overflow-wrap: anywhere; /* graceful wrap on any char but only when unavoidable */
  word-break: normal; /* don't split mid-word */
}
.shopping-item.is-checked .shopping-item-name {
  text-decoration: line-through;
  color: #6b6666;
}
.shopping-item-qty {
  font-size: 12px;
  color: #6b6666;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  background: rgba(255, 123, 163, 0.08);
  border-radius: 6px;
  flex-shrink: 0;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shopping-item-qty:hover {
  /* show full qty on hover — native title tooltip also shows it */
  max-width: none;
  white-space: normal;
}
.shopping-item.is-checked .shopping-item-qty {
  background: rgba(0, 0, 0, 0.04);
  color: #9c9793;
}

/* Mobile */
@media (max-width: 600px) {
  .shopping-categories { grid-template-columns: 1fr; gap: 14px; }
  .shopping-progress-wrap { gap: 10px; }
  .shopping-actions { width: 100%; }
  .shopping-actions .btn-sm { flex: 1; }
}

/* =========================================================
   B8.3 — Meal tracking (eaten checkbox + stats)
   ========================================================= */

/* Stats banner */
.meal-stats-card {
  margin-top: 12px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(255, 123, 163, 0.08), rgba(255, 255, 255, 0.9));
  border: 1.5px solid rgba(255, 123, 163, 0.22);
}
.meal-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.meal-stats-kpi {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin-top: 4px;
}
.meal-stats-eaten {
  color: #FF5788;
  font-variant-numeric: tabular-nums;
}
.meal-stats-macros {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.macro-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid rgba(255, 123, 163, 0.2);
  font-size: 13px;
  font-weight: 500;
  color: #6b6666;
  font-variant-numeric: tabular-nums;
}
.macro-pill strong {
  color: #111;
  font-weight: 700;
  margin: 0 2px;
}
.macro-p { border-color: rgba(68, 122, 34, 0.3); }
.macro-p strong { color: #2d5a17; }
.macro-f { border-color: rgba(255, 123, 163, 0.3); }
.macro-f strong { color: #7a1f5a; }
.macro-c { border-color: rgba(32, 128, 141, 0.3); }
.macro-c strong { color: #1B474D; }

.meal-stats-progress {
  width: 100%;
  height: 8px;
  background: rgba(255, 123, 163, 0.15);
  border-radius: 4px;
  overflow: hidden;
}
.meal-stats-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FF7BA3, #FF5788);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.meal-stats-footer {
  margin: 10px 0 0;
  font-size: 13px;
  color: #6b6666;
}

/* Dish card "eaten" state */
.dish-card.is-eaten {
  border-color: rgba(67, 122, 34, 0.4);
  background: linear-gradient(135deg, rgba(67, 122, 34, 0.06), #fff);
}
.dish-card.is-eaten .dish-image {
  filter: saturate(0.8) brightness(0.95);
}
.dish-card.is-eaten .dish-name {
  color: #2d5a17;
}

.dish-eaten-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(67, 122, 34, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.dish-eat-btn {
  margin-top: 10px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1.5px solid #FF7BA3;
  background: #fff;
  color: #FF5788;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}
.dish-eat-btn:hover {
  background: #FFE4EC;
}
.dish-eat-btn:focus-visible {
  outline: 2px solid #FF7BA3;
  outline-offset: 2px;
}
.dish-eat-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.dish-eat-btn.is-eaten {
  background: rgba(67, 122, 34, 0.1);
  border-color: rgba(67, 122, 34, 0.35);
  color: #2d5a17;
}
.dish-eat-btn.is-eaten:hover {
  background: rgba(67, 122, 34, 0.18);
}

/* Mobile */
@media (max-width: 600px) {
  .meal-stats-card { padding: 14px 16px; }
  .meal-stats-header { flex-direction: column; gap: 10px; }
  .meal-stats-macros { width: 100%; }
  .macro-pill { flex: 1; text-align: center; }
}

/* =========================================================== */
/* E-034: мобильный заголовок «Дофаминовый движ»               */
/* Desktop: скрыт (там остаётся .brand с логотипом слева)      */
/* Mobile ≤900px: лого скрываем, show brand-title-mobile центр */
/* =========================================================== */
.brand-title-mobile {
  display: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink, #1a1a1a);
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.brand-title-mobile:hover,
.brand-title-mobile:focus-visible {
  color: var(--brand, #FF6B9D);
  outline: none;
  text-decoration: none;
}

@media (max-width: 900px) {
  /* Скрываем логотип+слово слева полностью */
  .nav-inner > .brand { display: none; }

  /* Показываем центрированный кликабельный заголовок */
  .brand-title-mobile {
    display: inline-block;
    flex: 1;
    text-align: center;
    /* Поля, чтобы заголовок не перекрывал бургер/кнопки */
    margin: 0 8px;
    font-size: 15px;
  }

  /* Бургер теперь крайний слева — flex уже правильно ставит его первым,
     т.к. .brand скрыт. Просто даём ему не растягиваться. */
  .nav-toggle { flex: 0 0 auto; }

  /* user-chip остаётся справа */
  .user-chip { flex: 0 0 auto; }
}

@media (max-width: 420px) {
  /* На очень узких экранах сокращаем шрифт чтобы всё уместилось */
  .brand-title-mobile { font-size: 14px; margin: 0 4px; }
}

/* ================================================================
   E-057: модалка меню + сворачиваемое недельное + scope-grid списка покупок
================================================================ */

/* Общая модалка (меню + покупки) */
.menu-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.menu-modal[hidden] { display: none; }
.menu-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 22, 24, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.menu-modal-panel {
  position: relative;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 28px 28px 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(26, 22, 24, 0.25);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.menu-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: 0;
  font-size: 24px;
  color: var(--ink-muted);
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.menu-modal-close:hover { background: var(--pink-50); color: var(--ink); }
.menu-modal-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  padding-right: 32px;
  color: var(--ink);
}
.menu-modal-hint {
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0 0 20px;
}
.menu-modal-note {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 12px 0 0;
}
.menu-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Сворачиваемое недельное меню */
.weekly-collapse {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.weekly-collapse[open] { padding-bottom: 8px; }
.weekly-collapse-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  user-select: none;
  transition: background 0.15s;
}
.weekly-collapse-summary::-webkit-details-marker { display: none; }
.weekly-collapse-summary:hover { background: var(--pink-100); }
.weekly-collapse-open { display: inline; }
.weekly-collapse-close { display: none; }
.weekly-collapse[open] .weekly-collapse-open { display: none; }
.weekly-collapse[open] .weekly-collapse-close { display: inline; }
.weekly-collapse-body { margin-top: 16px; }

/* Яркая кнопка перегенерации в заголовке weekly */
.weekly-regen-btn {
  gap: 6px;
}
.weekly-regen-btn .weekly-regen-limit {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  margin-left: 6px;
}
.weekly-regen-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Грид вариантов scope в модалке списка покупок */
.shopping-scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .shopping-scope-grid { grid-template-columns: 1fr; }
}
.shopping-scope-card {
  background: var(--pink-50);
  border: 1px solid var(--pink-100);
  border-radius: 14px;
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shopping-scope-card.is-locked {
  opacity: 0.72;
  background: #FAFAFA;
  border-color: var(--border);
}
.shopping-scope-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--ink);
}
.shopping-scope-ico { font-size: 20px; }
.shopping-scope-desc {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.4;
}
.shopping-scope-note {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.45;
}
.shopping-scope-form { margin-top: 6px; }
.shopping-scope-form button { width: 100%; }
.shopping-scope-card .btn-secondary {
  margin-top: 6px;
}

/* ================================================================
   E-059: CTA-карточка «Начать тренировку» между слайдером и бейджами
================================================================ */

.start-workout-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  margin: 20px 0 24px;
  background: linear-gradient(135deg, #FFF0F5 0%, #FFE4EC 100%);
  border: 1.5px solid var(--pink-200, #FFC2D6);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(255, 123, 163, 0.08);
}

/* E-060: под бренд-иконку (PNG 120×120 с розовым фоном).
   Убрал белую подложку и рамку — иконка сама на розовом. */
.start-workout-cta__icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(255, 123, 163, 0.18);
}
.start-workout-cta__icon img {
  width: 52px;
  height: 52px;
  display: block;
  object-fit: cover;
  border-radius: 14px;
}

.start-workout-cta__body {
  flex: 1 1 auto;
  min-width: 0;
}
.start-workout-cta__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.start-workout-cta__desc {
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.45;
}

.start-workout-cta__btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 12px 22px;
  font-size: 15px;
}

@media (max-width: 600px) {
  .start-workout-cta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 14px;
    padding: 18px;
  }
  .start-workout-cta__icon {
    margin: 0 auto;
  }
  .start-workout-cta__body { text-align: center; }
  .start-workout-cta__btn { width: 100%; }
}
