/* ─────────────────────────────────────────────────────────────
   esMetabolicLab — shared styles. Mirrors the site's design tokens
   (cyan/gold/coral/purple on warm-near-black, geometric icons,
   serif headlines / sans body / mono accents). Self-contained:
   no esFormLab classes leak through.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:      #08090f;
  --panel:   #0e1018;
  --panel2:  #13151f;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --cyan:    #00e5c8;
  --gold:    #f5c842;
  --coral:   #ff6b35;
  --purple:  #8b7cf8;
  --text:    #e8ecf8;
  --muted:   #454960;
  --muted2:  #8492b4;
  --good:    #22c78a;
  --bad:     #ff5163;
  --display: 'Fraunces', Georgia, serif;
  --body:    'DM Sans', system-ui, sans-serif;
  --mono:    'Space Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Shared nav (matches the rest of the site) ───────────── */
nav.esml-nav {
  height: 62px; padding: 0 40px;
  display: flex; align-items: center;
  position: sticky; top: 0; z-index: 200;
  background: rgba(8,9,15,0.95); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.esml-nav .nav-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex-shrink: 0; margin-right: 32px;
}
.esml-nav .nav-logo-img { height: 36px; width: auto; display: block; }
.esml-nav .nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.esml-nav .nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; font-size: 14px;
  font-weight: 500; color: var(--muted2); text-decoration: none;
  transition: all .15s; border: 1px solid transparent;
}
.esml-nav .nav-link:hover { color: var(--text); background: rgba(255,255,255,.04); text-decoration: none; }
.esml-nav .nav-link.active { color: var(--purple); background: rgba(139,124,248,.07); border-color: rgba(139,124,248,.18); }
.esml-nav .nav-pill {
  font-size: 9px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  font-family: var(--mono); background: rgba(110,122,154,.14);
  color: var(--muted2); border-radius: 4px; padding: 2px 5px;
}

/* ── Generic page chrome ─────────────────────────────────── */
.page {
  max-width: 1080px; margin: 0 auto; padding: 40px 24px 80px;
}
.page-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(36px, 5vw, 54px); letter-spacing: -1px;
  line-height: 1.08; margin-bottom: 12px;
}
.page-title em { font-style: italic; color: var(--purple); }
.page-sub {
  color: var(--muted2); font-size: 18px; line-height: 1.7;
  max-width: 680px; margin-bottom: 36px;
}

