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

:root {
  --red:          #d91c22;
  --red-dark:     #b0161b;
  --red-dim:      rgba(217,28,34,0.1);
  --black:        #f5f3ed;   /* main background — warm off-white */
  --dark:         #ece9e1;   /* header / sticky surfaces */
  --surface:      #ffffff;   /* cards */
  --surface2:     #f0ede6;   /* inputs / secondary */
  --border:       #d9d5cb;   /* borders */
  --white:        #1c1917;   /* primary text */
  --muted:        #7a7870;   /* muted text */
  --louis:        #2563eb;
  --louis-dim:    rgba(37,99,235,0.10);
  --louis-border: rgba(37,99,235,0.30);
  --jaline:       #db2777;
  --jaline-dim:   rgba(219,39,119,0.10);
  --jaline-border:rgba(219,39,119,0.30);
  --success:      #16a34a;
  --success-dim:  rgba(22,163,74,0.10);
  --danger:       #dc2626;
  --display:      'Bebas Neue', sans-serif;
  --body:         'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --r:            4px;
  --r-sm:         7px;
  --r-md:         10px;
  /* Responsive spacing scale */
  --pad:          clamp(1rem, 3vw, 1.75rem);
}

html, body { height: 100%; }
html { overflow-x: hidden; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow-x: hidden;   /* clips the desktop full-bleed hero's 100vw edge */
}

/* ── APP SHELL ──
   Mobile: full width
   Tablet (≥640): constrained to 740px
   Desktop (≥1024): workout gets split layout, home gets 2-col cards
   Wide (≥1280): max 1140px
*/
#app {
  width: 100%;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════
   SETUP
══════════════════════════════ */
.setup-screen {
  background: var(--black);
  padding: 3rem var(--pad) 2rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.setup-logo {
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 4.5rem);
  letter-spacing: 3px;
  line-height: 1;
  color: var(--white);
}
.setup-logo span { color: var(--red); }
.setup-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.75rem;
  letter-spacing: 0.05em;
}
.setup-restore-card { margin-top: 0.25rem; }
.setup-restore-hdr {
  display: flex; align-items: flex-start; gap: 0.65rem;
}
.setup-restore-btns {
  display: flex; gap: 0.5rem;
}
.setup-restore-btns .btn-outline { flex: 1; text-align: center; }
.setup-danger-card { border-color: rgba(220,38,38,0.25); }
.btn-danger-outline { border-color: rgba(220,38,38,0.5) !important; color: var(--danger) !important; }
.btn-danger-outline:hover { border-color: var(--danger) !important; background: rgba(220,38,38,0.07) !important; }
.reset-confirm-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.reset-confirm-msg { flex: 1; font-size: 0.72rem; color: var(--danger); min-width: 0; }
.setup-restore-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--white);
  border-radius: var(--r-sm);
  padding: 0.65rem 1.2rem;
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.btn-outline:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.05); }
.btn-outline:active { background: rgba(255,255,255,0.1); }
.card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.field-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.text-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--white);
  font-family: var(--body);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
.text-input:focus { border-color: var(--red); }
.field-hint { font-size: 0.73rem; color: var(--muted); line-height: 1.55; }
.field-hint a { color: var(--red); text-decoration: none; }
.field-hint code {
  background: var(--surface2);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.85em;
}
.status-msg { font-size: 0.82rem; min-height: 1.2em; }
.status-msg.error   { color: var(--danger); }
.status-msg.success { color: var(--success); }

/* ══════════════════════════════
   BUTTONS
══════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--r);
  font-family: var(--body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.btn:active   { opacity: 0.72; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-red     { background: var(--red);     color: #fff; width: 100%; }
.btn-success { background: var(--success); color: #fff; width: 100%; }
.btn-ghost   {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  width: 100%;
}
.btn-lg { min-height: 56px; font-size: 0.9rem; }
.btn-sm { min-height: 36px; font-size: 0.7rem; padding: 0.35rem 1rem; width: auto; }

@media (hover: hover) {
  .btn-red:not(:disabled):hover     { background: var(--red-dark); }
  .btn-ghost:hover { color: var(--white); border-color: var(--muted); }
}

/* ══════════════════════════════
   HOME — HERO
══════════════════════════════ */
.home-screen { padding: 0; }

.home-hero {
  position: relative;
  min-height: clamp(280px, 52vh, 520px);
  display: flex;
  flex-direction: column;
  padding: 64px var(--pad) var(--pad);
  overflow: hidden;
}
.home-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/gym-bg.webp');
  background-size: cover;
  background-position: center 35%;
  filter: brightness(0.35) contrast(1.15) saturate(0.8);
}
.home-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8,8,8,0.1)    0%,
    rgba(8,8,8,0.3)   40%,
    rgba(8,8,8,0.65)  75%,
    rgba(8,8,8,0.82) 100%
  );
}
.home-hero-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}
.hero-top {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.hero-bottom { /* greeting + chips at bottom */ }

/* ── Hero quick-stats strip ── */
.hero-stats-strip {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 0.75rem 0;
}
.hss-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.hss-val {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: 1px;
}
.hss-label {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.48);
  margin-top: 0.2rem;
}
.hss-sep {
  width: 1px;
  height: 2rem;
  background: rgba(255,255,255,0.14);
  flex-shrink: 0;
}

/* ── Top navigation pill — fixed top-center ── */
.home-nav-pill {
  position: fixed;
  top: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  background: rgba(0,0,0,0.58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 99px;
  padding: 0.25rem 0.25rem;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
}
.hnp-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.9rem;
  border-radius: 99px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.82);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s;
}
.hnp-btn:active { background: rgba(255,255,255,0.12); color: #fff; }
/* Red "Go Pro" upsell button in the home nav pill */
.hnp-btn.hnp-pro { background: var(--red); color: #fff; animation: hnpProPulse 2.6s ease-in-out 1.2s infinite; }
.hnp-btn.hnp-pro .hnp-lbl { color: #fff; }
.hnp-btn.hnp-pro:active { background: var(--red-dark); }
@keyframes hnpProPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,28,34,0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(217,28,34,0); }
}
/* Very small phones — keep the 4-button pill from crowding the edges */
@media (max-width: 360px) {
  .hnp-btn { padding: 0.5rem 0.6rem; }
  .hnp-lbl { font-size: 0.43rem; letter-spacing: 0.05em; }
}
.hnp-icon { display:flex; align-items:center; justify-content:center; line-height: 1; }
.hnp-icon svg { display:block; }
.hnp-lbl  {
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

/* Greeting — replaces logo/tagline in hero */
.home-greeting {
  font-family: var(--display);
  font-size: clamp(1.6rem, 5.5vw, 2.6rem);
  letter-spacing: 2px;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.1rem;
}
.home-greeting-names {
  font-size: clamp(1rem, 3.5vw, 1.5rem);
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  margin-bottom: 0.15rem;
}
.home-greeting-date {
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

/* Legacy — kept for potential reuse */
.home-logo {
  font-family: var(--display);
  font-size: clamp(3.2rem, 10vw, 7rem);
  letter-spacing: clamp(2px, 0.6vw, 6px);
  line-height: 1;
  color: #fff;
}
.home-logo span { color: var(--red); }
.home-tagline {
  font-size: clamp(0.6rem, 1.5vw, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-top: 0.25rem;
}
.users-row { display: flex; gap: 0.5rem; margin-top: 0.85rem; flex-wrap: wrap; }
.user-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.user-chip.louis  { background: var(--louis-dim);  color: var(--louis);  border: 1px solid var(--louis-border);  }
.user-chip.jaline { background: var(--jaline-dim); color: var(--jaline); border: 1px solid var(--jaline-border); }

/* ══════════════════════════════
   HOME — BODY
   (explore-muscles is first child)
══════════════════════════════ */
.home-body {
  background: var(--black);
  padding: 1rem var(--pad) var(--pad);
  flex: 1;
}
/* ── Section header (programme titles) ── */
.section-hdr {
  --section-accent: var(--muted);
  display: flex; align-items: center; gap: 0.55rem;
  padding: 1.1rem 0 0.65rem;
}
.section-hdr-louis  { --section-accent: var(--red); }
.section-hdr-jaline { --section-accent: var(--jaline); }

.section-hdr-accent {
  display: block; width: 3px; height: 1.1rem;
  border-radius: 99px;
  background: var(--section-accent);
  flex-shrink: 0;
}
.section-hdr-title {
  flex: 1;
  font-size: 0.62rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--white);
}
.section-hdr-count {
  font-size: 0.5rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px; padding: 0.14rem 0.5rem;
}

/* Keep old class as fallback in case any other code still uses it */
.home-section-title {
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); padding: 1.1rem 0 0.7rem;
  display: flex; align-items: center; justify-content: space-between;
}

/* Remove-user button (in section title row) */
.remove-user-btn {
  font-size: 0.5rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  background: none; border: 1px solid var(--border);
  border-radius: 20px; padding: 0.18rem 0.55rem; cursor: pointer;
  touch-action: manipulation; transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.remove-user-btn:hover, .remove-user-btn:active {
  color: var(--danger); border-color: var(--danger);
}

/* Remove-user × inside user chips in hero */
.user-chip { position: relative; display: inline-flex; align-items: center; gap: 0.3rem; }
.user-chip-remove {
  font-size: 0.6rem; font-weight: 700; line-height: 1;
  background: rgba(0,0,0,0.18); border: none; border-radius: 50%;
  width: 14px; height: 14px; cursor: pointer; color: inherit; opacity: 0.7;
  display: flex; align-items: center; justify-content: center;
  padding: 0; touch-action: manipulation;
}
.user-chip-remove:hover { opacity: 1; }

/* Day cards: 1 col → 2 col → 4 col */
.day-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 600px) {
  .day-list { grid-template-columns: 1fr 1fr; gap: 0.65rem; }
}
@media (min-width: 1024px) {
  .day-list { grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
}

/* ── Day card — full-bleed photo with structured footer ── */
.day-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 130px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s;
}
.day-card:active { transform: scale(0.985); }
@media (hover: hover) {
  .day-card:hover { border-color: rgba(255,255,255,0.2); }
}
@media (min-width: 1024px) {
  .day-card { min-height: 160px; }
}
.day-card.recommended      { border: 2px solid var(--red); }
.day-card.recommended-jaline { border: 2px solid var(--jaline); }

/* Background photo */
.day-card-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.42;
  pointer-events: none;
}
/* Gradient: clear top-right → heavy bottom-left (num area) */
.day-card-grd {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.92) 100%);
  pointer-events: none;
}
/* Cardio day card — deeper teal tint in the gradient */
.day-card-grd-cardio {
  background: linear-gradient(160deg, rgba(6,182,212,0.08) 0%, rgba(0,0,0,0.58) 50%, rgba(0,0,0,0.93) 100%);
}

/* Cardio card — full-width banner spanning all grid columns */
.day-card-cardio {
  grid-column: 1 / -1;
  min-height: 160px;
}
@media (min-width: 1024px) {
  .day-card-cardio { min-height: 175px; }
}

/* Combined-stats strip — sits just above the footer text */
.dccs-strip {
  position: absolute;
  bottom: 2.65rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  border-radius: var(--r-sm);
  border: 1px solid rgba(6,182,212,0.22);
  padding: 0.38rem 0.65rem;
  z-index: 2;
  pointer-events: none;
}
.dccs-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}
.dccs-item-last { flex: 1.4; }
.dccs-num {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}
.dccs-num-sm {
  font-size: 0.65rem;
  font-weight: 700;
  color: #67e8f9;
}
.dccs-lbl {
  font-size: 0.38rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.dccs-sep {
  width: 1px;
  height: 1.5rem;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  margin: 0 0.1rem;
}
/* chevron arrow in footer */
.dccs-caret {
  width: 1rem; height: 1rem;
  color: rgba(255,255,255,0.45);
  flex-shrink: 0;
  margin-left: auto;
}

/* Muscle figure — absolute top-right */
.day-card-figure {
  position: absolute; top: 0.45rem; right: 0.45rem;
  width: 54px; z-index: 1; opacity: 0.9;
  pointer-events: none;
}
.rec-badge { z-index: 3; }

/* Chips — absolute top-left */
.day-group-chips {
  position: absolute; top: 0.45rem; left: 0.5rem;
  z-index: 2; display: flex; flex-wrap: wrap; gap: 0.22rem;
}
.day-group-chip {
  font-size: 0.38rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.12rem 0.38rem; border-radius: 99px;
  border: 1px solid; backdrop-filter: blur(4px);
}

/* Footer: [big number] [name centered] [badge pill] */
.day-card-footer {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.day-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.6rem; line-height: 1;
  letter-spacing: 0.02em; flex-shrink: 0;
}
.day-name {
  flex: 1; text-align: center;
  font-size: 0.9rem; font-weight: 800; color: #fff;
  letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.day-badge {
  flex-shrink: 0;
  font-size: 0.38rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  padding: 0.18rem 0.45rem; border-radius: 99px;
  backdrop-filter: blur(4px);
}

/* ── Full-width activity calendar (top of hero) ── */
.activity-cal {
  width: 100%;
  margin-top: 0;
}
.acal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}
.acal-title {
  font-size: 0.45rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
}
.acal-streaks { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.acal-streak-chip {
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  text-transform: uppercase;
}
.acal-streak-l { background: rgba(217,28,34,0.22);  color: var(--red);    border: 1px solid rgba(217,28,34,0.35);  }
.acal-streak-j { background: rgba(255,100,160,0.22); color: var(--jaline); border: 1px solid rgba(255,100,160,0.35); }
.acal-day-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}
.acal-day-lbl {
  text-align: center;
  font-size: 0.42rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.acal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.acal-cell {
  display: flex;
  justify-content: center;
  align-items: center;
}
.acal-dot {
  width: 100%;
  aspect-ratio: 1;
  max-width: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  background: rgba(255,255,255,0.08);
}
.acal-today .acal-dot {
  outline: 2px solid rgba(255,255,255,0.65);
  outline-offset: 1px;
}
.acal-half { flex: 1; height: 100%; }
.acal-l    { background: rgba(255,255,255,0.06); }
.acal-r    { background: rgba(255,255,255,0.06); }
.acal-l.acal-l-on { background: var(--red); }
.acal-r.acal-r-on { background: var(--jaline); }
.acal-dot-rested .acal-half { background: rgba(99,102,241,0.35) !important; }
.rest-day-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 99px;
  padding: 0.3rem 0.85rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rest-day-btn.rest-day-active {
  background: rgba(99,102,241,0.25);
  border-color: rgba(99,102,241,0.5);
  color: #a5b4fc;
}

/* ── Progress report (stats screen) ── */
.report-actions { display: flex; gap: 0.5rem; }
.report-actions .btn { flex: 1; }
.report-pre {
  margin-top: 0.75rem;
  padding: 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
  font-size: 0.62rem;
  line-height: 1.55;
  color: var(--white);
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.acal-legend {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.5rem;
}
.acal-leg {
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.acal-leg-l { color: var(--red); }
.acal-leg-r { color: var(--jaline); }

/* ── Home footer — prominent action buttons ── */
.home-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem var(--pad) 1.75rem;
}
.footer-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.7rem 0.4rem;
  cursor: pointer;
  color: var(--white);
  font-family: var(--body);
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.footer-action-btn:active { background: var(--surface2); }
@media (hover: hover) { .footer-action-btn:hover { background: var(--surface2); border-color: var(--muted); } }
.fab-icon { font-size: 1.15rem; line-height: 1; }
.fab-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── Add User screen ── */
.prog-type-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.35rem;
}
.prog-type-btn {
  flex: 1;
  padding: 0.65rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--white);
  font-family: var(--body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.prog-type-btn.active {
  border-color: var(--red);
  background: var(--red-dim);
  color: var(--white);
}

/* Extra user chip */
.user-chip.extra {
  background: rgba(37,99,235,0.15);
  border-color: rgba(37,99,235,0.3);
  color: #93c5fd;
}

/* Keep old settings-link if referenced elsewhere */
.settings-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.5rem 1rem;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
@media (hover: hover) {
  .settings-link:hover { color: var(--white); }
}

/* ══════════════════════════════
   WORKOUT — HEADER
══════════════════════════════ */
.workout-screen { background: var(--black); }

.workout-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem var(--pad);
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.back-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--red);
  background: linear-gradient(145deg, #e8282f 0%, #b01a1f 100%);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: 0 2px 8px rgba(176,26,31,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: filter 0.1s, box-shadow 0.1s;
}
.back-btn:active {
  filter: brightness(0.85);
  box-shadow: 0 1px 3px rgba(176,26,31,0.4);
}
@media (hover: hover) { .back-btn:hover { filter: brightness(1.1); } }
.hdr-info { flex: 1; min-width: 0; }
.hdr-day {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}
.hdr-progress { font-size: clamp(0.82rem, 2vw, 0.95rem); font-weight: 600; }

.progress-bar { height: 2px; background: var(--border); flex-shrink: 0; }
.progress-fill { height: 100%; background: var(--red); transition: width 0.35s ease; }

/* ══════════════════════════════
   WORKOUT — EXERCISE SECTION
   Mobile:  stacked (video → info)
   Desktop (≥960): side-by-side (video left | info right)
══════════════════════════════ */
.exercise-section {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* ≥960px: video on left, info on right */
@media (min-width: 960px) {
  .exercise-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 280px;
  }
}

.media-wrap {
  position: relative;
  width: 100%;
  padding-top: 44%;
  background: #1a1816;
  overflow: hidden;
}
@media (min-width: 960px) {
  .media-wrap {
    padding-top: 0;  /* height driven by grid row */
    height: 100%;
    min-height: 280px;
  }
}

.ex-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ex-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1a1816 0%, #221f1b 100%);
}
.ex-placeholder-icon { font-size: 2.8rem; opacity: 0.2; }
.ex-placeholder-name {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 1px;
  color: var(--muted);
  text-align: center;
  padding: 0 1.5rem;
}

.swap-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 5;
  background: rgba(20,18,14,0.82);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r);
  color: #f0ede8;
  font-family: var(--body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: border-color 0.15s, color 0.15s;
}
@media (hover: hover) {
  .swap-btn:hover { border-color: var(--red); color: var(--red); }
}
.swap-btn:active { border-color: var(--red); color: var(--red); }

.exercise-info {
  padding: clamp(0.75rem, 2vw, 1.25rem) var(--pad) clamp(0.65rem, 2vw, 1rem);
}
@media (min-width: 960px) {
  .exercise-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 1.75rem;
  }
}

.exercise-name {
  font-family: var(--display);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 1.5px;
  line-height: 1.05;
  color: var(--white);
}
/* cue-details is no longer used — replaced by .cue-card in workout screen */

/* ══════════════════════════════
   SETS GRID
══════════════════════════════ */
.sets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
}
/* Single-column mode — Jaline's own programme */
.sets-grid-single {
  grid-template-columns: 1fr;
}
.sets-grid-single .set-cell { border-left: none; }
.sets-grid-single .set-cell:nth-child(even) { border-left: none; }
.sets-grid-single .col-header.jaline-header { border-left: none; }
.col-header {
  padding: 0.55rem 0.75rem 0.45rem;
  border-bottom: 2px solid;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
@media (min-width: 600px) {
  .col-header { padding: 0.65rem 1rem 0.55rem; }
}
.col-header.louis-header  { border-color: var(--louis);  background: var(--louis-dim);  }
.col-header.jaline-header { border-color: var(--jaline); background: var(--jaline-dim); border-left: 1px solid var(--border); }
.col-name { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.louis-text  { color: var(--louis);  }
.jaline-text { color: var(--jaline); }
.col-target { font-size: 0.65rem; color: var(--muted); }

.set-cell {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
@media (min-width: 600px) {
  .set-cell { padding: 0.75rem 0.9rem; gap: 0.5rem; }
}
.set-cell:nth-child(even) { border-left: 1px solid var(--border); }
.set-cell.done     { background: rgba(34,197,94,0.04); }
.set-cell.disabled { opacity: 0.28; pointer-events: none; justify-content: center; align-items: center; min-height: 80px; }
.cell-null { color: var(--muted); font-size: 1.2rem; }
.set-num { font-size: 0.65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.set-done-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
}
.set-summary { flex: 1; font-size: 0.9rem; font-weight: 700; }
.done-tick { color: var(--success); font-size: 1rem; }

.set-row { display: flex; flex-direction: column; gap: 0.4rem; }
.input-group { display: flex; align-items: center; gap: 0.2rem; }

.adj-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  width: 32px;
  min-height: 40px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}
@media (min-width: 600px) {
  .adj-btn { width: 38px; min-height: 46px; }
}
.adj-btn:active { background: var(--border); }

.num-input {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--white);
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  padding: 0.4rem 0.2rem;
  min-height: 40px;
  outline: none;
  -moz-appearance: textfield;
  transition: border-color 0.15s;
}
@media (min-width: 600px) {
  .num-input { min-height: 46px; font-size: 1rem; }
}
.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.num-input:focus           { border-color: var(--louis); }
.num-input.jaline-input:focus { border-color: var(--jaline); }
.num-input::placeholder    { color: var(--muted); font-size: 0.75rem; font-weight: 400; }

.optional-row { display: flex; gap: 0.3rem; }
.opt-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.78rem;
  text-align: center;
  padding: 0.3rem 0.2rem;
  min-height: 34px;
  outline: none;
  -moz-appearance: textfield;
}
@media (min-width: 600px) {
  .opt-input { min-height: 38px; }
}
.opt-input::-webkit-outer-spin-button,
.opt-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.opt-input:focus { color: var(--white); }
.opt-input::placeholder { font-size: 0.65rem; }

