/* ---------- Theme ----------
   Light and clean (white surfaces, soft grey-blue page) with a bright,
   confident blue accent. */
:root {
  color-scheme: light;
  --bg: #F5F7FB;
  --card: #FFFFFF;
  --card-raised: #EEF2F8;
  --border: #E3E8F0;
  --text: #0F172A;
  --text-2: #6B7280;
  --accent: #1E7BF2;
  --accent-bright: #4A9BFF;
  --accent-soft: rgba(30, 123, 242, 0.12);
  --on-accent: #FFFFFF;
  --green: #12B24A;
  --green-light: #4CCB6E;
  --gold: #FFD23F;
  --gold-text: #D49B00; /* readable gold for the word "Perfect" */
  --green-deep: #0A8F3A;
  --mint: #0FA39A;
  --orange: #E98300;
  --red: #E5484D;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --tabbar-h: 64px;
  --app-w: 430px;
}

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

html, body {
  background: #E9EDF3;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

/* The app is laid out as a phone-width column so it looks like an iPhone
   in the desktop preview and fills the screen on a real phone. */
.app {
  position: relative;
  max-width: var(--app-w);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}
.app.no-tabbar { padding-bottom: 0; }

.screen { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Icons ---------- */
.icon {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  user-select: none;
}

/* ---------- Headers ---------- */
.large-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.5px;
  padding: calc(env(safe-area-inset-top) + 20px) 16px 8px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.navbar-title { text-align: center; font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar-btn { display: flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; padding: 8px; }
.navbar-btn.right { justify-self: end; font-weight: 600; }

/* ---------- Cards & text ---------- */
.card { background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.card-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--text-2); }
/* Buttons styled like the SBD tag: solid red rectangle, bold white text. */
.tag-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tag-btn {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px; font-weight: 700; letter-spacing: 0.5px;
}
.tag-btn:active { opacity: 0.8; }

/* Large page title with a button on the far right. */
.title-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.title-bar .large-title { white-space: nowrap; padding-right: 0; }
.title-link { margin: 0 16px 14px 0; color: var(--accent); font-size: 18px; font-weight: 800; letter-spacing: -0.2px; }
.title-bar .tag-btn { margin: 0 16px 12px 0; padding: 7px 11px; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
@media (max-width: 359px) {
  .title-bar .large-title { font-size: 27px; }
  .title-bar .tag-btn { padding: 6px 9px; font-size: 13px; }
}

/* Premium page */
.premium-hero {
  border-radius: var(--r-lg);
  padding: 24px 20px;
  background: linear-gradient(135deg, #3D95FF 0%, #1E7BF2 55%, #0F5FD0 100%);
  border: none;
  color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(30, 123, 242, 0.25);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.premium-hero h2 { font-size: 24px; font-weight: 700; }
.premium-hero .sub { color: rgba(255, 255, 255, 0.78); }
.plans { display: flex; flex-direction: column; gap: 10px; }
.plan {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 16px; border-radius: var(--r-md);
  background: var(--card); border: 2px solid var(--border);
  color: var(--text-2);
}
.plan.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.plan .grow { flex: 1; min-width: 0; }
.plan-name { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 17px; font-weight: 600; }
.plan-name .badge { margin-left: 0; font-size: 11px; padding: 2px 7px; }
.plan-price { display: flex; flex-direction: column; align-items: flex-end; color: var(--text); }
.plan-price strong { font-size: 20px; }

/* Apple / Google sign-in buttons, styled per each company's guidelines. */
.social-buttons { display: flex; flex-direction: column; gap: 10px; }
/* Register / Login: the sign-in options are centred in the space above the
   main button, which stays pinned to the bottom of the screen. */
.auth-screen { min-height: calc(100dvh - 52px - 16px - env(safe-area-inset-top)); padding-bottom: calc(env(safe-area-inset-bottom) + 20px); }
.auth-layout { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.auth-center { flex: 1; display: flex; flex-direction: column; gap: 22px; }
/* A fixed, clear gap under the Apple / Google buttons; spare space goes below. */
.auth-center::before { content: ""; flex: none; height: 0; }
.auth-center::after { content: ""; flex: 1 1 0; }
.auth-intro { text-align: center; margin-top: 4px; }
.auth-actions { display: flex; flex-direction: column; gap: 12px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px; border-radius: var(--r-md);
  font-size: 17px; font-weight: 600;
}
.social-btn.apple { background: #000000; color: #FFFFFF; }
.social-btn.google { background: #FFFFFF; color: #1F1F1F; border: 1px solid #D5DBE3; }
.social-btn:disabled { opacity: 0.6; }
@media (max-height: 700px) {
  .auth-layout { gap: 12px; }
  .auth-center { gap: 10px; }
  .auth-center::before { height: 0; }
  .auth-center .card { gap: 10px; }
}
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.field input {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--card-raised);
  color: var(--text);
  font-size: 17px;
  outline: none;
}
.field input:focus { border-color: var(--accent); }
/* Referral code box on the last onboarding question. */
.referral-input {
  width: 100%; margin-top: 8px; padding: 16px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--card); color: var(--text);
  font-size: 18px; font-weight: 600; letter-spacing: 1px; outline: none;
}
.referral-input:focus { border-color: var(--accent); }
.referral-input::placeholder { font-weight: 400; letter-spacing: 0; color: var(--text-2); }
.password-input { position: relative; display: flex; }
.password-input input { flex: 1; min-width: 0; padding-right: 48px; }
.eye-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.eye-btn[aria-pressed="true"] { color: var(--accent); }
.form-error { display: flex; align-items: center; gap: 8px; color: var(--red); font-size: 15px; }
.form-notice { display: flex; align-items: center; gap: 8px; color: var(--green-deep); font-size: 15px; }
.btn:disabled { opacity: 0.6; }

.badge {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
}
.small { font-size: 13px; }
.sub { font-size: 15px; line-height: 1.4; }

.icon-tile {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

/* ---------- Home ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 20px;
  /* Bright blue gradient panel. */
  background: linear-gradient(135deg, #3D95FF 0%, #1E7BF2 55%, #0F5FD0 100%);
  border: none;
  color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(30, 123, 242, 0.25);
  display: flex; flex-direction: column; gap: 6px;
}
.hero h2 { font-size: 24px; font-weight: 700; }
.hero .sub { color: rgba(255, 255, 255, 0.78); }

.section-heading {
  font-size: 15px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 10px;
}
.section-heading::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muscle-card {
  position: relative;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px;
  height: 150px; display: flex; flex-direction: column; justify-content: flex-start;
  text-align: left; transition: transform 0.1s, border-color 0.2s;
  overflow: hidden;
}
/* Red stripe along the top edge, like the trim on a machine frame. */
.muscle-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); }
.muscle-card:active { transform: scale(0.97); border-color: var(--accent); }
.muscle-card h3 { font-size: 19px; font-weight: 700; margin-top: 10px; }
.muscle-card .chev { position: absolute; top: 14px; right: 12px; color: var(--text-2); }
/* Abs and calves: 70% of the height of the other cards, laid out side-on. */
.muscle-card.compact { height: 105px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; }
.muscle-card.compact h3 { margin-top: 0; }
.muscle-card.compact h3, .muscle-card.compact p { white-space: nowrap; }
.muscle-card.compact .chev { display: none; } /* too narrow for the arrow; the whole card is tappable */

.muscle-tile { background: var(--card-raised); overflow: hidden; }
.muscle-art { display: block; }
.muscle-art .body { fill: #DCE3EC; }
.muscle-art .mus { fill: #C3CDDA; stroke: #DCE3EC; stroke-width: 0.6; stroke-linejoin: round; }
/* The target muscle: red with a soft glow. */
.muscle-art .hl {
  fill: var(--accent); stroke: var(--accent-bright); stroke-width: 0.5; stroke-linejoin: round;
  filter: drop-shadow(0 0 1.6px rgba(30, 123, 242, 0.6));
}

.list-row.tappable { cursor: pointer; }
/* Name and stars side by side: long names wrap in their own column so the
   stars always stay directly to the right of the first line. */
.title-row { display: flex; align-items: center; gap: 6px; }
.title-row h4 { flex: 0 1 auto; min-width: 0; }
.stars { display: inline-flex; flex: none; gap: 0; color: #F5A524; white-space: nowrap; }
/* Exercise list rows: compact type so the name and its stars share one line. */
.exercise-row { gap: 12px; }
.exercise-row .stars { margin-left: auto; } /* stars line up on the right edge */
.list-row.exercise-row h4 { font-size: 15px; font-weight: 600; letter-spacing: -0.1px; }
.exercise-row p { font-size: 13px; margin-top: 2px; }
@media (max-width: 359px) {
  .list-row.exercise-row { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .list-row.exercise-row h4 { font-size: 14px; }
  .exercise-row .stars .icon { font-size: 12px !important; }
}
.list-row .chev { color: var(--text-2); }

/* ---------- Exercise detail ---------- */
.detail-header { display: flex; gap: 16px; align-items: center; }
.eyebrow { font-size: 15px; font-weight: 600; color: var(--accent); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check-row .icon { color: var(--accent); }
.step-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: var(--on-accent);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

.action-bar {
  /* Pinned to the bottom of the screen (exercise pages have no tab bar). */
  position: sticky; bottom: 0;
  margin: 0 -16px -16px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px; border-radius: var(--r-md);
  font-size: 17px; font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--card-raised); }
.btn input { display: none; }

/* ---------- Welcome ---------- */
.welcome {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(env(safe-area-inset-top) + 32px) 24px calc(env(safe-area-inset-bottom) + 24px);
  gap: 24px;
  background: radial-gradient(120% 60% at 50% 0%, rgba(30, 123, 242, 0.14), transparent 70%);
}
.welcome-art { display: flex; gap: 18px; justify-content: center; }
.welcome-copy { text-align: center; }
.welcome-copy h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 4px; }
.welcome-list { display: flex; flex-direction: column; gap: 12px; align-self: stretch; padding: 0 8px; }
.welcome-list .check-row { font-size: 16px; align-items: center; }
.welcome-actions { margin-top: auto; align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.btn.welcome-cta { font-size: 19px; padding: 18px; }
.welcome-link { font-size: 15px; color: var(--text-2); padding: 6px; }
.welcome-link span { color: var(--accent); font-weight: 600; }

/* ---------- Onboarding questions ---------- */
.onboarding {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 12px) 20px calc(env(safe-area-inset-bottom) + 24px);
  gap: 24px;
}
.onboarding-top { display: flex; align-items: center; gap: 10px; }
.onboarding-top .navbar-btn { padding: 4px; margin-left: -8px; }
.progress-track { flex: 1; height: 6px; border-radius: 3px; background: var(--card-raised); overflow: hidden; }
.progress-track .progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s ease; }
.step-count { white-space: nowrap; }
.onboarding-body { display: flex; flex-direction: column; gap: 8px; animation: fade 0.3s ease; }
.onboarding-body h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
.option-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px; border-radius: var(--r-md);
  background: var(--card); border: 2px solid var(--border);
  color: var(--text-2);
  transition: border-color 0.15s, background 0.15s;
}
.option.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.option-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.option-text strong { color: var(--text); font-size: 17px; font-weight: 600; }
.option-grid .option { flex-direction: column; justify-content: center; gap: 2px; padding: 18px 8px; text-align: center; }
.option-number { color: var(--text); font-size: 28px; font-weight: 700; }
.onboarding-actions { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.generating { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding-bottom: 60px; }
.generating h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
.generate-heading { display: flex; flex-direction: column; gap: 10px; }
.step-text.awaiting { animation: fade 0.4s ease, breathe 1.6s ease-in-out 0.4s infinite; }
.generate-bar { height: 12px; border-radius: 6px; background: var(--card-raised); overflow: hidden; }
.generate-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #8CC0FF, var(--accent));
  box-shadow: 0 0 12px rgba(30, 123, 242, 0.4);
}
.generate-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.generate-meta strong { font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---------- Demo video (boomerang) ---------- */
.demo-video {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--card-raised);
}
.demo-video canvas { display: block; width: 100%; height: 100%; }
.demo-video-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-2);
  background: repeating-linear-gradient(135deg, rgba(15, 23, 42, 0.035) 0 10px, transparent 10px 20px);
}

/* ---------- Analysing ---------- */
.analyzing { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px; text-align: center; }
.analyzing .cancel { position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 12px; }
.pulse-wrap { position: relative; width: 180px; height: 180px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.pulse-ring { position: absolute; inset: 0; border: 2px solid var(--accent); border-radius: 50%; animation: pulse 1.4s ease-out infinite; }
.pulse-icon { animation: breathe 1.4s ease-in-out infinite; }
@keyframes pulse { from { transform: scale(0.9); opacity: 0.6; } to { transform: scale(1.2); opacity: 0; } }
@keyframes breathe { 50% { opacity: 0.55; } }
.progress { width: 180px; height: 4px; background: var(--card-raised); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); transition: width 0.7s ease; }
.step-text { animation: fade 0.4s ease; }
@keyframes fade { from { opacity: 0; } }

/* ---------- Result ---------- */
.snapshots { display: flex; flex-direction: column; gap: 10px; }
.snapshot-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  border-radius: var(--r-md); background: #0F172A; box-shadow: var(--shadow);
}
.snapshot-track::-webkit-scrollbar { display: none; }
.snapshot { position: relative; flex: 0 0 100%; margin: 0; scroll-snap-align: center; }
.snapshot img { display: block; width: 100%; height: 260px; object-fit: contain; }
.snapshot-caption { text-align: center; font-size: 13px; color: var(--text-2); margin-top: -2px; }
.snapshot-dots { display: flex; justify-content: center; gap: 6px; }
.snapshot-dots button {
  width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%;
  background: var(--border); cursor: pointer; transition: width 0.2s, background 0.2s;
}
.snapshot-dots button.active { width: 18px; border-radius: 4px; background: var(--accent); }
.score-header { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 4px; }
.auto-detected {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--card-raised); color: var(--text-2); font-size: 13px;
}
.auto-detected .inline-link { margin-left: 6px; font-size: 13px; }
.rating { font-size: 22px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--card); border-radius: var(--r-md); padding: 14px 8px; text-align: center; }
.stat-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-label { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.bar-label span:first-child { display: flex; align-items: center; gap: 8px; }
.bar-track { height: 8px; border-radius: 4px; background: var(--card-raised); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; animation: grow 0.9s ease-out; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }

.rep-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 18px; }
.rep-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.rep-bar { width: 100%; border-radius: 4px 4px 2px 2px; position: relative; animation: rise 0.8s ease-out; transform-origin: bottom; }
.rep-bar span { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-2); }
@keyframes rise { from { transform: scaleY(0); } }