.section-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--purple); font-family: var(--mono);
  background: rgba(139,124,248,.08); border: 1px solid rgba(139,124,248,.20);
  border-radius: 16px; padding: 4px 12px; margin-bottom: 22px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; font-weight: 600; font-size: 15px;
  font-family: var(--body); border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text); transition: all .15s; text-decoration: none;
}
.btn:hover { border-color: rgba(255,255,255,.28); text-decoration: none; }
.btn.primary {
  background: var(--purple); color: #0c0a18; border-color: var(--purple);
}
.btn.primary:hover { opacity: .9; }
.btn.cyan { background: var(--cyan); color: #001b18; border-color: var(--cyan); }
.btn.cyan:hover { opacity: .9; }
.btn.ghost { color: var(--muted2); }
.btn.danger {
  background: var(--bad); color: #fff; border-color: var(--bad);
}
.btn.danger:hover { opacity: .9; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ── Fork choice (landing step 1) ───────────────────────── */
.fork {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  margin-bottom: 28px;
  text-align: center;
}
.fork-q {
  font-family: var(--display);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1.15;
  margin-bottom: 12px;
}
.fork-sub {
  color: var(--muted2);
  font-size: 15px;
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto 28px;
}
.fork-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
}
@media (max-width: 720px) {
  .fork-cards { grid-template-columns: 1fr; }
}
.fork-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 28px 24px;
  background: var(--panel2);
  border: 2px solid var(--border2);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font-family: var(--body);
  transition: all .15s;
  color: var(--text);
}
.fork-card:hover {
  transform: translateY(-2px);
  border-color: var(--purple);
  background: rgba(139,124,248,.06);
}
.fork-have:hover { border-color: var(--cyan);  background: rgba(0,229,200,.06); }
.fork-skip:hover { border-color: var(--gold);  background: rgba(245,200,66,.06); }
.fork-icon {
  font-size: 28px;
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.fork-have .fork-icon { background: rgba(0,229,200,.10); color: var(--cyan); }
.fork-skip .fork-icon { background: rgba(245,200,66,.12); color: var(--gold); }
.fork-title {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 4px;
}
.fork-desc {
  color: var(--muted2);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}
.fork-cta {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-top: 6px;
}
.fork-have .fork-cta { color: var(--cyan); }
.fork-skip .fork-cta { color: var(--gold); }

/* "← change my answer" link above a revealed path */
.path-back { margin-bottom: 18px; }
.link-button {
  background: transparent; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 12px; color: var(--muted2);
  padding: 0; letter-spacing: .3px;
}
.link-button:hover { color: var(--text); text-decoration: underline; }

/* ── Path layout (revealed after fork choice) ────────────── */
.path {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; padding: 30px;
  position: relative;
}
.path-have { border-left: 4px solid var(--cyan); }
.path-skip { border-left: 4px solid var(--gold); }
.path-header { margin-bottom: 6px; }
.path-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px; margin-bottom: 14px;
}
.path-have .path-eyebrow { color: var(--cyan); background: rgba(0,229,200,.08); border: 1px solid rgba(0,229,200,.20); }
.path-skip .path-eyebrow { color: var(--gold); background: rgba(245,200,66,.10); border: 1px solid rgba(245,200,66,.24); }
.path-title { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.18; margin-bottom: 10px; letter-spacing: -.5px; }
.path-sub { color: var(--muted2); font-size: 15px; line-height: 1.7; margin-bottom: 4px; }
.path-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  background: rgba(139,124,248,.18); color: var(--purple);
  margin-top: 10px;
}
.path .tile { padding: 22px; }
.tile-caveat {
  margin-top: 14px; padding: 11px 14px;
  background: rgba(245,200,66,.08); border: 1px solid rgba(245,200,66,.24);
  border-left: 3px solid var(--gold); border-radius: 8px;
  font-size: 12px; color: var(--gold); line-height: 1.6;
}
.admin-footer-link {
  text-align: center; margin-top: 28px; font-family: var(--mono); font-size: 11px;
}
.admin-footer-link a { color: var(--muted); opacity: .7; }
.admin-footer-link a:hover { color: var(--muted2); opacity: 1; text-decoration: none; }

/* ────────────────────────────────────────────────────────────
   Landing page — three-section layout (free / paid / in-person)
   ──────────────────────────────────────────────────────────── */

/* Free hero card — visually dominant, the front door */
.free-card {
  position: relative;
  background: linear-gradient(135deg, rgba(0,229,200,.10), rgba(139,124,248,.05) 60%, rgba(8,9,15,0) 100%);
  border: 1px solid rgba(0,229,200,.32);
  border-radius: 22px;
  padding: 44px 40px 40px;
  margin-bottom: 44px;
  overflow: hidden;
}
.free-card::before {
  /* soft cyan glow in the top-right corner */
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle at center, rgba(0,229,200,.22), transparent 65%);
  pointer-events: none;
  filter: blur(8px);
}
.free-card > * { position: relative; }
.free-card-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--cyan); font-family: var(--mono);
  background: rgba(0,229,200,.12); border: 1px solid rgba(0,229,200,.32);
  border-radius: 16px; padding: 5px 12px; margin-bottom: 18px;
}
.free-card-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(30px, 4.6vw, 46px); letter-spacing: -.5px;
  line-height: 1.1; margin-bottom: 16px;
}
.free-card-title em { font-style: italic; color: var(--cyan); }
.free-card-sub {
  color: var(--text); font-size: 16.5px; line-height: 1.7;
  max-width: 680px; margin-bottom: 26px;
}
.free-card-list {
  list-style: none; padding: 0; margin: 0 0 30px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 22px;
}
.free-card-list li {
  font-size: 14px; line-height: 1.55; padding-left: 22px;
  position: relative; color: var(--text);
}
.free-card-list li::before {
  content: '✓';
  position: absolute; left: 0; top: 0;
  color: var(--cyan); font-weight: 700;
}
.free-card .free-card-cta {
  font-size: 16px; padding: 15px 32px;
}
.free-card-foot {
  margin-top: 16px;
  font-family: var(--mono); font-size: 11px;
  color: var(--muted2); letter-spacing: .3px;
}
@media (max-width: 560px) {
  .free-card { padding: 32px 22px; }
}