.btn-done {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--success);
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem;
  min-height: 36px;
  cursor: pointer;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
}
@media (min-width: 600px) {
  .btn-done { min-height: 42px; }
}
.btn-done:active { background: var(--success-dim); border-color: var(--success); }
@media (hover: hover) {
  .btn-done:hover { background: var(--success-dim); border-color: var(--success); }
}

/* ══════════════════════════════
   WORKOUT FOOTER
══════════════════════════════ */
.workout-footer {
  position: sticky;
  bottom: 0;
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: 0.7rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 10;
}
.rest-timer {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: 2px;
  line-height: 1;
  min-width: 80px;
  transition: color 0.3s;
}
.rest-timer.active { color: var(--red); }
.rest-timer.idle   { color: var(--muted); font-size: clamp(1rem, 3vw, 1.3rem); }
.footer-actions { display: flex; gap: 0.5rem; flex: 1; justify-content: flex-end; }
.footer-actions .btn { width: auto; padding: 0.6rem 1.2rem; min-height: 44px; }

/* ══════════════════════════════
   SWAP MODAL
   Mobile:  bottom sheet
   Desktop (≥640): centred dialog
══════════════════════════════ */
.swap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 50;
  display: flex;
  align-items: flex-end;      /* bottom sheet on mobile */
  justify-content: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
@media (min-width: 640px) {
  .swap-overlay { align-items: center; }  /* centred dialog on wider screens */
}

.swap-sheet {
  width: 100%;
  max-width: 560px;
  background: var(--dark);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.22s cubic-bezier(0.32,0.72,0,1);
}
@media (min-width: 640px) {
  .swap-sheet {
    border-radius: 14px;
    border: 1px solid var(--border);
    max-height: 75vh;
    animation: fadeScale 0.2s ease;
  }
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1;   }
}
@keyframes fadeScale {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0.8rem auto 0;
  flex-shrink: 0;
}
@media (min-width: 640px) { .sheet-handle { display: none; } }

.sheet-header {
  padding: 1rem 1.25rem 0.65rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.sheet-title {
  font-family: var(--display);
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  letter-spacing: 1.5px;
}
.sheet-sub { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.sheet-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .sheet-close:hover { color: var(--white); } }

.swap-search-wrap { padding: 0.75rem 1.25rem; flex-shrink: 0; }
.swap-search {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--white);
  font-family: var(--body);
  font-size: 0.9rem;
  padding: 0.65rem 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
.swap-search:focus { border-color: var(--red); }
.swap-search::placeholder { color: var(--muted); }

.swap-list { overflow-y: auto; flex: 1; padding-bottom: 1.5rem; }
.swap-group-name {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  padding: 0.85rem 1.25rem 0.4rem;
  border-top: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--dark);
  z-index: 1;
}
.swap-group-name:first-child { border-top: none; }

.swap-row {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  gap: 0.75rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.swap-row:active     { background: var(--surface2); }
.swap-row.is-current { background: var(--red-dim); }
@media (hover: hover) {
  .swap-row:hover { background: var(--surface2); }
  .swap-row.is-current:hover { background: var(--red-dim); }
}
.swap-row-name { flex: 1; font-size: clamp(0.85rem, 2vw, 0.92rem); font-weight: 600; }
.swap-row-meta { font-size: 0.68rem; color: var(--muted); }
.swap-row-badge {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ══════════════════════════════
   FINISH SCREEN
══════════════════════════════ */
.finish-screen { background: var(--black); }

.finish-hero {
  background: linear-gradient(160deg, #fce8e9 0%, #f5f3ed 60%, #f5f3ed 100%);
  padding: clamp(2.5rem, 6vw, 4rem) var(--pad) clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.finish-icon { font-size: clamp(2.8rem, 7vw, 4rem); margin-bottom: 0.75rem; display: block; }
.finish-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  letter-spacing: 4px;
  line-height: 1;
}
.finish-sub { color: var(--muted); font-size: clamp(0.82rem, 2vw, 0.95rem); margin-top: 0.4rem; }

.finish-body {
  padding: clamp(1.25rem, 3vw, 2rem) var(--pad);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}
.finish-stats { display: flex; gap: 0.75rem; }
.stat-box {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: clamp(0.85rem, 2.5vw, 1.25rem) 0.5rem;
  text-align: center;
}
.stat-val {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--red);
  letter-spacing: 1px;
  line-height: 1;
}
.stat-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ══════════════════════════════
   BODY MAP SVG
══════════════════════════════ */
.body-svg { width: 100%; height: auto; display: block; overflow: visible; }
.body-svg .sil * {
  fill: #ccc9bf;
  stroke: #a8a49a;
  stroke-width: 0.7;
  stroke-linejoin: round;
}
.body-svg .muscle {
  fill: rgba(0,0,0,0.04);
  stroke: rgba(0,0,0,0.16);
  stroke-width: 0.45;
  stroke-linejoin: round;
  transition: fill 0.25s ease;
}
.body-svg .muscle.active {
  fill: var(--red);
  fill-opacity: 0.72;
  stroke: var(--red-dark);
  stroke-width: 0.5;
}

/* ══════════════════════════════
   HOME — RECOMMENDATION CARD
══════════════════════════════ */
.rec-card {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: var(--r);
  padding: 1rem var(--pad);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 1.25rem;
  transition: background 0.15s;
}
.rec-card:active { background: var(--surface2); }
@media (hover: hover) { .rec-card:hover { background: var(--surface2); } }

.rec-card-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.rec-card-text { flex: 1; min-width: 0; }
.rec-tag {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.3rem;
}
.rec-name {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  letter-spacing: 1px;
  line-height: 1.05;
  margin-bottom: 0.25rem;
}
.rec-reason { font-size: 0.7rem; color: var(--muted); margin-bottom: 0.55rem; }
.rec-muscles { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.rec-muscle {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  background: var(--surface2);
  color: var(--muted);
  text-transform: capitalize;
}
.rec-body-map { flex-shrink: 0; width: 58px; opacity: 0.9; }

/* ══════════════════════════════
   HOME — TODAY HERO CARD
══════════════════════════════ */
.today-card {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(190px, 50vw, 280px);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  border: none;
  background: #1a1816;
  margin-bottom: 1.25rem;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.today-card:active { transform: scale(0.985); }
@media (hover: hover) { .today-card:hover { transform: scale(0.993); } }
.today-card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) brightness(0.68);
}
.today-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(8,6,4,0.96)  0%,
    rgba(8,6,4,0.52)  48%,
    rgba(8,6,4,0.14) 100%
  );
}
.today-card-content {
  position: absolute;
  inset: 0;
  padding: 1.1rem var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
}
.today-card-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.today-tag {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  background: var(--red);
  color: #fff;
  padding: 0.18rem 0.55rem;
  border-radius: 3px;
}
.today-reason {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}
.today-card-name {
  font-family: var(--display);
  font-size: clamp(2rem, 7vw, 3.2rem);
  letter-spacing: 1.5px;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.today-card-meta {
  font-size: 0.67rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.85rem;
  font-weight: 500;
}
.today-card-cta {
  display: inline-flex;
  align-items: center;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.55rem 1.3rem;
  border-radius: 100px;
  width: fit-content;
}

/* ══════════════════════════════
   JALINE NEXT CARD
══════════════════════════════ */
/* ── Louis compact card — identical structure to Jaline, red accent ── */
.louis-next-card {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(110px, 28vw, 160px);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  border: none;
  background: #1a1414;
  margin-bottom: 1.25rem;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.louis-next-card:active { transform: scale(0.985); }
@media (hover: hover) { .louis-next-card:hover { transform: scale(0.993); } }
/* Reuse jnc-photo / jnc-content / jnc-name / jnc-meta — only override colours */
.lnc-overlay {
  background: linear-gradient(
    to right,
    rgba(8,4,4,0.94) 0%,
    rgba(8,4,4,0.60) 55%,
    rgba(8,4,4,0.20) 100%
  ) !important;
  border-top: 3px solid var(--red) !important;
}
.lnc-tag  { background: var(--red) !important; }
.lnc-cta  { background: var(--red) !important; }

.jaline-next-card {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(110px, 28vw, 160px);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  border: none;
  background: #1a1816;
  margin-bottom: 1.25rem;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s;
}
.jaline-next-card:active { transform: scale(0.985); }
@media (hover: hover) { .jaline-next-card:hover { transform: scale(0.993); } }
.jnc-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) brightness(0.65);
}
.jnc-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(8,6,4,0.94) 0%,
    rgba(8,6,4,0.60) 55%,
    rgba(8,6,4,0.20) 100%
  );
  border-top: 3px solid var(--jaline);
}
.jnc-content {
  position: absolute;
  inset: 0;
  padding: 0.85rem var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}
.jnc-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.22rem;
}
.jnc-tag {
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  background: var(--jaline);
  color: #fff;
  padding: 0.14rem 0.5rem;
  border-radius: 3px;
  flex-shrink: 0;
}
.jnc-reason {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.52);
  font-weight: 500;
}
.jnc-name {
  font-family: var(--display);
  font-size: clamp(1.25rem, 4.5vw, 1.9rem);
  letter-spacing: 1.2px;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.18rem;
}
.jnc-meta {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.58);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.jnc-cta {
  display: inline-flex;
  align-items: center;
  background: var(--jaline);
  color: #fff;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0.42rem 1.05rem;
  border-radius: 100px;
  width: fit-content;
}

/* Recommended badge on day cards */
.rec-badge {
  position: absolute;
  top: -1px; right: 0.55rem;
  font-size: 0.42rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--red); color: #fff;
  padding: 0.15rem 0.45rem;
  border-radius: 0 0 4px 4px;
}
.rec-badge.jaline-badge { background: var(--jaline); }
@media (min-width: 1024px) {
  .rec-badge { right: 0.75rem; }
}

/* ══════════════════════════════
   PREVIEW SCREEN
══════════════════════════════ */
.preview-screen {
  background: var(--black);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;   /* body handles the scroll */
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem var(--pad);
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.preview-hdr-text { flex: 1; min-width: 0; }
.preview-hdr-day {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}
.preview-hdr-last {
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  font-weight: 600;
}

.preview-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: var(--pad);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.preview-body-wrap { flex-shrink: 0; width: 88px; }
@media (min-width: 480px) { .preview-body-wrap { width: 108px; } }
@media (min-width: 768px) { .preview-body-wrap { width: 136px; } }

.preview-stats-wrap { flex: 1; display: flex; flex-direction: column; gap: 0.85rem; }

.preview-stats { display: flex; gap: 0.5rem; }
.p-stat {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.6rem 0.4rem;
  text-align: center;
}
.p-stat-val {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  color: var(--red);
  letter-spacing: 1px;
  line-height: 1;
}
.p-stat-lbl {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 0.2rem;
}
.preview-muscle-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.muscle-chip {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 20px;
  border: 1px solid;
  letter-spacing: 0.05em;
  text-transform: capitalize;
}

/* preview scrollable body */
.preview-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 5.5rem;  /* clear sticky footer */
}

/* exercise list section */
.preview-ex-list {
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.preview-ex-list-title {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

/* ── Exercise Customise Panel ───────────────────────────────────────────── */
.preview-customize {
  margin: 0 var(--pad) 0.75rem;
  border-radius: var(--r-md);
  border: 2px solid var(--red);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 0 0 0 var(--red);
  transition: box-shadow 0.2s ease;
}
.pct-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.9rem 1rem;
  background: rgba(var(--red-rgb, 220,38,38), 0.06);
  border: none;
  cursor: pointer;
  text-align: left;
}
.pct-toggle:active {
  background: rgba(var(--red-rgb, 220,38,38), 0.12);
}
.pct-icon {
  width: 1.2rem; height: 1.2rem;
  flex-shrink: 0;
  color: var(--red);
}
.pct-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--red);
  flex: 1;
  letter-spacing: 0.01em;
}
.pct-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 0.2rem;
}
.pct-arrow {
  width: 0.9rem; height: 0.9rem;
  flex-shrink: 0;
  color: var(--red);
  transition: transform 0.2s ease;
}
.pct-arrow.pct-open {
  transform: rotate(180deg);
}
.pcp-panel {
  border-top: 1px solid var(--border);
  padding: 0.6rem 0.9rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pcp-person-hdr {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.55rem 0 0.2rem;
  border-top: 1px solid var(--border);
  margin-top: 0.15rem;
}
.pcp-person-hdr:first-of-type { border-top: none; margin-top: 0; padding-top: 0.1rem; }
.pcp-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.25rem;
}
.pcp-group-lbl {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.05rem;
}
.pcp-group-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pcp-ex-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  user-select: none;
}
.pcp-on {
  background: var(--bg);
  border-color: var(--border);
}
.pcp-off {
  background: transparent;
  opacity: 0.45;
}
.pcp-check {
  width: 1.1rem; height: 1.1rem;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.6rem;
  color: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.pcp-check-on {
  background: var(--ck, #22c55e);
  border-color: var(--ck, #22c55e);
  color: #fff;
}
.pcp-ex-name {
  flex: 1;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--white);
}
.pcp-ex-target {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.pcp-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.pcp-footer button {
  padding: 0.45rem 0.85rem;
  border-radius: var(--r-sm);
  font-size: 0.67rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--white);
  cursor: pointer;
}
.pcp-footer button:last-child {
  margin-left: auto;
  border: none;
}
.pcp-saved-flash {
  font-size: 0.65rem;
  font-weight: 700;
  color: #22c55e;
  margin-right: auto;
}

/* ── Goal guidance pill ── */
.goal-guide-pill {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.45rem 0.9rem;
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.goal-guide-pill .ggp-label {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--red);
  font-size: 0.62rem;
}
.goal-guide-pill .ggp-sep {
  color: var(--border);
}
.goal-guide-pill .ggp-reps,
.goal-guide-pill .ggp-sets,
.goal-guide-pill .ggp-rest {
  color: var(--white);
  font-weight: 600;
}

/* ── Cardio tip ── */
.cardio-tip {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.9rem;
  margin: 0 1rem 0.75rem;
  text-align: center;
}

.prev-ex-off {
  opacity: 0.35;
  filter: grayscale(0.6);
  pointer-events: none;
}
.prev-ex-skip-lbl {
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--muted);
  background: var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  align-self: center;
}

/* Per-person sub-header in "both" mode preview */
.prev-person-hdr {
  font-size: 0.5rem; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.65rem 0 0.35rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}
.prev-person-hdr:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* photo exercise card */
.prev-ex-card {
  display: flex;
  background: var(--surface);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gc, var(--red));
  align-items: stretch;
}
.prev-ex-imgs {
  display: flex;
  width: 108px;
  flex-shrink: 0;
  background: #1a1816;
  gap: 1px;
}
.prev-ex-img {
  flex: 1;
  width: 50%;
  object-fit: cover;
  display: block;
}
.prev-ex-body {
  flex: 1;
  padding: 0.6rem 0.7rem;
  min-width: 0;
}
.prev-ex-toprow {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.12rem;
}
.prev-ex-num {
  font-size: 0.5rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.07em;
  flex-shrink: 0;
}
.prev-ex-group-lbl {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 1;
}
.prev-ex-diff {
  font-size: 0.48rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.prev-ex-name {
  font-family: var(--display);
  font-size: clamp(0.82rem, 2.5vw, 1rem);
  letter-spacing: 1px;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prev-ex-meta {
  font-size: 0.54rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.prev-ex-cue {
  font-size: 0.57rem;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* legacy rows (no longer rendered) */
.preview-group-header,
.preview-ex-row,
.preview-ex-icon,
.preview-ex-details { display: none; }

.preview-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.85rem var(--pad);
  background: var(--dark);
  border-top: 1px solid var(--border);
  z-index: 10;
}

/* ══════════════════════════════
   PREVIEW — TRAINER SELECTOR
══════════════════════════════ */
.trainer-selector {
  padding: 0.9rem var(--pad) 0.5rem;
  border-top: 1px solid var(--border);
}
.trainer-sel-label {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.trainer-chips {
  display: flex;
  gap: 0.5rem;
}
.trainer-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem 0.42rem 0.5rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--white);
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.trainer-chip:active { opacity: 0.75; }
@media (hover: hover) { .trainer-chip:hover { background: var(--surface2); } }

/* Louis active */
.trainer-chip.tc-active[data-trainer="louis"] {
  border-color: var(--red);
  background: var(--red-dim);
  color: #fff;
}
/* Jaline active */
.trainer-chip.tc-active[data-trainer="jaline"] {
  border-color: var(--jaline);
  background: rgba(219,39,119,0.14);
  color: #f9a8d4;
}
/* Both active */
.trainer-chip.tc-active[data-trainer="both"] {
  border-color: var(--muted);
  background: var(--surface2);
  color: #fff;
}

.tc-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.trainer-chip.tc-active[data-trainer="louis"]  .tc-avatar { background: rgba(239,68,68,0.3); }
.trainer-chip.tc-active[data-trainer="jaline"] .tc-avatar { background: rgba(219,39,119,0.3); }
.trainer-chip.tc-active[data-trainer="both"]   .tc-avatar { background: rgba(255,255,255,0.15); }

.tc-name { white-space: nowrap; }

/* ══════════════════════════════
   SPLIT WORKOUT SCREEN
══════════════════════════════ */
.workout-screen-split {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Dual progress bars */
.split-prog-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 0;
  flex-shrink: 0;
}
.split-prog-bar {
  height: 3px;
  background: var(--surface2);
  overflow: hidden;
}
.split-prog-fill {
  height: 100%;
  transition: width 0.35s ease;
}

/* Side-by-side panels container */
.split-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  border-top: 1px solid var(--border);
}

/* Each person's panel */
.split-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0.45rem 0.4rem 0.3rem;
  border-right: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
.split-panel:last-child { border-right: none; }

/* Tighten the shared solo-body spacing inside a narrow split column */
.split-panel .solo-sets-title {
  font-size: 0.38rem;
  padding-bottom: 0.28rem;
  margin-bottom: 0.28rem;
}
.split-panel .solo-sets-section { flex-shrink: 0; }
.split-panel .solo-ex-target    { font-size: 0.54rem; margin-bottom: 0.28rem; }

/* Panel header */
.split-phdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.3rem;
  margin-bottom: 0.35rem;
  border-bottom: 2px solid;
  flex-shrink: 0;
}
.split-pname {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.split-ex-progress {
  font-size: 0.52rem;
  color: var(--muted);
  font-weight: 700;
}

/* ── Split START+FINISH image pair ── */
.split-ex-imgs {
  display: flex; gap: 0.28rem; margin-bottom: 0.4rem; flex-shrink: 0;
}
.split-ex-img-panel {
  flex: 1; position: relative; aspect-ratio: 4/3;
  border-radius: 6px; overflow: hidden; background: #111;
}
/* Bottom gradient scrim */
.split-ex-img-panel::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,0.68), transparent);
  pointer-events: none; z-index: 1;
}
.split-ex-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.split-pos-tag {
  position: absolute; bottom: 0.22rem; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 0.36rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; white-space: nowrap; pointer-events: none; z-index: 2;
}

