*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --card: #f1f5f9;
  --card2: #e8edf4;
  --border: #e2e8f0;
  --text: #111827;
  --muted: #6b7280;
  --accent: #f97316;
  --accent-dark: #ea580c;
  --green: #16a34a;
  --red: #dc2626;
  --blue: #2563eb;
  --orange: #ea580c;
  --radius: 14px;
  --nav-h: 60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── LOADING ── */
.app-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── APP SHELL ── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOP NAV (authenticated) ── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.topnav .logo {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.topnav .logo span { color: var(--accent); }
.topnav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topnav-greeting {
  font-size: 0.8rem;
  color: var(--muted);
  display: none;
}

/* ── Language dropdown ── */
.app-lang-dd { position: relative; }
.app-lang-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 8px; cursor: pointer;
  font-family: inherit; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.app-lang-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(249,115,22,.08); }
.app-lang-menu {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 148px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 999; flex-direction: column;
}
.app-lang-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: none; background: none;
  border-radius: 7px; cursor: pointer; width: 100%;
  font-family: inherit; text-align: left;
  transition: background .12s;
}
.app-lang-opt:hover { background: var(--bg); }
.app-lang-opt.active { background: rgba(249,115,22,.06); }

/* ── BOTTOM NAV (mobile) ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 64px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  box-shadow: 0 -1px 12px rgba(0,0,0,0.06);
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a svg { width: 20px; height: 20px; }

/* ── PAGE CONTAINER ── */
.page {
  flex: 1;
  padding: 24px 20px 80px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.page-header p {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

/* ── AUTH PAGES ── */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
}

.auth-logo {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: 32px;
}
.auth-logo span { color: var(--accent); }

.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.auth-card .sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
}

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
}
.form-group input::placeholder { color: #adb5bd; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}
.form-error.show { display: block; }

.btn-patreon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: #ff424d;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  margin-bottom: 4px;
  transition: background 0.15s, transform 0.1s;
}
.btn-patreon:hover { background: #e0333e; transform: translateY(-1px); }
.btn-patreon:active { transform: translateY(0); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 0.75rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--muted);
}
.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; border-radius: 8px; }

.btn-accent { background: var(--accent); color: #fff; font-weight: 800; box-shadow: 0 6px 16px rgba(249,115,22,.28); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline-w {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline-w:hover { border-color: var(--muted); background: var(--card); }

.btn-ghost-sm {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: 0.2s;
}
.btn-ghost-sm:hover { color: var(--text); border-color: #555; }

.btn-danger {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.25); }

/* ── ONBOARDING ── */
.onboarding-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.onboarding-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
}

.ob-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
}
.ob-step {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.3s;
}
.ob-step.done { background: var(--accent); }
.ob-step.active { background: var(--accent); opacity: 0.5; }

.onboarding-card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.onboarding-card .sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
}

