/* ═════════════════════════════════════════════════════════════════════════════════
   Form — Brass Studio Design System (Stage 3 / Phase 1)
   Equinox-inspired: deep black + bone cream + brass accent.
   Editorial serif headlines, refined sans body, monospace numerals.
   Find your form.
   ═════════════════════════════════════════════════════════════════════════════════ */

/* ── GOOGLE FONTS (Fraunces serif + Inter Tight + IBM Plex Mono) ──────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,800;1,9..144,400;1,9..144,500;1,9..144,600;1,9..144,700;1,9..144,800&family=Inter+Tight:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  /* ══ BRASS STUDIO PALETTE (Stage 3 rebrand) ══════════════════════════════════════ */
  --bg-primary:      #0A0A0A;
  --bg-elevated:     #141414;
  --bg-recessed:     #070707;
  --bg-translucent:  rgba(20,20,20,0.72);

  --border-subtle:   #1F1F1F;
  --border-rule:     #2A2A2A;
  --border-brass:    #5C4A2E;

  --text-bone:       #EFE9DD;
  --text-muted-bone: #A8A199;
  --text-tertiary:   #6B655E;

  --brass:           #B08D57;
  --brass-hover:     #C9A370;
  --brass-deep:      #8B6E40;
  --brass-muted:     #5C4A2E;
  --brass-glow:      rgba(176,141,87,0.14);

  --sage:            #8BAE7A;
  --sage-deep:       #5F7E52;
  --aged-gold:       #C9A050;
  --dust-burgundy:   #9B4D4D;
  --dust-burgundy-deep:#7A3B3B;

  /* Legacy palette below kept for backward compatibility — re-mapped to Brass values
     where it matters so legacy pages inherit the new look automatically. */

  /* ── Core Brand Palette (kept for compatibility) ── */
  --emerald-50:  #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-900: #064e3b;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --rose-400:  #fb7185;
  --rose-500:  #f43f5e;
  --violet-500:#8b5cf6;
  --blue-500:  #3b82f6;
  --orange-500:#f97316;
  --cyan-500:  #06b6d4;

  /* ── Warm Mode (now mapped to Brass Studio dark for legacy inner pages) ── */
  --warm-bg:       var(--bg-primary);
  --warm-surface:  var(--bg-elevated);
  --warm-border:   var(--border-subtle);
  --warm-text:     var(--text-bone);
  --warm-muted:    var(--text-muted-bone);
  --warm-accent:   var(--brass);
  --warm-accent2:  var(--aged-gold);
  --warm-shadow:   0 2px 20px rgba(0,0,0,0.5);

  /* ── Energy Mode (Active Workout) ── */
  --energy-bg:     #0a0f1e;
  --energy-surface:#111827;
  --energy-card:   #1a2235;
  --energy-border: #1e3a5f;
  --energy-text:   #f0f9ff;
  --energy-muted:  #7ca4c4;
  --energy-accent: #00f5a0;
  --energy-neon:   #00d4ff;
  --energy-fire:   #ff6b35;

  /* ── Active Theme (Brass Studio dark) ── */
  --bg:        var(--bg-primary);
  --surface:   var(--bg-elevated);
  --border:    var(--border-subtle);
  --text:      var(--text-bone);
  --muted:     var(--text-muted-bone);
  --accent:    var(--brass);
  --shadow:    0 1px 0 var(--border-subtle), 0 8px 32px rgba(0,0,0,0.4);

  /* ── Component aliases re-mapped to Brass Studio ── */
  --primary:        var(--brass);
  --primary-light:  var(--brass-glow);
  --surface-2:      var(--bg-recessed);
  --text-primary:   var(--text-bone);
  --text-secondary: var(--text-muted-bone);
  --text-muted:     var(--text-muted-bone);
  --emerald-300:    var(--sage);
  --emerald-500:    var(--brass);
  --emerald-600:    var(--brass-deep);
  --emerald-800:    var(--brass-deep);

  /* ══ BRASS STUDIO TYPOGRAPHY ══════════════════════════════════════════════════════ */
  --font-display: 'Fraunces', 'Tiempos Headline', Georgia, serif;
  --font-body:    'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-caps:    var(--font-body);

  /* ── Spacing & Radii (Brass Studio: tighter radii signal seriousness) ── */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-2xl:16px;
  --r-full:9999px;

  /* ── Letter-spacing tokens ── */
  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.05em;
  --tracking-caps:   0.15em;

  /* ── Transitions ── */
  --ease: cubic-bezier(0.4,0,0.2,1);
  --transition: 0.25s var(--ease);
}

/* ── Energy Mode (active workout) — retuned to Brass Studio ── */
.energy-mode {
  --bg:            #050505;
  --surface:       #0F0F0F;
  --border:        #1F1F1F;
  --text:          var(--text-bone);
  --muted:         var(--text-muted-bone);
  --accent:        var(--brass-hover);
  --shadow:        0 4px 30px rgba(176,141,87,0.08);
  --primary:       var(--brass-hover);
  --primary-light: var(--brass-glow);
  --surface-2:     #161616;
  --text-primary:  var(--text-bone);
  --text-secondary:var(--text-muted-bone);
  --text-muted:    var(--text-muted-bone);
}

/* ══════════════ RESET & BASE ══════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ══════════════ APP SHELL ══════════════ */
#app { min-height: 100vh; display: block; position: relative; }

.page { display: none; flex-direction: column; min-height: 100vh; }
.page.active { display: flex; }

/* ══════════════ NAVIGATION ══════════════ */
.app-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  transition: background var(--transition), border-color var(--transition);
}

.energy-mode .app-nav {
  background: var(--energy-surface);
  border-top-color: var(--energy-border);
  box-shadow: 0 -4px 30px rgba(0,245,160,0.06);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  transition: color var(--transition), transform 0.15s;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-item i { font-size: 20px; }
.nav-item:active { transform: scale(0.92); }

.nav-item.active {
  color: var(--accent);
}

.energy-mode .nav-item.active { color: var(--energy-accent); }

/* ══════════════ TOP HEADER ══════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  padding-top: calc(16px + env(safe-area-inset-top, 0));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  transition: background var(--transition);
}

.header-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.header-avatar {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-400));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  cursor: pointer;
}

/* ══════════════ SCROLL CONTAINER ══════════════ */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 90px;
  -webkit-overflow-scrolling: touch;
}

/* ══════════════ TYPOGRAPHY ══════════════ */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(24px, 6vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.text-xl { font-size: 20px; font-weight: 700; }
.text-lg { font-size: 18px; font-weight: 600; }
.text-md { font-size: 15px; font-weight: 500; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-white { color: #fff; }

/* ══════════════ BUTTONS ══════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600));
  color: white;
  box-shadow: 0 4px 15px rgba(16,185,129,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(16,185,129,0.45); transform: translateY(-1px); }

.btn-energy {
  background: linear-gradient(135deg, #00f5a0, #00d4ff);
  color: #0a0f1e;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,245,160,0.3);
}
.btn-energy:hover { box-shadow: 0 6px 30px rgba(0,245,160,0.5); transform: translateY(-1px); }

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

.btn-ghost {
  background: var(--slate-100);
  color: var(--slate-700);
}
.btn-ghost:hover { background: var(--slate-200); }

.btn-danger {
  background: linear-gradient(135deg, var(--rose-500), #e11d48);
  color: white;
}

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 18px 32px; font-size: 17px; }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; border-radius: var(--r-md); }

/* ══════════════ CARDS ══════════════ */
.card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  padding: 20px;
  transition: background var(--transition), border-color var(--transition);
}

.card-hover:hover {
  border-color: var(--emerald-400);
  box-shadow: 0 4px 20px rgba(16,185,129,0.12);
  transform: translateY(-1px);
  transition: all var(--transition);
}

.card-glass {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
}

.energy-mode .card {
  background: var(--energy-card);
  border-color: var(--energy-border);
}

.energy-mode .card-glass {
  background: rgba(26,34,53,0.8);
  border-color: rgba(0,245,160,0.15);
}

.card-gradient-green {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600));
  color: white;
  border: none;
}