/* Exercise name & target */
.split-ex-name {
  font-family: var(--head);
  font-size: 0.72rem;
  line-height: 1.1;
  margin-bottom: 0.08rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.split-ex-target {
  font-size: 0.52rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  flex-shrink: 0;
}

/* ── Split set cards (.ssc) ── */
.split-sets { flex-shrink: 0; }
.ssc {
  display: flex; align-items: center; gap: 0.28rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.28rem 0.32rem; margin-bottom: 0.28rem;
}
.ssc.done {
  background: var(--success-dim); border-color: rgba(22,163,74,0.2);
}
.ssc-num {
  font-size: 0.38rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  width: 1.2rem; flex-shrink: 0; text-align: center;
}
.ssc-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.18rem; }
.ssc-field-row { display: flex; align-items: center; gap: 0.14rem; }
.ssc-fl {
  font-size: 0.36rem; font-weight: 800; color: var(--muted);
  width: 12px; flex-shrink: 0; text-align: right;
}
.ssc-adj {
  width: 28px; min-height: 30px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.95rem; font-weight: 700;
  color: var(--white); cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ssc-adj:active { background: var(--border); }
.ssc-val {
  flex: 1; min-width: 0; min-height: 30px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; touch-action: manipulation; text-align: center;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ssc-val:active { border-color: var(--muted); }
.ssc-done {
  width: 28px; height: 28px; flex-shrink: 0; align-self: center;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 50%; font-size: 0.65rem; color: var(--success);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ssc-done:active { background: var(--success-dim); }
.ssc-summary { flex: 1; font-size: 0.72rem; font-weight: 600; }
.ssc-check   { font-size: 0.8rem; flex-shrink: 0; }

/* Per-panel prev/next buttons */
.split-nav {
  display: flex;
  gap: 0.25rem;
  padding-top: 0.45rem;
  margin-top: auto;
  flex-shrink: 0;
}
.split-nav-btn {
  flex: 1;
  font-size: 0.6rem !important;
  padding: 0.38rem 0.2rem !important;
  font-weight: 700 !important;
  min-height: 1.9rem;
}
.split-nav-placeholder { flex: 1; }

/* Completed state */
.split-completed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 0.4rem;
  padding: 1.5rem 0;
}
.split-completed-icon { font-size: 2rem; }
.split-completed-text {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Shared footer */
.split-footer {
  padding: 0.65rem var(--pad);
  border-top: 1px solid var(--border);
  background: var(--dark);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.split-status {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  padding-bottom: 0.1rem;
}

/* ══════════════════════════════
   WORKOUT — MUSCLE GROUP TAG
══════════════════════════════ */
.ex-group-tag {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  border: 1px solid;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ══════════════════════════════
   WORKOUT — BPM CHIP
══════════════════════════════ */
.bpm-chip {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.28rem 0.65rem;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.73rem;
  font-weight: 700;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, color 0.15s;
  min-height: 32px;
}
.bpm-chip.has-bpm { border-color: rgba(239,68,68,0.5); color: #ef4444; }
.bpm-heart { font-size: 0.9rem; line-height: 1; }
.bpm-unit  { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.06em; }
@media (hover: hover) { .bpm-chip:hover { border-color: rgba(239,68,68,0.5); color: #ef4444; } }

/* ══════════════════════════════
   HOME — STREAK / WEEK CHIPS
══════════════════════════════ */
.streak-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.35);
}
.week-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  background: rgba(34,197,94,0.12);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.35);
}

/* Updated home footer — row with stats + settings */
.home-footer {
  padding: 0.75rem var(--pad) 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.footer-sep {
  color: var(--border);
  font-size: 0.9rem;
  line-height: 1;
}

/* ══════════════════════════════
   ONBOARDING SCREEN
══════════════════════════════ */
.onboard-screen { background: var(--black); }

.onboard-hero {
  position: relative;
  height: clamp(240px, 42vh, 380px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
  overflow: hidden;
}
.onboard-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('assets/gym-bg.webp');
  background-size: cover;
  background-position: center 35%;
  filter: brightness(0.35) contrast(1.15) saturate(0.8);
}
.onboard-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8,8,8,0.05)       0%,
    rgba(8,8,8,0)          20%,
    rgba(245,243,237,0.45) 60%,
    rgba(245,243,237,1)   100%
  );
}
.onboard-hero-content { position: relative; z-index: 1; }

.onboard-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem var(--pad);
  background: var(--dark);
  border-bottom: 1px solid var(--border);
}
.onboard-step {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  flex-shrink: 0;
}
.onboard-step-title {
  flex: 1;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  font-weight: 700;
}
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  -webkit-tap-highlight-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  flex-shrink: 0;
  transition: color 0.15s;
}
@media (hover: hover) { .btn-link:hover { color: var(--white); } }

.onboard-body {
  padding: 1.5rem var(--pad) 2.5rem;
  flex: 1;
}
.onboard-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}
.onboard-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 420px;
}
.onboard-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 480px;
}
.onboard-field { display: flex; flex-direction: column; gap: 0.5rem; }

/* Goal cards — 2×2 grid */
.goal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.9rem 0.8rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.goal-card:active { background: var(--surface2); }
.goal-card.selected {
  background: var(--red-dim);
  border-color: var(--red);
}
@media (hover: hover) {
  .goal-card:hover { background: var(--surface2); }
  .goal-card.selected:hover { background: var(--red-dim); }
}
.goal-icon { font-size: 1.5rem; line-height: 1; margin-bottom: 0.1rem; }
.goal-name { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; }
.goal-desc { font-size: 0.62rem; color: var(--muted); }

/* Level buttons — row of 3 */
.level-row { display: flex; gap: 0.5rem; }
.level-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.8rem 0.5rem;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.level-btn:active { background: var(--surface2); }
.level-btn.selected { background: var(--red-dim); border-color: var(--red); }
@media (hover: hover) {
  .level-btn:hover { background: var(--surface2); }
  .level-btn.selected:hover { background: var(--red-dim); }
}
.level-name { font-size: 0.75rem; font-weight: 700; }
.level-desc { font-size: 0.6rem; color: var(--muted); }

/* ══════════════════════════════
   STATS SCREEN
══════════════════════════════ */
.stats-screen { background: var(--black); }

.stats-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem var(--pad);
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.stats-hdr-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  letter-spacing: 2px;
  flex: 1;
}

.stats-tabs {
  display: flex;
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--pad);
  position: sticky;
  top: 56px; /* below header */
  z-index: 9;
}
.stats-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 0;
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, border-color 0.15s;
}
.stats-tab.active {
  color: var(--white);
  border-bottom-color: var(--red);
}
@media (hover: hover) {
  .stats-tab:not(.active):hover { color: var(--white); }
}

.stats-body {
  padding: 0 var(--pad) 4rem;
}

/* Overview grid — 4 cards */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 1rem 0;
}
@media (max-width: 400px) {
  .stats-overview { grid-template-columns: repeat(2, 1fr); }
}
.overview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: clamp(0.7rem, 2vw, 1rem) 0.5rem;
  text-align: center;
}
.ov-val {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  color: var(--red);
  letter-spacing: 1px;
  line-height: 1;
}
.ov-lbl {
  font-size: 0.53rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 0.3rem;
}

.stats-section { margin-top: 1.5rem; }
.stats-section-title {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* Volume chart */
.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 0.75rem 0.75rem;
  overflow: hidden;
}
.volume-chart { width: 100%; height: auto; display: block; }
.chart-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

/* Achievements */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
@media (min-width: 480px) {
  .achievement-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .achievement-grid { grid-template-columns: repeat(5, 1fr); }
}
.achievement-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.8rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color 0.2s, transform 0.15s;
}
.achievement-badge.earned {
  border-color: rgba(180,83,9,0.35);
  background: linear-gradient(160deg, var(--surface) 60%, rgba(180,83,9,0.07));
}
.ach-icon { font-size: 1.5rem; line-height: 1; filter: grayscale(1) opacity(0.5); }
.achievement-badge.earned .ach-icon { filter: none; }
.ach-body { display: flex; flex-direction: column; gap: 0.12rem; }
.ach-name { font-size: 0.72rem; font-weight: 800; }
.ach-desc { font-size: 0.58rem; color: var(--muted); line-height: 1.4; }
.ach-done {
  font-size: 0.55rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: #b45309; margin-top: 0.15rem;
}
.ach-prog { margin-top: 0.25rem; display: flex; flex-direction: column; gap: 0.2rem; }
.ach-prog-bar { height: 5px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.ach-prog-fill { height: 100%; border-radius: 99px; background: var(--red); transition: width 0.5s cubic-bezier(0.2,0.7,0.2,1); }
.ach-prog-txt { font-size: 0.52rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Achievements header + overall + filters */
.ach-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.4rem; }
.ach-count { font-family: var(--display); font-size: 1.3rem; color: var(--red); }
.ach-count span { color: var(--muted); font-size: 0.9rem; }
.ach-overall { height: 7px; border-radius: 99px; background: var(--surface2); overflow: hidden; margin-bottom: 0.7rem; }
.ach-overall-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--red-dark), var(--red)); transition: width 0.6s cubic-bezier(0.2,0.7,0.2,1); }
.ach-filters { display: flex; gap: 0.4rem; margin-bottom: 0.7rem; }
.ach-filt {
  flex: 1; padding: 0.4rem; border: 1px solid var(--border); background: var(--surface);
  border-radius: 99px; font-size: 0.68rem; font-weight: 700; color: var(--muted); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ach-filt.on { background: var(--red); border-color: var(--red); color: #fff; }
.ach-empty { text-align: center; color: var(--muted); font-size: 0.78rem; padding: 1rem 0; }

/* Report compact badge progress */
.rep-ach-prog { font-size: 0.5rem; font-weight: 700; color: var(--muted); margin-left: auto; flex-shrink: 0; }

/* Finish-screen achievement unlock banners */
.finish-unlocks { margin-bottom: 0.8rem; }
.finish-unlocks-hdr { font-family: var(--display); font-size: 1.1rem; color: var(--red); text-align: center; margin-bottom: 0.5rem; }
.unlock-banner {
  display: flex; align-items: center; gap: 0.7rem;
  background: linear-gradient(110deg, rgba(180,83,9,0.14), rgba(180,83,9,0.05));
  border: 1px solid rgba(180,83,9,0.4); border-radius: var(--r-md);
  padding: 0.6rem 0.85rem; margin-bottom: 0.45rem;
  animation: unlockPop 0.5s cubic-bezier(0.2,0.9,0.3,1.4) backwards;
}
.unlock-banner:nth-child(3) { animation-delay: 0.1s; }
.unlock-banner:nth-child(4) { animation-delay: 0.2s; }
@keyframes unlockPop { from { opacity: 0; transform: scale(0.9) translateY(8px); } to { opacity: 1; transform: none; } }
.unlock-icon { font-size: 1.6rem; animation: unlockSpin 0.7s ease-out; }
@keyframes unlockSpin { 0% { transform: rotate(-25deg) scale(0.4); } 60% { transform: rotate(10deg) scale(1.2); } 100% { transform: none; } }
.unlock-text { display: flex; flex-direction: column; }
.unlock-name { font-family: var(--display); font-size: 1.05rem; color: #92400e; letter-spacing: 0.03em; }
.unlock-desc { font-size: 0.68rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .unlock-banner, .unlock-icon { animation: none !important; } }

/* PRs */
.pr-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.pr-row {
  display: flex;
  align-items: center;
  padding: 0.65rem var(--pad);
  border-bottom: 1px solid var(--border);
  gap: 0.6rem;
}
.pr-row:last-child { border-bottom: none; }
.pr-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pr-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
}
.pr-date {
  font-size: 0.6rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Recent sessions */
.session-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.session-row {
  display: flex;
  align-items: center;
  padding: 0.8rem var(--pad);
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}
.session-row:last-child { border-bottom: none; }
.session-info { flex: 1; min-width: 0; }
.session-name { font-size: 0.85rem; font-weight: 700; }
.session-meta { font-size: 0.62rem; color: var(--muted); margin-top: 0.12rem; }
.session-vol {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

/* Empty state */
.stats-empty {
  text-align: center;
  padding: 3rem var(--pad) 1rem;
  color: var(--muted);
}
.stats-empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; }
.stats-empty p { font-size: 0.85rem; line-height: 1.6; }

/* ══════════════════════════════
   HOME — EXPLORE MUSCLES CARD
══════════════════════════════ */
.explore-muscles-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #0a0a0a url('assets/gym-bg.webp') center 55% / cover no-repeat;
  border: none;
  border-radius: var(--r-md);
  padding: 1rem var(--pad);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
  overflow: hidden;
  position: relative;
  transition: filter 0.15s;
}
/* Dark gradient overlay: opaque on left (text side), semi-transparent on right (SVG side) */
.explore-muscles-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.6) 55%, rgba(0,0,0,0.3) 100%);
  border-radius: inherit;
  pointer-events: none;
}
.explore-muscles-btn .emb-left,
.explore-muscles-btn .emb-svg { position: relative; z-index: 1; }
.explore-muscles-btn .emb-label { color: #fff; }
.explore-muscles-btn .emb-sub   { color: rgba(255,255,255,0.62); }
.explore-muscles-btn .emb-dot   { box-shadow: 0 0 3px rgba(0,0,0,0.4); }
.explore-muscles-btn:active  { filter: brightness(1.12); }
@media (hover: hover) { .explore-muscles-btn:hover { filter: brightness(1.07); } }

.emb-left { flex: 1; min-width: 0; }
.emb-label {
  font-family: var(--display);
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  letter-spacing: 1.5px;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.emb-sub { font-size: 0.7rem; color: var(--muted); margin-bottom: 0.6rem; }
.emb-groups { display: flex; gap: 5px; flex-wrap: wrap; }
.emb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.emb-svg {
  flex-shrink: 0;
  width: 96px;   /* wider for dual front+back view */
  opacity: 0.9;
  pointer-events: none;   /* clicks handled on parent button */
}

/* day-card layout defined near top of file (~line 361) */

/* ══════════════════════════════
   WORKOUT — FORM CUE CARD
   (always visible, not collapsed)
══════════════════════════════ */
.cue-card {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin-top: 0.6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cue-color, var(--red));
  border-radius: var(--r);
  padding: 0.6rem 0.75rem;
}
.cue-icon { font-size: 0.9rem; flex-shrink: 0; line-height: 1.5; }
.cue-card .cue-text {
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  color: var(--white);
  line-height: 1.6;
  opacity: 0.82;
  border: none;
  padding: 0;
  margin: 0;
}

/* ══════════════════════════════
   MUSCLE EXPLORER SCREEN
══════════════════════════════ */
.muscles-screen { background: var(--black); }

.muscles-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem var(--pad);
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.muscles-hdr-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  letter-spacing: 2px;
  flex: 1;
}

.muscles-body { padding: var(--pad); }

.muscles-map-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.muscles-map-inner {
  width: clamp(280px, 92vw, 480px);  /* large — front+back cutout photos */
}
/* ── Body model thumbnail (non-explorer contexts) ── */
.body-photo-thumb-wrap {
  position: relative;
  width: 100%;
  display: block;
}
.body-photo-thumb {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.88) brightness(0.96);
}
.body-svg-on-photo-thumb {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* Photo-backed explorer wrapper — two images side by side */
.body-photo-explorer-wrap {
  position: relative;
  display: flex;           /* side-by-side front + back */
  width: 100%;
  line-height: 0;
  border-radius: var(--r-md);
  overflow: hidden;
}
/* Each cutout image takes exactly half the container width */
.body-photo-half {
  flex: 1;
  min-width: 0;
  width: 50%;
  height: auto;
  display: block;
  object-fit: cover;
  filter: saturate(0.9) brightness(1.0);
}
/* SVG overlaid on the photos — absolutely fills the entire container */
.body-svg-on-photo {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border-radius: var(--r-md);
}

.body-svg-explorer { display: block; }
.body-svg-explorer [data-muscle-group] {
  stroke: rgba(0,0,0,0.28);
  stroke-width: 0.5;
  stroke-linejoin: round;
  transition: opacity 0.18s;
}
.body-svg-explorer [data-muscle-group]:active { opacity: 0.68 !important; }
@media (hover: hover) {
  .body-svg-explorer [data-muscle-group]:hover { opacity: 0.68 !important; }
}
.muscles-hint {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Muscle group card grid — 2 cols on mobile, 4 on wide */
.muscle-group-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
@media (min-width: 600px)  { .muscle-group-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .muscle-group-grid { grid-template-columns: repeat(4, 1fr); } }

/* Photo card design */
.muscle-group-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  aspect-ratio: 1;
  background: #1a1816;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s;
}
.muscle-group-card:active { transform: scale(0.96); }
@media (hover: hover) { .muscle-group-card:hover .mgc-photo { transform: scale(1.06); } }

.mgc-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.82) saturate(0.82);
  transition: transform 0.35s ease;
}

.mgc-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.14) 52%,
    rgba(0,0,0,0.02) 100%
  );
  border-top: 3px solid var(--gc, var(--red));
}

.mgc-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.7rem 0.65rem;
  pointer-events: none;
}

.mgc-name {
  font-family: var(--display);
  font-size: clamp(0.95rem, 3.5vw, 1.35rem);
  letter-spacing: 1.5px;
  line-height: 1;
  color: #fff;
}
.mgc-count {
  font-size: 0.52rem;
  color: rgba(255,255,255,0.58);
  margin-top: 0.18rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ══════════════════════════════
   MUSCLE EXERCISES SCREEN
══════════════════════════════ */
.muscle-exs-screen { background: var(--black); }

.muscle-exs-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem var(--pad);
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.muscle-exs-hdr-content { flex: 1; min-width: 0; }
.muscle-exs-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: 2px;
  line-height: 1;
}
.muscle-exs-sub { font-size: 0.62rem; color: var(--muted); margin-top: 0.1rem; }
.muscle-exs-hdr-svg { flex-shrink: 0; width: 42px; }

.muscle-exs-list {
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 3rem;
}
@media (min-width: 640px) {
  .muscle-exs-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
@media (min-width: 1024px) {
  .muscle-exs-list { grid-template-columns: repeat(3, 1fr); }
}

/* Exercise card — video top, info bottom */
.ex-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent, var(--red));
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.15s;
}
@media (hover: hover) {
  .ex-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
}