/* "Go Deeper" section — paid lactate tools */
.deeper { margin-bottom: 44px; }
.deeper-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.3px;
  line-height: 1.18; margin: 8px 0 12px;
}
.deeper-title em { font-style: italic; color: var(--purple); }
.deeper-sub {
  color: var(--muted2); font-size: 15px; line-height: 1.7;
  max-width: 720px;
}
.deeper-sub a { color: var(--cyan); }

/* Tile badge variants for the "Go Deeper" tiles */
.tile-badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.tile-badges .tile-badge { margin-bottom: 0; }
.tile-badge.paid {
  background: rgba(139,124,248,.14);
  color: var(--purple);
  border: 1px solid rgba(139,124,248,.32);
}

/* In-Person band — distinct white-glove option */
.inperson-band {
  background: linear-gradient(135deg, rgba(139,124,248,.10), rgba(139,124,248,.02));
  border: 1px solid rgba(139,124,248,.30);
  border-radius: 18px;
  padding: 32px 36px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  margin-bottom: 40px;
}
.inperson-band-left .section-label {
  margin-bottom: 14px;
}
.inperson-band-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(22px, 2.8vw, 30px); letter-spacing: -.3px;
  line-height: 1.18; margin: 0 0 10px;
}
.inperson-band-title em { font-style: italic; color: var(--purple); }
.inperson-band-sub {
  color: var(--muted2); font-size: 14.5px; line-height: 1.7;
  max-width: 540px;
}
.inperson-band-right {
  text-align: center;
  min-width: 200px;
  padding: 6px 8px;
}
.inperson-band-price {
  font-family: var(--display);
  font-size: 52px; font-weight: 700; letter-spacing: -1.5px;
  color: var(--text); line-height: 1;
}
.inperson-band-pricenote {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted2); letter-spacing: .3px;
  margin: 8px 0 18px;
}
@media (max-width: 720px) {
  .inperson-band {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 28px 22px;
  }
  .inperson-band-right { text-align: left; }
  .inperson-band-price { font-size: 44px; }
}

/* ── Big "Download PDF" CTA (matches esFormLab pattern) ───── */
.report-actions {
  display: flex; justify-content: center; gap: 10px;
  margin: 18px 0 28px; flex-wrap: wrap;
}
.btn-download-report {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 20px 38px;
  background: var(--purple); border: none; border-radius: 14px;
  color: #0c0a18; font-weight: 800; font-size: 17px;
  font-family: var(--body); letter-spacing: .2px;
  cursor: pointer; transition: all .18s;
  box-shadow: 0 14px 38px rgba(139,124,248,.38), 0 4px 12px rgba(0,0,0,.45);
}
.btn-download-report:hover {
  transform: translateY(-2px); background: #a99bf9;
  box-shadow: 0 18px 46px rgba(139,124,248,.5), 0 6px 16px rgba(0,0,0,.45);
}
.btn-download-report:active { transform: translateY(0); }
.btn-download-report[disabled] { opacity: .55; cursor: wait; transform: none; }
.btn-download-report .bdr-icon { font-size: 24px; line-height: 1; }
.btn-download-report .bdr-sub {
  font-size: 11px; font-weight: 700;
  color: rgba(12,10,24,.7);
  font-family: var(--mono); letter-spacing: .5px; text-transform: uppercase;
  padding-left: 12px; margin-left: 2px;
  border-left: 1px solid rgba(12,10,24,.25);
}
@media (max-width: 560px) {
  .btn-download-report {
    padding: 16px 24px; font-size: 15px; gap: 10px;
    flex-wrap: wrap; justify-content: center;
  }
  .btn-download-report .bdr-sub {
    border-left: none; padding-left: 0; margin-left: 0;
    width: 100%; text-align: center; font-size: 10px;
  }
}