/* Goal / Level cards */
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.option-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}
.option-card:hover { border-color: #555; }
.option-card.selected { border-color: var(--accent); background: rgba(212, 245, 66, 0.05); }
.option-card .oc-icon { font-size: 2rem; margin-bottom: 8px; }
.option-card .oc-title { font-size: 0.875rem; font-weight: 700; margin-bottom: 4px; }
.option-card .oc-desc { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }

.ob-nav {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* ── DASHBOARD ── */
.dash-page { padding-top: 18px; }

.dash-header { margin-bottom: 22px; }
.dash-greeting {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.dash-date {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Today workout */
.dash-today {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 18px 24px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.dash-today::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
}
.dash-today:hover { border-color: #cbd5e1; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.dash-today-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 7px;
}
.dash-today-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 4px;
}
.dash-today-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.dash-today-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.dash-today-btn:hover { background: var(--accent-dark); }

/* Rest day */
.dash-rest {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-rest-icon {
  width: 38px; height: 38px;
  background: var(--card);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.dash-rest-info h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 2px; }
.dash-rest-info p { font-size: 0.76rem; color: var(--muted); }

/* Stats */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}
.dash-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 8px;
  text-align: center;
}
.dash-stat-val {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.03em;
}
.dash-stat-lbl {
  display: block;
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.4;
}

/* Section label */
.dash-label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Program card */
.dash-program {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-program-info { flex: 1; min-width: 0; }
.dash-program-info h3 {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.dash-program-info p { font-size: 0.75rem; color: var(--muted); }
.dash-program-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }

/* Week strip */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.ws-day {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 3px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.ws-day.today { border-color: var(--accent); background: rgba(249,115,22,0.05); }
.ws-day.rest { opacity: 0.38; cursor: default; }
.ws-day:not(.rest):hover { border-color: #444; }
.ws-name {
  font-size: 0.54rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ws-day.today .ws-name { color: var(--accent); }
.ws-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.ws-day.today .ws-dot { background: var(--accent); }
.ws-grp {
  font-size: 0.44rem;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
}

/* kept for history/programs compat */
.section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.stats-row {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 28px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.stat-card .sv { font-size: 1.6rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-card .sl { font-size: 0.7rem; color: var(--muted); margin-top: 4px; }
.program-card-dash {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 28px;
  display: flex; align-items: center; gap: 16px;
}
.pcd-info { flex: 1 }
.pcd-info h3 { font-size: 1rem; font-weight: 700; }
.pcd-info p { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.pcd-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.badge {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.7rem;
  color: var(--muted);
}
.badge-green { border-color: rgba(22,163,74,0.3); color: var(--green); background: rgba(22,163,74,0.07); }
.badge-accent { border-color: rgba(249,115,22,0.3); color: var(--accent); background: rgba(249,115,22,0.07); }
.badge-gender-male { border-color: rgba(37,99,235,0.3); color: #2563eb; background: rgba(37,99,235,0.07); }
.badge-gender-female { border-color: rgba(219,39,119,0.3); color: #db2777; background: rgba(219,39,119,0.07); }

.no-program-card {
  background: linear-gradient(120deg, #fff7ed, #ffffff 65%);
  border: 1px solid rgba(249,115,22,.25);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  margin-bottom: 28px;
  box-shadow: 0 8px 26px rgba(249,115,22,.10);
}
.no-program-card .npc-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(249,115,22,.13); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.no-program-card h3 { font-size: 1.25rem; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 8px; }
.no-program-card p { color: var(--muted); font-size: 0.875rem; margin-bottom: 20px; max-width: 420px; margin-left: auto; margin-right: auto; line-height: 1.55; }
.no-program-card .btn { box-shadow: 0 6px 16px rgba(249,115,22,.28); }

/* ── WORKOUT PAGE ── */
.workout-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.workout-header-card h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.workout-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exercise-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

/* ── EXERCISE CARD (with media) ── */

.exercise-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.exercise-card.expanded { border-color: #3a3a3a; }

/* Collapsed header with thumbnail */
.ex-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

/* Thumbnail in collapsed state */
.ex-thumb-wrap {
  width: 60px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: var(--card);
}
.ex-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}
.ex-thumb-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  opacity: 0;
}
.ex-thumb[style*="opacity: 0"] ~ .ex-thumb-icon { opacity: 1; }

/* Legacy icon classes for thumb fallback */
.ex-icon-chest   { background: rgba(248,113,113,0.15); }
.ex-icon-back    { background: rgba(96,165,250,0.15); }
.ex-icon-shoulders { background: rgba(251,146,60,0.15); }
.ex-icon-legs    { background: rgba(167,139,250,0.15); }
.ex-icon-biceps  { background: rgba(74,222,128,0.15); }
.ex-icon-triceps { background: rgba(249,115,22,0.15); }
.ex-icon-core    { background: rgba(34,211,238,0.15); }
.ex-icon-cardio  { background: rgba(248,113,113,0.15); }

.ex-info { flex: 1; min-width: 0; }
.ex-name { font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-sets { font-size: 0.72rem; color: var(--muted); margin-top: 1px; }
.ex-equip { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.ex-chip-inline { color: var(--accent); }

.ex-expand-arrow {
  color: var(--muted);
  font-size: 0.75rem;
  transition: transform 0.25s;
  flex-shrink: 0;
}
.exercise-card.expanded .ex-expand-arrow { transform: rotate(180deg); }

/* ── EXERCISE EXPANDED BODY ── */
.ex-body {
  border-top: 1px solid var(--border);
  display: none;
}
.exercise-card.expanded .ex-body { display: block; }

/* Media section — thumbnail + inline YouTube embed */
.ex-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}
.ex-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.3s ease;
}
.ex-media-wrap:hover .ex-media-img {
  transform: scale(1.03);
  filter: brightness(0.75);
}

/* Dark gradient overlay */
.ex-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Big centered play button */
.ex-play-btn {
  pointer-events: all;
  background: rgba(255,0,0,0.88);
  border: none;
  border-radius: 50%;
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(0,0,0,0.55);
}
.ex-play-btn:hover {
  background: #ff0000;
  transform: scale(1.1);
  box-shadow: 0 6px 32px rgba(255,0,0,0.45);
}
.ex-play-icon {
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  margin-left: 4px; /* optical center for triangle */
}

/* Inline YouTube iframe */
.ex-yt-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Fallback when thumbnail fails */
.ex-media-wrap.ex-media-fallback .ex-media-img { display: none; }
.ex-media-fallback-content {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}
.ex-media-wrap.ex-media-fallback .ex-media-fallback-content { display: flex; }
.ex-media-wrap.ex-media-fallback .ex-media-overlay { display: none; }

/* Content below image */
.ex-content-pad { padding: 16px 18px; }

.ex-body-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.ex-stat {
  background: var(--card);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.ex-stat .val { font-size: 1.1rem; font-weight: 800; color: var(--accent); }
.ex-stat .lbl { font-size: 0.65rem; color: var(--muted); margin-top: 2px; }

.ex-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

/* Step-by-step instructions */
.ex-instructions {
  background: var(--card);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.ex-instructions h4 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.ex-instructions ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ex-instructions li {
  display: flex;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.55;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: rgba(249,115,22,0.12);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: 1px;
}

/* Secondary muscles */
.ex-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tag-label { font-size: 0.72rem; color: var(--muted); }

.ex-note {
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(249,115,22,0.06);
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

/* YouTube bar at the bottom of expanded card */
.ex-yt-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  background: rgba(255,0,0,0.06);
  border-top: 1px solid rgba(255,0,0,0.15);
  color: #ff4444;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.2s;
}
.ex-yt-bar:hover { background: rgba(255,0,0,0.12); }

.workout-complete-btn {
  position: sticky;
  bottom: 72px;
  margin: 0 -4px;
}
.workout-complete-btn .btn {
  width: 100%;
  font-size: 1rem;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(249,115,22,0.2);
}

/* ── HISTORY PAGE ── */
.history-list { display: flex; flex-direction: column; gap: 10px; }

.history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.history-item:hover { border-color: #3a3a3a; }

.hi-icon {
  width: 44px;
  height: 44px;
  background: var(--card);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.hi-info { flex: 1; min-width: 0; }
.hi-name { font-size: 0.9rem; font-weight: 700; }
.hi-meta { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

.hi-right { text-align: right; flex-shrink: 0; }
.hi-cal { font-size: 0.875rem; font-weight: 700; color: var(--accent); }
.hi-dur { font-size: 0.7rem; color: var(--muted); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--muted); font-size: 0.875rem; margin-bottom: 20px; }

/* ── PROFILE PAGE ── */
.profile-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.avatar-wrap {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
}
.avatar-wrap:hover .avatar-change-hint { opacity: 1; }
.avatar-change-hint {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.48);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 6px;
  font-size: 0.52rem; font-weight: 700; color: #fff;
  letter-spacing: 0.07em; text-transform: uppercase;
  opacity: 0; transition: opacity 0.15s;
  border-radius: 50%;
  pointer-events: none;
}
.av-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 8px 0 20px;
  justify-items: center;
}
.av-picker-item {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  outline: 3px solid transparent;
  outline-offset: 3px;
}
.av-picker-item:hover { transform: scale(1.1); }
.av-picker-item.selected { outline-color: var(--accent); }
.av-check {
  display: none;
  position: absolute; bottom: 0; right: 0;
  width: 18px; height: 18px;
  background: var(--accent); border-radius: 50%;
  align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.av-picker-item.selected .av-check { display: flex; }
.profile-info h2 { font-size: 1.1rem; font-weight: 800; }
.profile-info p { font-size: 0.8rem; color: var(--muted); }

.profile-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.profile-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.profile-section-header h3 { font-size: 0.875rem; font-weight: 700; }
.profile-section-body { padding: 20px; }

/* ── DANGER ZONE (изтриване на акаунт) ── */
.danger-zone {
  border: 1.5px solid rgba(249,115,22, 0.35);
  border-radius: var(--radius);
  margin-top: 16px;
  overflow: hidden;
}
.danger-zone summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--red);
  user-select: none;
}
.danger-zone summary::-webkit-details-marker { display: none; }
.danger-zone summary:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -2px;
  border-radius: var(--radius);
}
.dz-chevron {
  display: flex;
  align-items: center;
  transition: transform 0.2s;
}
.danger-zone[open] .dz-chevron { transform: rotate(180deg); }
.dz-body { padding: 0 20px 16px; }
.dz-body p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 14px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.profile-row:last-child { border-bottom: none; }
.profile-row .label { color: var(--muted); }
.profile-row .value { font-weight: 600; }

/* ── PROGRAMS LIST ── */
.programs-list { display: flex; flex-direction: column; gap: 14px; }

.prog-list-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.prog-list-card:hover { border-color: #444; }
.prog-list-card.active-prog { border-color: var(--accent); background: rgba(249,115,22,0.03); }

.plc-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.plc-title { flex: 1; min-width: 0; }
.plc-title h3 { font-size: 1rem; font-weight: 700; }
.plc-title p { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.plc-active-badge {
  margin-left: auto;
  background: rgba(249,115,22,0.15);
  border: 1px solid rgba(249,115,22,0.3);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.plc-locked-badge {
  margin-left: auto;
  background: rgba(251,146,60,0.12);
  border: 1px solid rgba(251,146,60,0.3);
  color: #fb923c;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.plc-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.plc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 0;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 32px;
  width: 100%;
  max-width: 560px;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 800; }
.modal-close {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  transition: 0.2s;
}
.modal-close:hover { color: var(--text); }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 200px;
  animation: toastIn 0.3s ease;
  pointer-events: all;
}
.toast-success { border-left: 3px solid var(--green); color: var(--green); }
.toast-error { border-left: 3px solid var(--red); color: var(--red); }
.toast-info { border-left: 3px solid var(--accent); color: var(--accent); }
@keyframes toastIn {
  from { transform: translateX(40px); opacity: 0; }
}

/* ── GOAL COLORS ── */
.goal-muscle_mass { color: #dc2626; }
.goal-definition { color: #d97706; }
.goal-strength { color: #2563eb; }
.goal-endurance { color: #16a34a; }
.goal-weight_loss { color: #7c3aed; }

/* ── MISC ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--border);
}

.rest-day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.rest-day-card .rd-icon { font-size: 3rem; margin-bottom: 12px; }
.rest-day-card h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.rest-day-card p { color: var(--muted); font-size: 0.875rem; }

/* ── LOADING STATE ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--card) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ── RESPONSIVE ── */
@media (min-width: 600px) {
  .topnav-greeting { display: block; }
  .bottom-nav { max-width: 600px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
  .page { padding-bottom: 100px; }
}

@media (max-width: 360px) {
  .week-grid { grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .week-day { padding: 6px 2px; }
  .wd-name { font-size: 0.5rem; }
}

/* ── PRICING / PLAN FEATURES ── */
.plan-features {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.45;
}
.plan-features li.yes { color: var(--text); }
.plan-features li::before {
  content: '';
  width: 15px; height: 15px;
  flex-shrink: 0; margin-top: 1px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15'%3E%3Ccircle cx='7.5' cy='7.5' r='6.5' stroke='%23303030' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
}
.plan-features li.yes::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15'%3E%3Ccircle cx='7.5' cy='7.5' r='6.5' fill='%23f9731615' stroke='%23f9731645'/%3E%3Cpath d='M4.5 7.5l2 2 4-4' stroke='%23f97316' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}

/* ── RECIPES ── */
.recipe-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.recipe-cat-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.recipe-cat-btn:hover { border-color: #555; color: var(--text); }
.recipe-cat-btn.active { background: var(--accent); border-color: transparent; color: #fff; }

.recipe-search {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  margin-bottom: 16px;
  transition: border-color 0.15s;
  outline: none;
}
.recipe-search:focus { border-color: var(--accent); }

.recipes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.recipe-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.recipe-card:hover { border-color: #cbd5e1; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

.recipe-img-wrap {
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.recipe-img-emoji {
  font-size: 3rem;
  line-height: 1;
  position: absolute;
  z-index: 1;
  opacity: 0.7;
}
.recipe-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  transition: opacity 0.4s, transform 0.4s;
}
.recipe-card:hover .recipe-img { transform: scale(1.04); }
.recipe-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 60%);
  z-index: 3;
  pointer-events: none;
}
.recipe-cat-tag {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(0,0,0,0.45);
  padding: 2px 7px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  z-index: 4;
}

.recipe-card-body {
  padding: 12px 14px 14px;
}

.recipe-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.recipe-ing-preview {
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 9px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recipe-macros {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.recipe-macro {
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--card);
  border-radius: 5px;
  padding: 2px 6px;
}
.recipe-macro strong { color: var(--text); }
.recipe-foot {
  display: flex;
  gap: 6px;
  font-size: 0.67rem;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 400px) {
  .recipes-grid { grid-template-columns: 1fr; }
  .recipe-img-wrap { height: 140px; }
  .recipe-img-emoji { font-size: 4rem; }
}

.recipe-modal-hero {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.recipe-modal-emoji {
  font-size: 5rem;
  line-height: 1;
  position: absolute;
  z-index: 1;
  opacity: 0.7;
}
.recipe-modal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  transition: opacity 0.4s;
}
.recipe-modal-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.1) 60%);
  z-index: 3;
  pointer-events: none;
}

.recipe-detail-macros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.rm-stat {
  background: var(--card);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.rm-val { display: block; font-size: 1.1rem; font-weight: 800; color: var(--accent); }
.rm-lbl { display: block; font-size: 0.62rem; color: var(--muted); margin-top: 2px; }

/* ── NUTRITION ── */
.nut-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.nut-donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.nut-donut::before {
  content: '';
  position: absolute;
  inset: 20px;
  background: var(--surface);
  border-radius: 50%;
  z-index: 1;
}
.nut-donut-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  text-align: center;
}
.nut-donut-val { font-size: 1.2rem; font-weight: 900; color: var(--text); letter-spacing: -0.04em; line-height: 1; }
.nut-donut-lbl { font-size: 0.52rem; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.nut-hero-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.nut-hero-stats { display: flex; gap: 14px; }
.nut-hero-stat { text-align: center; }
.nut-hero-stat-val { display: block; font-size: 1rem; font-weight: 800; color: var(--text); }
.nut-hero-stat-lbl { display: block; font-size: 0.58rem; color: var(--muted); margin-top: 1px; }
.nut-adj { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.nut-adj.surplus { color: var(--green); }
.nut-adj.deficit { color: var(--accent); }
.nut-legend { display: flex; flex-direction: column; gap: 4px; }
.nut-legend > div { display: flex; align-items: center; gap: 6px; font-size: 0.68rem; color: var(--muted); }
.nut-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.nut-macros-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.nut-macro-card {
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  border: 1.5px solid;
}
.nut-mc-p { background: rgba(220,38,38,0.05); border-color: rgba(220,38,38,0.2); }
.nut-mc-c { background: rgba(37,99,235,0.05); border-color: rgba(37,99,235,0.2); }
.nut-mc-f { background: rgba(234,88,12,0.05); border-color: rgba(234,88,12,0.2); }
.nut-macro-icon { font-size: 1.3rem; margin-bottom: 5px; }
.nut-macro-val { font-size: 1.25rem; font-weight: 800; line-height: 1; margin-bottom: 2px; }
.nut-macro-lbl { font-size: 0.63rem; color: var(--muted); margin-bottom: 4px; }
.nut-macro-sub { font-size: 0.58rem; color: var(--muted); }

.nut-water-card {
  background: rgba(37,99,235,0.04);
  border: 1.5px solid rgba(37,99,235,0.14);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.nut-water-icon { font-size: 2rem; flex-shrink: 0; }
.nut-water-title { font-size: 0.67rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.nut-water-val { font-size: 1.25rem; font-weight: 800; color: var(--blue); line-height: 1.1; margin-top: 2px; }
.nut-water-sub { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }

/* Plan summary bar */
.nut-plan-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 12px;
}
.nut-plan-sum-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nut-plan-sum-val { font-size: 1rem; font-weight: 800; color: var(--text); line-height: 1; }
.nut-plan-sum-lbl { font-size: 0.58rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.nut-plan-sum-sep { width: 1px; height: 28px; background: var(--border); }

/* Meal list */
.nut-meals-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.nut-meal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.nut-meal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.nut-meal-left { display: flex; align-items: center; gap: 10px; }
.nut-meal-icon { font-size: 1.5rem; line-height: 1; }
.nut-meal-name { font-size: 0.9rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.nut-meal-time-lbl { font-size: 0.65rem; color: var(--muted); margin-top: 1px; }
.nut-meal-cal { font-size: 1rem; font-weight: 800; color: var(--text); text-align: right; line-height: 1; }
.nut-meal-cal-unit { font-size: 0.6rem; font-weight: 500; color: var(--muted); margin-left: 2px; }

.nut-meal-foods {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.nut-meal-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.nut-chip {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}
.nut-chip-p { background: rgba(220,38,38,0.1); color: #b91c1c; }
.nut-chip-c { background: rgba(37,99,235,0.1); color: #1d4ed8; }
.nut-chip-f { background: rgba(234,88,12,0.1); color: #c2530a; }

/* Tips */
.nut-tips-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.nut-tip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.nut-tip-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.nut-tip strong { color: var(--text); }

/* ── PRO LOCKER (заключено PRO съдържание, upsell към #pricing) ── */
.pro-locker {
  background: var(--surface);
  border: 1.5px dashed rgba(251, 146, 60, 0.45);
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
}
.pro-locker-badge {
  display: inline-block;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px;
  background: #fb923c; color: #fff;
  border-radius: 4px; padding: 2px 8px;
  margin-bottom: 12px;
}
.pro-locker h3 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.pro-locker p { font-size: 0.8rem; color: var(--muted); line-height: 1.55; margin-bottom: 18px; }
.pro-locker-btn {
  display: block; width: 100%; padding: 13px;
  background: var(--accent); color: #fff;
  border-radius: var(--radius); font-size: 0.9rem; font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(249,115,22, 0.22);
  transition: background 0.15s, transform 0.1s;
}
.pro-locker-btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.pro-locker-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── LOCKED PROGRAM CARD ── */
.prog-locked { opacity: 0.75; }
.prog-lock-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
  background: rgba(249,115,22,0.05); border: 1px dashed rgba(249,115,22,0.2);
  border-radius: 10px; padding: 10px 14px; margin-top: 12px;
}
.prog-lock-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.prog-lock-links { display: flex; gap: 8px; flex-wrap: wrap; }
.prog-lock-link {
  font-size: 0.75rem; font-weight: 700; padding: 5px 10px;
  border-radius: 8px; text-decoration: none; transition: opacity 0.15s;
}
.prog-lock-link:hover { opacity: 0.8; }
.prog-lock-link.oauth { background: #ff424d22; color: #ff424d; }
.prog-lock-link.join  { background: #ff424d; color: #fff; }

/* ── 5-TAB NAV ADJUSTMENTS ── */
@media (max-width: 420px) {
  .bottom-nav a { font-size: 0.52rem; }
  .bottom-nav a svg { width: 18px; height: 18px; }
}

/* ── MOBILE ENHANCEMENTS ── */

/* Remove tap flash, speed up touch response */
* { -webkit-tap-highlight-color: transparent; }
button, a, [role="button"], .option-card, .ws-day, .exercise-card,
.history-item, .recipe-card, .prog-list-card, .dash-today {
  touch-action: manipulation;
}

/* Prevent pull-to-refresh jank on mobile */
body { overscroll-behavior-y: none; }

/* iOS auto-zoom prevention: inputs must be >= 16px */
.form-group input,
.form-group select,
.form-group textarea,
.recipe-search {
  font-size: max(16px, 0.9rem);
}

/* Safe area insets for notched phones (iPhone X+) */
.bottom-nav {
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(64px + env(safe-area-inset-bottom));
}
.page { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.workout-complete-btn { bottom: calc(72px + env(safe-area-inset-bottom)); }

@media (min-width: 600px) {
  .page { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
}

/* Toast: prevent overflow on narrow phones */
@media (max-width: 480px) {
  .toast-container { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: unset; width: 100%; }
}

/* Auth/Onboarding: comfortable padding on small phones */
@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; border-radius: 16px; }
  .onboarding-card { padding: 28px 20px; border-radius: 16px; }
  .modal { padding: 24px 18px 28px; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* Nutrition hero: stack vertically on narrow phones */
@media (max-width: 440px) {
  .nut-hero-card { flex-direction: column; align-items: center; padding: 16px; gap: 14px; }
  .nut-donut { width: 120px; height: 120px; }
  .nut-hero-info { width: 100%; }
  .nut-hero-stats { justify-content: center; }
}

/* Form row: collapse to single column on small phones */
@media (max-width: 420px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Week strip: hide tiny group text on small phones, bump name size */
@media (max-width: 400px) {
  .ws-grp { display: none; }
  .ws-name { font-size: 0.56rem; }
  .ws-day { padding: 8px 2px 7px; }
}

/* Program lock CTA: stack links below label on very small phones */
@media (max-width: 380px) {
  .prog-lock-cta { flex-direction: column; align-items: flex-start; gap: 8px; }
  .prog-lock-links { width: 100%; }
  .prog-lock-link { flex: 1; text-align: center; }
}

/* Tiny phones: macro grids go 2-column */
@media (max-width: 360px) {
  .nut-macros-grid { grid-template-columns: 1fr 1fr; }
  .recipe-detail-macros { grid-template-columns: repeat(2, 1fr); }
  .dash-stats { gap: 6px; }
  .dash-stat { padding: 12px 6px; }
  .dash-stat-val { font-size: 1.3rem; }
  .dash-stat-lbl { font-size: 0.58rem; }
}

/* Ensure minimum tap target sizes */
.modal-close { width: 40px; height: 40px; }
.recipe-cat-btn { min-height: 36px; display: inline-flex; align-items: center; }
.btn-ghost-sm { min-height: 36px; }
/* ═══════════════════════════════════════════════════════════════
   V3 REDESIGN: app-ът в дизайн системата на landing-а
   (светло #f6f7f9, оранжев акцент, bold заглавия, spring hover)
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg: #f6f7f9;
  --border: #e6e9ee;
  --text: #0f1215;
  --muted: #5b6472;
}

.page-header h1 { font-size: 2rem; font-weight: 900; letter-spacing: -0.02em; }
.dash-label {
  color: var(--accent); font-weight: 800; font-size: 0.7rem;
  letter-spacing: 0.16em; text-transform: uppercase;
}

.btn { transition: transform .28s cubic-bezier(.34,1.56,.64,1), background .15s, box-shadow .28s, border-color .15s; }
.btn:active { transform: scale(.96); }
.btn-primary { box-shadow: 0 6px 16px rgba(249,115,22,.28); }
.btn-primary:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 10px 24px rgba(249,115,22,.38); }

.prog-list-card, .recipe-card, .stat-card, .dash-card, .diet-card {
  background: #fff; border-color: var(--border);
  box-shadow: 0 1px 2px rgba(15,18,21,.05);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease, border-color .2s;
}
.prog-list-card:hover, .recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15,18,21,.10);
  border-color: #ccd4de;
}

/* Десктоп: долната навигация става горни табове (както Centr/Boostcamp web) */
@media (min-width: 901px) {
  .page { max-width: 1120px; padding: 36px 28px 64px; }

  .bottom-nav {
    top: 0; bottom: auto; left: 50%; right: auto;
    transform: translateX(-50%);
    width: auto; height: var(--nav-h);
    background: none; border: none; box-shadow: none;
    z-index: 101; gap: 2px; align-items: center;
  }
  .bottom-nav a {
    flex: none; flex-direction: row; gap: 8px;
    padding: 9px 16px; border-radius: 10px;
    font-size: 0.82rem; font-weight: 700; letter-spacing: 0;
  }
  .bottom-nav a svg { width: 16px; height: 16px; }
  .bottom-nav a.active { background: rgba(249,115,22,.10); }
  .bottom-nav a:hover:not(.active) { color: var(--text); }

  .programs-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; align-items: start; }
  .recipes-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (min-width: 901px) and (max-width: 1240px) {
  .topnav-greeting { display: none; }
}

/* ── V3: Workout страницата ── */
.section-title { color: var(--accent); font-weight: 800; letter-spacing: 0.14em; font-size: 0.7rem; }
.workout-header-card h1 { font-size: 1.7rem; font-weight: 900; letter-spacing: -0.02em; }
.workout-header-card { box-shadow: 0 1px 2px rgba(15,18,21,.05); border-color: var(--border); }
.exercise-card {
  background: #fff; border-color: var(--border);
  box-shadow: 0 1px 2px rgba(15,18,21,.05);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease, border-color .2s;
}
.exercise-card:not(.expanded):hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(15,18,21,.09); border-color: #ccd4de; }
.exercise-card.expanded { border-color: var(--accent); box-shadow: 0 14px 30px rgba(15,18,21,.10); }
.ex-header { padding: 14px 16px; }
.ex-thumb-wrap { width: 96px; height: 64px; border-radius: 10px; }
.ex-name { font-size: 0.95rem; font-weight: 800; }
.ex-sets { font-size: 0.78rem; margin-top: 3px; }
.ex-expand-arrow { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg); }

@media (min-width: 901px) {
  /* Упражненията остават 1 под 1 (ред на изпълнение), с умерена ширина */
  .exercise-list, .workout-header-card, .workout-complete-btn { max-width: 760px; }
  .workout-complete-btn { position: static; margin: 28px 0 0; }
  .workout-complete-btn .btn { width: 100%; }
}

/* V3 mobile: имената на упражненията се пренасят, не се режат */
@media (max-width: 900px) {
  .ex-name { white-space: normal; overflow: visible; text-overflow: unset; line-height: 1.3; }
  .ex-thumb-wrap { width: 80px; height: 56px; }
}

/* V3: тъмбнейли на програмните карти + "Препоръчана" бадж */
.prog-list-card { overflow: hidden; }
.plc-thumb { position: relative; height: 150px; margin: -20px -20px 14px; overflow: hidden; background: var(--card); }
.prog-list-card:hover .plc-thumb img { transform: scale(1.05); }
.plc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.prog-locked .plc-thumb img { filter: grayscale(.5) brightness(.85); }
.plc-rec-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent); color: #fff;
  font-size: .64rem; font-weight: 800; letter-spacing: .05em;
  padding: 4px 10px; border-radius: 6px;
  box-shadow: 0 4px 12px rgba(249,115,22,.35);
}


/* V3: на десктоп модалите са центрирани (bottom-sheet е само за телефон) */
@media (min-width: 901px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .modal { border-radius: 18px; animation: modalPop .32s cubic-bezier(.16,1,.3,1); box-shadow: 0 24px 60px rgba(15,18,21,.28); }
}
@keyframes modalPop {
  from { transform: translateY(14px) scale(.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* V3: панел "Избрана специално за теб" - split layout */
.mp-card { max-width: 680px !important; padding: 0 !important; overflow: hidden; }
.mp-split { display: flex; flex-direction: column; }
.mp-media { position: relative; height: 200px; flex-shrink: 0; }
.mp-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,12,15,.18), rgba(10,12,15,0) 45%); }
.mp-pro-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: .62rem; font-weight: 900; letter-spacing: .08em;
  background: var(--accent); color: #fff; border-radius: 6px; padding: 4px 10px;
  box-shadow: 0 4px 14px rgba(249,115,22,.45);
}
.mp-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(10,12,15,.5); color: #fff; font-size: .8rem; cursor: pointer;
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.mp-close:hover { background: rgba(10,12,15,.75); }
.mp-body { padding: 24px; display: flex; flex-direction: column; }
.mp-eyebrow { font-size: .64rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.mp-title { font-size: 1.5rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.12; margin-bottom: 10px; }
.mp-meta { display: flex; gap: 14px; font-size: .76rem; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.mp-meta svg { flex-shrink: 0; opacity: .7; }
.mp-meta span { display: flex; align-items: center; gap: 6px; }
.mp-desc { font-size: .84rem; color: var(--muted); line-height: 1.6; }
.mp-note {
  font-size: .76rem; color: var(--muted); line-height: 1.55; margin-top: 14px;
  padding: 12px 14px; background: rgba(249,115,22,.07);
  border: 1px solid rgba(249,115,22,.18); border-radius: 10px;
}
.mp-actions { margin-top: 20px; }

@media (min-width: 700px) {
  .mp-split { flex-direction: row; }
  .mp-media { width: 44%; height: auto; min-height: 380px; }
  .mp-media::after { background: linear-gradient(90deg, rgba(10,12,15,0) 70%, rgba(10,12,15,.12)); }
  .mp-body { width: 56%; padding: 28px; }
  .mp-actions { margin-top: auto; padding-top: 20px; }
}

/* V3: Instagram-стил парола: Покажи/Скрий + ✓/✗ в полето */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; }
.pw-valid { position: absolute; top: 50%; transform: translateY(-50%); right: 82px; display: flex; align-items: center; }
.pw-valid[hidden] { display: none; }
.pw-wrap:not(:has(.pw-toggle)) .pw-valid { right: 14px; }
.pw-toggle {
  position: absolute; top: 50%; transform: translateY(-50%); right: 12px;
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: .78rem; font-weight: 700; color: var(--text); padding: 4px;
}
.pw-toggle:hover { color: var(--muted); }


/* V3: админ панел */
.adm-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.adm-table th { text-align: left; padding: 12px 14px; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--border); }
.adm-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-table tbody tr:hover { background: var(--bg); }
.adm-badge { display: inline-block; font-size: .66rem; font-weight: 800; padding: 3px 9px; border-radius: 6px; background: var(--card); color: var(--muted); }
.adm-badge.pro { background: rgba(249,115,22,.12); color: var(--accent-dark); }
.adm-badge.bug { background: rgba(220,38,38,.1); color: #b91c1c; }
.adm-badge.sug { background: rgba(37,99,235,.1); color: #1d4ed8; }
.adm-fb { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(15,18,21,.05); }
.adm-fb.done { opacity: .55; }


/* V3: админ табове */
.adm-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 18px; }
.adm-tab {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: .86rem; font-weight: 700; color: var(--muted);
  padding: 10px 16px; margin-bottom: -2px; border-bottom: 2px solid transparent;
  display: flex; align-items: center; gap: 7px; transition: color .15s, border-color .15s;
}
.adm-tab:hover { color: var(--text); }
.adm-tab.on { color: var(--accent-dark); border-bottom-color: var(--accent); }
.adm-tab-badge {
  background: var(--accent); color: #fff; font-size: .62rem; font-weight: 800;
  border-radius: 999px; padding: 1px 7px;
}


/* V3: Stripe pricing карти */
.bill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .bill-grid { grid-template-columns: 1fr; } }
.bill-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px 22px; display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(15,18,21,.05);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
}
.bill-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(15,18,21,.1); }
.bill-card.hot { border-color: var(--accent); box-shadow: 0 8px 26px rgba(249,115,22,.14); }
.bill-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff;
  font-size: .62rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 12px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(249,115,22,.35);
}
.bill-name { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.bill-old { font-size: .95rem; color: var(--muted); text-decoration: line-through; font-weight: 600; }
.bill-price { font-size: 2.3rem; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
.bill-per { font-size: .76rem; color: var(--muted); margin-bottom: 14px; }
.bill-feats { list-style: none; padding: 0; margin: 0 0 18px; flex: 1; }
.bill-feats li { font-size: .78rem; color: var(--muted); padding: 4px 0 4px 20px; position: relative; line-height: 1.45; }
.bill-feats li::before { content: ''; position: absolute; left: 2px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.bill-note { font-size: .68rem; color: var(--muted); margin-top: 10px; line-height: 1.45; text-align: center; }
.bill-includes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; }
@media (max-width: 560px) { .bill-includes { grid-template-columns: 1fr; } }
.bill-includes li { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