.ex-card-num {
  position: absolute;
  top: 0.55rem;
  left: 0.65rem;
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 1px;
  line-height: 1;
  z-index: 5;
  background: rgba(255,255,255,0.92);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

/* ── dual start/finish image panel ── */
.ex-card-imgs {
  position: relative;
  display: flex;
  gap: 2px;
  height: 158px;
  background: #1a1816;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.ex-card-img-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
}
.ex-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ex-pos-tag {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  font-size: 0.44rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  color: rgba(255,255,255,0.75);
  padding: 0.12rem 0.3rem;
  border-radius: 3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
/* legacy (kept for safety, no longer rendered) */
.ex-card-video-wrap {
  position: relative;
  width: 100%;
  padding-top: 62%;
  background: #1a1816;
  overflow: hidden;
  flex-shrink: 0;
}
.ex-card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ex-card-group-tag {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  border: 1px solid;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ex-card-no-video {
  width: 100%;
  padding-top: 62%;
  position: relative;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ex-card-no-video > span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ex-card-body { padding: 0.85rem 0.9rem 1rem; }

.ex-card-name {
  font-family: var(--display);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  letter-spacing: 1px;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.ex-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}
.ex-meta-pill {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  border: 1px solid;
  text-transform: uppercase;
}
.louis-pill  { background: var(--louis-dim);  color: var(--louis);  border-color: var(--louis-border);  }
.jaline-pill { background: var(--jaline-dim); color: var(--jaline); border-color: var(--jaline-border); }
.time-pill   { background: rgba(251,191,36,0.1); color: #b45309; border-color: rgba(180,83,9,0.3); }

.ex-card-cue {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  padding: 0.55rem 0.65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent, var(--red));
  border-radius: var(--r);
}
.ex-cue-icon { font-size: 0.8rem; flex-shrink: 0; line-height: 1.6; }
.ex-cue-text {
  font-size: 0.75rem;
  color: var(--white);
  line-height: 1.6;
  opacity: 0.78;
}

/* ── Difficulty badge (overlaid on exercise card video) ── */
.ex-diff-badge {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── Difficulty filter chips row ── */
.diff-filter-row {
  display: flex;
  gap: 0.45rem;
  padding: 0.7rem var(--pad);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
}
.diff-filter-row::-webkit-scrollbar { display: none; }
.diff-chip {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.38rem 0.9rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}
.diff-chip-active {
  border-color: var(--white);
  color: var(--white);
  background: var(--surface2);
}

/* ── Empty state when filter has no results ── */
.exs-empty {
  padding: 3rem var(--pad);
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════
   SOLO WORKOUT SCREEN (redesigned)
   ═══════════════════════════════════════════════════════ */

/* Touch-action: manipulation on ALL interactive elements prevents
   double-tap iOS zoom while keeping single-tap panning. */
button, input, select, a,
.solo-adj, .solo-val-btn, .solo-done-btn,
.adj-btn, .btn-done, .split-inp, .split-done-btn,
.nk, .numpad-cancel-btn, .numpad-confirm-btn {
  touch-action: manipulation;
}

/* Scrollable body area (between header and footer) */
.solo-screen { display: flex; flex-direction: column; overflow: hidden; }
.solo-body   { overflow-y: auto; flex: 1 1 0; min-height: 0; padding: 0.75rem var(--pad) 1rem; }

/* ── Exercise hero: START + FINISH images ── */
.solo-ex-hero  { margin-bottom: 0.75rem; }
.solo-ex-imgs  { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }

.solo-ex-img-panel {
  flex: 1; min-width: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  background: #1a1a1a; /* dark bg so gaps/transparency shows black not beige */
  aspect-ratio: 4 / 3;
}
/* Bottom gradient scrim — ensures START/FINISH label is always readable */
.solo-ex-img-panel::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
  pointer-events: none; z-index: 1;
}
.solo-ex-img {
  position: absolute; inset: 0; /* guaranteed full-fill regardless of flex */
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ex-img-fallback {
  position: absolute; inset: 0; /* overlay, not flex child */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.35rem; font-size: 2rem; color: var(--muted);
}
.ex-fallback-name { font-size: 0.55rem; font-weight: 600; color: var(--muted); text-align: center; padding: 0 0.4rem; }

.ex-pos-tag {
  position: absolute; bottom: 0.4rem; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 0.46rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; white-space: nowrap; pointer-events: none;
  z-index: 2; /* above gradient scrim */
}

/* ── Exercise meta below images ── */
.solo-ex-meta { }
.solo-ex-top-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.45rem;
}
/* Inline swap button (not absolute-positioned for solo) */
.solo-ex-top-row .swap-btn {
  position: static; transform: none;
  font-size: 0.7rem; padding: 0.3rem 0.65rem;
}
.solo-ex-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; letter-spacing: 0.04em; line-height: 1;
  margin-bottom: 0.1rem;
}
.solo-ex-target {
  font-size: 0.72rem; color: var(--muted); margin-bottom: 0.55rem;
}

/* ── Sets section ── */
.solo-sets-section { }
.solo-sets-title {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 0.5rem; font-weight: 800; letter-spacing: 0.16em;
  color: var(--muted); text-transform: uppercase;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border); margin-bottom: 0.5rem;
}
.solo-target {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.95rem; letter-spacing: 0.04em;
  color: var(--white); text-transform: none; font-weight: 400;
}

/* ── Individual set row ── */
.solo-set-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 0.6rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); margin-bottom: 0.4rem;
}
.solo-set-row.done {
  background: var(--success-dim);
  border-color: rgba(22,163,74,0.25);
}
.solo-set-num {
  font-size: 0.46rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  width: 1.6rem; flex-shrink: 0; text-align: center;
}
/* Done state */
.solo-done-summary {
  flex: 1; font-size: 0.9rem; font-weight: 600; color: var(--white);
}
.solo-done-tick { font-size: 1rem; flex-shrink: 0; }

/* ── Main body (fields + optional row) ── */
.solo-set-main {
  display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 0.3rem;
}

/* ── Field groups (weight & reps side by side) ── */
.solo-set-fields {
  display: flex; gap: 0.55rem; justify-content: center; align-items: center;
}
.solo-field-group {
  display: flex; flex-direction: column; align-items: center; gap: 0.18rem;
  flex: 1; min-width: 0;
}
.solo-field-label {
  font-size: 0.42rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.solo-field-row { display: flex; align-items: center; gap: 0.22rem; width: 100%; }

/* ── Optional RPE / RIR chips ── */
.solo-opt-row {
  display: flex; gap: 0.35rem; justify-content: center;
}
.solo-opt-chip {
  display: flex; align-items: center; gap: 0.28rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.22rem 0.6rem;
  cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; flex: 1; justify-content: center;
}
.solo-opt-chip:active { border-color: var(--muted); }
.solo-opt-lbl {
  font-size: 0.38rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.solo-opt-val { font-size: 0.75rem; font-weight: 700; color: var(--white); }
.solo-opt-val.muted { color: var(--muted); font-weight: 400; }

/* ── Adjust (− / +) buttons ── */
.solo-adj {
  width: 44px; min-height: 52px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; font-size: 1.4rem; font-weight: 700;
  color: var(--white); cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}
.solo-adj:active { background: var(--border); }

/* ── Value display (tappable → opens numpad) ── */
.solo-val-btn {
  min-width: 0; flex: 1 1 auto; min-height: 52px; padding: 0 0.35rem;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 10px; cursor: pointer;
  font-size: 1.05rem; font-weight: 700; color: var(--white);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.solo-val-btn:active { border-color: var(--muted); }
.val-placeholder { color: var(--muted); font-size: 0.72rem; font-weight: 400; }
.val-unit        { font-size: 0.58rem; font-weight: 400; color: var(--muted); margin-left: 1px; }

/* ── Done (circle check) button ── */
.solo-done-btn {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: 50%; cursor: pointer; font-size: 1rem;
  color: var(--success); display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; transition: background 0.12s, border-color 0.12s;
}
.solo-done-btn:active { background: var(--success-dim); border-color: var(--success); }

/* ── Compact set row — used in split/dual panels ─────────────────────────────
   Phone base: controls at 36 px touch targets (comfortable minimum).
   Tablet (≥ 640 px): columns are wide enough for 44 px — full solo sizing. */
.solo-set-row.compact {
  padding: 0.35rem 0.4rem;
  gap: 0.32rem; margin-bottom: 0.32rem; border-radius: 8px;
}
.solo-set-row.compact .solo-set-num { font-size: 0.4rem; width: 1.3rem; }
.solo-set-row.compact .solo-set-main { gap: 0.22rem; }
/* Stack KG + REPS field groups vertically */
.solo-set-row.compact .solo-set-fields { flex-direction: column; gap: 0.2rem; }
/* Each field group: label inline left, controls to the right */
.solo-set-row.compact .solo-field-group { flex-direction: row; align-items: center; gap: 0.18rem; }
.solo-set-row.compact .solo-field-label { font-size: 0.36rem; width: 1.5rem; text-align: right; flex-shrink: 0; }
/* Controls — phone base: 36 px */
.solo-set-row.compact .solo-adj      { width: 36px; min-height: 36px; font-size: 1.1rem; border-radius: 7px; }
.solo-set-row.compact .solo-val-btn  { min-width: 48px; min-height: 36px; font-size: 0.78rem; border-radius: 7px; padding: 0 0.3rem; }
.solo-set-row.compact .solo-done-btn { width: 36px; height: 36px; font-size: 0.85rem; border-width: 1.5px; }
/* Compact opt chips */
.solo-set-row.compact .solo-opt-row { gap: 0.2rem; }
.solo-set-row.compact .solo-opt-chip { padding: 0.16rem 0.35rem; border-radius: 5px; }
.solo-set-row.compact .solo-opt-lbl  { font-size: 0.32rem; }
.solo-set-row.compact .solo-opt-val  { font-size: 0.6rem; }
/* Compact done row summary */
.solo-set-row.compact.done .solo-done-summary { font-size: 0.68rem; }

/* Tablet / iPad (≥ 640 px): columns are wide — bump up to full 44 px targets */
@media (min-width: 640px) {
  .solo-set-row.compact .solo-adj      { width: 44px; min-height: 44px; font-size: 1.3rem; border-radius: 9px; }
  .solo-set-row.compact .solo-val-btn  { min-width: 58px; min-height: 44px; font-size: 0.9rem; border-radius: 9px; }
  .solo-set-row.compact .solo-done-btn { width: 44px; height: 44px; font-size: 1rem; }
  .solo-set-row.compact .solo-field-label { font-size: 0.42rem; width: 1.6rem; }
  .solo-set-row.compact .solo-set-num  { font-size: 0.44rem; }
  .solo-set-row.compact .solo-opt-chip { padding: 0.22rem 0.5rem; }
  .solo-set-row.compact .solo-opt-lbl  { font-size: 0.36rem; }
  .solo-set-row.compact .solo-opt-val  { font-size: 0.72rem; }
}

/* ── Compact PB banner — used in split panels ────────────────────────────── */
.pb-banner.pb-compact {
  padding: 0.28rem 0.45rem;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  border-radius: 6px;
}
.pb-banner.pb-compact .pb-icon  { font-size: 0.8rem; }
.pb-banner.pb-compact .pb-label { font-size: 0.3rem; }
.pb-banner.pb-compact .pb-val   { font-size: 0.68rem; }
.pb-banner.pb-compact .pb-hint  { font-size: 0.52rem; }

/* ── Split exercise meta (below images in split panel) ───────────────────── */
.split-ex-meta {
  flex-shrink: 0;
  margin-bottom: 0.32rem;
}
.split-ex-top-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.2rem;
}
/* Group tag in meta context — not absolutely positioned */
.workout-group-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  font-size: 0.4rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* Exercise name in split panel — slightly smaller than full solo */
.split-ex-name-override {
  font-size: 1.1rem !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.05;
  margin-bottom: 0.08rem;
}
/* Reduce image gap + bottom margin inside split columns */
.split-imgs { margin-bottom: 0.35rem; gap: 0.28rem; }

/* ── Fix ex-group-tag position when used in meta rows (not over image) ────── */
.solo-ex-top-row .ex-group-tag {
  position: static !important;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════
   CUSTOM NUMBER PICKER (numpad overlay)
   ═══════════════════════════════════════════════════════ */

.numpad-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease;
}
.numpad-overlay.open {
  opacity: 1; pointer-events: all;
}
.numpad-sheet {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 1.1rem var(--pad) calc(1.2rem + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 0.8rem;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.18);
}
.numpad-label {
  font-size: 0.5rem; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); text-align: center;
}
.numpad-display-row { display: flex; justify-content: center; }
.numpad-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.6rem; letter-spacing: 0.06em; color: var(--white);
  min-width: 130px; text-align: center;
  background: var(--surface2); border-radius: var(--r-md);
  padding: 0.1rem 1.4rem; border: 1.5px solid var(--border);
}
.numpad-keys {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem;
}
.nk {
  height: 58px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 1.35rem; font-weight: 700; color: var(--white);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; transition: background 0.08s;
}
.nk:active { background: var(--border); }
.nk-dot  { font-size: 1.6rem; font-weight: 900; }
.nk-back { font-size: 1.15rem; }
.numpad-actions { display: flex; gap: 0.55rem; }
.numpad-cancel-btn {
  flex: 1; height: 52px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 600; color: var(--muted);
  cursor: pointer; touch-action: manipulation;
}
.numpad-confirm-btn {
  flex: 2; height: 52px; border-radius: 12px;
  background: var(--red); border: none;
  font-size: 0.95rem; font-weight: 700; color: #fff;
  cursor: pointer; touch-action: manipulation; transition: filter 0.1s;
}
.numpad-confirm-btn:active { filter: brightness(0.88); }

/* ══════════════════════════════
   PERSONAL BEST BANNER
══════════════════════════════ */
.pb-banner {
  display: flex; align-items: center; gap: 0.6rem;
  background: linear-gradient(135deg, rgba(180,83,9,0.14) 0%, rgba(180,83,9,0.06) 100%);
  border: 1px solid rgba(180,83,9,0.35);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  margin: 0 0 0.75rem;
}
.pb-icon { font-size: 1.15rem; flex-shrink: 0; }
.pb-info { flex: 1; min-width: 0; }
.pb-label {
  font-size: 0.4rem; font-weight: 800; letter-spacing: 0.14em;
  color: #b45309; text-transform: uppercase; display: block;
}
.pb-val {
  font-size: 0.88rem; font-weight: 700; color: #92400e; display: block;
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.04em;
}
.pb-date {
  font-size: 0.48rem; font-weight: 700; color: #b45309;
  flex-shrink: 0; text-transform: uppercase;
}
.pb-empty {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
.pb-empty .pb-icon { opacity: 0.3; }
.pb-hint {
  font-size: 0.62rem; font-weight: 600; color: var(--muted);
}

/* ══════════════════════════════
   CUSTOM WORKOUTS
══════════════════════════════ */

/* Home section bar */
.cw-section-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 0 0.7rem;
}
.cw-new-btn {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em;
  padding: 0.3rem 0.7rem; border-radius: 99px;
  background: var(--red); color: #fff; border: none;
  cursor: pointer; touch-action: manipulation;
}

/* Empty state */
.cw-empty-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.3rem; width: 100%; padding: 1.5rem 1rem;
  background: var(--surface); border: 2px dashed var(--border);
  border-radius: 14px; cursor: pointer; touch-action: manipulation;
  text-align: center; margin-bottom: 0.5rem;
}
.cw-empty-icon { font-size: 1.8rem; }
.cw-empty-text {
  font-size: 0.8rem; font-weight: 700; color: var(--white);
}
.cw-empty-sub {
  font-size: 0.58rem; color: var(--muted); font-weight: 500;
}

/* CW card list */
.cw-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.5rem; }
.cw-card {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.75rem 0.85rem;
}
.cw-card-body { flex: 1; min-width: 0; }
.cw-card-name {
  font-size: 0.85rem; font-weight: 700; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cw-card-meta {
  font-size: 0.55rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.cw-card-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.cw-edit-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 0.8rem; color: var(--muted); cursor: pointer;
  touch-action: manipulation;
}
.cw-delete-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(217,28,34,0.08); border: 1px solid rgba(217,28,34,0.2);
  font-size: 0.75rem; cursor: pointer; touch-action: manipulation;
}
.cw-train-btn {
  padding: 0.35rem 0.75rem; border-radius: 8px;
  background: var(--red); color: #fff; border: none;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
  cursor: pointer; touch-action: manipulation;
}

/* CW builder screen */
.cw-edit-screen { background: var(--surface2); }
.cw-edit-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem var(--pad);
  background: var(--surface2); border-bottom: 1px solid var(--border);
}
.cw-edit-title {
  flex: 1; font-size: 0.8rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--white);
}
.cw-edit-body {
  padding: 1rem var(--pad) 4rem;
  overflow-y: auto;
}

/* Exercise list in builder */
.cw-ex-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.cw-ex-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.65rem 0.75rem;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.cw-ex-row-info { }
.cw-ex-row-name {
  font-size: 0.78rem; font-weight: 700; color: var(--white); line-height: 1.2;
}
.cw-ex-row-group {
  font-size: 0.48rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.cw-ex-row-ctrl {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.cw-ex-field {
  display: flex; align-items: center; gap: 0.3rem;
  background: var(--surface2); border-radius: 8px; padding: 0.25rem 0.4rem;
}
.cw-field-lbl {
  font-size: 0.38rem; font-weight: 800; letter-spacing: 0.12em;
  color: var(--muted); text-transform: uppercase; min-width: 28px;
}
.cw-field-val {
  font-size: 0.9rem; font-weight: 700; color: var(--white);
  min-width: 1.5ch; text-align: center; font-family: 'Bebas Neue', sans-serif;
}
.cw-target-input {
  width: 52px; height: 30px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.72rem; font-weight: 600; color: var(--white);
  text-align: center; padding: 0 0.3rem;
}
.cw-remove-btn {
  margin-left: auto; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(217,28,34,0.1); border: 1px solid rgba(217,28,34,0.25);
  font-size: 0.65rem; color: var(--red); cursor: pointer;
  touch-action: manipulation; display: flex; align-items: center; justify-content: center;
}
.cw-ex-empty {
  font-size: 0.65rem; color: var(--muted); text-align: center;
  padding: 1.2rem 0; font-weight: 500;
}

/* Add exercise button */
.cw-add-ex-btn {
  width: 100%; padding: 0.65rem; border-radius: 10px;
  background: rgba(217,28,34,0.06); border: 1.5px dashed rgba(217,28,34,0.35);
  font-size: 0.7rem; font-weight: 700; color: var(--red);
  cursor: pointer; touch-action: manipulation; letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}
.cw-add-ex-btn.open {
  background: var(--surface); border-style: solid;
}

/* Exercise picker */
.cw-picker {
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
  margin-bottom: 0.75rem;
}
.cw-picker > .text-input {
  border-radius: 0; border: none; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.cw-picker-list {
  max-height: 280px; overflow-y: auto;
}
.cw-picker-group {
  padding: 0.4rem 0.75rem 0.2rem;
  font-size: 0.4rem; font-weight: 800; letter-spacing: 0.14em;
  color: var(--muted); text-transform: uppercase;
  background: var(--surface2); position: sticky; top: 0; z-index: 1;
}
.cw-picker-row {
  width: 100%; padding: 0.65rem 0.75rem;
  display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  cursor: pointer; touch-action: manipulation; text-align: left;
}
.cw-picker-row:active { background: var(--surface2); }
.cw-picker-row.already { opacity: 0.5; pointer-events: none; }
.cw-picker-name { font-size: 0.75rem; font-weight: 600; color: var(--white); }
.cw-picker-badge {
  font-size: 0.42rem; font-weight: 700; padding: 0.1rem 0.35rem;
  background: rgba(34,197,94,0.15); color: #22c55e;
  border-radius: 99px; text-transform: uppercase; letter-spacing: 0.08em;
}
.cw-picker-empty {
  padding: 1.2rem 0.75rem; font-size: 0.65rem; color: var(--muted); text-align: center;
}

/* ══════════════════════════════
   CARDIO SCREEN
══════════════════════════════ */
.cardio-screen {
  display: flex; flex-direction: column;
  background: var(--black); min-height: 100%;
  padding-bottom: 2rem;
}
.cardio-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem var(--pad) 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cardio-title {
  flex: 1; font-family: var(--display); font-size: 1.4rem;
  letter-spacing: 2px; color: var(--white);
}

/* Person picker */
.cardio-person-row {
  display: flex; gap: 0.5rem;
  padding: 0.9rem var(--pad) 0.5rem;
}
.cardio-person-btn {
  flex: 1; padding: 0.55rem;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); font-size: 0.78rem; font-weight: 700;
  color: var(--white); cursor: pointer; text-align: center;
  transition: background 0.12s, border-color 0.12s;
  touch-action: manipulation;
}

/* Activity grid */
.cardio-type-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem; padding: 0.75rem var(--pad);
}
.cardio-type-btn {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.2rem;
  padding: 0.55rem 0.3rem 0.5rem;
  aspect-ratio: 1 / 1;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s;
}
/* Background photo */
.ctt-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  z-index: 0;
}
/* Dark overlay — normal state */
.ctt-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.70) 0%, rgba(0,0,0,0.28) 55%, rgba(0,0,0,0.18) 100%);
  transition: background 0.15s, border-bottom 0.15s;
}
/* Selected state: stronger overlay + accent bottom border */
.ctt-overlay-sel {
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.42) 60%, rgba(0,0,0,0.22) 100%);
  box-shadow: inset 0 -3px 0 var(--ctt-accent, var(--red));
}
.cardio-type-btn.selected { border-color: transparent; }
.ctt-icon  { position: relative; z-index: 2; font-size: 1.3rem; line-height: 1; }
.ctt-label { position: relative; z-index: 2; font-size: 0.34rem; font-weight: 800; color: rgba(255,255,255,0.92);
             text-transform: uppercase; letter-spacing: 0.07em; text-align: center; }

/* Duration + Distance field cards */
.cardio-fields-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  padding: 0 var(--pad) 0.75rem;
}
.cardio-field-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-md); padding: 0.85rem 1rem;
  cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s;
}
.cardio-field-card:active { border-color: var(--muted); }
.cfc-label {
  font-size: 0.38rem; font-weight: 800; letter-spacing: 0.14em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 0.4rem;
}
.cfc-val {
  font-size: 1.5rem; font-weight: 700; color: var(--white); line-height: 1;
}
.cfc-val.empty { color: var(--muted); font-weight: 400; font-size: 1.1rem; }

/* History */
.cardio-history-section {
  padding: 0 var(--pad);
  flex: 1;
}
.cardio-history-title {
  font-size: 0.58rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
  padding: 0.6rem 0 0.5rem; border-top: 1px solid var(--border);
}
.cardio-entry-row {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
}
.cer-icon  { font-size: 1.1rem; flex-shrink: 0; }
.cer-info  { flex: 1; min-width: 0; }
.cer-type  { display: block; font-size: 0.72rem; font-weight: 700; color: var(--white); }
.cer-meta  { font-size: 0.58rem; color: var(--muted); }
.cer-person{ font-size: 0.52rem; font-weight: 700; flex-shrink: 0; }
.cer-date  { font-size: 0.46rem; color: var(--muted); flex-shrink: 0; }
.cer-del   {
  background: none; border: none; color: var(--muted); font-size: 0.7rem;
  cursor: pointer; padding: 0.3rem; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.cer-del:active { color: var(--danger); }
.cardio-empty {
  padding: 1.5rem 0; text-align: center;
  font-size: 0.7rem; color: var(--muted);
}

/* ── Cardio home widget ── */
.cardio-home-section { margin-bottom: 0; }
.cardio-recent-list  { margin: 0.75rem 0 1.25rem; }

/* Banner card top gap */
.cardio-banner-card { margin-top: 0.75rem; }

/* Banner card — mirrors jaline-next-card pattern */
.cardio-banner-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  width: 100%; min-height: 148px;
  border-radius: var(--r-md);
  border: none; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.cardio-banner-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
.cardio-banner-grd {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.84) 0%, rgba(0,0,0,0.42) 55%, rgba(0,0,0,0.16) 100%);
}
.cardio-banner-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; flex: 1;
  padding: 0.75rem 0.85rem 0.8rem;
  gap: 0.25rem;
}
.cardio-banner-top {
  display: flex; align-items: center; justify-content: space-between;
}
.cardio-banner-tag {
  font-size: 0.38rem; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--red); color: #fff;
  border-radius: 99px; padding: 0.2rem 0.55rem;
}
.cardio-banner-count {
  font-size: 0.44rem; font-weight: 600; color: rgba(255,255,255,0.62);
}
.cardio-banner-title {
  font-family: var(--display); font-size: 1.7rem; letter-spacing: 3px;
  color: #fff; line-height: 1; margin-top: 0.1rem;
}
.cardio-banner-types {
  display: flex; gap: 0.35rem; margin-top: 0.05rem;
}
.cardio-banner-icon { font-size: 1rem; line-height: 1; }
.cardio-banner-cta {
  align-self: flex-start; margin-top: auto; padding-top: 0.45rem;
  font-size: 0.46rem; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgba(255,255,255,0.82);
}