.card-gradient-energy {
  background: linear-gradient(135deg, #0a1628, #1a2a4a);
  border: 1px solid rgba(0,245,160,0.2);
  color: white;
}

/* ══════════════ STAT RINGS / CIRCLES ══════════════ */
.stat-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-ring svg { transform: rotate(-90deg); }
.stat-ring-label {
  position: absolute;
  text-align: center;
}

/* ══════════════ FORM ELEMENTS ══════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}

.form-label .required { color: var(--rose-500); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}

.form-input::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; min-height: 100px; }

.form-select-wrap { position: relative; }
.form-select-wrap::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--rose-500); margin-top: 4px; }

/* Input unit suffix */
.input-group { position: relative; display: flex; align-items: center; }
.input-group .form-input { padding-right: 52px; }
.input-suffix {
  position: absolute; right: 14px;
  font-size: 13px; color: var(--muted); font-weight: 500;
}

/* Toggle Switch */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle {
  position: relative;
  width: 50px; height: 28px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--slate-300);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--emerald-500); }
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); }

/* Chip / Tag selectors */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--emerald-400); color: var(--emerald-600); }
.chip.selected {
  background: var(--emerald-50);
  border-color: var(--emerald-500);
  color: var(--emerald-700);
  font-weight: 600;
}

/* ══════════════ PROGRESS BARS ══════════════ */
.progress-bar { background: var(--slate-200); border-radius: var(--r-full); overflow: hidden; height: 8px; }
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--emerald-500), var(--emerald-400));
  transition: width 0.6s var(--ease);
}
.progress-fill.fat { background: linear-gradient(90deg, var(--amber-500), var(--amber-400)); }
.progress-fill.carb { background: linear-gradient(90deg, var(--blue-500), var(--cyan-500)); }
.progress-fill.protein { background: linear-gradient(90deg, var(--rose-500), var(--rose-400)); }
.progress-fill.water { background: linear-gradient(90deg, var(--cyan-500), var(--blue-500)); }