/* ── Upload-access paywall (sprint + step-test pages) ───── */
.paywall-card {
  max-width: 720px; margin: 32px auto 0;
  padding: 40px 36px;
  background: linear-gradient(135deg, rgba(139,124,248,.10), rgba(0,229,200,.04));
  border: 1px solid rgba(139,124,248,.30);
  border-radius: 18px;
}
.paywall-h {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(28px, 4vw, 40px); letter-spacing: -.5px;
  line-height: 1.18; margin-bottom: 16px;
}
.paywall-h em { font-style: italic; color: var(--purple); }
.paywall-card p {
  color: var(--text); font-size: 15.5px; line-height: 1.7; margin-bottom: 14px;
}
.paywall-tiers {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 20px 0;
}
.paywall-tier-chip {
  background: var(--panel2); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 18px;
  font-size: 13px; line-height: 1.3; color: var(--text);
}
.paywall-tier-chip strong { font-family: var(--mono); color: var(--purple); }
@media (max-width: 560px) {
  .paywall-card { padding: 28px 22px; }
}

/* ── Post-results upsell card (free-tier → paid CTA) ─────── */
.upsell {
  margin: 38px 0 8px;
  padding: 32px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(139,124,248,.10), rgba(0,229,200,.05));
  border: 1px solid rgba(139,124,248,.30);
}
.upsell-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--purple); font-family: var(--mono);
  background: rgba(139,124,248,.16); border: 1px solid rgba(139,124,248,.30);
  border-radius: 16px; padding: 4px 12px; margin-bottom: 16px;
}
.upsell h3 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(24px, 3.2vw, 32px); line-height: 1.18; letter-spacing: -.5px;
  margin-bottom: 14px;
}
.upsell h3 em { font-style: italic; color: var(--purple); }
.upsell p {
  color: var(--text); font-size: 15.5px; line-height: 1.7; margin-bottom: 12px;
}
.upsell p:last-of-type { margin-bottom: 0; }
.upsell .row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.upsell .btn { padding: 13px 24px; font-size: 14px; }
@media (max-width: 560px) {
  .upsell { padding: 24px 20px; }
  .upsell .row .btn { width: 100%; justify-content: center; }
}

/* ── Tile cards (mode selection) ─────────────────────────── */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.tile {
  display: block; padding: 26px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--border);
  transition: border-color .15s, transform .15s; cursor: pointer;
  color: inherit; text-decoration: none;
}
.tile:hover { border-color: var(--purple); transform: translateY(-2px); text-decoration: none; }
.tile.disabled { opacity: .55; cursor: not-allowed; }
.tile.disabled:hover { border-color: var(--border); transform: none; }
.tile-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 14px;
  background: rgba(139,124,248,.10); color: var(--purple);
}
.tile-icon.cyan { background: rgba(0,229,200,.08); color: var(--cyan); }
.tile-icon.gold { background: rgba(245,200,66,.08); color: var(--gold); }
.tile-icon.coral { background: rgba(255,107,53,.10); color: var(--coral); }
.tile-title { font-family: var(--display); font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.tile-desc  { color: var(--muted2); font-size: 14px; line-height: 1.6; margin-bottom: 14px; }
.tile-need  { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }
.tile-badge {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  font-weight: 600; letter-spacing: .5px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; margin-bottom: 12px;
  background: rgba(110,122,154,.15); color: var(--muted2);
}
.tile-badge.v2 { background: rgba(245,200,66,.10); color: var(--gold); }

/* ── Form panels (wizard steps) ──────────────────────────── */
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px; margin-bottom: 18px;
}
.panel-h { font-family: var(--display); font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.panel-sub { color: var(--muted2); font-size: 14px; margin-bottom: 18px; line-height: 1.65; }

label.field {
  display: block; margin-bottom: 14px;
  font-size: 13px; color: var(--muted2); font-weight: 500;
}
label.field > .lab { display: block; margin-bottom: 6px; color: var(--muted2); font-size: 12px; letter-spacing: .3px; text-transform: uppercase; font-family: var(--mono); }
label.field > .hint { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-family: var(--mono); }

input[type=number], input[type=text], input[type=email], input[type=tel],
input[type=date], input[type=search], input[type=url], textarea, select {
  width: 100%; padding: 10px 14px;
  background: var(--panel2); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text); font-family: var(--body); font-size: 15px;
  transition: border-color .15s;
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Unit pill toggle (e.g. min/mi ↔ min/km on results page) ──── */
.unit-pill {
  display: inline-flex;
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 12px;
  position: relative;
}
.unit-pill button {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--muted2);
  cursor: pointer;
  transition: all .12s;
  min-width: 64px;
}
.unit-pill button.active {
  background: rgba(139,124,248,.18);
  color: var(--purple);
}
.unit-pill button:hover:not(.active) { color: var(--text); }