.comment { display: flex; gap: 12px; align-items: flex-start; }
.comment-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.disclaimer { text-align: center; font-size: 12px; color: var(--text-2); padding: 0 8px; }

.perfect-star {
  position: absolute; left: -9%; top: -11%; width: 118%; height: 118%; overflow: visible;
  pointer-events: none; fill: #FFD23F; stroke: #0F172A; stroke-width: 2.5px; stroke-linejoin: miter; stroke-miterlimit: 10;
  animation: star-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}
.perfect-star.small { left: 0; top: -3%; width: 100%; height: 100%; stroke-width: 1.2px; }
@keyframes star-pop { from { transform: scale(0) rotate(-30deg); opacity: 0; } }
.history-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-rating { font-weight: 600; }
.score-ring-text { font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-progress { transition: stroke-dashoffset 1s ease-out; }

/* ---------- Charts ---------- */
.chart-wrap { width: 100%; }
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sample-chip { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--card-raised); padding: 2px 8px; border-radius: 6px; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-leader { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.chart-dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart-label { fill: var(--text); font-size: 12px; font-weight: 600; }
.chart-crosshair { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tooltip {
  position: absolute; top: 4px; transform: translateX(-50%);
  min-width: 120px; padding: 8px 10px; border-radius: 10px;
  background: var(--card-raised); border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  font-size: 13px; pointer-events: none;
}
.chart-tooltip-title { color: var(--text-2); font-size: 12px; margin-bottom: 4px; }
.chart-tooltip-row { display: flex; justify-content: space-between; gap: 12px; }

/* ---------- History ---------- */
.list { background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; width: 100%; text-align: left;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row h4 { font-size: 17px; font-weight: 600; }
.delete-btn { color: var(--red); padding: 4px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 80px 24px; color: var(--text-2); }
.empty h3 { color: var(--text); font-size: 20px; }

/* ---------- Profile ---------- */
.section-label { font-size: 15px; font-weight: 600; color: var(--text-2); padding: 0 16px 6px; }
.section-footer { font-size: 13px; color: var(--text-2); padding: 6px 16px 0; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 17px; }
.setting-row:last-child { border-bottom: none; }
/* A padded section inside a list block (e.g. the account buttons or the chart). */
.block-section { padding: 16px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--border); }
.block-section:last-child { border-bottom: none; }
.toggle { position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--card-raised); transition: background 0.2s; flex-shrink: 0; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }

/* Premium page: no nav bar; a delayed close button sits top right. */
.premium-screen { padding-top: calc(env(safe-area-inset-top) + 56px); }
.paywall-close {
  position: fixed; z-index: 30;
  top: calc(env(safe-area-inset-top) + 12px);
  right: max(16px, calc(50% - var(--app-w) / 2 + 16px));
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(118, 118, 128, 0.16); color: #6B7280;
  animation: fade 0.4s ease;
}

/* ---------- Progress tab ---------- */
.progress-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.progress-tile {
  background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow);
  padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 104px;
}
.progress-tile-value { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.progress-number { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.progress-rating { font-size: 15px; font-weight: 700; }
.add-exercise-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.progress-hint { text-align: center; margin-top: -4px; }
.exercise-progress { display: flex; flex-direction: column; gap: 10px; }
.exercise-progress-head { display: flex; align-items: center; gap: 12px; }
.exercise-progress-head h3 { font-size: 16px; }
.exercise-progress-info { color: var(--accent); padding: 4px; display: flex; margin-left: auto; }
.data-table { margin: 4px 0 16px; }
.data-row { display: grid; grid-template-columns: 1.4fr 0.6fr 1fr; gap: 8px; padding: 11px 16px; font-size: 15px; }
.data-row + .data-row { border-top: 1px solid var(--border); }
.data-head { font-size: 13px; font-weight: 600; color: var(--text-2); }
.data-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.remove-graph-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; color: var(--red); border: 1.5px solid var(--red);
}
.exercise-progress-empty { padding: 16px 0 8px; text-align: center; }
.line-chart { width: 100%; height: auto; display: block; overflow: visible; }
.line-chart .grid { stroke: var(--border); stroke-width: 1; }
.line-chart .axis { font-size: 10px; fill: var(--text-2); }
.line-chart .line { fill: none; stroke: #C9D1DD; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .fit { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; }
.line-chart .dot { stroke: var(--card); stroke-width: 2; }
.line-chart .dot-hit { cursor: pointer; }
.line-chart .value { font-size: 12px; font-weight: 700; fill: var(--text); }

/* ---------- Payment sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 23, 42, 0.35);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.2s ease;
}
.sheet {
  width: 100%; max-width: var(--app-w); max-height: 92dvh; overflow-y: auto;
  background: #FFFFFF; color: #1A1A1A;
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.12);
  border-radius: 20px 20px 0 0;
  padding: 12px 12px calc(env(safe-area-inset-bottom) + 16px);
  animation: sheet-up 0.3s ease;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.history-popup { height: 88dvh; background: var(--bg); padding: 0 12px calc(env(safe-area-inset-bottom) + 16px); }
.history-popup-header {
  position: sticky; top: 0; z-index: 1; background: var(--bg);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 4px 12px; font-size: 17px;
}
.history-popup-header .navbar-btn { justify-self: end; }
.history-undo { justify-self: start; color: var(--accent); display: flex; padding: 4px; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 12px; font-size: 16px; }
.sheet-close { color: #6B6B70; padding: 4px; }
.sheet-status { padding: 24px 4px; text-align: center; color: #6B6B70; }
.sheet .form-error { color: #C62828; justify-content: center; }
.sheet-checkout { min-height: 40px; }

/* ---------- Developer view switcher (localhost only) ---------- */
/* A small tab on the right edge, halfway down, so it never covers buttons. */
.dev-switcher {
  position: fixed; z-index: 50;
  right: max(0px, calc(50% - var(--app-w) / 2));
  top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: row; align-items: center; gap: 8px;
}
.dev-toggle {
  writing-mode: vertical-rl;
  padding: 9px 4px; border-radius: 8px 0 0 8px; border-right: none !important;
  font-size: 11px; font-weight: 800; letter-spacing: 0.8px;
  background: rgba(255, 255, 255, 0.92); color: var(--text-2);
  border: 1px dashed var(--text-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.dev-toggle.on { color: #B7791F; border-color: #B7791F; }
.dev-menu {
  background: var(--card-raised); border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; min-width: 170px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}
.dev-menu-title { font-size: 11px; color: var(--text-2); padding: 4px 8px 6px; text-transform: uppercase; letter-spacing: 0.6px; }
.dev-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border-radius: 8px; font-size: 15px; text-align: left; }
.dev-option .icon { font-size: 20px; color: var(--text-2); }
.dev-option.active { background: var(--accent-soft); color: var(--accent); }
.dev-option.active .icon { color: var(--accent); }

/* ---------- Consult chat ---------- */
/* Leave room at the end of the chat for the docked message box. */
.chat { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-bottom: 72px; }
.chat-end { scroll-margin-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 96px); }
/* Message box fixed just above the tab bar; messages scroll behind it. */
.chat-dock {
  position: fixed; z-index: 15;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-w);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 10px 16px 6px;
  background: linear-gradient(to bottom, rgba(245, 247, 251, 0), var(--bg) 14px);
  display: flex; flex-direction: column; gap: 4px;
}
.chat-popup-backdrop {
  position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, 0.25);
  display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s ease;
}
/* Pop-up chat: a card rising from the chat button, above the tab bar. */
.chat-popup {
  width: calc(100% - 24px); max-width: calc(var(--app-w) - 24px); height: min(72dvh, 620px);
  margin-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  background: var(--bg); border-radius: 22px; box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
  display: flex; flex-direction: column; overflow: hidden;
  transform-origin: bottom left; animation: chat-pop 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}
@keyframes chat-pop { from { transform: scale(0.6); opacity: 0; } }
.chat-popup-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 18px;
  background: var(--card); border-bottom: 1px solid var(--border); font-size: 17px;
}
.chat-popup-header strong { flex: 1; }
.chat-popup-body { flex: 1; overflow-y: auto; padding: 14px 14px 0; }
.chat-popup-body .chat { padding-bottom: 12px; }
.chat-popup .chat-dock { position: static; transform: none; max-width: none; padding: 8px 12px 10px; background: var(--bg); }
.bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 18px;
  font-size: 16px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere;
}
.bubble p + p, .bubble p + ul, .bubble ul + p { margin-top: 8px; }
.bubble ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.bubble.coach { align-self: flex-start; background: var(--card); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.bubble.error { background: rgba(255, 69, 58, 0.12); color: var(--red); }
.inline-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.bubble.notice { color: var(--text-2); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: typing 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.suggestions { display: flex; flex-direction: column; margin-top: 10px; }
.suggestions-label { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 0 2px 6px; }
/* Tappable options: plain rows divided by hairlines, softly faded text, fading in one by one. */
.suggestion {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 13px 2px; text-align: left;
  font-size: 15px; color: var(--text-2);
  border-top: 0.5px solid rgba(15, 23, 42, 0.14);
  opacity: 0; animation: suggestion-in 0.45s ease forwards;
}
.suggestion:last-child { border-bottom: 0.5px solid rgba(15, 23, 42, 0.14); }
.suggestion .icon { color: rgba(107, 114, 128, 0.6); flex-shrink: 0; }
.suggestion:active, .suggestion:hover { color: var(--accent); }
.suggestion:active .icon, .suggestion:hover .icon { color: var(--accent); }
@keyframes suggestion-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.chat-input {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 16px; border-radius: 26px;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.chat-input input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 16px; padding: 8px 0; }
.send-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.send-btn:disabled { background: var(--card); color: var(--text-2); }
.chat-disclaimer { text-align: center; font-size: 11px; color: var(--text-2); }

/* Quick chat button floating on Home, above the tab bar. */
.chat-fab {
  position: fixed; z-index: 15;
  left: max(16px, calc(50% - var(--app-w) / 2 + 16px));
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 16px rgba(30, 123, 242, 0.35);
}
.chat-fab:active { transform: scale(0.94); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-w);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 20;
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; font-weight: 500; color: var(--text-2); }
.tab.active { color: var(--accent); }
/* Quick record: a raised blue circle in the middle of the tab bar. */
.quick-record { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.quick-record input { display: none; }
.quick-record-btn {
  width: 46px; height: 46px; margin-top: -8px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(30, 123, 242, 0.3);
  transition: transform 0.15s;
}
.quick-record:active .quick-record-btn { transform: scale(0.94); }

/* Report: key moments and the "example scores" notice */
.snapshot .moment-tag {
  position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff; background: var(--accent);
}
.snapshot .moment-tag.fix { background: var(--orange); }
.snapshot .moment-tag.best { background: var(--green); }
.moment-caption { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; margin-top: -2px; }
.moment-caption p { margin: 4px 0 0; }
.estimate-note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--orange) 12%, transparent); color: var(--text-2); font-size: 14px;
}