/* ══════════════ BADGES ══════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-green { background: var(--emerald-100); color: var(--emerald-700); }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-rose  { background: #ffe4e6; color: #9f1239; }
.badge-blue  { background: #dbeafe; color: #1e40af; }
.badge-violet{ background: #ede9fe; color: #5b21b6; }
.badge-slate { background: var(--slate-200); color: var(--slate-700); }
.badge-energy{ background: rgba(0,245,160,0.15); color: #00f5a0; }

/* ══════════════ INSIGHT CARDS ══════════════ */
.insight-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 10px;
}
.insight-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.insight-icon.success { background: var(--emerald-100); }
.insight-icon.warning { background: #fef3c7; }
.insight-icon.info    { background: #dbeafe; }
.insight-icon.action  { background: #ede9fe; }
.insight-icon.milestone { background: linear-gradient(135deg, var(--emerald-500), var(--emerald-400)); color: white; }
.insight-body { flex: 1; min-width: 0; }
.insight-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.insight-msg { font-size: 13px; color: var(--muted); line-height: 1.5; }
.insight-action { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 6px; }
.insight-evidence { font-size: 11px; color: var(--muted); font-style: italic; margin-top: 4px; }

/* ══════════════ EXERCISE CARDS ══════════════ */
.exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 16px;
  transition: all var(--transition);
}

.exercise-card:hover {
  border-color: var(--emerald-400);
  box-shadow: 0 4px 20px rgba(16,185,129,0.1);
}

.exercise-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(135deg, var(--slate-100), var(--slate-200));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.exercise-svg-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.energy-mode .exercise-svg-wrap {
  background: linear-gradient(135deg, #0d1f3c, #162038);
}

.exercise-body { padding: 16px; }
.exercise-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.exercise-name { font-size: 17px; font-weight: 700; line-height: 1.2; }
.exercise-muscles { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }

.exercise-detail { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 14px; }
.exercise-stat {
  background: var(--slate-50);
  border-radius: var(--r-md);
  padding: 10px;
  text-align: center;
}
.energy-mode .exercise-stat { background: rgba(0,245,160,0.05); }
.exercise-stat-val { font-size: 16px; font-weight: 700; color: var(--accent); }
.exercise-stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.exercise-steps { list-style: none; margin-bottom: 14px; }
.exercise-steps li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.exercise-steps li:last-child { border-bottom: none; }
.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--emerald-500);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.mistakes-section {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 12px;
}
.energy-mode .mistakes-section { background: rgba(255,107,53,0.08); border-color: rgba(255,107,53,0.3); }
.mistakes-title { font-size: 13px; font-weight: 700; color: #c2410c; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.energy-mode .mistakes-title { color: var(--energy-fire); }
.mistake-item { margin-bottom: 10px; }
.mistake-wrong { font-size: 12px; color: #dc2626; font-weight: 600; margin-bottom: 2px; }
.mistake-fix { font-size: 12px; color: var(--muted); }
.energy-mode .mistake-wrong { color: #ff6b6b; }

.glp1-note {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid var(--emerald-200);
  border-radius: var(--r-lg);
  padding: 12px;
  font-size: 12px;
  color: var(--emerald-700);
  line-height: 1.5;
}
.energy-mode .glp1-note { background: rgba(0,245,160,0.06); border-color: rgba(0,245,160,0.2); color: #00f5a0; }

.video-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fee2e2;
  border-radius: var(--r-lg);
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}
.video-link:hover { background: #fecaca; }
.energy-mode .video-link { background: rgba(255,107,53,0.1); color: var(--energy-fire); }

/* ══════════════ WORKOUT TIMER (Energy Mode) ══════════════ */
.workout-timer {
  background: var(--energy-bg);
  border-radius: var(--r-2xl);
  padding: 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.workout-timer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(0,245,160,0.08), transparent 60%);
  pointer-events: none;
}

.timer-ring-wrap { position: relative; display: inline-block; margin-bottom: 20px; }
.timer-display {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.timer-seconds {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  color: white;
  line-height: 1;
  letter-spacing: -2px;
}
.timer-label { font-size: 11px; color: var(--energy-muted); text-transform: uppercase; letter-spacing: 1px; }

.timer-exercise-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--energy-text);
  margin-bottom: 6px;
}
.timer-set-info { font-size: 14px; color: var(--energy-muted); margin-bottom: 24px; }
.timer-controls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ══════════════ MACRO RINGS ══════════════ */
.macro-rings { display: flex; justify-content: space-around; padding: 24px 0; }
.macro-ring-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.macro-ring-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.macro-ring-val { font-size: 20px; font-weight: 700; }
.macro-ring-target { font-size: 11px; color: var(--muted); }

/* ══════════════ ONBOARDING ══════════════ */
.onboarding-wrap {
  min-height: 100vh;
  background: var(--warm-bg);
  display: flex;
  flex-direction: column;
}

.onboarding-progress {
  display: flex;
  gap: 6px;
  padding: 16px 24px 0;
}
.onboarding-step-dot {
  flex: 1;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--slate-200);
  transition: background var(--transition);
}
.onboarding-step-dot.done { background: var(--emerald-500); }
.onboarding-step-dot.active {
  background: linear-gradient(90deg, var(--emerald-500), var(--emerald-300));
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%,100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.onboarding-header { padding: 24px 24px 16px; }
.onboarding-step-label { font-size: 12px; font-weight: 600; color: var(--emerald-600); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.onboarding-title { font-size: 26px; font-weight: 800; line-height: 1.2; margin-bottom: 8px; color: var(--warm-text); }
.onboarding-subtitle { font-size: 14px; color: var(--warm-muted); line-height: 1.5; }

.onboarding-body { flex: 1; padding: 16px 24px; overflow-y: auto; }
.onboarding-footer { padding: 16px 24px; padding-bottom: calc(16px + env(safe-area-inset-bottom,0)); border-top: 1px solid var(--warm-border); background: var(--warm-surface); }

/* Incentive banner */
.incentive-banner {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid var(--emerald-200);
  border-radius: var(--r-xl);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.incentive-icon { font-size: 24px; }
.incentive-text { font-size: 13px; color: var(--emerald-800); line-height: 1.5; }
.incentive-text strong { display: block; font-size: 14px; margin-bottom: 2px; }

/* ══════════════ LANDING PAGE ══════════════ */
.landing-hero {
  min-height: 100vh;
  background: linear-gradient(160deg, #0a1628 0%, #0d2040 40%, #0a3d2e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,245,160,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,160,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,0.12) 0%, transparent 70%);
  top: -100px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,245,160,0.1);
  border: 1px solid rgba(0,245,160,0.25);
  color: #00f5a0;
  padding: 8px 18px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 10vw, 68px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  color: white;
  margin-bottom: 20px;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #00f5a0, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(15px, 3vw, 18px);
  color: rgba(240,249,255,0.7);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 36px;
}

.hero-cta-group { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; margin: 0 auto 48px; }

.hero-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-stat {
  text-align: center;
}
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: #00f5a0;
  line-height: 1;
}
.hero-stat-label { font-size: 12px; color: rgba(240,249,255,0.5); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* ══════════════ PRICING ══════════════ */
.pricing-grid { display: flex; flex-direction: column; gap: 16px; padding: 24px; }

.pricing-card {
  border-radius: var(--r-2xl);
  padding: 28px;
  border: 2px solid var(--border);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.pricing-card.featured {
  border-color: var(--emerald-500);
  background: linear-gradient(160deg, #0a1628, #0d2040);
  color: white;
}

.pricing-popular {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--emerald-500);
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: var(--r-full);
}

.pricing-tier { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; color: var(--emerald-500); }
.pricing-card.featured .pricing-tier { color: #00f5a0; }
.pricing-name { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.pricing-price { font-size: 42px; font-weight: 900; line-height: 1; margin-bottom: 4px; font-family: var(--font-display); }
.pricing-price span { font-size: 16px; font-weight: 500; }
.pricing-period { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.pricing-card.featured .pricing-period { color: rgba(240,249,255,0.6); }
.pricing-features { list-style: none; margin-bottom: 24px; }
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.pricing-card.featured .pricing-features li { border-color: rgba(255,255,255,0.05); }
.pricing-features li:last-child { border-bottom: none; }
.pricing-check { color: var(--emerald-500); font-size: 14px; flex-shrink: 0; margin-top: 2px; }
.pricing-card.featured .pricing-check { color: #00f5a0; }
.pricing-x { color: var(--slate-400); font-size: 14px; flex-shrink: 0; margin-top: 2px; }

/* ══════════════ TABS ══════════════ */
.tab-bar {
  display: flex;
  background: var(--slate-100);
  border-radius: var(--r-lg);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}
.tab-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: all var(--transition);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn.active {
  background: white;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.energy-mode .tab-bar { background: var(--energy-surface); }
.energy-mode .tab-btn.active { background: var(--energy-card); color: var(--energy-text); }

/* ══════════════ GLP-1 PILL TRACKER ══════════════ */
.dose-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.dose-day {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.dose-day.taken { background: var(--emerald-500); border-color: var(--emerald-500); color: white; }
.dose-day.missed { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.dose-day.upcoming { background: var(--slate-50); color: var(--muted); }
.dose-day.today { border-color: var(--emerald-500); color: var(--emerald-600); font-weight: 700; }

/* ══════════════ WEARABLE METRICS ══════════════ */
.metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.energy-mode .metric-card { background: var(--energy-card); border-color: var(--energy-border); }
.metric-icon { font-size: 22px; }
.metric-value { font-size: 28px; font-weight: 800; line-height: 1; color: var(--text); }
.energy-mode .metric-value { color: var(--energy-text); }
.metric-unit { font-size: 13px; color: var(--muted); }
.metric-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.metric-trend { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.metric-trend.up { color: var(--emerald-500); }
.metric-trend.down { color: var(--rose-500); }
.metric-trend.neutral { color: var(--muted); }

/* ══════════════ CHARTS ══════════════ */
.chart-wrap {
  position: relative;
  width: 100%;
}

/* ══════════════ TRAINER PORTAL ══════════════ */
.trainer-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  margin-bottom: 12px;
}
.trainer-avatar {
  width: 48px; height: 48px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--violet-500), var(--blue-500));
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.trainer-info { flex: 1; min-width: 0; }
.trainer-name { font-size: 15px; font-weight: 600; }
.trainer-role { font-size: 12px; color: var(--muted); }
.trainer-status { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-500); }
.status-dot.pending { background: var(--amber-500); }

/* ══════════════ NUTRITION LOG ══════════════ */
.food-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.food-entry:last-child { border-bottom: none; }
.food-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--slate-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.energy-mode .food-icon { background: var(--energy-surface); }
.food-info { flex: 1; min-width: 0; }
.food-name { font-size: 14px; font-weight: 600; }
.food-macros { font-size: 12px; color: var(--muted); margin-top: 2px; }
.food-cal { font-size: 15px; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ══════════════ SETTINGS ══════════════ */
.settings-section { margin-bottom: 28px; }
.settings-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
  padding: 0 4px;
}
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: all var(--transition);
}
.settings-item:hover { border-color: var(--emerald-400); }
.settings-item-left { display: flex; align-items: center; gap: 14px; }
.settings-item-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-lg);
  background: var(--slate-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.energy-mode .settings-item-icon { background: var(--energy-card); }
.settings-item-text { font-size: 15px; font-weight: 500; }
.settings-item-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-chevron { color: var(--muted); font-size: 14px; }

/* ══════════════ MODALS ══════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-sheet {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  transform: translateY(100%);
  transition: transform 0.35s var(--ease);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
  width: 40px; height: 4px;
  border-radius: var(--r-full);
  background: var(--slate-300);
  margin: 0 auto 20px;
}
.energy-mode .modal-handle { background: var(--energy-border); }
.energy-mode .modal-sheet { background: var(--energy-surface); }

/* ══════════════ TOASTS ══════════════ */
.toast-container {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--slate-900);
  color: white;
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: toastIn 0.3s var(--ease) forwards;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}
.toast.success { background: var(--emerald-600); }
.toast.error   { background: var(--rose-500); }
.toast.warning { background: var(--amber-500); color: #1c0a00; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* ══════════════ ANIMATIONS ══════════════ */
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse   { 0%,100%{transform:scale(1);} 50%{transform:scale(1.05);} }
@keyframes spin    { from{transform:rotate(0deg);} to{transform:rotate(360deg);} }
@keyframes glow    { 0%,100%{box-shadow:0 0 15px rgba(0,245,160,0.3);} 50%{box-shadow:0 0 40px rgba(0,245,160,0.7);} }

.animate-fade-in  { animation: fadeIn  0.4s var(--ease) both; }
.animate-slide-up { animation: slideUp 0.4s var(--ease) both; }
.animate-pulse    { animation: pulse 2s infinite; }
.animate-spin     { animation: spin 1s linear infinite; }
.animate-glow     { animation: glow 2s infinite; }

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ══════════════ LOADING ══════════════ */
.loader {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loader-lg { width: 36px; height: 36px; border-width: 3px; }

/* ══════════════ EMPTY STATE ══════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  gap: 16px;
}
.empty-icon { font-size: 48px; opacity: 0.5; }
.empty-title { font-size: 18px; font-weight: 700; }
.empty-msg { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 280px; }

/* ══════════════ UTILITY ══════════════ */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-1     { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.p-20   { padding: 20px; }
.px-20  { padding-left: 20px; padding-right: 20px; }
.py-16  { padding-top: 16px; padding-bottom: 16px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.mb-24  { margin-bottom: 24px; }
.mt-auto { margin-top: auto; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.overflow-hidden { overflow: hidden; }
.rounded-full { border-radius: var(--r-full); }
.relative { position: relative; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ══════════════ RESPONSIVE ══════════════ */
@media (min-width: 640px) {
  .pricing-grid { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .pricing-card { max-width: 320px; flex: 1; min-width: 280px; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .app-nav { display: none; }
  .scroll-content { padding-bottom: 24px; }
  .desktop-sidebar { display: flex !important; }
  .app-layout { display: flex; }
  .sidebar-nav {
    width: 240px;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
    overflow-y: auto;
  }
  .main-content { margin-left: 240px; }
}

/* ══════════════ SCROLLBAR ══════════════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }
.energy-mode ::-webkit-scrollbar-thumb { background: var(--energy-border); }

/* ══════════════ THEME TRANSITIONS ══════════════ */
body, .card, .form-input, .form-select, .app-nav, .page-header,
.exercise-card, .insight-card, .metric-card, .modal-sheet {
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}

/* ═════════════════════════════════════════════════════════════════════════════════
   ▓▓▓ STAGE 3 / PHASE 1 — BRASS STUDIO COMPONENT OVERRIDES ▓▓▓
   These rules sit at the END of the file so they win cascade order without
   needing to refactor legacy selectors. Editorial luxury fitness aesthetic.
   ═════════════════════════════════════════════════════════════════════════════════ */

/* ── Scrollbar in brass tones ─────────────────────────────────────────────────────── */
::-webkit-scrollbar-thumb { background: var(--border-rule) !important; border-radius: 2px !important; }
::-webkit-scrollbar-thumb:hover { background: var(--brass-muted) !important; }

/* ── Selection ────────────────────────────────────────────────────────────────────── */
::selection { background: var(--brass); color: var(--bg-primary); }
::-moz-selection { background: var(--brass); color: var(--bg-primary); }

/* ── Base body refinements ────────────────────────────────────────────────────────── */
body {
  background: var(--bg-primary);
  color: var(--text-bone);
  font-feature-settings: 'ss01', 'cv11', 'tnum';
  letter-spacing: -0.005em;
}

/* ── Editorial typography utilities ───────────────────────────────────────────────── */
.bs-eyebrow {
  font-family: var(--font-caps);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--brass);
  display: inline-block;
}

.bs-eyebrow-muted {
  font-family: var(--font-caps);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.bs-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--text-bone);
}

.bs-display-italic { font-style: italic; font-weight: 400; }

.bs-metric {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum', 'zero';
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-bone);
}

.bs-divider {
  height: 1px;
  background: var(--border-subtle);
  border: none;
  margin: 32px 0;
}

.bs-divider-brass {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--brass-muted) 30%, var(--brass-muted) 70%, transparent 100%);
  border: none;
  margin: 24px 0;
}

/* ── Heading overrides for the whole app ──────────────────────────────────────────── */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--text-bone);
}

h2, .h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 3.5vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-bone);
}

h3, .h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-bone);
}

h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-bone);
}

/* ── Button system (Brass Studio) ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 28px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--brass);
  color: var(--bg-primary);
  border-color: var(--brass);
}
.btn-primary:hover {
  background: var(--brass-hover);
  border-color: var(--brass-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--brass-glow);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: var(--brass-muted); border-color: var(--brass-muted); color: var(--text-tertiary); cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary, .btn-outline {
  background: transparent;
  color: var(--text-bone);
  border-color: var(--border-rule);
}
.btn-secondary:hover, .btn-outline:hover {
  border-color: var(--brass);
  color: var(--brass);
  background: var(--brass-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted-bone);
  border-color: transparent;
  height: 44px;
  padding: 0 16px;
}
.btn-ghost:hover { color: var(--text-bone); background: var(--bg-elevated); }

.btn-danger {
  background: transparent;
  color: var(--dust-burgundy);
  border-color: var(--dust-burgundy-deep);
}
.btn-danger:hover { background: var(--dust-burgundy); color: var(--text-bone); border-color: var(--dust-burgundy); }

.btn-sm { height: 38px; padding: 0 16px; font-size: 11px; }
.btn-lg { height: 60px; padding: 0 36px; font-size: 14px; }
.btn-full { width: 100%; }
.btn-icon { padding: 0; width: 44px; height: 44px; gap: 0; }

/* Legacy emerald button class re-skinned */
.btn-emerald { background: var(--brass); color: var(--bg-primary); border-color: var(--brass); }
.btn-emerald:hover { background: var(--brass-hover); }

/* ── Card system ──────────────────────────────────────────────────────────────────── */
.card, .insight-card, .metric-card, .exercise-card, .stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: none;
}

.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border-rule);
  border-radius: var(--r-lg);
  padding: 28px;
}

.card-recessed {
  background: var(--bg-recessed);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 20px;
}

.card-brass {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, #1a1510 100%);
  border: 1px solid var(--brass-muted);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative;
}
.card-brass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}

.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-bone);
  margin-bottom: 4px;
}