/* ── Pace / distance input with right-edge unit toggle ──── */
.pace-input {
  display: flex; align-items: stretch;
  background: var(--panel2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s;
}
.pace-input:focus-within { border-color: var(--purple); }
.pace-input input.pace-text {
  flex: 1; min-width: 0;
  background: transparent;
  border: none;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  outline: none;
  border-radius: 0;
}
.pace-unit-toggle {
  flex-shrink: 0;
  padding: 0 12px;
  background: rgba(139,124,248,.08);
  border: none;
  border-left: 1px solid var(--border2);
  color: var(--purple);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  min-width: 56px;
}
.pace-unit-toggle:hover { background: rgba(139,124,248,.18); }
.pace-unit-toggle:focus-visible { outline: 2px solid var(--purple); outline-offset: -2px; }

/* Two-option pill that lives inside .pace-input for per-input unit toggles
   (e.g. distance: m | mi). Both options visible, active one highlighted. */
.unit-toggle-inline {
  display: inline-flex; align-self: stretch; flex-shrink: 0;
  border-left: 1px solid var(--border2);
  background: rgba(255,255,255,.03);
}
.unit-toggle-inline button {
  background: transparent; border: none;
  border-right: 1px solid var(--border2);
  padding: 0 14px; min-width: 44px;
  color: var(--muted2); font-family: var(--mono);
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  cursor: pointer; transition: background .12s, color .12s;
}
.unit-toggle-inline button:last-child { border-right: none; }
.unit-toggle-inline button:hover:not(.active) {
  background: rgba(255,255,255,.06); color: var(--text);
}
/* Selected unit gets a solid fill so the active choice is unmistakable. */
.unit-toggle-inline button.active {
  background: var(--purple); color: #fff;
}
.unit-toggle-inline button:focus-visible {
  outline: 2px solid var(--purple); outline-offset: -2px;
}

/* Fixed (non-toggle) unit label on the right edge of an input — e.g. the
   "W" on cycling power fields, where there's only one possible unit. */
.unit-static {
  display: inline-flex; align-items: center; align-self: stretch;
  flex-shrink: 0; padding: 0 16px;
  border-left: 1px solid var(--border2);
  background: rgba(139,124,248,.07);
  color: var(--muted2); font-family: var(--mono);
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
}

.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-row label {
  flex: 1; min-width: 0; cursor: pointer; padding: 10px 14px;
  background: var(--panel2); border: 1px solid var(--border2);
  border-radius: 8px; text-align: center; font-weight: 500;
  font-size: 14px; color: var(--muted2); transition: all .15s;
  user-select: none;
}
.radio-row label:hover { color: var(--text); border-color: rgba(255,255,255,.22); }
.radio-row label:has(input:checked),
.radio-row label.active {
  border-color: var(--purple); background: rgba(139,124,248,.10); color: var(--text);
}
.radio-row input {
  position: absolute; opacity: 0; pointer-events: none;
  width: 0; height: 0;
}

/* ── Saved VLamax card (Profile step 1) ──────────────────── */
.vlamax-card {
  background: linear-gradient(135deg, rgba(139,124,248,.12), rgba(0,229,200,.04));
  border: 1px solid rgba(139,124,248,.32);
  border-left: 4px solid var(--purple);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 22px;
}
.vlc-summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.vlc-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vlc-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--purple);
  background: rgba(139,124,248,.16); border: 1px solid rgba(139,124,248,.28);
  border-radius: 6px; padding: 3px 9px; align-self: flex-start;
}
.vlc-val {
  font-family: var(--display); font-size: 32px; font-weight: 700;
  color: var(--text); line-height: 1.1; letter-spacing: -.5px;
}
.vlc-val .vlc-unit,
.vlc-unit { font-family: var(--mono); font-size: 13px; color: var(--muted2); font-weight: 400; }
.vlc-date { font-size: 13px; color: var(--muted2); }
.vlc-actions { display: flex; gap: 10px; }
.vlc-actions .btn { padding: 9px 18px; font-size: 13px; }