/* Recent cardio rows on home */
.cardio-home-row {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); margin-bottom: 0.35rem;
}
.chr-thumb {
  width: 34px; height: 34px; border-radius: 5px;
  object-fit: cover; flex-shrink: 0;
}
.chr-icon   { font-size: 1rem; flex-shrink: 0; }
.chr-info   { flex: 1; min-width: 0; }
.chr-type   { display: block; font-size: 0.68rem; font-weight: 700; color: var(--white); }
.chr-meta   { font-size: 0.54rem; color: var(--muted); }
.chr-person { font-size: 0.5rem; font-weight: 700; flex-shrink: 0; }
.chr-date   { font-size: 0.44rem; color: var(--muted); flex-shrink: 0; }
.cardio-view-all-btn {
  width: 100%; padding: 0.6rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 0.55rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  cursor: pointer; touch-action: manipulation; text-align: center;
  margin-top: 0.15rem; -webkit-tap-highlight-color: transparent;
}
.cardio-view-all-btn:active { background: var(--surface2); }

/* ══════════════════════════════
   WARM-UP SCREEN
══════════════════════════════ */
.warmup-screen {
  display: flex; flex-direction: column;
  background: var(--black); min-height: 100dvh;
}

/* Header */
.warmup-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem var(--pad);
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.warmup-hdr-text  { flex: 1; }
.warmup-hdr-title {
  font-family: var(--display); font-size: 1.1rem; letter-spacing: 2px;
  color: var(--white); line-height: 1;
}
.warmup-hdr-sub {
  font-size: 0.52rem; color: var(--muted); margin-top: 0.15rem;
}
.warmup-skip-btn {
  font-size: 0.5rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  background: none; border: 1px solid var(--border);
  border-radius: 99px; padding: 0.22rem 0.65rem;
  cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.warmup-skip-btn:active { background: var(--surface2); }

/* Scrollable body */
.warmup-body {
  flex: 1; overflow-y: auto;
  padding: 1.5rem var(--pad) 2.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
}

/* Timer ring */
.warmup-timer-wrap {
  position: relative; width: 200px; height: 200px; flex-shrink: 0;
}
.warmup-ring {
  width: 200px; height: 200px;
}
.warmup-ring-bg {
  fill: none; stroke: var(--border); stroke-width: 10;
}
.warmup-ring-track {
  fill: none; stroke-width: 10;
  transition: stroke-dashoffset 0.9s linear;
}
.warmup-timer-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.25rem;
}
.warmup-time {
  font-family: var(--display); font-size: 3rem; letter-spacing: 4px;
  color: var(--white); line-height: 1;
}
.warmup-time.done-text {
  font-size: 1.5rem; letter-spacing: 2px;
}
.warmup-timer-lbl {
  font-size: 0.38rem; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Control buttons */
.warmup-ctrl { width: 100%; max-width: 340px; }
.warmup-start-btn,
.warmup-go-btn {
  width: 100%; padding: 0.9rem;
  font-family: var(--display); font-size: 1.1rem; letter-spacing: 3px;
  border-radius: var(--r-md); border: none;
  cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.12s;
}
.warmup-start-btn:active,
.warmup-go-btn:active { opacity: 0.82; }
.warmup-pause-btn {
  width: 100%; padding: 0.75rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  border-radius: var(--r-md);
}

/* Exercise list */
.warmup-ex-section { width: 100%; max-width: 440px; }
.warmup-ex-header {
  font-size: 0.46rem; font-weight: 800; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted);
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.warmup-ex-row {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); margin-bottom: 0.4rem;
  transition: border-color 0.2s, background 0.2s;
}
.warmup-ex-row.wu-done {
  opacity: 0.45;
}
.warmup-ex-row.wu-active {
  border-color: var(--wu-accent, var(--red));
  background: var(--surface);
}
.wu-active-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: 2px 0 0 2px;
}
.wu-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.52rem; font-weight: 800; color: var(--muted);
  flex-shrink: 0; margin-top: 0.1rem;
}
.wu-active .wu-step-num {
  background: var(--wu-accent, var(--red));
  color: #fff; border-color: transparent;
}
.wu-emoji { font-size: 1.4rem; flex-shrink: 0; line-height: 1.3; }
.wu-info  { flex: 1; min-width: 0; }
.wu-name  { font-size: 0.72rem; font-weight: 700; color: var(--white); }
.wu-dur   { font-size: 0.55rem; font-weight: 600; color: var(--muted); margin-top: 0.1rem; }
.wu-cue   { font-size: 0.52rem; color: var(--muted); margin-top: 0.18rem; font-style: italic; }

/* ══════════════════════════════════════════════════
   ONBOARDING v2  (.ob-*)
══════════════════════════════════════════════════ */
.ob-screen { display:flex; flex-direction:column; min-height:100vh; background:var(--black); }