.card-subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted-bone);
  letter-spacing: 0;
}

/* ── Inputs ──────────────────────────────────────────────────────────────────────── */
.form-input, .form-select, .form-textarea, input[type="text"], input[type="email"],
input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--bg-recessed);
  border: 1px solid var(--border-rule);
  border-radius: var(--r-md);
  color: var(--text-bone);
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: all 0.2s var(--ease);
}

.form-textarea, textarea { height: auto; min-height: 100px; padding: 14px 16px; line-height: 1.6; resize: vertical; }

.form-input:focus, .form-select:focus, .form-textarea:focus,
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brass);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--brass-glow);
}

.form-input::placeholder, input::placeholder, textarea::placeholder {
  color: var(--text-tertiary);
  font-style: italic;
}

.form-label, label {
  display: block;
  font-family: var(--font-caps);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted-bone);
  margin-bottom: 8px;
}

/* Checkboxes — brass accent */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brass);
  cursor: pointer;
}

/* ── Chip / Tag selectors ─────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-rule);
  border-radius: var(--r-full);
  color: var(--text-muted-bone);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.chip:hover { color: var(--text-bone); border-color: var(--text-tertiary); }
.chip.selected, .chip.active {
  background: var(--brass);
  color: var(--bg-primary);
  border-color: var(--brass);
  font-weight: 600;
}

/* ── Toggle switches re-skinned ───────────────────────────────────────────────────── */
.toggle, .toggle-switch {
  position: relative;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.toggle input, .toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-rule);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  left: 3px; top: 3px;
  background: var(--text-bone);
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.toggle input:checked + .toggle-slider,
.toggle-switch input:checked + .toggle-slider { background: var(--brass); }
.toggle input:checked + .toggle-slider::before,
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ── Navigation (top + bottom + sidebar) ──────────────────────────────────────────── */
.app-nav, .nav-bar, .top-nav, .bottom-nav {
  background: var(--bg-translucent) !important;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-color: var(--border-subtle) !important;
}