.vlc-divider { height: 1px; background: rgba(139,124,248,.20); margin: 20px 0 18px; }
.vlc-form-h { font-family: var(--display); font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.vlc-form-sub { color: var(--muted2); font-size: 13px; line-height: 1.65; margin-bottom: 16px; }
.vlc-result { margin-top: 14px; }
.vlc-result-empty {
  font-family: var(--mono); font-size: 12px; color: var(--muted2);
  padding: 12px 14px; background: var(--panel2); border-radius: 8px;
  border: 1px dashed var(--border2);
}
.vlc-result-box {
  background: rgba(0,229,200,.06); border: 1px solid rgba(0,229,200,.22);
  border-left: 3px solid var(--cyan);
  padding: 14px 18px; border-radius: 10px;
}
.vlc-result-label {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; color: var(--cyan); margin-bottom: 4px;
}
.vlc-result-val { font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--text); }
.vlc-form-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* ── Stage table (step-test inputs) ────────────────────── */
table.stages { width: 100%; border-collapse: collapse; font-size: 14px; }
table.stages th, table.stages td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; }
table.stages th { font-family: var(--mono); font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
table.stages td input { padding: 6px 10px; font-size: 14px; }
.row-add { margin-top: 12px; }
.row-remove { background: transparent; border: 1px solid var(--border2); color: var(--muted2); padding: 6px 10px; border-radius: 6px; cursor: pointer; font-family: var(--mono); font-size: 11px; }
.row-remove:hover { color: var(--bad); border-color: var(--bad); }

.warn {
  background: rgba(245,200,66,.08); border: 1px solid rgba(245,200,66,.30);
  border-left: 3px solid var(--gold);
  padding: 12px 16px; border-radius: 8px; font-size: 13px;
  color: var(--gold); margin-bottom: 14px; line-height: 1.6;
}
.info {
  background: rgba(0,229,200,.06); border: 1px solid rgba(0,229,200,.18);
  border-left: 3px solid var(--cyan);
  padding: 12px 16px; border-radius: 8px; font-size: 13px;
  color: var(--text); margin-bottom: 14px; line-height: 1.6;
}

/* ── Results ─────────────────────────────────────────────── */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px;
}
.metric-label { font-family: var(--mono); font-size: 10px; color: var(--muted2); letter-spacing: .8px; text-transform: uppercase; margin-bottom: 6px; }
.metric-value { font-family: var(--display); font-size: 28px; font-weight: 700; color: var(--text); }
.metric-unit  { font-family: var(--mono); font-size: 12px; color: var(--muted2); margin-left: 6px; }
.metric-meaning {
  font-size: 12.5px; color: var(--text);
  margin-top: 8px; line-height: 1.5;
}
.metric-note  { font-size: 11px; color: var(--muted2); margin-top: 6px; line-height: 1.4; font-family: var(--mono); letter-spacing: .2px; }

/* ── Plain-English profile guide — prominent card atop Active profile ── */
.profile-guide {
  margin: 0 0 24px;
  padding: 26px 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0,229,200,.11), rgba(139,124,248,.05));
  border: 1px solid rgba(0,229,200,.32);
  box-shadow: 0 0 0 1px rgba(0,229,200,.04), 0 8px 30px rgba(0,0,0,.25);
}
.profile-guide-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--cyan); font-family: var(--mono);
  background: rgba(0,229,200,.14); border: 1px solid rgba(0,229,200,.30);
  border-radius: 16px; padding: 4px 12px; margin-bottom: 14px;
}
.profile-guide h3 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(20px, 2.6vw, 26px); line-height: 1.2; letter-spacing: -.4px;
  margin-bottom: 20px; color: var(--text);
}
.pg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.pg-list li {
  display: grid; gap: 3px;
  padding-left: 14px; border-left: 2px solid rgba(0,229,200,.40);
}
.pg-name { font-family: var(--body); font-size: 15px; font-weight: 700; color: var(--text); }
.pg-name em {
  font-style: normal; font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--muted2); letter-spacing: .3px;
}
.pg-what { font-size: 14px; color: var(--muted2); line-height: 1.55; }
.pg-use  { font-size: 13.5px; color: var(--cyan); line-height: 1.5; }
@media (max-width: 560px) { .profile-guide { padding: 22px 18px; } }