/* Welcome */
.ob-welcome { position:relative; flex:1; min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; padding:0 var(--pad) 3rem; }
.ob-welcome-bg { position:absolute; inset:0; background:url('assets/model-male-front.webp') center/cover no-repeat; filter:brightness(0.28); }
.ob-welcome-grd { position:absolute; inset:0; background:linear-gradient(to top,#000 0%,rgba(0,0,0,0.6) 45%,rgba(0,0,0,0.05) 100%); }
.ob-welcome-body { position:relative; z-index:1; text-align:center; width:100%; max-width:420px; }
.ob-welcome-logo { font-family:var(--display); font-size:clamp(4rem,12vw,6rem); letter-spacing:4px; line-height:1; color:var(--white); margin-bottom:0.4rem; }
.ob-welcome-logo span { color:var(--red); }
.ob-welcome-tagline { font-size:0.88rem; color:rgba(255,255,255,0.45); letter-spacing:0.06em; margin-bottom:2rem; }

/* Step nav bar */
.ob-step-nav { display:flex; align-items:center; padding:1.1rem var(--pad); gap:0.75rem; }
.ob-back-btn { width:34px; height:34px; border-radius:50%; background:var(--surface); border:none; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--muted); flex-shrink:0; transition:background 0.15s; }
.ob-back-btn:active { background:var(--surface2); }
.ob-progress-bar { flex:1; height:3px; background:var(--surface2); border-radius:2px; overflow:hidden; }
.ob-progress-fill { height:100%; border-radius:2px; background:var(--red); transition:width 0.35s ease; }
.ob-step-label { font-size:0.6rem; font-weight:700; letter-spacing:0.14em; text-transform:uppercase; color:var(--muted); flex-shrink:0; white-space:nowrap; }

/* Step content */
.ob-step-content { flex:1; display:flex; flex-direction:column; padding:0.5rem var(--pad) 1rem; }
.ob-step-q { font-family:var(--display); font-size:clamp(1.8rem,5.5vw,2.4rem); letter-spacing:1px; color:var(--white); margin-bottom:0.35rem; }
.ob-step-hint { font-size:0.8rem; color:var(--muted); margin-bottom:1.4rem; line-height:1.55; }
.ob-step-choices { flex:1; display:flex; flex-direction:column; gap:0.65rem; }
.ob-step-footer { padding:1rem var(--pad); }
.ob-name-error { font-size:0.75rem; color:var(--danger); margin-top:0.35rem; min-height:1em; }

/* Name input */
.ob-name-input { font-size:1.35rem; font-weight:700; background:var(--surface); border:2px solid var(--border); border-radius:14px; color:var(--white); font-family:var(--body); padding:1.1rem 1.25rem; width:100%; outline:none; transition:border-color 0.15s; }
.ob-name-input:focus { border-color:var(--red); }

/* Dark gym background overlay — reused across goal/stats/experience/days/result steps */
.ob-has-bg { position:relative; }
.ob-bg-img { position:fixed; inset:0; background:url('assets/model-male-front.webp') center/cover no-repeat; filter:brightness(0.1); z-index:0; pointer-events:none; }
/* Extra darkening overlay so content is always readable */
.ob-has-bg::after { content:''; position:fixed; inset:0; background:rgba(0,0,0,0.52); z-index:0; pointer-events:none; }
.ob-has-bg .ob-step-nav,
.ob-has-bg .ob-step-content,
.ob-has-bg .ob-step-footer { position:relative; z-index:1; }
/* Titles need text-shadow to punch through any remaining background bleed */
.ob-has-bg .ob-step-q { text-shadow:0 1px 20px rgba(0,0,0,1),0 2px 6px rgba(0,0,0,0.9); }
.ob-has-bg .ob-step-hint { text-shadow:0 1px 10px rgba(0,0,0,0.95); }

/* Body stats step */
.obs-fields { display:flex; flex-direction:column; gap:1.1rem; flex:1; }
.obs-field { display:flex; flex-direction:column; gap:0.45rem; }
.obs-label { font-size:0.68rem; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:rgba(255,255,255,0.5); }
.obs-label-row { display:flex; align-items:center; justify-content:space-between; }
.obs-input { background:rgba(0,0,0,0.55); border:1.5px solid rgba(255,255,255,0.2); border-radius:12px; padding:0.95rem 1rem; font-size:1.1rem; font-weight:600; color:#fff; width:100%; box-sizing:border-box; outline:none; transition:border-color 0.15s; appearance:none; }
.obs-input::placeholder { color:rgba(255,255,255,0.5); }
.obs-input:focus { border-color:var(--red); background:rgba(0,0,0,0.65); }
.obs-unit-toggle { display:flex; background:rgba(255,255,255,0.08); border-radius:8px; overflow:hidden; }
.obs-unit-btn { padding:0.3rem 0.8rem; background:none; border:none; font-size:0.7rem; font-weight:700; color:var(--muted); cursor:pointer; transition:all 0.15s; letter-spacing:0.06em; }
.obs-unit-btn.active { background:var(--red); color:#fff; border-radius:6px; }
.obs-ft-row { display:flex; align-items:center; gap:0.5rem; }
.obs-ft-sep { font-size:1.1rem; color:var(--muted); font-weight:600; flex-shrink:0; }
.obs-ft-row .obs-input { flex:1; min-width:0; }
.obs-skip { font-size:0.72rem; color:var(--muted); text-align:center; margin:0.75rem 0 0; }

/* Goal cards — bigger and brighter */
.ob-goal-choices { gap:0.75rem; flex:1; }
.ob-goal-card { position:relative; overflow:hidden; border-radius:14px; flex:1; min-height:130px; border:2px solid rgba(255,255,255,0.15); cursor:pointer; display:flex; align-items:center; -webkit-tap-highlight-color:transparent; transition:border-color 0.15s, transform 0.1s; }
.ob-goal-card:active { transform:scale(0.985); }
.ob-goal-card.ob-sel { border-color:var(--goal-accent, var(--red)); box-shadow:0 0 0 1px var(--goal-accent, var(--red)) inset; }
.ob-goal-img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:0.5; }
.ob-goal-grd { position:absolute; inset:0; background:linear-gradient(to right,rgba(0,0,0,0.97) 15%,rgba(0,0,0,0.55) 60%,rgba(0,0,0,0.15) 100%); }
.ob-goal-body { position:relative; z-index:1; padding:1.1rem 1.25rem; flex:1; display:flex; flex-direction:column; gap:0.25rem; }
.ob-goal-icon { font-size:2.2rem; line-height:1; margin-bottom:0.1rem; }
.ob-goal-name { font-size:1.2rem; font-weight:900; color:var(--white); letter-spacing:0.02em; }
.ob-goal-desc { font-size:0.78rem; color:rgba(255,255,255,0.75); line-height:1.4; }
.ob-goal-tick { position:absolute; right:1.1rem; top:50%; transform:translateY(-50%); width:26px; height:26px; border-radius:50%; border:2px solid rgba(255,255,255,0.25); display:flex; align-items:center; justify-content:center; font-size:0.7rem; color:white; transition:all 0.15s; }
.ob-goal-card.ob-sel .ob-goal-tick { border-color:var(--goal-accent, var(--red)); background:var(--goal-accent, var(--red)); }

/* Programme cards — full height, bright images */
.ob-prog-screen .ob-step-content { padding-bottom:0; }
.ob-prog-content { gap:0; }
.ob-prog-grid { display:grid; grid-template-columns:1fr 1fr; gap:0.75rem; flex:1; }
.ob-prog-grid-full { flex:1; min-height:280px; }
.ob-prog-card { position:relative; overflow:hidden; border-radius:14px; border:2px solid var(--border); cursor:pointer; min-height:240px; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; padding-bottom:1.5rem; -webkit-tap-highlight-color:transparent; transition:border-color 0.15s; }
.ob-prog-card-full { flex:1; }
.ob-prog-card.ob-sel { border-color:var(--red); }
.ob-prog-img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:top; opacity:0.72; }
.ob-prog-overlay { position:absolute; inset:0; background:linear-gradient(to top,rgba(0,0,0,0.94) 0%,rgba(0,0,0,0.1) 60%,transparent 100%); }
.ob-prog-body { position:relative; z-index:1; text-align:center; padding:0 0.6rem; }
.ob-prog-name { font-size:1.2rem; font-weight:900; color:white; letter-spacing:0.04em; }
.ob-prog-exs { font-size:0.72rem; color:rgba(255,255,255,0.65); margin-top:0.35rem; line-height:1.7; }
.ob-prog-tick { position:absolute; top:0.75rem; right:0.75rem; width:24px; height:24px; border-radius:50%; border:2px solid rgba(255,255,255,0.28); display:flex; align-items:center; justify-content:center; font-size:0.65rem; color:white; transition:all 0.15s; }
.ob-prog-card.ob-sel .ob-prog-tick { border-color:var(--red); background:var(--red); }
.ob-prog-tag-pill { position:absolute; top:0.75rem; left:0.75rem; background:rgba(220,38,38,0.9); color:#fff; font-size:0.52rem; font-weight:800; letter-spacing:0.1em; padding:0.22rem 0.6rem; border-radius:20px; text-transform:uppercase; z-index:1; }

/* Experience level cards — with color accents */
.ob-level-card { display:block; padding:0; background:none; border:none; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.ob-level-bar { display:flex; align-items:center; gap:1rem; padding:1.25rem 1.25rem; background:rgba(0,0,0,0.6); border:2px solid rgba(255,255,255,0.14); border-radius:14px; transition:all 0.15s; }
.ob-level-card.ob-sel .ob-level-bar { background:rgba(0,0,0,0.72); border-color:var(--lvl-color, var(--red)); }
.ob-level-dot { width:16px; height:16px; border-radius:50%; flex-shrink:0; }
.ob-level-info { flex:1; }
.ob-level-name { font-size:1.05rem; font-weight:800; color:var(--white); }
.ob-level-time { font-size:0.72rem; font-weight:500; color:rgba(255,255,255,0.5); margin-left:0.4rem; }
.ob-level-desc { font-size:0.76rem; color:rgba(255,255,255,0.6); margin-top:0.2rem; }
.ob-level-tick { width:26px; height:26px; border-radius:50%; border:2px solid rgba(255,255,255,0.22); display:flex; align-items:center; justify-content:center; font-size:0.65rem; color:white; flex-shrink:0; transition:all 0.15s; }
.ob-level-card.ob-sel .ob-level-tick { border-color:var(--lvl-color, var(--red)); background:var(--lvl-color, var(--red)); }

/* Days selector — 5 options */
.ob-days-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:0.75rem; }
.ob-days-grid-5 { display:grid; grid-template-columns:repeat(5,1fr); gap:0.45rem; margin-top:0.5rem; }
.ob-days-card { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0.35rem; padding:1.75rem 0; background:var(--surface); border:2px solid var(--border); border-radius:14px; cursor:pointer; -webkit-tap-highlight-color:transparent; transition:all 0.15s; }
.ob-days-card5 { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0.25rem; padding:1.75rem 0.15rem; background:rgba(0,0,0,0.55); border:2px solid rgba(255,255,255,0.15); border-radius:14px; cursor:pointer; -webkit-tap-highlight-color:transparent; transition:all 0.15s; min-width:0; }
.ob-days-card.ob-sel, .ob-days-card5.ob-sel { border-color:var(--red); background:rgba(220,38,38,0.18); }
.ob-days-num { font-family:var(--display); font-size:3.2rem; color:var(--white); letter-spacing:1px; line-height:1; transition:color 0.15s; }
.ob-days-card5 .ob-days-num { font-size:2.8rem; }
.ob-days-card.ob-sel .ob-days-num, .ob-days-card5.ob-sel .ob-days-num { color:var(--red); }
.ob-days-label { font-size:0.58rem; font-weight:700; color:var(--muted); letter-spacing:0.1em; text-transform:uppercase; }
.ob-days-label5 { font-size:0.6rem; font-weight:700; color:rgba(255,255,255,0.55); letter-spacing:0.05em; text-transform:uppercase; }
.ob-days-note { font-size:0.72rem; color:var(--muted); text-align:center; margin-top:1.25rem; line-height:1.6; }
.ob-days-note5 { font-size:0.55rem; color:rgba(255,255,255,0.38); text-align:center; line-height:1.35; margin-top:0.1rem; overflow:hidden; }

/* Settings days grid */
.settings-days-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:0.45rem; }
.settings-days-grid .ob-days-card5 { background:var(--surface); border-color:var(--border); }
.settings-days-grid .ob-days-card5.ob-sel { border-color:var(--red); background:rgba(220,38,38,0.08); }

/* Plan ready / results screen */
.ob-result-screen .ob-step-nav { position:relative; z-index:1; }
.ob-result-scroll { position:relative; z-index:1; overflow-y:auto; -webkit-overflow-scrolling:touch; flex:1; display:flex; flex-direction:column; }
.ob-result-hero { text-align:center; padding:2rem var(--pad) 1.5rem; }
.ob-result-ready { font-size:0.7rem; font-weight:700; letter-spacing:0.18em; text-transform:uppercase; color:var(--red); margin-bottom:0.6rem; text-shadow:0 1px 8px rgba(0,0,0,0.9); }
.ob-result-title { font-family:var(--display); font-size:clamp(2.4rem,8vw,3.2rem); color:var(--white); letter-spacing:2px; line-height:1; text-shadow:0 2px 24px rgba(0,0,0,1); }
.ob-result-sub { font-size:0.85rem; color:rgba(255,255,255,0.7); margin-top:0.6rem; text-shadow:0 1px 8px rgba(0,0,0,0.9); }
.ob-result-cards { display:flex; flex-direction:column; gap:0.55rem; padding:0 var(--pad); }
.ob-result-row { display:flex; align-items:center; gap:0.9rem; background:rgba(0,0,0,0.72); border:1px solid rgba(255,255,255,0.18); border-radius:14px; padding:1rem 1.1rem; }
.ob-result-icon { font-size:1.4rem; line-height:1; flex-shrink:0; }
.ob-result-info { flex:1; }
.ob-result-key { font-size:0.6rem; font-weight:700; letter-spacing:0.14em; text-transform:uppercase; color:rgba(255,255,255,0.5); }
.ob-result-val { font-size:1.05rem; font-weight:700; color:var(--white); margin-top:0.15rem; }
.ob-focus-card { margin:0.55rem var(--pad) 0; padding:1.1rem 1.15rem; background:rgba(0,0,0,0.65); border:1px solid rgba(220,38,38,0.45); border-radius:14px; display:flex; align-items:flex-start; gap:0.75rem; }
.ob-focus-icon { font-size:1.4rem; line-height:1; flex-shrink:0; }
.ob-focus-text { flex:1; }
.ob-focus-label { font-size:0.62rem; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:var(--red); }
.ob-focus-desc { font-size:0.88rem; color:rgba(255,255,255,0.9); margin-top:0.25rem; line-height:1.55; }
.ob-plan-section { padding:0.75rem var(--pad) 0; }
.ob-plan-title { font-size:0.62rem; font-weight:700; letter-spacing:0.14em; text-transform:uppercase; color:rgba(255,255,255,0.5); margin-bottom:0.65rem; }
.ob-plan-day { display:flex; align-items:center; gap:0.75rem; padding:0.85rem 1rem; background:rgba(0,0,0,0.62); border:1px solid rgba(255,255,255,0.14); border-radius:12px; margin-bottom:0.45rem; }
.ob-plan-day-dot { width:9px; height:9px; border-radius:50%; background:var(--red); flex-shrink:0; }
.ob-plan-day.ob-dim .ob-plan-day-dot { background:rgba(255,255,255,0.2); }
.ob-plan-day-name { font-size:0.95rem; font-weight:700; color:var(--white); flex:1; }
.ob-plan-day.ob-dim .ob-plan-day-name { color:rgba(255,255,255,0.35); }
.ob-plan-day-exs { font-size:0.72rem; color:rgba(255,255,255,0.5); }
.ob-cta { padding:1rem var(--pad) 2rem; }

/* ══════════════════════════════════════════════════
   TRAINING PARTNER SYSTEM
══════════════════════════════════════════════════ */
.partner-status-row { display:flex; align-items:center; gap:0.85rem; }
.partner-avatar { width:40px; height:40px; border-radius:50%; background:var(--red); color:white; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:1rem; flex-shrink:0; }
.partner-info { flex:1; min-width:0; }
.partner-name { font-size:0.9rem; font-weight:700; color:var(--white); }
.partner-email { font-size:0.72rem; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.partner-badge { font-size:0.58rem; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; padding:0.25rem 0.65rem; border-radius:20px; background:rgba(16,185,129,0.15); color:#10b981; border:1px solid rgba(16,185,129,0.3); }
.partner-badge.pending { background:rgba(245,158,11,0.15); color:#f59e0b; border-color:rgba(245,158,11,0.3); }
.partner-remove-btn { background:transparent; border:none; color:var(--muted); font-size:0.72rem; cursor:pointer; text-decoration:underline; padding:0; text-underline-offset:3px; }
.partner-remove-btn:hover { color:var(--danger); }
.pending-invite-card { background:rgba(99,102,241,0.1); border:1px solid rgba(99,102,241,0.3); border-radius:12px; padding:0.9rem 1.1rem; display:flex; align-items:center; gap:0.75rem; }
.pic-icon { font-size:1.4rem; line-height:1; flex-shrink:0; }
.pic-info { flex:1; }
.pic-from { font-size:0.85rem; font-weight:700; color:var(--white); }
.pic-sub { font-size:0.7rem; color:var(--muted); margin-top:0.15rem; }
.pic-btns { display:flex; gap:0.4rem; flex-shrink:0; }
.pic-accept { background:var(--red); color:white; border:none; border-radius:8px; padding:0.45rem 0.85rem; font-size:0.7rem; font-weight:700; letter-spacing:0.05em; cursor:pointer; }
.pic-decline { background:transparent; color:var(--muted); border:1.5px solid var(--border); border-radius:8px; padding:0.45rem 0.85rem; font-size:0.7rem; font-weight:700; cursor:pointer; }

/* Stats partner toggle */
.stats-hdr-actions { display:flex; align-items:center; gap:0.5rem; }
.stats-partner-toggle { background:var(--surface2); border:1.5px solid var(--border); color:var(--muted); font-size:0.65rem; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; border-radius:20px; padding:0.35rem 0.85rem; cursor:pointer; transition:all 0.15s; white-space:nowrap; }
.stats-partner-toggle.active { color:var(--white); border-color:var(--red); background:rgba(220,38,38,0.1); }
.stats-partner-loading { text-align:center; padding:2rem; color:var(--muted); font-size:0.82rem; }

/* Details/summary chevron (used in Settings collapsible) */
details.card summary { -webkit-user-select:none; user-select:none; }
details.card summary::-webkit-details-marker { display:none; }
details.card[open] .details-chevron { transform:rotate(180deg); }
.details-chevron { transition:transform 0.2s ease; color:var(--muted); flex-shrink:0; }

/* ══════════════════════════════
   AUTH (SIGN-IN / REGISTER)
══════════════════════════════ */
.auth-tabs {
  display: flex;
  width: 100%;
  max-width: 480px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-bottom: none;
}
.auth-tab {
  flex: 1;
  background: var(--surface2);
  color: var(--muted);
  border: none;
  padding: 0.85rem;
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab:not(:last-child) { border-right: 1px solid var(--border); }
.auth-tab.active { background: var(--surface); color: var(--white); }
.auth-tab + .card { border-radius: 0 0 var(--r-md) var(--r-md); }
.auth-hero {
  width: 100%; padding: 2.5rem var(--pad) 1.75rem;
  text-align: center;
}
.auth-not-configured {
  width: 100%; max-width: 480px;
  background: rgba(255,68,68,0.1);
  border: 1px solid rgba(255,68,68,0.35);
  border-radius: var(--r-md);
  padding: 0.9rem 1.1rem;
  font-size: 0.8rem;
  color: #ff9999;
  line-height: 1.5;
}
.auth-not-configured code {
  background: rgba(255,255,255,0.08);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}

/* ════════════════════════════════════════════════════════════════════════════
   MOTION & FEEL — screen transitions, tap feedback, celebrations
   ════════════════════════════════════════════════════════════════════════════ */

/* Screen entrance — applied only on navigation, never on in-screen re-renders */
.screen-enter { animation: screenIn 0.32s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Universal tap feedback — every interactive element responds to touch */
button, .day-card, .muscle-group-card, .ex-card, .overview-card {
  -webkit-tap-highlight-color: transparent;
}
button:active,
.day-card:active,
.muscle-group-card:active {
  transform: scale(0.97);
  transition: transform 0.06s ease;
}

/* Set-done pulse — fired from the done handler via .set-flash */
.set-flash { animation: setFlash 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes setFlash {
  0%   { box-shadow: 0 0 0 0 rgba(22,163,74, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(22,163,74, 0); }
}

/* PB celebration banner on the finish screen */
.pb-celebrate {
  display: flex; align-items: center; gap: 0.65rem;
  background: linear-gradient(120deg, rgba(217,28,34,0.12), rgba(217,28,34,0.04));
  border: 1px solid rgba(217,28,34,0.35);
  border-radius: var(--r-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  animation: pbPop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) backwards;
}
.pb-celebrate:nth-child(2) { animation-delay: 0.12s; }
.pb-celebrate:nth-child(3) { animation-delay: 0.24s; }
.pb-celebrate:nth-child(4) { animation-delay: 0.36s; }
@keyframes pbPop {
  from { opacity: 0; transform: scale(0.85) translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.pb-celebrate .pbc-icon { font-size: 1.5rem; animation: pbcBounce 1.6s ease-in-out infinite; }
@keyframes pbcBounce { 0%,100% { transform: none; } 50% { transform: translateY(-3px) rotate(-6deg); } }
.pb-celebrate .pbc-text  { flex: 1; }
.pb-celebrate .pbc-title {
  font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.05em;
  color: var(--red);
}
.pb-celebrate .pbc-detail { font-size: 0.78rem; color: var(--muted); margin-top: 1px; }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .screen-enter, .set-flash, .pb-celebrate, .pb-celebrate .pbc-icon { animation: none !important; }
  button:active, .day-card:active, .muscle-group-card:active { transform: none; }
}

/* ── Staggered entrances — children cascade in when a screen is navigated to ── */
.screen-enter .day-card,
.screen-enter .overview-card,
.screen-enter .stats-section,
.screen-enter .muscle-group-card,
.screen-enter .ex-card,
.screen-enter .prev-ex-row,
.screen-enter .achievement-badge {
  animation: cardIn 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.screen-enter .day-card:nth-child(1), .screen-enter .overview-card:nth-child(1),
.screen-enter .muscle-group-card:nth-child(1), .screen-enter .ex-card:nth-child(1) { animation-delay: 0.04s; }
.screen-enter .day-card:nth-child(2), .screen-enter .overview-card:nth-child(2),
.screen-enter .muscle-group-card:nth-child(2), .screen-enter .ex-card:nth-child(2) { animation-delay: 0.09s; }
.screen-enter .day-card:nth-child(3), .screen-enter .overview-card:nth-child(3),
.screen-enter .muscle-group-card:nth-child(3), .screen-enter .ex-card:nth-child(3) { animation-delay: 0.14s; }
.screen-enter .day-card:nth-child(4), .screen-enter .overview-card:nth-child(4),
.screen-enter .muscle-group-card:nth-child(4), .screen-enter .ex-card:nth-child(4) { animation-delay: 0.19s; }
.screen-enter .day-card:nth-child(5), .screen-enter .muscle-group-card:nth-child(5),
.screen-enter .ex-card:nth-child(5) { animation-delay: 0.24s; }
.screen-enter .day-card:nth-child(6), .screen-enter .muscle-group-card:nth-child(6),
.screen-enter .ex-card:nth-child(6) { animation-delay: 0.29s; }
.screen-enter .day-card:nth-child(7), .screen-enter .muscle-group-card:nth-child(7),
.screen-enter .ex-card:nth-child(7) { animation-delay: 0.34s; }
.screen-enter .ex-card:nth-child(n+8) { animation-delay: 0.38s; }

/* Hero stats strip values pop on home entrance */
.screen-enter .hss-val { animation: hssPop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) 0.25s backwards; }
@keyframes hssPop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen-enter .day-card, .screen-enter .overview-card, .screen-enter .stats-section,
  .screen-enter .muscle-group-card, .screen-enter .ex-card, .screen-enter .prev-ex-row,
  .screen-enter .achievement-badge, .screen-enter .hss-val { animation: none !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
   LIVE TRAIN-TOGETHER — partner list, live chip, workout panel
   ════════════════════════════════════════════════════════════════════════════ */

/* Partner row on the Train Together screen */
.partner-live-row {
  display: flex; align-items: center; gap: 0.8rem;
  width: 100%; text-align: left;
  background: var(--surface);
  border: 1.5px solid rgba(22,163,74,0.45);
  border-radius: var(--r-md);
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.partner-live-row:hover { border-color: var(--success); transform: translateY(-1px); }
.plr-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--success-dim); color: var(--success);
  font-weight: 800; font-size: 1.1rem; flex-shrink: 0;
}
.plr-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.plr-name { font-weight: 700; font-size: 0.95rem; }
.plr-sub  { font-size: 0.68rem; color: var(--muted); }
.plr-live-pill {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em;
  color: var(--success); background: var(--success-dim);
  border: 1px solid rgba(22,163,74,0.4);
  border-radius: 99px; padding: 0.25rem 0.6rem;
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* Live partner chip in the preview "Who's training" row */
.tc-live { border-color: rgba(22,163,74,0.5) !important; cursor: default; }
.tc-live-dot { color: var(--success); font-size: 0.6rem; animation: livePulse 2s infinite; }

/* Header toggle for the partner panel */
.live-toggle {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 99px;
  padding: 0.35rem 0.6rem;
  font-size: 0.95rem; line-height: 1;
  cursor: pointer; opacity: 0.45;
  transition: opacity 0.2s, border-color 0.2s;
}
.live-toggle.lt-on { opacity: 1; border-color: rgba(22,163,74,0.55); background: var(--success-dim); }

/* The live panel itself */
.live-panel {
  margin: 0.6rem var(--pad) 0;
  background: var(--surface);
  border: 1.5px solid rgba(22,163,74,0.4);
  border-radius: var(--r-md);
  padding: 0.7rem 0.9rem;
  display: flex; flex-direction: column; gap: 0.45rem;
  font-size: 0.78rem;
}
.live-panel-waiting { flex-direction: row; align-items: center; gap: 0.7rem; color: var(--muted); }
.lp-pulse {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
}
.lp-pulse-on { background: var(--success); animation: livePulse 1.6s infinite; }
.lp-head { display: flex; align-items: center; gap: 0.55rem; }
.lp-name { font-weight: 800; }
.lp-day  { color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-progress { font-weight: 700; color: var(--success); }
.lp-now {
  display: flex; align-items: center; gap: 0.55rem;
  background: var(--surface2); border-radius: var(--r-sm);
  padding: 0.45rem 0.6rem;
}
.lp-now-label { font-size: 0.55rem; font-weight: 800; letter-spacing: 0.12em; color: var(--success); }
.lp-now-ex { font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-now-sets { display: flex; align-items: center; gap: 4px; }
.lp-set-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
}
.lp-set-dot.on { background: var(--success); }
.lp-now-count { font-size: 0.65rem; font-weight: 700; color: var(--muted); margin-left: 2px; }
.lp-last { color: var(--muted); }
.lp-last b { color: var(--white); }
.lp-last-time {
  margin-left: 0.4rem; font-weight: 700; color: var(--success);
  font-variant-numeric: tabular-nums;
}

/* Completion time on own set rows */
.solo-done-time {
  margin-left: 0.5rem; font-size: 0.62rem; font-weight: 600;
  color: var(--muted); font-variant-numeric: tabular-nums;
}

/* ── Multi-partner lists (Settings + Train Together) ── */
.partner-live-list, .partner-list {
  display: flex; flex-direction: column; gap: 0.55rem;
  max-height: 268px; overflow-y: auto;
  margin-bottom: 0.85rem;
  -webkit-overflow-scrolling: touch;
}
.partner-list .partner-status-row { margin-bottom: 0; }
.partner-x {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.75rem; line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.partner-x:hover { color: var(--danger); border-color: var(--danger); }

/* ── Workout footer timers: session (always ticking) + rest (after each set) ── */
.footer-timers { display: flex; gap: 1.1rem; align-items: flex-end; }
.ft-block { display: flex; flex-direction: column; gap: 2px; }
.ft-label {
  font-size: 0.5rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
}
.session-timer {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: 2px; line-height: 1;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.rest-timer { min-width: 56px; font-variant-numeric: tabular-nums; }
.rest-timer.idle { font-size: clamp(1.6rem, 4vw, 2.2rem); }

/* ── Rest countdown states + mid-set PR celebration ── */
.rest-timer.over { color: var(--success); }
.pr-flash {
  display: flex; align-items: center; gap: 0.7rem;
  margin: 0 var(--pad);
  padding: 0.7rem 1rem;
  background: linear-gradient(110deg, var(--red), var(--red-dark));
  color: #fff; border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(217,28,34,0.35);
  animation: prFlashIn 0.5s cubic-bezier(0.2,0.9,0.3,1.4);
  overflow: hidden; position: relative;
}
.pr-flash::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  transform: translateX(-120%); animation: prSheen 1.1s 0.3s ease-out;
}
@keyframes prSheen { to { transform: translateX(120%); } }
@keyframes prFlashIn { from { opacity: 0; transform: translateY(-12px) scale(0.96); } to { opacity: 1; transform: none; } }
.pr-flash-burst { font-size: 1.6rem; animation: prBurst 0.7s ease-out; }
@keyframes prBurst { 0% { transform: scale(0.3) rotate(-20deg); } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: none; } }
.pr-flash-text { display: flex; flex-direction: column; gap: 1px; }
.pr-flash-title { font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.06em; }
.pr-flash-detail { font-size: 0.74rem; opacity: 0.92; }
@media (prefers-reduced-motion: reduce) {
  .pr-flash, .pr-flash-burst, .pr-flash::after { animation: none !important; }
}

/* ── Strength progression chart ── */
.strength-chart { width: 100%; height: auto; display: block; }
.strength-delta {
  font-size: 0.72rem; font-weight: 700; margin-bottom: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.strength-delta.up   { color: var(--success); }
.strength-delta.down { color: var(--muted); }

/* ── Muscle map view toggle + weekly heatmap legend ── */
.muscle-view-toggle {
  display: flex; gap: 0; margin: 0 auto 0.75rem; width: fit-content;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 99px; padding: 3px;
}
.mvt-btn {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--cond, var(--body)); font-weight: 700;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 0.4rem 1rem; border-radius: 99px;
  transition: background 0.18s, color 0.18s;
}
.mvt-btn.mvt-on { background: var(--red); color: #fff; }
.heat-legend {
  display: flex; align-items: center; gap: 0.5rem; justify-content: center;
  margin-top: 0.5rem; flex-wrap: wrap;
}
.heat-legend-label { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.heat-bar {
  width: 90px; height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, rgba(154,154,154,0.25), var(--red));
}
.heat-legend-note { flex-basis: 100%; text-align: center; font-size: 0.66rem; color: var(--muted); margin-top: 0.15rem; }

/* ── Plate calculator ── */
.plate-toggle {
  width: 100%; margin-top: 0.6rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 0.55rem;
  font-weight: 700; font-size: 0.78rem; color: var(--muted);
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.plate-toggle.pt-on { color: var(--white); border-color: var(--red); }
.plate-panel {
  margin-top: 0.5rem; padding: 0.85rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.plate-bars { display: flex; gap: 0.4rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.plate-bar-btn {
  flex: 1; min-width: 64px; border: 1px solid var(--border); background: var(--surface2);
  border-radius: var(--r-sm); padding: 0.35rem 0.2rem;
  font-size: 0.68rem; font-weight: 700; color: var(--muted); cursor: pointer;
}
.plate-bar-btn.pbb-on { background: var(--red); border-color: var(--red); color: #fff; }
.plate-result { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.6rem; }
.plate-total { font-family: var(--display); font-size: 1.6rem; }
.plate-perside { font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.plate-stack { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.plate-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 0.4rem;
  border-radius: 6px; font-size: 0.72rem; font-weight: 800;
  background: var(--pc); border: 1.5px solid rgba(0,0,0,0.18);
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.plate-chip[style*="#ffffff"] { color: #1c1917; text-shadow: none; }
.plate-empty, .plate-leftover { font-size: 0.74rem; color: var(--muted); }
.plate-leftover { margin-top: 0.5rem; color: var(--danger); }

/* ── Recap / Wrapped share card ── */
.wrapped-wrap { margin-bottom: 0.75rem; border-radius: var(--r-md); overflow: hidden; box-shadow: 0 8px 28px rgba(0,0,0,0.25); }
.wrapped-svg { width: 100%; height: auto; display: block; }

/* ── Circular ring rest timer ── */
.ft-rest { align-items: center; }
.rest-ring-wrap { position: relative; width: 48px; height: 48px; }
.rest-ring { width: 48px; height: 48px; display: block; }
.rr-track { fill: none; stroke: var(--border); stroke-width: 4; }
.rr-fill  { fill: none; stroke: var(--muted); stroke-width: 4; stroke-linecap: round;
            transition: stroke-dashoffset 0.95s linear, stroke 0.3s; }
.rest-ring-wrap.active .rr-fill { stroke: var(--red); }
.rest-ring-wrap.over   .rr-fill { stroke: var(--success); }
.rest-digits {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 0.95rem; letter-spacing: 0.5px;
  color: var(--white); font-variant-numeric: tabular-nums;
}
.rest-ring-wrap.active .rest-digits { color: var(--red); }
.rest-ring-wrap.over   .rest-digits { color: var(--success); }
.rest-skip {
  display: block; margin: 2px auto 0; border: none; background: none;
  font-family: var(--cond, var(--body)); font-weight: 700; font-size: 0.55rem;
  letter-spacing: 0.14em; color: var(--muted); cursor: pointer; padding: 2px 4px;
}
.rest-skip:hover { color: var(--red); }

/* ── Workout completion rail ── */
.ex-rail {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem var(--pad); overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.ex-rail::-webkit-scrollbar { display: none; }
.ex-rail-pip {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 0.7rem; font-weight: 800; color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s, border-color 0.2s, background 0.2s, color 0.2s;
}
.ex-rail-pip:active { transform: scale(0.9); }
.ex-rail-pip.erp-done { background: var(--accent, var(--red)); border-color: transparent; color: #fff; }
.ex-rail-pip.erp-cur  { border-color: var(--red); color: var(--red); border-width: 2px; box-shadow: 0 0 0 3px var(--red-dim); }
.ex-rail-count { flex: 0 0 auto; margin-left: auto; padding-left: 0.5rem; font-size: 0.7rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── HIIT / interval timer ── */
.hiit-entry {
  display: flex; align-items: center; gap: 0.8rem; width: 100%;
  margin: 0 0 1rem; padding: 0.9rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); cursor: pointer; text-align: left;
}
.hiit-entry:active { transform: scale(0.99); }
.hiit-entry-icon { font-size: 1.5rem; }
.hiit-entry-text { flex: 1; display: flex; flex-direction: column; }
.hiit-entry-text b { font-size: 0.95rem; }
.hiit-entry-text span { font-size: 0.7rem; color: var(--muted); }
.hiit-entry-go { color: var(--red); font-weight: 800; }
.hiit-config { padding: 1.2rem var(--pad); display: flex; flex-direction: column; gap: 1rem; }
.hiit-stepper { display: flex; align-items: center; justify-content: space-between; }
.hiit-stepper-label { font-family: var(--display); font-size: 1.3rem; letter-spacing: 1px; }
.hiit-stepper-ctrl { display: flex; align-items: center; gap: 0.8rem; }
.hiit-step-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--surface); font-size: 1.4rem; font-weight: 700; color: var(--white); cursor: pointer;
}
.hiit-step-btn:active { background: var(--surface2); }
.hiit-step-val { min-width: 70px; text-align: center; font-family: var(--display); font-size: 1.8rem; }
.hiit-step-val i { font-size: 0.9rem; color: var(--muted); font-style: normal; margin-left: 1px; }
.hiit-presets { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.hiit-preset {
  flex: 1; min-width: 70px; padding: 0.5rem; border: 1px solid var(--border);
  background: var(--surface2); border-radius: var(--r-sm); font-size: 0.72rem; font-weight: 700;
  color: var(--muted); cursor: pointer;
}
.hiit-preset:active { border-color: var(--red); color: var(--red); }
.hiit-total { text-align: center; font-size: 0.8rem; color: var(--muted); font-weight: 700; }
/* Run view */
.hiit-run { display: flex; flex-direction: column; transition: background 0.4s; }
.hiit-run.is-work { background: var(--red); }
.hiit-run.is-rest { background: #0f766e; }
.hiit-run .cardio-header { color: #fff; }
.hiit-run .cardio-title, .hiit-run .back-btn { color: #fff; }
.hiit-run-body { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; }
.hiit-ring { width: min(78vw, 320px); height: min(78vw, 320px); }
.hr-track { fill: none; stroke: rgba(255,255,255,0.22); stroke-width: 10; }
.hr-fill  { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.95s linear; }
.hiit-run-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.hiit-mode { font-family: var(--cond, var(--body)); font-weight: 600; letter-spacing: 0.3em; font-size: 1rem; opacity: 0.9; }
.hiit-count { font-family: var(--display); font-size: 5.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.hiit-run-controls { display: flex; gap: 0.6rem; padding: 1rem var(--pad) 1.5rem; }
.hiit-run-controls .btn { flex: 1; background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.4); color: #fff; }

/* ── Preview session-length filter ── */
.wo-filter { margin: 0.25rem 0 1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.wo-filter-lbl { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.wo-filter-chips { display: flex; gap: 0.5rem; }
.wo-chip {
  flex: 1; padding: 0.5rem; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-sm); font-size: 0.8rem; font-weight: 700; color: var(--muted); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.wo-chip.woc-on { background: var(--red); border-color: var(--red); color: #fff; }
.wo-filter-count { font-size: 0.68rem; color: var(--muted); }

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESKTOP / TABLET LAYOUT
   Mobile-first below 700px (unchanged). Above, the app widens into a centred
   surface; dashboard screens (home, stats, muscles) use multi-column grids,
   while focused task flows (workout, preview, cardio, hiit, setup, onboarding)
   keep a readable centred column so they never sprawl.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── TABLET (≥ 700px): full-width surface, first multi-column grids ──
   No boxed container — the app fills the screen edge-to-edge so it never
   looks "cut off". */
@media (min-width: 700px) {
  #app { width: 100%; max-width: 100%; margin: 0; min-height: 100vh; position: relative; }
  .preview-footer { left: 0; right: 0; transform: none; width: 100%; max-width: 100%; }

  /* Home programme cards as a grid */
  .day-list { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  /* Preview exercise list two-up */
  .preview-ex-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .preview-ex-list-title, .prev-person-hdr { grid-column: 1 / -1; }
}

/* ── DESKTOP (≥ 1024px): wide centred app, backdrop BLENDS (no boxed card) ── */
@media (min-width: 1024px) {
  body { background: var(--black); }   /* same as the app — margins are invisible, no "container" */
  #app {
    max-width: 1200px; margin: 0 auto; min-height: 100vh; position: relative;
    background: var(--black); box-shadow: none;
  }
  /* full-bleed hero so the dark band spans the whole window, not a boxed rectangle */
  .home-hero { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
  .preview-footer { left: 50%; right: auto; transform: translateX(-50%); width: 100%; max-width: 1200px; }

  /* Home as a dashboard grid: explore + next-session side by side on row 1,
     everything else spans the full width. */
  .home-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; align-items: stretch; }
  .home-body > * { grid-column: 1 / -1; min-width: 0; }
  .home-body > .explore-muscles-btn { grid-column: 1; margin: 0; min-height: 150px; }
  .home-body > .louis-next-card     { grid-column: 2; height: 100%; margin: 0; min-height: 150px; }
  .day-list { grid-template-columns: repeat(3, 1fr); }

  /* Stats: overview spans, sections flow two-up */
  .stats-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.1rem; align-items: start; }
  .stats-overview { grid-column: 1 / -1; }
  .stats-tabs { grid-column: 1 / -1; }

  /* Muscles: body map left, group grid right */
  .muscles-body { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 1.4rem; align-items: start; }
  .muscle-group-grid { grid-template-columns: repeat(2, 1fr); align-content: start; }

  /* Focused task flows — keep a readable centred column inside the wide app */
  .preview-ex-list { grid-template-columns: repeat(3, 1fr); }
  .solo-body > .solo-ex-hero,
  .solo-body > .solo-sets-section,
  .solo-body > .pr-flash { max-width: 680px; margin-left: auto; margin-right: auto; }
  .warmup-body, .cardio-screen .cardio-person-row,
  .hiit-config, .setup-body, .ob-step-body { max-width: 600px; margin-left: auto; margin-right: auto; }
}

/* ── Narrow phones: keep the set-row controls from overflowing ── */
@media (max-width: 410px) {
  .solo-set-row { gap: 0.3rem; padding: 0.6rem 0.45rem; }
  .solo-set-fields { gap: 0.4rem; }
  .solo-adj { width: 36px; font-size: 1.2rem; }
  .solo-done-btn { width: 42px; height: 42px; }
}

/* ── Visual progress report ── */
.report-card {
  margin-top: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0;
  overflow: hidden;
}
.report-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.1rem 1rem;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
}
.report-head-title { font-family: var(--display); font-size: 1.5rem; letter-spacing: 0.06em; line-height: 1; }
.report-head-sub { font-size: 0.72rem; opacity: 0.9; margin-top: 3px; font-weight: 600; }
.report-head-badge {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.rep-section-lbl {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); padding: 1rem 1.1rem 0.5rem;
}
.rep-tiles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.rep-tile { background: var(--surface); padding: 0.85rem 0.4rem; text-align: center; }
.rep-tile-val { font-family: var(--display); font-size: 1.55rem; line-height: 1; color: var(--white); }
.rep-tile-lbl { font-size: 0.55rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.rep-chart { padding: 0 1.1rem 0.5rem; }
.rep-pr-list { padding: 0 1.1rem 0.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
.rep-pr-row {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface2); border-radius: var(--r-sm); padding: 0.5rem 0.7rem;
}
.rep-pr-medal { font-size: 1rem; width: 1.5rem; text-align: center; flex-shrink: 0; }
.rep-pr-rank { font-family: var(--display); font-size: 0.9rem; color: var(--muted); }
.rep-pr-name { flex: 1; font-weight: 600; font-size: 0.82rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-pr-val { font-family: var(--display); font-size: 0.95rem; color: var(--red); letter-spacing: 0.03em; flex-shrink: 0; }
.rep-ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem; padding: 0 1.1rem 0.5rem; }
.rep-ach {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 0.5rem 0.65rem; opacity: 0.45;
}
.rep-ach.earned { opacity: 1; border-color: rgba(180,83,9,0.4); background: rgba(180,83,9,0.08); }
.rep-ach-icon { font-size: 1.05rem; flex-shrink: 0; filter: grayscale(1); }
.rep-ach.earned .rep-ach-icon { filter: none; }
.rep-ach-name { font-size: 0.7rem; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-sess-list { padding: 0 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.rep-sess-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border);
}
.rep-sess-row:last-child { border-bottom: none; }
.rep-sess-day { font-weight: 700; font-size: 0.82rem; }
.rep-sess-meta { font-size: 0.68rem; color: var(--muted); text-align: right; }

/* ── Achievement rarity tiers (earned badges) ── */
.achievement-badge.earned.rarity-bronze   { border-color: rgba(205,127,50,0.5);  background: linear-gradient(160deg, var(--surface) 55%, rgba(205,127,50,0.10)); }
.achievement-badge.earned.rarity-silver   { border-color: rgba(150,156,168,0.6); background: linear-gradient(160deg, var(--surface) 55%, rgba(150,156,168,0.12)); }
.achievement-badge.earned.rarity-gold      { border-color: rgba(224,169,59,0.6);  background: linear-gradient(160deg, var(--surface) 50%, rgba(224,169,59,0.14)); }
.achievement-badge.earned.rarity-platinum  { border-color: rgba(103,232,214,0.65); background: linear-gradient(160deg, var(--surface) 50%, rgba(103,232,214,0.14)); box-shadow: 0 0 0 1px rgba(103,232,214,0.25); }
.achievement-badge.earned { cursor: pointer; position: relative; }
.achievement-badge.earned:active { transform: scale(0.97); }
.ach-rarity-tag {
  position: absolute; top: 0.5rem; right: 0.55rem;
  font-size: 0.46rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.12rem 0.35rem; border-radius: 99px;
}
.rarity-bronze   .ach-rarity-tag { background: rgba(205,127,50,0.18);  color: #9a5b1f; }
.rarity-silver   .ach-rarity-tag { background: rgba(120,126,138,0.2);  color: #6b7280; }
.rarity-gold     .ach-rarity-tag { background: rgba(224,169,59,0.2);   color: #b45309; }
.rarity-platinum .ach-rarity-tag { background: rgba(20,160,145,0.18);  color: #0d9488; }
.rarity-gold.earned .ach-icon, .rarity-platinum.earned .ach-icon { animation: achShine 3s ease-in-out infinite; }
@keyframes achShine { 0%,100% { transform: none; } 50% { transform: scale(1.08) rotate(-3deg); } }

/* ── Home: next-achievement spotlight ── */
.ach-spotlight {
  display: flex; align-items: center; gap: 0.85rem; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--rc); border-radius: var(--r-md);
  padding: 0.8rem 1rem; cursor: pointer; margin-bottom: 0.6rem;
  transition: transform 0.15s, border-color 0.2s;
}
.ach-spotlight:active { transform: scale(0.99); }
.achs-icon { font-size: 1.9rem; flex-shrink: 0; }
.achs-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.achs-top { display: flex; align-items: center; gap: 0.5rem; }
.achs-label { font-size: 0.55rem; font-weight: 800; letter-spacing: 0.14em; color: var(--muted); }
.achs-rarity { font-size: 0.5rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rc); margin-left: auto; }
.achs-name { font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.02em; color: var(--white); }
.achs-bar { height: 6px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.achs-fill { display: block; height: 100%; border-radius: 99px; background: var(--rc); transition: width 0.6s cubic-bezier(0.2,0.7,0.2,1); }
.achs-prog { font-size: 0.62rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ach-card-svg { width: 100%; height: auto; display: block; }

@media (prefers-reduced-motion: reduce) { .rarity-gold.earned .ach-icon, .rarity-platinum.earned .ach-icon { animation: none; } }

/* ── Upgrade / Pro paywall ── */
.upgrade-screen { display: flex; flex-direction: column; min-height: 100%; }
.upgrade-hero {
  position: relative; padding: 2.4rem var(--pad) 1.6rem; text-align: center; color: #fff;
  background: linear-gradient(150deg, var(--red) 0%, var(--red-dark) 70%, #7a0f13 100%);
}
.upgrade-back { position: absolute; top: 0.9rem; left: var(--pad); background: rgba(255,255,255,0.18); color: #fff; }
.upgrade-flag { font-family: var(--cond, var(--body)); font-weight: 800; letter-spacing: 0.22em; font-size: 0.7rem; opacity: 0.9; }
.upgrade-title { font-family: var(--display); font-size: 2.4rem; line-height: 1; margin: 0.4rem 0; letter-spacing: 0.02em; }
.upgrade-price { font-size: 0.95rem; font-weight: 700; }
.upgrade-price span { opacity: 0.85; font-weight: 500; }
.upgrade-body { flex: 1; padding: 1.2rem var(--pad) 2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.upgrade-feats { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 0.6rem; }
.up-feat {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0.7rem 0.85rem;
}
.up-feat-icon { font-size: 1.3rem; flex-shrink: 0; }
.up-feat-text { flex: 1; display: flex; flex-direction: column; }
.up-feat-text b { font-size: 0.86rem; }
.up-feat-text span { font-size: 0.68rem; color: var(--muted); }
.up-feat-check { color: var(--success); font-weight: 800; flex-shrink: 0; }
.upgrade-fine { text-align: center; font-size: 0.68rem; color: var(--muted); margin-top: -0.2rem; }

/* Settings Pro status card */
.pro-card {
  display: flex; align-items: center; gap: 0.85rem;
  border-radius: var(--r-md); padding: 0.9rem 1rem; margin-bottom: 1rem;
}
.pro-card.is-pro   { background: linear-gradient(135deg, rgba(180,83,9,0.12), rgba(180,83,9,0.04)); border: 1px solid rgba(180,83,9,0.4); }
.pro-card.is-free  { background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.pro-card-icon { font-size: 1.6rem; }
.pro-card-text { flex: 1; }
.pro-card-text b { display: block; font-size: 0.92rem; }
.pro-card-text span { font-size: 0.7rem; color: var(--muted); }
.pro-card-cta { font-family: var(--display); font-size: 1rem; color: var(--red); }
.pro-card-badge { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em; color: #b45309; background: rgba(180,83,9,0.15); padding: 0.2rem 0.5rem; border-radius: 99px; }

/* ── Feedback / ideas ── */
.feedback-screen { display: flex; flex-direction: column; min-height: 100%; }
.fb-body { padding: 1rem var(--pad) 2rem; display: flex; flex-direction: column; gap: 0.85rem; }
.fb-intro { font-size: 0.85rem; color: var(--muted); line-height: 1.55; margin: 0; }
.fb-cats { display: flex; gap: 0.5rem; }
.fb-cat {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  padding: 0.7rem 0.4rem; border-radius: var(--r-md); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--border); color: var(--white);
  font-size: 0.78rem; font-weight: 600;
}
.fb-cat.active { border-color: var(--red); background: var(--red-dim); color: var(--red); }
.fb-cat-icon { font-size: 1.3rem; }
.fb-textarea {
  width: 100%; box-sizing: border-box; background: var(--surface); color: var(--white);
  border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 0.85rem 1rem;
  font-family: var(--body); font-size: 0.95rem; line-height: 1.5; resize: vertical; outline: none;
}
.fb-textarea:focus { border-color: var(--red); }
.fb-textarea::placeholder { color: var(--muted); }
.fb-error { color: var(--red); font-size: 0.8rem; font-weight: 600; margin: 0; }
.fb-fine { text-align: center; font-size: 0.7rem; color: var(--muted); margin: 0.1rem 0 0; }

.fb-thanks { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.55rem; padding: 2rem var(--pad); text-align: center; }
.fb-thanks-icon { font-size: 3.4rem; }
.fb-thanks-title { font-family: var(--display); font-size: 1.9rem; }
.fb-thanks-sub { font-size: 0.85rem; color: var(--muted); max-width: 280px; margin-bottom: 0.8rem; }
.fb-thanks .btn { width: 100%; max-width: 320px; }

/* Owner inbox */
.fb-inbox-body { padding: 0.85rem var(--pad) 2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.fb-inbox-empty { text-align: center; color: var(--muted); padding: 3rem 1rem; font-weight: 600; }
.fb-inbox-empty span { font-size: 0.78rem; font-weight: 400; }
.fb-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0.8rem 0.9rem; }
.fb-item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.fb-item-cat { font-size: 0.72rem; font-weight: 700; text-transform: capitalize; color: var(--red); }
.fb-item-date { font-size: 0.68rem; color: var(--muted); }
.fb-item-msg { font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.fb-item-email { font-size: 0.68rem; color: var(--muted); margin-top: 0.45rem; }

/* Settings link cards (Send an idea / Feedback inbox) */
.settings-link-card {
  display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.75rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 0.85rem 1rem; cursor: pointer; color: var(--white);
}
.settings-link-card .slc-icon { font-size: 1.4rem; }
.settings-link-card .slc-text { flex: 1; display: flex; flex-direction: column; }
.settings-link-card .slc-text b { font-size: 0.9rem; }
.settings-link-card .slc-text span { font-size: 0.7rem; color: var(--muted); }
.settings-link-card .slc-arrow { color: var(--muted); font-size: 1.1rem; }
.settings-link-card.slc-owner { border-color: rgba(180,83,9,0.4); background: rgba(180,83,9,0.06); }

/* Forgot-password link on the auth gate */
.auth-forgot {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 0.78rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  padding: 0.35rem; margin-top: -0.1rem; align-self: center;
}
.auth-forgot:active { color: var(--red); }

/* ── Progression coach strip (last session + next-step suggestion) ── */
.coach-strip {
  display: flex; align-items: center; gap: 0.65rem;
  margin-top: 0.6rem; padding: 0.6rem 0.85rem;
  background: var(--success-dim); border: 1px solid rgba(22,163,74,0.35);
  border-radius: var(--r-md);
}
.coach-icon { font-size: 1.1rem; }
.coach-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.coach-last { font-size: 0.72rem; color: var(--muted); }
.coach-last b { color: var(--white); font-weight: 700; }
.coach-tip  { font-size: 0.82rem; font-weight: 700; color: var(--success); }

/* ── Exercise picker thumbnails (start frame — quick visual ID) ── */
.pick-thumb {
  width: 44px; height: 44px; flex: 0 0 44px;
  object-fit: cover; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
}
.cw-picker-row { gap: 0.6rem; }
.cw-picker-row .cw-picker-name { flex: 1; min-width: 0; }
.swap-row { gap: 0.6rem; }
.swap-row .swap-row-name { flex: 1; min-width: 0; }

/* ── Free-trial strip on home ── */
.trial-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  width: calc(100% - var(--pad) * 2); margin: 0.55rem var(--pad) 0;
  padding: 0.6rem 0.9rem; border-radius: var(--r-md); cursor: pointer;
  background: var(--red-dim); border: 1px solid rgba(217,28,34,0.35);
  color: var(--white); font-size: 0.78rem; font-weight: 600; text-align: left;
}
.trial-strip b { color: var(--red); }
.trial-strip-cta { color: var(--red); font-weight: 800; white-space: nowrap; }

/* Upgrade screen trial subtitle */
.upgrade-trial-sub { font-size: 0.85rem; font-weight: 700; opacity: 0.9; margin: 0.2rem 0 0.35rem; }

/* ── Progress screen upgrades ── */
.sst-sub { font-size: 0.62rem; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; margin-left: 0.4rem; text-transform: none; }
.strength-ex-chips { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0 var(--pad) 0.55rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.strength-ex-chips::-webkit-scrollbar { display: none; }
.sx-chip {
  flex: 0 0 auto; padding: 0.4rem 0.75rem; border-radius: 99px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--border); color: var(--white);
  font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.sx-chip.sx-on { border-color: var(--red); background: var(--red-dim); color: var(--red); }
.strength-ex-single { padding: 0 var(--pad) 0.45rem; font-size: 0.78rem; font-weight: 700; }
.strength-latest { margin-top: 0.45rem; font-size: 0.72rem; color: var(--muted); }
.strength-latest b { color: var(--red); }

/* Manage / cancel subscription link under the PRO card */
.sub-manage-link {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 0.75rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  padding: 0 0 0.8rem; margin-top: -0.35rem; align-self: flex-start;
}
.sub-manage-link:active { color: var(--red); }

/* Report — muscle split bars */
.rep-lbl-note { font-size: 0.6rem; color: var(--muted); font-weight: 600; margin-left: 0.3rem; }
.rep-split { display: flex; flex-direction: column; gap: 0.45rem; }
.rep-split-row { display: flex; align-items: center; gap: 0.6rem; }
.rep-split-name { flex: 0 0 84px; font-size: 0.72rem; font-weight: 700; }
.rep-split-bar { flex: 1; height: 10px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.rep-split-fill { height: 100%; border-radius: 99px; }
.rep-split-pct { flex: 0 0 36px; text-align: right; font-size: 0.7rem; font-weight: 700; color: var(--muted); }

/* ── Settings — professional grouped sections ── */
.set-section-lbl {
  padding: 1.1rem var(--pad) 0.45rem; font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.set-lbl-danger { color: var(--danger); }
.account-card { flex-direction: row; align-items: center; gap: 0.85rem; padding: 1rem 1.25rem; }
.acct-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 46px;
  display: flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-weight: 800; font-size: 1.2rem;
}
.acct-info { flex: 1; min-width: 0; }
.acct-name { font-size: 0.95rem; font-weight: 700; }
.acct-email { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* My Programme day rows */
.prog-day-row {
  display: flex; align-items: center; gap: 0.7rem; width: 100%;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 0.7rem 0.85rem; margin-bottom: 0.5rem; cursor: pointer; text-align: left;
}
.pdr-num { font-family: var(--display); font-size: 1.15rem; color: var(--red); }
.pdr-info { flex: 1; min-width: 0; }
.pdr-name { font-size: 0.85rem; font-weight: 700; }
.pdr-meta { font-size: 0.68rem; color: var(--muted); }
.pdr-edit { font-size: 0.72rem; font-weight: 700; color: var(--red); white-space: nowrap; }

/* ── Programme Editor screen ── */
.pe-screen { display: flex; flex-direction: column; min-height: 100%; }
.pe-body { flex: 1; padding: 0.85rem var(--pad) 1rem; display: flex; flex-direction: column; gap: 0.55rem; }
.pe-hint { font-size: 0.8rem; color: var(--muted); line-height: 1.5; margin: 0; }
.pe-summary { font-size: 0.72rem; font-weight: 700; color: var(--red); letter-spacing: 0.04em; }
.pe-row {
  display: flex; align-items: center; gap: 0.65rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 0.55rem 0.65rem;
}
.pe-row-info { flex: 1; min-width: 0; }
.pe-row-name { font-size: 0.82rem; font-weight: 700; line-height: 1.25; }
.pe-row-meta { font-size: 0.68rem; color: var(--muted); font-weight: 600; }
.pe-row-btns { display: flex; gap: 0.3rem; }
.pe-mini {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border); color: var(--white);
  font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.pe-mini:disabled { opacity: 0.25; pointer-events: none; }
.pe-mini.pe-x { color: var(--danger); }
.pe-mini:active { background: var(--border); }
.pe-empty { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1.2rem 0; }
.pe-reset-btn { margin-top: 0.3rem; }
.pe-footer {
  position: sticky; bottom: 0; padding: 0.75rem var(--pad) calc(0.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--black) 75%, transparent);
}
.pe-footer .btn { width: 100%; }

/* Preview → editor entry button */
.pe-open-btn {
  display: flex; align-items: center; gap: 0.7rem; width: calc(100% - var(--pad) * 2);
  margin: 0.35rem var(--pad) 0.6rem; padding: 0.8rem 1rem; cursor: pointer; text-align: left;
  background: var(--surface); border: 1.5px solid var(--accent, var(--red)); border-radius: var(--r-md);
}
.pe-open-icon { font-size: 1.15rem; color: var(--accent, var(--red)); }
.pe-open-text { flex: 1; display: flex; flex-direction: column; }
.pe-open-text b { font-size: 0.85rem; }
.pe-open-text span { font-size: 0.68rem; color: var(--muted); }
.pe-open-arrow { color: var(--accent, var(--red)); font-weight: 800; }

/* ── Settings — uniform width for every section/card/button ── */
.setup-screen > .card,
.setup-screen > .pro-card,
.setup-screen > .settings-link-card,
.setup-screen > .set-section-lbl,
.setup-screen > .setup-danger-card {
  width: 100%;
  max-width: 480px;
  box-sizing: border-box;
}
/* Section labels align with the card column, not the screen edge */
.setup-screen > .set-section-lbl { padding-left: 0.2rem; padding-right: 0.2rem; }

/* Programme editor — day-name field */
.pe-name-wrap { display: flex; flex-direction: column; }


/* ── Programme editor picker v2 — big visual cards, filter chips ── */
.pe-picker {
  display: flex; flex-direction: column; gap: 0.55rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 0.7rem;
}
.pe-pick-cats {
  display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.pe-pick-cats::-webkit-scrollbar { display: none; }
.pe-cat {
  flex: 0 0 auto; display: flex; align-items: center; gap: 0.35rem;
  padding: 0.42rem 0.8rem; border-radius: 99px; cursor: pointer;
  background: var(--surface2); border: 1.5px solid var(--border); color: var(--white);
  font-size: 0.74rem; font-weight: 700; white-space: nowrap;
  touch-action: manipulation;
}
.pe-cat .pe-cat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cc, var(--muted)); }
.pe-cat.on { border-color: var(--cc, var(--red)); background: var(--red-dim); }
.pe-cat.on:first-child { border-color: var(--red); color: var(--red); }

.pe-pick-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.55rem;
  max-height: 58vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 2px 6px; border-radius: 8px;
}
@media (min-width: 560px) { .pe-pick-grid { grid-template-columns: repeat(3, 1fr); } }

.pe-pick-card {
  display: flex; flex-direction: column; text-align: left; padding: 0;
  background: var(--surface2); border: 2px solid var(--border);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.pe-pick-card:active { transform: scale(0.97); }
.pe-pick-card.added { border-color: var(--success); background: var(--success-dim); }
.pe-pick-imgwrap { position: relative; aspect-ratio: 4 / 3; background: #fff; }
.pe-pick-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pe-pick-card.added .pe-pick-img { opacity: 0.55; }
.pe-pick-check {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 0.95rem; font-weight: 800;
}
.pe-pick-card.added .pe-pick-check { background: var(--success); }
.pe-pick-name  { font-size: 0.73rem; font-weight: 700; line-height: 1.25; padding: 0.45rem 0.55rem 0.1rem; }
.pe-pick-group { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.05em; padding: 0 0.55rem 0.5rem; }

/* Slightly larger thumbs in the editor's selected-exercise rows too */
.pe-row .pick-thumb { width: 54px; height: 54px; flex-basis: 54px; }

/* ── Picker card v3 — prominent name + info + explicit reps ── */
.pe-pick-body { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.5rem 0.55rem 0.6rem; }
.pe-pick-name { font-size: 0.8rem; font-weight: 800; line-height: 1.25; padding: 0; }
.pe-pick-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.pe-pick-tag {
  font-size: 0.56rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.14rem 0.4rem; border-radius: 99px; border: 1px solid; white-space: nowrap;
}
.pe-pick-reps { font-size: 0.74rem; font-weight: 700; color: var(--white); }
.pe-pick-reps::before { content: '🎯 '; font-size: 0.65rem; }

/* ── Per-exercise sets/reps tuning in the programme editor ── */
/* pe-row is now a column: main row + optional tune panel below */
.pe-row { flex-direction: column; align-items: stretch; gap: 0; }
.pe-row-main { display: flex; align-items: center; gap: 0.65rem; }
.pe-row-open { border-color: var(--red); }
.pe-row-tune {
  display: inline-flex; align-items: center; gap: 0.2rem;
  background: none; border: none; padding: 0.1rem 0; cursor: pointer;
  font-size: 0.68rem; color: var(--muted); font-weight: 600; text-align: left;
}
.pe-row-tune.tuned { color: var(--white); }
.pe-tuned-dot { color: var(--red); font-size: 0.5rem; margin-left: 0.15rem; }
.pe-tune-caret { color: var(--muted); font-size: 0.6rem; margin-left: 0.2rem; }

.pe-tune {
  display: flex; align-items: flex-end; gap: 0.7rem;
  margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--border);
}
.pe-tune-block { display: flex; flex-direction: column; gap: 0.3rem; }
.pe-tune-lbl { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; color: var(--muted); }
.pe-tune-stepper { display: flex; align-items: center; gap: 0.45rem; }
.pe-tune-sets { min-width: 26px; text-align: center; font-size: 1.05rem; font-weight: 800; }
.pe-target-inp { padding: 0.5rem 0.65rem; font-size: 0.9rem; font-weight: 700; width: 100%; }
.pe-tune-reset {
  background: none; border: 1px solid var(--border); border-radius: 9px;
  padding: 0.5rem 0.6rem; cursor: pointer; color: var(--muted);
  font-size: 0.68rem; font-weight: 700; white-space: nowrap;
}
.pe-tune-reset:active { color: var(--red); border-color: var(--red); }

/* ── Standout pillars: readiness / comeback / duo / ring / shields ── */

/* Readiness check-in (warm-up screen) */
.readiness-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 0.85rem 0.9rem; margin-bottom: 0.85rem;
}
.readiness-q { font-size: 0.82rem; font-weight: 800; margin-bottom: 0.6rem; text-align: center; }
.readiness-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.readiness-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.7rem 0.3rem; border-radius: 12px; cursor: pointer;
  background: var(--surface2); border: 2px solid var(--border); color: var(--white);
  touch-action: manipulation;
}
.readiness-btn:active { border-color: var(--red); transform: scale(0.97); }
.readiness-btn span { font-size: 1.5rem; }
.readiness-btn b { font-size: 0.75rem; }
.readiness-btn small { font-size: 0.58rem; color: var(--muted); }
.readiness-done {
  background: var(--success-dim); border: 1px solid rgba(22,163,74,0.35); border-radius: var(--r-md);
  padding: 0.65rem 0.85rem; margin-bottom: 0.85rem; font-size: 0.78rem; font-weight: 600;
}

/* Coach strip — plateau warning + readiness note */
.coach-strip.coach-warn { background: rgba(180,83,9,0.08); border-color: rgba(180,83,9,0.45); }
.coach-strip.coach-warn .coach-tip { color: #b45309; }
.coach-rdy { font-size: 0.7rem; color: var(--muted); font-weight: 600; }

/* Comeback card */
.comeback-card {
  display: flex; align-items: center; gap: 0.75rem; width: 100%;
  background: linear-gradient(120deg, rgba(217,28,34,0.09), rgba(217,28,34,0.02));
  border: 1.5px solid rgba(217,28,34,0.4); border-radius: var(--r-md);
  padding: 0.85rem 1rem; margin-bottom: 0.85rem; cursor: pointer; text-align: left;
}
.cb-icon { font-size: 1.6rem; }
.cb-text { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.cb-text b { font-size: 0.9rem; }
.cb-text span { font-size: 0.72rem; color: var(--muted); line-height: 1.45; }
.cb-cta { color: var(--red); font-weight: 800; font-size: 0.72rem; white-space: nowrap; }

/* Shield chip + note */
.acal-shield-chip {
  font-size: 0.62rem; font-weight: 800; padding: 0.18rem 0.5rem; border-radius: 99px;
  background: rgba(37,99,235,0.12); color: var(--louis); border: 1px solid rgba(37,99,235,0.35);
}
.shield-note {
  background: rgba(37,99,235,0.08); border: 1px solid rgba(37,99,235,0.3); border-radius: var(--r-md);
  padding: 0.6rem 0.85rem; margin-bottom: 0.85rem; font-size: 0.74rem; font-weight: 600;
}

/* Weekly goal ring (hero strip) */
.week-ring-wrap { position: relative; width: 40px; height: 40px; margin: 0 auto; }
.week-ring { width: 40px; height: 40px; display: block; }
.week-ring-txt {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 800; color: #fff;
}

/* Duo card */
.duo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 0.9rem 1rem; margin-bottom: 0.85rem;
}
.duo-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.duo-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; }
.duo-streak { font-size: 0.72rem; font-weight: 800; color: var(--red); }
.duo-streak.duo-dim { color: var(--muted); font-weight: 600; }
.duo-duel-lbl { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.4rem; }
.duo-bar-row { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.35rem; }
.duo-bar-name { flex: 0 0 70px; font-size: 0.72rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duo-bar { flex: 1; height: 10px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.duo-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s; }
.duo-bar-n { flex: 0 0 18px; text-align: right; font-size: 0.74rem; font-weight: 800; }
.duo-vol { font-size: 0.66rem; color: var(--muted); margin-top: 0.3rem; }
.duo-nudge-btn {
  width: 100%; margin-top: 0.65rem; padding: 0.6rem; border-radius: 10px; cursor: pointer;
  background: var(--red-dim); border: 1.5px solid rgba(217,28,34,0.4); color: var(--red);
  font-size: 0.76rem; font-weight: 800; touch-action: manipulation;
}
.duo-nudge-btn.sent { background: var(--success-dim); border-color: rgba(22,163,74,0.4); color: var(--success); }
.duo-nudge-in {
  position: relative; background: var(--red-dim); border: 1px solid rgba(217,28,34,0.35);
  border-radius: 10px; padding: 0.6rem 2rem 0.6rem 0.75rem; margin-bottom: 0.6rem;
  font-size: 0.76rem; line-height: 1.4;
}
.duo-nudge-x {
  position: absolute; top: 0.35rem; right: 0.4rem; background: none; border: none;
  color: var(--muted); cursor: pointer; font-size: 0.8rem; padding: 0.2rem;
}

/* ── Body weight section ── */
.bw-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.55rem; }
.bw-now { font-size: 0.9rem; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.bw-now b { font-size: 1.4rem; font-family: var(--display); }
.bw-delta { font-size: 0.72rem; font-weight: 700; }
.bw-log-btn { width: auto; white-space: nowrap; }
.bw-hint { font-size: 0.75rem; color: var(--muted); margin: 0.3rem 0 0; }

/* ── Session detail (expandable rows) ── */
.session-row { cursor: pointer; flex-direction: column; align-items: stretch; }
.session-row-top { display: flex; align-items: center; gap: 0.6rem; }
.session-row-top .session-info { flex: 1; }
.session-caret { color: var(--muted); font-size: 0.7rem; }
.session-row.sr-open { border-color: var(--red); }
.session-detail { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 0.55rem; }
.sd-ex-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.sd-thumb { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; background: var(--surface2); border: 1px solid var(--border); }
.sd-ex-name { font-size: 0.76rem; font-weight: 700; flex: 1; }
.sd-ex-grp { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; }
.sd-sets { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.sd-set {
  font-size: 0.66rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 99px;
  background: var(--surface2); border: 1px solid var(--border);
}

/* ── Exercise info sheet ── */
.pe-pick-info, .prev-ex-info {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 0.72rem; font-weight: 800; color: #fff;
}
.pe-pick-info {
  position: absolute; top: 6px; left: 6px; width: 24px; height: 24px;
  border-radius: 50%; background: rgba(0,0,0,0.5);
}
.prev-ex-info {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--border);
}
.exs-sheet { max-height: 82vh; display: flex; flex-direction: column; }
.exs-body { overflow-y: auto; padding: 0.8rem 1.1rem 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; }
.exs-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.exs-imgwrap { position: relative; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--border); aspect-ratio: 4/3; }
.exs-imgwrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.exs-imgwrap span {
  position: absolute; bottom: 5px; left: 6px; font-size: 0.52rem; font-weight: 800;
  letter-spacing: 0.1em; color: #fff; background: rgba(0,0,0,0.55); padding: 0.12rem 0.4rem; border-radius: 99px;
}
.exs-cue { display: flex; gap: 0.55rem; background: var(--surface2); border-radius: 10px; padding: 0.65rem 0.8rem; }
.exs-cue span { font-size: 1rem; }
.exs-cue p { margin: 0; font-size: 0.78rem; line-height: 1.5; }
.exs-pb { font-size: 0.78rem; background: rgba(180,83,9,0.08); border: 1px solid rgba(180,83,9,0.35); border-radius: 10px; padding: 0.55rem 0.8rem; }
.exs-pb span { color: var(--muted); font-size: 0.66rem; }
.exs-hist-lbl { font-size: 0.56rem; font-weight: 800; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.3rem; }
.exs-hist-row { display: flex; justify-content: space-between; font-size: 0.74rem; padding: 0.3rem 0; border-bottom: 1px dashed var(--border); }
.exs-hist-row:last-child { border-bottom: none; }

/* ═══ ONBOARDING — readability + desktop pass ═══════════════════════════════
   The photo-background steps used var(--white) (#1c1917 — the LIGHT theme's
   dark text colour) for headings and values → near-black on a grey photo.
   Force literal light colours on .ob-has-bg screens, darken the backdrop for
   guaranteed contrast, and scale type/layout up on desktop. */

/* Guaranteed-dark backdrop regardless of the photo */
.ob-bg-img { filter: brightness(0.22) saturate(0.85); }

/* Light text on photo-background steps (scoped — light-bg steps keep dark text) */
.ob-has-bg .ob-step-q     { color: #f5f3ed; }
.ob-has-bg .ob-step-hint  { color: rgba(255,255,255,0.78); }
.ob-has-bg .obs-skip      { color: rgba(255,255,255,0.6); }
.ob-has-bg .ob-goal-name  { color: #fff; }
.ob-has-bg .ob-level-name { color: #fff; }
.ob-has-bg .ob-days-num   { color: #f5f3ed; }
.ob-has-bg .ob-days-card5.ob-sel .ob-days-num { color: var(--red); }
.ob-has-bg .ob-result-title { color: #f5f3ed; }
.ob-has-bg .ob-result-val   { color: #fff; }
.ob-has-bg .obs-label       { color: rgba(255,255,255,0.85); }

/* Base type bumps (mobile too — the card text was too small everywhere) */
.ob-goal-icon  { font-size: 2.6rem; }
.ob-goal-name  { font-size: 1.35rem; }
.ob-goal-desc  { font-size: 0.85rem; color: rgba(255,255,255,0.82); }
.ob-level-name { font-size: 1.15rem; }
.ob-level-time { font-size: 0.8rem;  color: rgba(255,255,255,0.6); }
.ob-level-desc { font-size: 0.85rem; color: rgba(255,255,255,0.72); }
.ob-days-label5 { font-size: 0.68rem; color: rgba(255,255,255,0.65); }
.ob-days-note5  { font-size: 0.62rem; color: rgba(255,255,255,0.5); }
.ob-prog-name  { font-size: 1.5rem; }
.ob-prog-exs   { font-size: 0.85rem; color: rgba(255,255,255,0.8); }
.ob-prog-overlay { background: linear-gradient(to top, rgba(0,0,0,0.96) 0%, rgba(0,0,0,0.35) 45%, transparent 100%); }
.ob-result-key { font-size: 0.68rem; }
.ob-result-val { font-size: 1.15rem; }

/* ── Desktop / tablet: use the space ── */
@media (min-width: 700px) {
  .ob-step-content, .ob-step-footer { width: 100%; max-width: 880px; margin-left: auto; margin-right: auto; }
  .ob-step-nav { max-width: 880px; margin-left: auto; margin-right: auto; }
  .ob-step-q    { font-size: 3.1rem; }
  .ob-step-hint { font-size: 1.05rem; margin-bottom: 1.8rem; }

  /* Goals — 2×2 grid of tall cards, big type */
  .ob-goal-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .ob-goal-card { min-height: 220px; }
  .ob-goal-icon { font-size: 3.2rem; }
  .ob-goal-name { font-size: 1.8rem; }
  .ob-goal-desc { font-size: 1rem; max-width: 34ch; }

  /* Experience levels — taller bars, larger text */
  .ob-level-bar  { padding: 1.6rem 1.75rem; }
  .ob-level-name { font-size: 1.45rem; }
  .ob-level-time { font-size: 0.95rem; }
  .ob-level-desc { font-size: 1rem; margin-top: 0.3rem; }

  /* Days per week — taller cards, larger numbers */
  .ob-days-card5 { padding: 2.6rem 0.4rem; }
  .ob-days-card5 .ob-days-num { font-size: 3.6rem; }
  .ob-days-label5 { font-size: 0.82rem; }
  .ob-days-note5  { font-size: 0.78rem; }

  /* Programme style — bigger card text */
  .ob-prog-name { font-size: 2rem; }
  .ob-prog-exs  { font-size: 1.05rem; }

  /* Plan-ready — centred column, two-column summary, bigger everything */
  .ob-result-scroll  { max-width: 900px; margin: 0 auto; width: 100%; }
  .ob-result-cards   { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .ob-result-key { font-size: 0.78rem; }
  .ob-result-val { font-size: 1.35rem; }
  .ob-plan-day   { padding: 1.1rem 1.3rem; }
  .ob-plan-day-name { font-size: 1.05rem; }
  .ob-plan-day-exs  { font-size: 0.85rem; }
  .ob-focus-desc { font-size: 1rem; }
}

/* Plan-ready screen — weekly schedule text was still theme-dark + too small */
.ob-has-bg .ob-plan-day-name { color: #fff; }
.ob-plan-title   { font-size: 0.72rem; color: rgba(255,255,255,0.65); }
.ob-plan-day-exs { font-size: 0.78rem; color: rgba(255,255,255,0.65); }
@media (min-width: 700px) {
  .ob-plan-title { font-size: 0.82rem; }
  .ob-result-sub { font-size: 1rem; }
}

/* ── Screen header (feedback, inbox, and any screen using .screen-head) ──
   Had NO layout rules — the back button stacked above the title. Proper
   sticky header row: back button and title on one line, vertically centred. */
.screen-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.85rem var(--pad) 0.7rem;
  background: var(--black);
}
.screen-head .screen-title {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

/* Owner inbox — delete-handled-feedback button */
.fb-item-del {
  background: none; border: none; cursor: pointer; font-size: 0.9rem;
  padding: 0.15rem 0.3rem; margin-left: 0.4rem; opacity: 0.55;
  touch-action: manipulation;
}
.fb-item-del:active { opacity: 1; transform: scale(0.92); }

/* ── Refer a Friend card ── */
.referral-card { }
.ref-link-row { display: flex; gap: 0.5rem; margin-bottom: 0.55rem; }
.ref-link-input { flex: 1; min-width: 0; font-size: 0.78rem; }
.ref-share-btn { width: 100%; }
.ref-progress-lbl { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--muted); font-weight: 600; margin: 0.7rem 0 0.3rem; }
.ref-progress { height: 10px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.ref-progress-fill { height: 100%; border-radius: 99px; background: var(--red); transition: width 0.4s; }
.ref-earned { margin-top: 0.6rem; font-size: 0.78rem; font-weight: 600; color: var(--success); }

/* ── Owner Console ── */
.oc-comp-row { display: flex; align-items: center; gap: 0.5rem; }
.oc-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.oc-row:last-child { border-bottom: none; }
.oc-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.oc-row-main b { font-size: 0.85rem; }
.oc-uid { font-size: 0.62rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-row-val { font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.oc-mini { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--danger); cursor: pointer; flex-shrink: 0; }
.oc-total { margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px dashed var(--border); font-size: 0.78rem; font-weight: 600; }

/* ── Owner Console — user list ── */
.oc-user-list { max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; }
.oc-user { display: flex; align-items: center; gap: 0.55rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.oc-user:last-child { border-bottom: none; }
.oc-user-info { flex: 1; min-width: 0; }
.oc-user-name { font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; gap: 0.35rem; }
.oc-user-email { font-size: 0.66rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-badge-tr { font-size: 0.5rem; font-weight: 800; letter-spacing: 0.06em; padding: 0.1rem 0.3rem; border-radius: 4px; background: rgba(37,99,235,0.15); color: var(--louis); }
.oc-pill { font-size: 0.55rem; font-weight: 800; letter-spacing: 0.05em; padding: 0.14rem 0.4rem; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.oc-user-btns { display: flex; gap: 0.3rem; flex-shrink: 0; }
.oc-act { font-size: 0.66rem; font-weight: 700; padding: 0.35rem 0.5rem; border-radius: 8px; cursor: pointer; background: var(--surface2); border: 1px solid var(--border); color: var(--white); white-space: nowrap; touch-action: manipulation; }
.oc-act.oc-grant { background: var(--red-dim); border-color: rgba(217,28,34,0.4); color: var(--red); }
.oc-act.oc-revoke { color: var(--danger); }
.oc-act.oc-tr-on { background: rgba(37,99,235,0.15); border-color: var(--louis); color: var(--louis); }
.oc-act:active { transform: scale(0.94); }
.oc-act.oc-del { color: var(--danger); border-color: rgba(220,38,38,0.35); }