.nav-item, .nav-link {
  color: var(--text-tertiary);
  font-family: var(--font-caps);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  transition: color 0.2s var(--ease);
}
.nav-item.active, .nav-link.active, .nav-item:hover, .nav-link:hover {
  color: var(--brass);
}

/* ── Page header ──────────────────────────────────────────────────────────────────── */
.page-header {
  background: var(--bg-primary) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
}

/* ── Modals ───────────────────────────────────────────────────────────────────────── */
.modal-backdrop, .modal-overlay {
  background: rgba(7, 7, 7, 0.85) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal, .modal-content, .modal-sheet {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-rule) !important;
  border-radius: var(--r-lg) !important;
  color: var(--text-bone) !important;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}

.modal-header { border-bottom: 1px solid var(--border-subtle); padding-bottom: 16px; margin-bottom: 20px; }
.modal-title { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -0.02em; }

/* ── Toasts ───────────────────────────────────────────────────────────────────────── */
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-rule);
  border-left: 3px solid var(--brass);
  color: var(--text-bone);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.toast.success { border-left-color: var(--sage); }
.toast.error, .toast.danger { border-left-color: var(--dust-burgundy); }
.toast.warning { border-left-color: var(--aged-gold); }

/* ── Badges ───────────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-rule);
  border-radius: var(--r-sm);
  font-family: var(--font-caps);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted-bone);
}
.badge-brass { background: var(--brass); color: var(--bg-primary); border-color: var(--brass); }
.badge-glp1 { background: var(--brass-glow); color: var(--brass); border-color: var(--brass-muted); }
.badge-sage { background: transparent; color: var(--sage); border-color: var(--sage-deep); }
.badge-burgundy { background: transparent; color: var(--dust-burgundy); border-color: var(--dust-burgundy-deep); }

/* ── Landing / Hero (Brass Studio editorial) ──────────────────────────────────────── */
.landing, #page-landing {
  background: var(--bg-primary);
  color: var(--text-bone);
  min-height: 100vh;
}

.landing-hero, .hero {
  padding: 64px 24px 48px;
  text-align: left;
  max-width: 1200px;
  margin: 0 auto;
}

.landing-hero h1, .hero h1, .hero-title {
  font-family: var(--font-display) !important;
  font-weight: 400 !important;
  font-size: clamp(48px, 9vw, 96px) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.035em !important;
  color: var(--text-bone) !important;
  margin: 24px 0 !important;
  background: none !important;
  -webkit-text-fill-color: var(--text-bone) !important;
}

.landing-hero h1 .italic, .hero h1 em, .hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--brass);
}

.landing-hero .subtitle, .hero-subtitle, .hero p {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted-bone);
  max-width: 540px;
  margin: 0 0 36px;
  letter-spacing: -0.005em;
}

.landing-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--brass);
}

/* ── Pricing/plan cards ───────────────────────────────────────────────────────────── */
.plan-card, .pricing-card {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--r-lg) !important;
  padding: 32px 28px !important;
}
.plan-card.featured, .pricing-card.featured, .plan-card.recommended {
  border-color: var(--brass) !important;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, #1a1510 100%) !important;
  position: relative;
}
.plan-card .price, .pricing-card .price {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 48px;
  letter-spacing: -0.025em;
  color: var(--text-bone);
}

/* ── Metric / data tiles ──────────────────────────────────────────────────────────── */
.metric-value, .stat-value, .big-number {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: var(--text-bone);
  font-feature-settings: 'tnum', 'zero';
}
.metric-label, .stat-label {
  font-family: var(--font-caps);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.metric-delta {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.metric-delta.positive { color: var(--sage); }
.metric-delta.negative { color: var(--dust-burgundy); }

/* ── Tabs ────────────────────────────────────────────────────────────────────────── */
.tab-bar, .tab-list, .tabs {
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 4px;
}
.tab, .tab-button {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 16px;
  color: var(--text-tertiary);
  font-family: var(--font-caps);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.tab:hover, .tab-button:hover { color: var(--text-bone); }
.tab.active, .tab-button.active {
  color: var(--brass);
  border-bottom-color: var(--brass);
}

/* ── Progress bars ────────────────────────────────────────────────────────────────── */
.progress-bar, .progress {
  background: var(--bg-recessed);
  border-radius: var(--r-full);
  overflow: hidden;
  height: 4px;
}
.progress-fill, .progress > * {
  background: var(--brass) !important;
  height: 100%;
  transition: width 0.4s var(--ease);
}

/* ── Onboarding ───────────────────────────────────────────────────────────────────── */
#page-onboarding { background: var(--bg-primary); color: var(--text-bone); }
.onboarding-progress { background: var(--border-subtle); }
.onboarding-progress-fill { background: var(--brass); }
.onboarding-step-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--text-bone);
}

/* ── Workout / exercise cards ─────────────────────────────────────────────────────── */
.exercise-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  transition: all 0.2s var(--ease);
}
.exercise-card:hover { border-color: var(--brass-muted); transform: translateY(-2px); }
.exercise-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.015em;
  color: var(--text-bone);
}

/* ── GLP-1 Hub specific ──────────────────────────────────────────────────────────── */
.glp1-hub-header, .glp1-status-card {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, #1a1510 100%) !important;
  border: 1px solid var(--brass-muted) !important;
  color: var(--text-bone) !important;
}

/* ── Footer ──────────────────────────────────────────────────────────────────────── */
.app-footer, footer {
  border-top: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0;
}
.app-footer a, footer a {
  color: var(--text-muted-bone);
  transition: color 0.2s var(--ease);
}
.app-footer a:hover, footer a:hover { color: var(--brass); }

/* ── Focus visible (accessibility) ────────────────────────────────────────────────── */
*:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible { outline-offset: 3px; }