.chart-block { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 18px; }
.chart-title { font-family: var(--display); font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.chart-sub   { color: var(--muted2); font-size: 13px; margin-bottom: 14px; }
.chart-canvas { width: 100%; height: 380px; }

/* ── Educational expandables ─────────────────────────────── */
details.edu {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px; margin-bottom: 10px;
}
details.edu summary {
  cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 16px;
  list-style: none; display: flex; align-items: center; gap: 10px;
}
details.edu summary::before { content: '▸'; color: var(--purple); transition: transform .15s; display: inline-block; }
details.edu[open] summary::before { transform: rotate(90deg); }
details.edu .body { margin-top: 12px; color: var(--muted2); font-size: 14px; line-height: 1.7; }
details.edu .body p { margin-bottom: 10px; }

/* ── Zones table ─────────────────────────────────────────── */
table.zones { width: 100%; border-collapse: collapse; font-size: 14px; }
table.zones th, table.zones td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; }
table.zones th { font-family: var(--mono); font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: .5px; }
table.zones td.num { font-family: var(--mono); }

/* ── "How to measure lactate" trigger (reusable) ─────────── */
.howto-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; margin-bottom: 22px;
  background: rgba(0,229,200,0.06); border: 1px solid rgba(0,229,200,.24);
  color: var(--cyan); border-radius: 10px;
  font-family: var(--body); font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer; transition: all .15s;
}
.howto-trigger:hover {
  background: rgba(0,229,200,.10); border-color: rgba(0,229,200,.40);
  text-decoration: none;
}
.howto-trigger .icon { font-size: 16px; }