/* Report: coach notes */
.coach-cue {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.coach-priority { display: flex; gap: 10px; align-items: flex-start; }
.coach-loading { animation: coach-pulse 1.4s ease-in-out infinite; }
@keyframes coach-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .coach-loading { animation: none; } }

/* ---------- Dark mode (Profile → Dark Mode) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0F17;
  --card: #151B26;
  --card-raised: #1F2734;
  --border: #283244;
  --text: #E8ECF3;
  --text-2: #98A3B6;
  --accent-soft: rgba(74, 155, 255, 0.16);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
:root[data-theme="dark"] body, :root[data-theme="dark"] html { background: #05070B; }
:root[data-theme="dark"] .sheet { background: var(--card); color: var(--text); }
:root[data-theme="dark"] .sheet-close { color: var(--text-2); }
:root[data-theme="dark"] .toggle::after { background: #E8ECF3; }
:root[data-theme="dark"] .navbar,
:root[data-theme="dark"] .action-bar,
:root[data-theme="dark"] .tabbar { background: rgba(21, 27, 38, 0.92); }
:root[data-theme="dark"] .chat-dock { background: linear-gradient(to bottom, rgba(11, 15, 23, 0), var(--bg) 14px); }

/* ---------- Calendar ---------- */
.calendar { padding: 8px 0 24px; }
.calendar-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 16px; }
.calendar-nav button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text); }
.calendar-nav h2 { font-size: 18px; font-weight: 700; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 0; }
.calendar-head { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-2); padding-bottom: 12px; letter-spacing: 0.3px; }
.calendar-day { height: 56px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: default; }
.calendar-day.has-sessions { cursor: pointer; }
.calendar-num { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; font-size: 17px; }
.calendar-day.today .calendar-num { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.calendar-dots { display: flex; gap: 4px; height: 6px; }
.calendar-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* Bottom sheets shared by Calendar and Profile */
.sheet-grabber { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 12px; }
.sheet-close.round { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--card-raised); color: var(--text); }
.day-sheet { padding-left: 0; padding-right: 0; max-height: 80dvh; display: flex; flex-direction: column; }
.day-sheet .sheet-header { padding: 4px 20px 12px; border-bottom: 1px solid var(--border); }
.day-sheet-title { font-size: 15px; font-weight: 800; }
.day-sheet-list { overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.session-card { background: var(--card-raised); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.session-card-head { display: flex; align-items: center; gap: 10px; }
.session-card-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.session-card-head strong { font-size: 14px; font-weight: 700; }
.session-labels { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.session-labels li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text); opacity: 0.85; }
.session-labels li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.session-btn { height: 40px; min-height: 0; border-radius: 12px; font-size: 14px; font-weight: 700; }

/* ---------- Profile ---------- */
.profile-title { text-align: center; font-size: 17px; font-weight: 600; padding: calc(env(safe-area-inset-top) + 14px) 16px 14px; }
.profile { padding-bottom: 24px; }
.profile-header { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.profile-header h2 { font-size: 18px; font-weight: 800; }
.profile-header .grow { flex: 1; min-width: 0; }
.profile-header .small { overflow: hidden; text-overflow: ellipsis; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.profile-section h3 { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 1px; padding: 20px 20px 6px; }
.profile-card { margin: 0 16px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.profile-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; text-align: left; border-bottom: 1px solid var(--border); }
.profile-row:last-child { border-bottom: none; }
.profile-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.profile-row.muted-row { color: var(--text-2); }
.profile-row.danger { color: var(--red); }
.accent-text { color: var(--accent); }
.row-sub { font-size: 12px; font-weight: 400; color: var(--text-2); margin-top: 1px; }
.error-text { color: var(--red); }
.profile-badge { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--card-raised); color: var(--accent); flex: none; }
.profile-badge.muted { color: var(--text-2); }
.profile-badge.accent { background: var(--accent-soft); }
.profile-badge.danger { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.soon-pill, .pill-btn { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.pill-btn { font-size: 12px; font-weight: 700; padding: 6px 12px; }
.pill-btn:disabled { opacity: 0.6; }
.profile-error { padding: 10px 20px 0; }
.profile-disclaimer { font-size: 12px; color: var(--text-2); padding: 20px 24px 0; text-align: center; }
.confirm-sheet { padding: 12px 20px calc(env(safe-area-inset-bottom) + 20px); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.confirm-sheet h3 { font-size: 20px; font-weight: 700; }
.confirm-sheet .sub { margin-bottom: 10px; }
.confirm-sheet .btn { height: 52px; border-radius: 16px; font-weight: 700; }
.confirm-danger { background: var(--red); color: #fff; }

/* ---------- Profile sub-pages ---------- */
.settings-page { padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 12px; }
.settings-page > .profile-card { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.8px; }
.field-input { width: 100%; padding: 13px 14px; font-size: 15px; font-weight: 600; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px; outline: none; }
.field-input:focus { border-color: var(--accent); }
.picker-row { display: flex; align-items: center; justify-content: space-between; text-align: left; cursor: pointer; }
.save-btn { margin-top: 8px; height: 50px; border-radius: 16px; font-weight: 700; background: var(--accent); color: var(--on-accent); }
.save-btn.saved { background: var(--green); }
.picker-sheet { padding: 12px 16px calc(env(safe-area-inset-bottom) + 16px); }
.picker-sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 4px 12px; }
.picker-done { justify-self: end; color: var(--accent); font-weight: 700; font-size: 15px; }
/* Scoped to the settings picker so they don't change the onboarding options. */
.picker-sheet .option-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; scroll-snap-type: y mandatory; }
.picker-sheet .option { padding: 11px; font-size: 17px; text-align: center; border-radius: 10px; color: var(--text-2); scroll-snap-align: center; }
.picker-sheet .option.selected { background: var(--card-raised); color: var(--text); font-weight: 600; }
.option-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.date-input { text-align: center; }
.unit-picker { display: flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.unit-picker button { padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--text-2); background: var(--card-raised); }
.unit-picker button.active { background: var(--accent); color: var(--on-accent); }
.permission-warning { display: flex; gap: 8px; align-items: center; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--orange) 10%, transparent); color: var(--text-2); }
.goal-list { display: flex; flex-direction: column; gap: 10px; }
.goal-option { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-size: 14px; font-weight: 600; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.goal-option.selected { border: 2px solid var(--accent); color: var(--accent); padding: 13px 15px; }
.reminder-block { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-top: 1px solid var(--border); }
.time-input { width: auto; }
.day-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; }
.day-picker button { padding: 8px 0; font-size: 11px; font-weight: 700; border-radius: 10px; color: var(--text-2); background: var(--card-raised); }
.day-picker button.active { background: var(--accent); color: var(--on-accent); }
.legal-text { white-space: pre-line; font-size: 14px; line-height: 1.55; padding: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; }

/* Progress: three small stat cards at the top (Total Sessions, Streak, Reps) */
.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-stat {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); text-align: center;
}
.quick-stat strong { font-size: 18px; font-weight: 900; }
.quick-stat span { font-size: 10px; font-weight: 600; color: var(--text-2); }

/* Gold crown on Home for Premium members. */
.premium-crown { margin: 0 16px 10px 0; font-size: 32px; line-height: 1; }