/* ── Loaders ─────────────────────────────────────────────────────────────────────── */
.loader, .spinner {
  border: 2px solid var(--border-subtle);
  border-top-color: var(--brass);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: bs-spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes bs-spin { to { transform: rotate(360deg); } }

/* ── Legal pages ──────────────────────────────────────────────────────────────────── */
.legal-doc {
  font-family: var(--font-body);
  color: var(--text-muted-bone);
  line-height: 1.75;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}
.legal-doc h1, .legal-doc h2, .legal-doc h3 { color: var(--text-bone); margin-top: 32px; }
.legal-doc h1 { font-size: 36px; }
.legal-doc strong { color: var(--text-bone); }
.legal-inline-link { color: var(--brass); }
.legal-inline-link:hover { color: var(--brass-hover); }
.required { color: var(--dust-burgundy); }

/* ── Reduced motion ──────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Small screen refinements ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .landing-hero, .hero { padding: 48px 20px 32px; }
  .btn { font-size: 12px; height: 48px; padding: 0 20px; }
  .btn-lg { height: 56px; padding: 0 28px; }
  .card, .insight-card, .metric-card { padding: 20px; }
  .metric-value, .stat-value, .big-number { font-size: 28px; }
}

/* ── End of Brass Studio overrides ────────────────────────────────────────────────── */

/* ═════════════════════════════════════════════════════════════════════════════════
   ▓▓▓ STAGE 3 / PHASE 1 HOT-FIX — Neutralize legacy emerald glow ▓▓▓
   The old landing page used .btn-energy, .hero-grid, .hero-glow, .hero-badge,
   and a teal/emerald .landing-hero gradient. Force them to Brass Studio.
   ═════════════════════════════════════════════════════════════════════════════════ */

.landing-hero {
  background: var(--bg-primary) !important;
  min-height: auto !important;
  display: block !important;
  text-align: left !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  overflow: visible !important;
}

.hero-grid, .hero-glow, .hero-bg-photo {
  display: none !important;
  background: none !important;
  background-image: none !important;
}

.hero-badge {
  background: transparent !important;
  border: none !important;
  color: var(--brass) !important;
  padding: 0 !important;
  font-family: var(--font-caps) !important;
  font-size: 10px !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  display: none !important; /* hidden in favor of new .bs-eyebrow */
}

/* btn-energy → re-skin to Brass primary */
.btn-energy, .btn.btn-energy {
  background: var(--brass) !important;
  background-image: none !important;
  color: var(--bg-primary) !important;
  border: 1px solid var(--brass) !important;
  box-shadow: none !important;
  font-weight: 600 !important;
  font-family: var(--font-body) !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
}
.btn-energy:hover, .btn.btn-energy:hover {
  background: var(--brass-hover) !important;
  background-image: none !important;
  border-color: var(--brass-hover) !important;
  box-shadow: 0 8px 24px var(--brass-glow) !important;
  transform: translateY(-1px) !important;
}

/* btn-primary legacy shadow → remove green glow */
.btn-primary {
  background: var(--brass) !important;
  background-image: none !important;
  color: var(--bg-primary) !important;
  border: 1px solid var(--brass) !important;
  box-shadow: none !important;
}
.btn-primary:hover {
  background: var(--brass-hover) !important;
  border-color: var(--brass-hover) !important;
  box-shadow: 0 8px 24px var(--brass-glow) !important;
}

/* Highlight span inside hero (old emerald glow) */
.hero-title .highlight,
.hero-title .italic {
  background: none !important;
  -webkit-text-fill-color: var(--brass) !important;
  color: var(--brass) !important;
  font-style: italic !important;
}

/* Hero CTA group — left-align in editorial layout */
.hero-cta-group {
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
}

/* Hero stats legacy strip → editorial */
.hero-stats {
  border-color: var(--border-subtle) !important;
}
.hero-stat-num {
  font-family: var(--font-mono) !important;
  color: var(--brass) !important;
  background: none !important;
  -webkit-text-fill-color: var(--brass) !important;
}
.hero-stat-label {
  font-family: var(--font-caps) !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  color: var(--text-tertiary) !important;
}

/* Incentive banner (signup) — kill legacy emerald */
.incentive-banner {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, #1a1510 100%) !important;
  border: 1px solid var(--brass-muted) !important;
  color: var(--text-bone) !important;
}
.incentive-icon i { color: var(--brass) !important; }
.incentive-text { color: var(--text-muted-bone) !important; }
.incentive-text strong { color: var(--text-bone) !important; }

/* Required asterisk */
.required { color: var(--dust-burgundy) !important; }

/* Header logo (legacy class still used some places) → brass wordmark */
.header-logo {
  font-family: var(--font-display) !important;
  font-style: italic !important;
  font-weight: 500 !important;
  color: var(--brass) !important;
  background: none !important;
  -webkit-text-fill-color: var(--brass) !important;
  letter-spacing: -0.02em !important;
}

/* Pricing grid legacy → kill light bg behind editorial cards */
.pricing-grid {
  background: transparent !important;
}
.pricing-card, .pricing-card.featured {
  background: var(--bg-elevated) !important;
  background-image: none !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-bone) !important;
}
.pricing-card.featured {
  border-color: var(--brass) !important;
}
.pricing-tier, .pricing-name, .pricing-price, .pricing-period { color: var(--text-bone) !important; }
.pricing-check { color: var(--brass) !important; }
.pricing-x { color: var(--text-tertiary) !important; }
.pricing-popular {
  background: var(--brass) !important;
  color: var(--bg-primary) !important;
  font-family: var(--font-caps) !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  font-size: 10px !important;
}

/* Card hover legacy */
.card-hover:hover {
  border-color: var(--brass-muted) !important;
  transform: translateY(-2px) !important;
  box-shadow: none !important;
}

/* Badge violet legacy → brass */
.badge-violet, .badge.badge-violet {
  background: var(--brass) !important;
  color: var(--bg-primary) !important;
  border-color: var(--brass) !important;
}

/* Divider legacy line */
.divider {
  background: var(--border-subtle) !important;
  height: 1px !important;
}

/* End of hot-fix */

/* ═════════════════════════════════════════════════════════════════════════════════
   ▓▓▓ STAGE 3 / PHASE 2 — Inner page Brass Studio overrides ▓▓▓
   Dashboard, GLP-1 Hub, Workouts — neutralize all remaining emerald/violet.
   ═════════════════════════════════════════════════════════════════════════════════ */

/* ── Insight card / icon — was pastel emerald/yellow/blue/violet ──────────────────── */
.insight-card {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-subtle) !important;
  border-left: 2px solid var(--brass-muted) !important;
  border-radius: var(--r-md) !important;
  padding: 18px 20px !important;
  margin-bottom: 12px !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
}
.insight-icon {
  width: 36px !important;
  height: 36px !important;
  border-radius: var(--r-sm) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  background: var(--brass-glow) !important;
  color: var(--brass) !important;
  font-size: 14px !important;
}
.insight-icon.success, .insight-icon.milestone {
  background: rgba(139,174,122,0.12) !important;
  color: var(--sage) !important;
}
.insight-icon.warning {
  background: rgba(201,160,80,0.12) !important;
  color: var(--aged-gold) !important;
}
.insight-icon.danger, .insight-icon.error {
  background: rgba(155,77,77,0.12) !important;
  color: var(--dust-burgundy) !important;
}
.insight-icon.info, .insight-icon.action {
  background: var(--brass-glow) !important;
  color: var(--brass) !important;
}
.insight-body, .insight-content { flex: 1; min-width: 0; }
.insight-title {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  font-size: 16px !important;
  letter-spacing: -0.015em !important;
  color: var(--text-bone) !important;
  margin-bottom: 6px !important;
}
.insight-msg, .insight-body {
  font-family: var(--font-body) !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  color: var(--text-muted-bone) !important;
}
.insight-action {
  font-family: var(--font-caps) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  color: var(--brass) !important;
  margin-top: 10px !important;
}

/* ── Tab-btn legacy → match Brass .tab ────────────────────────────────────────────── */
.tab-bar {
  border-bottom: 1px solid var(--border-subtle) !important;
  background: transparent !important;
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}
.tab-btn {
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  padding: 12px 16px !important;
  color: var(--text-tertiary) !important;
  font-family: var(--font-caps) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: none !important;
}
.tab-btn:hover { color: var(--text-bone) !important; }
.tab-btn.active {
  color: var(--brass) !important;
  border-bottom-color: var(--brass) !important;
  background: transparent !important;
}

/* ── Metric card legacy → editorial ───────────────────────────────────────────────── */
.metric-card {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--r-sm) !important;
  padding: 18px 16px !important;
}
.metric-icon { display: none !important; }
.metric-value {
  font-family: var(--font-mono) !important;
  font-weight: 500 !important;
  font-size: 24px !important;
  letter-spacing: -0.02em !important;
  color: var(--text-bone) !important;
}
.metric-unit {
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  color: var(--text-tertiary) !important;
  margin-left: 4px;
}
.metric-label {
  font-family: var(--font-caps) !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  color: var(--text-tertiary) !important;
  margin-bottom: 10px !important;
}
.metric-trend.up { color: var(--sage) !important; }
.metric-trend.down { color: var(--dust-burgundy) !important; }
.metric-trend.neutral { color: var(--text-tertiary) !important; }

/* ── Card header legacy ──────────────────────────────────────────────────────────── */
.card-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 16px !important;
}