/* ── Modal (reusable) ────────────────────────────────────── */
.esml-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(8,9,15,0.78); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 24px; overflow-y: auto;
  animation: esml-fade-in 0.15s ease;
}
@keyframes esml-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.esml-modal {
  position: relative; max-width: 640px; width: 100%;
  background: var(--panel); border: 1px solid var(--border2);
  border-radius: 16px; padding: 36px 40px;
  animation: esml-slide-up 0.2s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
@keyframes esml-slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.esml-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 1px solid var(--border2);
  color: var(--muted2); font-size: 18px; line-height: 1;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--body);
}
.esml-modal-close:hover { background: rgba(255,255,255,.06); color: var(--text); }
.esml-modal-title  { font-family: var(--display); font-size: 28px; font-weight: 700; margin-bottom: 12px; line-height: 1.15; letter-spacing: -.5px; }
.esml-modal-lede   { color: var(--muted2); font-size: 15px; line-height: 1.65; margin-bottom: 22px; }
.esml-modal-h3     { font-family: var(--display); font-size: 17px; font-weight: 600; margin: 22px 0 10px; }
.esml-modal-p      { color: var(--muted2); font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.esml-modal-foot   { font-size: 11px; line-height: 1.7; color: var(--muted); font-family: var(--mono); margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.esml-modal-callout {
  margin-top: 22px; padding: 18px 20px;
  background: rgba(0,229,200,.06); border: 1px solid rgba(0,229,200,.20);
  border-left: 3px solid var(--cyan); border-radius: 10px;
}

/* Tabs inside a modal (e.g. Cycling / Running in the step-test guide) */
.esml-tabs {
  display: flex; gap: 6px; padding: 4px;
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 22px;
}
.esml-tab {
  flex: 1; padding: 10px 16px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  color: var(--muted2); font-family: var(--body);
  font-weight: 600; font-size: 14px;
  transition: all .15s;
}
.esml-tab:hover { color: var(--text); background: rgba(255,255,255,.03); }
.esml-tab.active {
  background: rgba(139,124,248,.16);
  color: var(--purple);
  border: 1px solid rgba(139,124,248,.28);
}
.esml-tab-pane { display: none; }
.esml-tab-pane.active { display: block; }
.esml-checklist, .esml-steps { list-style: none; padding: 0; margin: 0 0 14px; }
.esml-checklist li, .esml-steps li {
  padding: 7px 0; padding-left: 26px; position: relative;
  color: var(--text); font-size: 14px; line-height: 1.6;
}
.esml-checklist li::before {
  content: '◆'; position: absolute; left: 0; color: var(--cyan); font-size: 11px; top: 11px;
}
.esml-steps { counter-reset: step; }
.esml-steps li { counter-increment: step; }
.esml-steps li::before {
  content: counter(step) '.'; position: absolute; left: 0; color: var(--purple);
  font-family: var(--mono); font-size: 12px; font-weight: 700; top: 9px;
}

/* ── Saved sessions panel (Sprint VLamax) ────────────────── */
.sess-panel-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.sess-panel-h .panel-h { margin-bottom: 0; }
.sess-empty {
  text-align: center; padding: 36px 20px;
  background: var(--panel2); border: 1px dashed var(--border2); border-radius: 12px;
}
.sess-empty p { color: var(--muted2); font-size: 14px; line-height: 1.7; margin-bottom: 18px; max-width: 380px; margin-left: auto; margin-right: auto; }
.sess-list { display: flex; flex-direction: column; gap: 10px; }
.sess-card {
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px 44px 20px;
  display: grid; grid-template-columns: 1fr auto; gap: 8px 18px;
  align-items: center; transition: border-color .15s;
  position: relative;
}
.sess-card.latest { border-color: rgba(139,124,248,.40); border-left: 3px solid var(--purple); }
.sess-card .sess-delete {
  position: absolute; bottom: 10px; right: 14px;
  padding: 5px 12px; border-radius: 6px;
  background: transparent;
  border: 1px solid rgba(255,81,99,.32);
  color: var(--bad);
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase;
  cursor: pointer;
  opacity: 0.75;
  transition: all .12s;
}
.sess-card:hover .sess-delete { opacity: 1; }
.sess-card .sess-delete:hover {
  background: var(--bad); color: #fff; border-color: var(--bad);
}
.sess-card .sess-delete:disabled { opacity: 0.4; cursor: not-allowed; }
.sess-card-date { font-family: var(--mono); font-size: 12px; color: var(--muted2); letter-spacing: .3px; }
.sess-card-date .latest-pill {
  display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 4px;
  background: rgba(139,124,248,.18); color: var(--purple);
  font-size: 9px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
}
.sess-card-val { font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.1; }
.sess-card-val .unit { font-family: var(--mono); font-size: 11px; color: var(--muted2); font-weight: 400; margin-left: 4px; }
.sess-card-meta {
  grid-column: 1 / -1; font-size: 12px; color: var(--muted2);
  padding-top: 8px; border-top: 1px solid var(--border); font-family: var(--mono);
}
.sess-foot { color: var(--muted2); font-size: 12px; line-height: 1.6; margin-top: 14px; font-family: var(--mono); }

/* ── Inline "new session" form ───────────────────────────── */
.new-session-card {
  background: linear-gradient(135deg, rgba(139,124,248,.10), rgba(0,229,200,.04));
  border: 1px solid rgba(139,124,248,.32);
  border-left: 4px solid var(--purple);
  border-radius: 14px; padding: 22px 24px; margin-bottom: 18px;
}
.new-session-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 6px;
}
.new-session-h .h-title { font-family: var(--display); font-size: 19px; font-weight: 600; }
.new-session-sub { color: var(--muted2); font-size: 13px; line-height: 1.65; margin-bottom: 16px; }
.new-session-result { margin-top: 14px; }
.new-session-result-box {
  background: rgba(0,229,200,.06); border: 1px solid rgba(0,229,200,.22);
  border-left: 3px solid var(--cyan);
  padding: 14px 18px; border-radius: 10px;
}
.new-session-result-label { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--cyan); margin-bottom: 4px; }
.new-session-result-val   { font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--text); }
.new-session-result-val .unit { font-family: var(--mono); font-size: 11px; color: var(--muted2); font-weight: 400; margin-left: 4px; }
.new-session-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* ── Footer ──────────────────────────────────────────────── */
footer.esml {
  padding: 28px 24px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12px; text-align: center; margin-top: 60px;
}
footer.esml .disclaimer { font-family: var(--mono); line-height: 1.7; margin-top: 10px; }