/* ── Badge variants legacy → Brass Studio ─────────────────────────────────────────── */
.badge-green, .badge.badge-green {
  background: transparent !important;
  color: var(--sage) !important;
  border: 1px solid var(--sage-deep) !important;
  font-family: var(--font-caps) !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  font-size: 10px !important;
}
.badge-violet, .badge.badge-violet {
  background: var(--brass) !important;
  color: var(--bg-primary) !important;
  border-color: var(--brass) !important;
}
.badge-amber, .badge.badge-amber {
  background: transparent !important;
  color: var(--aged-gold) !important;
  border: 1px solid var(--aged-gold) !important;
}

/* ── Header avatar — was emerald gradient ─────────────────────────────────────────── */
.header-avatar {
  background: var(--bg-elevated) !important;
  background-image: none !important;
  color: var(--brass) !important;
  border: 1px solid var(--border-rule) !important;
  font-family: var(--font-display) !important;
  font-style: italic !important;
  font-weight: 500 !important;
}

/* ── Input suffix (lbs, kg, etc.) ─────────────────────────────────────────────────── */
.input-suffix {
  color: var(--text-tertiary) !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
}

/* ── Page title / subtitle ────────────────────────────────────────────────────────── */
.page-title {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  font-size: 22px !important;
  letter-spacing: -0.02em !important;
  color: var(--text-bone) !important;
}
.page-subtitle {
  font-family: var(--font-body) !important;
  font-size: 13px !important;
  color: var(--text-muted-bone) !important;
}

/* ── Bottom-nav active emerald → brass ───────────────────────────────────────────── */
.nav-item.active i, .nav-item.active span,
.nav-link.active i, .nav-link.active span {
  color: var(--brass) !important;
}

/* ── Progress bar legacy fills → brass ────────────────────────────────────────────── */
.progress-bar {
  background: var(--bg-recessed) !important;
  height: 2px !important;
  border-radius: 1px !important;
  overflow: hidden;
}

/* ── Page content padding for hub ─────────────────────────────────────────────────── */
.page-content {
  padding: 0 20px 90px;
  background: var(--bg-primary);
  min-height: 100vh;
}

/* End of Phase 2 inner-page overrides */

/* ═════════════════════════════════════════════════════════════════════════════════
   ▓▓▓ STAGE 3 / PHASE 3 — Final polish (Onboarding, Settings, Modals, Charts) ▓▓▓
   ═════════════════════════════════════════════════════════════════════════════════ */

/* ── Onboarding chip groups & inputs ─────────────────────────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }

/* Multi-chip selectable (used in onboarding) */
.chip-multi {
  padding: 10px 18px !important;
  border: 1px solid var(--border-rule) !important;
  border-radius: var(--r-full) !important;
  background: transparent !important;
  color: var(--text-muted-bone) !important;
  font-family: var(--font-body) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.chip-multi:hover { border-color: var(--text-tertiary) !important; color: var(--text-bone) !important; }
.chip-multi.selected, .chip-multi.active {
  background: var(--brass) !important;
  color: var(--bg-primary) !important;
  border-color: var(--brass) !important;
  font-weight: 600 !important;
}

/* Form group spacing */
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Input group with suffix (lbs, ft, in, etc.) */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-group .form-input { padding-right: 56px; }
.input-group .input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-tertiary) !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  font-weight: 500;
}

/* ── Legacy onboarding step dot — kept for fallback ──────────────────────────────── */
.onboarding-step-dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: var(--border-rule);
  transition: all 0.3s var(--ease);
}
.onboarding-step-dot.done { background: var(--brass) !important; }
.onboarding-step-dot.active {
  background: var(--brass) !important;
  width: 24px !important;
}
.onboarding-wrap { background: var(--bg-primary); color: var(--text-bone); min-height: 100vh; }
.onboarding-title { font-family: var(--font-display); font-weight: 400; color: var(--text-bone) !important; letter-spacing: -0.02em; }
.onboarding-subtitle { color: var(--text-muted-bone) !important; }
.onboarding-step-label { color: var(--brass) !important; font-family: var(--font-caps); font-size: 11px; font-weight: 600; letter-spacing: var(--tracking-caps); text-transform: uppercase; }

/* ── Body comp chart placeholder fix ──────────────────────────────────────────────── */
#body-comp-chart, #weight-chart { background: transparent !important; }

/* ── Modal polish ─────────────────────────────────────────────────────────────────── */
.modal {
  max-width: 480px !important;
  margin: 0 auto !important;
}
.modal-sheet, .modal-content {
  padding: 28px !important;
}

/* Modal close button */
.modal-close, button[aria-label="Close"] {
  color: var(--text-tertiary) !important;
  background: transparent !important;
  border: none !important;
  font-size: 18px !important;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.modal-close:hover, button[aria-label="Close"]:hover { color: var(--text-bone) !important; }

/* ── Settings page sub-section card titles ───────────────────────────────────────── */
.settings-section { padding: 24px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); margin-bottom: 16px; }
.settings-section h3, .settings-section .card-title {
  font-family: var(--font-caps) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  color: var(--brass) !important;
  margin-bottom: 16px !important;
}

/* ── Active workout / energy-mode overrides (Brass Studio dark) ───────────────────── */
.energy-mode {
  background: var(--bg-primary) !important;
  color: var(--text-bone) !important;
}
.energy-mode body, body.energy-mode { background: var(--bg-primary) !important; }
.energy-mode .card,
.energy-mode .insight-card,
.energy-mode .metric-card {
  background: var(--bg-elevated) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-bone) !important;
}
.energy-mode .btn-primary {
  background: var(--brass) !important;
  color: var(--bg-primary) !important;
  border-color: var(--brass) !important;
}
.energy-mode .btn-secondary, .energy-mode .btn-outline {
  background: transparent !important;
  border-color: var(--border-rule) !important;
  color: var(--text-bone) !important;
}

/* ── Header logo "Form" wordmark cross-page ──────────────────────────────────────── */
.page-header .header-logo,
.page-header [class*="logo"] {
  font-family: var(--font-display) !important;
  font-style: italic !important;
  font-weight: 500 !important;
  color: var(--brass) !important;
  background: none !important;
  -webkit-text-fill-color: var(--brass) !important;
}

/* ── Badge variants used by Progress ──────────────────────────────────────────────── */
.badge-success { color: var(--sage) !important; border-color: var(--sage-deep) !important; background: transparent !important; }
.badge-warning { color: var(--aged-gold) !important; border-color: var(--aged-gold) !important; background: transparent !important; }
.badge-slate, .badge-primary {
  color: var(--text-muted-bone) !important;
  border-color: var(--border-rule) !important;
  background: transparent !important;
}

/* ── Insight glp1 variant ─────────────────────────────────────────────────────────── */
.insight-glp1 {
  border-left-color: var(--brass) !important;
}

/* ── Nav badge for GLP-1 / trainer ──────────────────────────────────────────────── */
.nav-glp1 { color: var(--brass) !important; }

/* ── Fix any leftover emerald-50 / emerald-100 backgrounds ───────────────────────── */
[style*="rgba(16,185,129"], [style*="rgba(99,102,241"], [style*="rgba(139,92,246"],
[style*="rgba(0,245,160"], [style*="#10b981"], [style*="#6366f1"], [style*="#8b5cf6"] {
  /* These are inline; we can't override colors directly, but we can ensure the
     containing element looks right. No-op rule kept for documentation. */
}

/* ── Workout-active "energy mode" inline overrides ───────────────────────────────── */
.energy-mode [style*="var(--energy-accent)"],
[style*="--energy-accent"] { color: var(--brass) !important; }
.energy-mode [style*="var(--energy-bg)"] { background: var(--bg-primary) !important; }
.energy-mode [style*="var(--energy-muted)"] { color: var(--text-muted-bone) !important; }

/* End of Phase 3 polish */

/* ═════════════════════════════════════════════════════════════════════════════════
   ▓▓▓ TWEAKS PATCH — Flatpickr dark theme + final inline emerald scrub ▓▓▓
   ═════════════════════════════════════════════════════════════════════════════════ */

/* ── Flatpickr calendar — Brass Studio dark theme ─────────────────────────────────── */
.flatpickr-calendar {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-rule) !important;
  border-radius: var(--r-md) !important;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6) !important;
  color: var(--text-bone) !important;
  font-family: var(--font-body) !important;
}
.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowBottom:before { border-bottom-color: var(--border-rule) !important; border-top-color: var(--border-rule) !important; }
.flatpickr-calendar.arrowTop:after,
.flatpickr-calendar.arrowBottom:after { border-bottom-color: var(--bg-elevated) !important; border-top-color: var(--bg-elevated) !important; }

.flatpickr-months {
  background: var(--bg-elevated) !important;
  border-bottom: 1px solid var(--border-subtle);
}
.flatpickr-month {
  background: transparent !important;
  color: var(--text-bone) !important;
  height: 48px !important;
}
.flatpickr-current-month {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  font-size: 16px !important;
  color: var(--text-bone) !important;
  padding-top: 6px !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
  background: var(--bg-elevated) !important;
  color: var(--text-bone) !important;
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
  background: var(--bg-elevated) !important;
  color: var(--text-bone) !important;
}
.flatpickr-current-month input.cur-year {
  color: var(--text-bone) !important;
  font-family: var(--font-mono) !important;
  font-weight: 500 !important;
}
.flatpickr-current-month .numInputWrapper span.arrowUp:after { border-bottom-color: var(--brass) !important; }
.flatpickr-current-month .numInputWrapper span.arrowDown:after { border-top-color: var(--brass) !important; }

.flatpickr-prev-month, .flatpickr-next-month {
  color: var(--text-muted-bone) !important;
  fill: var(--text-muted-bone) !important;
  padding: 12px !important;
}
.flatpickr-prev-month:hover, .flatpickr-next-month:hover {
  color: var(--brass) !important;
  fill: var(--brass) !important;
}
.flatpickr-prev-month svg, .flatpickr-next-month svg { fill: currentColor !important; }

.flatpickr-weekdays {
  background: transparent !important;
  border-bottom: 1px solid var(--border-subtle);
}
.flatpickr-weekday {
  color: var(--text-tertiary) !important;
  font-family: var(--font-caps) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
}

.dayContainer { padding: 6px 0 !important; }
.flatpickr-day {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--text-bone) !important;
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  border-radius: var(--r-sm) !important;
  max-width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
}
.flatpickr-day:hover {
  background: var(--brass-glow) !important;
  border-color: var(--brass-muted) !important;
  color: var(--brass) !important;
}
.flatpickr-day.today {
  border-color: var(--brass-muted) !important;
  color: var(--brass) !important;
  font-weight: 600 !important;
}
.flatpickr-day.today:hover { background: var(--brass-glow) !important; }
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--brass) !important;
  border-color: var(--brass) !important;
  color: var(--bg-primary) !important;
  font-weight: 600 !important;
}
.flatpickr-day.disabled,
.flatpickr-day.disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--text-tertiary) !important;
  background: transparent !important;
  border-color: transparent !important;
}
.flatpickr-day.disabled:hover { cursor: not-allowed !important; }

.flatpickr-calendar.hasTime .flatpickr-time { border-top: 1px solid var(--border-subtle) !important; }
.flatpickr-time { background: var(--bg-recessed) !important; }
.flatpickr-time input {
  color: var(--text-bone) !important;
  background: transparent !important;
  font-family: var(--font-mono) !important;
}

/* ── Severity preview dots (already inline, but legacy red emoji) ────────────────── */
/* No CSS needed — selectSeverity() rewritten in JS */

/* ── Workout active "energy-mode" lingering inline emerald/violet (force) ─────────── */
.energy-mode .badge-energy,
.badge.badge-energy {
  background: transparent !important;
  color: var(--brass) !important;
  border: 1px solid var(--brass-muted) !important;
  font-family: var(--font-caps) !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  font-size: 10px !important;
}

/* Animate-glow class — kill green glow */
@keyframes brass-glow {
  0%, 100% { box-shadow: 0 0 0 0 var(--brass-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}
.animate-glow {
  animation: brass-glow 2s ease-in-out infinite !important;
}

/* Exercise SVG wrapper backgrounds — was emerald-tinted */
.exercise-svg-wrap {
  background: var(--bg-elevated) !important;
  border-radius: var(--r-md) !important;
  border: 1px solid var(--border-subtle) !important;
  overflow: hidden;
}

/* Step list numbering pill */
.step-num {
  display: inline-flex;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brass-glow) !important;
  color: var(--brass) !important;
  align-items: center; justify-content: center;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  margin-right: 10px;
  flex-shrink: 0;
}
.exercise-steps { list-style: none; padding: 0; margin: 0 0 18px; }
.exercise-steps li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted-bone);
  line-height: 1.55;
}
.exercise-steps li:last-child { border-bottom: none; }

/* Mistakes section */
.mistakes-section {
  background: var(--bg-recessed) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--r-md) !important;
  padding: 18px !important;
  margin-bottom: 14px;
}
.mistakes-title {
  font-family: var(--font-caps) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: var(--tracking-caps) !important;
  text-transform: uppercase !important;
  color: var(--aged-gold) !important;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mistakes-title i { color: var(--aged-gold) !important; }
.mistake-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.mistake-item:last-child { border-bottom: none; }
.mistake-wrong {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--dust-burgundy) !important;
  margin-bottom: 4px;
}
.mistake-fix {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted-bone) !important;
  font-style: italic;
}

/* End tweaks */

/* ═══════════════════════════════════════════════════════════════════════════════════
 * EXERCISE PHOTO CYCLER (Brass Studio v3 photo set)
 * ──────────────────────────────────────────────────────────────────────────────────
 * Multi-frame keyframe animation for the top 10 exercises. Each cycler stacks
 * 2–3 frames absolutely; only the .is-active frame is visible. JS rotates the
 * class every 800ms. CSS transition handles the crossfade.
 * ═══════════════════════════════════════════════════════════════════════════════ */
.exercise-photo-cycler {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-secondary, #111);
  border-radius: 8px;
  overflow: hidden;
}
.exercise-photo-cycler img.exercise-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 280ms ease-in-out;
  pointer-events: none;
}
.exercise-photo-cycler img.exercise-frame.is-active {
  opacity: 1;
}
/* Subtle visual hint that the user can tap to pause. */
.exercise-photo-cycler::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(176, 141, 87, 0.10);  /* brass hairline */
  border-radius: 8px;
}
/* Paused state — show a small brass pause glyph in the corner. */
.exercise-photo-cycler[data-paused="true"]::before {
  content: '\f04c';   /* fa-pause (FontAwesome unicode) */
  font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', FontAwesome;
  font-weight: 900;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.7);
  color: var(--brass, #B08D57);
  border-radius: 50%;
  font-size: 10px;
  z-index: 2;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(176, 141, 87, 0.3);
}
/* Reduced-motion users: freeze on the first frame so we don't animate at all. */
@media (prefers-reduced-motion: reduce) {
  .exercise-photo-cycler img.exercise-frame {
    transition: none;
  }
  .exercise-photo-cycler img.exercise-frame:not(:first-child) {
    display: none;
  }
}
