
/* ============================================================
   V2 polish — zone data palette (Garmin scale) + app patterns
   Rule: --z1..--z5 are DATA encoding. They may appear only where
   they carry data (zone band, hero zone identity, chart bands).
   Chrome (buttons, links, brand, forms, header/footer/FAQ) stays
   neutral + the single accent, which equals zone-2 blue.
   ============================================================ */
:root {
  --z1: #8E8E93;
  --z2: #007AFF;
  --z3: #34C759;
  --z4: #FF9F0A;
  --z5: #FF453A;
}

@media (prefers-color-scheme: dark) {
  :root {
    --z1: #98989D;
    --z2: #0A84FF;
    --z3: #30D158;
    --z4: #FF9F0A;
    --z5: #FF453A;
  }
}

/* ---------- Hero ---------- */

.hero-card { text-align: center; padding: 28px 20px 24px; box-shadow: var(--shadow-soft); }

.hero-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--z2);
  margin: 0 0 4px;
}

.hero-label .method-name { color: var(--z2); }

.hero-number {
  font-size: clamp(56px, 17vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--z2);
  margin: 0;
}

.hero-unit {
  font-size: 15px;
  color: var(--text-2);
  margin: 6px 0 0;
}

.hero-verdict {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  margin: 0;
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-empty {
  padding: 12px 0 4px;
}

.hero-empty p {
  font-size: 15px;
  color: var(--text-2);
  margin: 0 0 16px;
}

.hero-empty strong { color: var(--text); }

.basis-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-2);
}

/* ---------- Segmented control (iOS pattern) ---------- */

.segmented {
  display: flex;
  background: var(--bg);
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  padding: 3px;
  margin: 16px 0 20px;
}

.segmented label {
  flex: 1 1 0;
  margin: 0;
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented .seg-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: background 180ms var(--ease-in), color 180ms var(--ease-in), box-shadow 180ms var(--ease-in);
  padding: 0 6px;
  text-align: center;
}

.segmented input:checked + .seg-label {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.segmented input:focus-visible + .seg-label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Contributor rows (Oura pattern) ---------- */

.contributors {
  list-style: none;
  margin: 20px 0 0;
  padding: 12px 0 0;
  border-top: 0.5px solid var(--hairline);
  display: grid;
  gap: 2px;
  text-align: left;
}

.contrib {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 8px;
  min-height: 52px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 180ms var(--ease-in);
}

.contrib:hover { background: var(--bg); }

.contrib .c-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.contrib .c-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.contrib .c-sub {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  margin-top: 2px;
}

.contrib .c-val {
  font-size: 15px;
  color: var(--text-2);
  white-space: nowrap;
}

.contrib .c-val.needs { color: var(--accent); font-weight: 600; }

/* ---------- Zone band (Apple Workout / Garmin pattern) ---------- */

.band-caption {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 10px;
}

.band {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 96px;
}

.band .seg {
  flex: 1 1 0;
  min-height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.band .seg.z1 { background: var(--z1); }
.band .seg.z2 {
  background: var(--z2);
  min-height: 78px;
  box-shadow: 0 6px 18px rgba(0, 122, 255, 0.35);
  outline: 2px solid var(--card);
  outline-offset: -2px;
}
.band .seg.z3 { background: var(--z3); }
.band .seg.z4 { background: var(--z4); }
.band .seg.z5 { background: var(--z5); }

.band-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.band-labels > div { text-align: center; min-width: 0; }

.band-labels .num {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.band-labels .z2 .num { color: var(--z2); }

.band-labels small {
  display: block;
  font-size: 10.5px;
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.3;
}

/* ---------- Talk-test verdict card (WHOOP score+verdict pattern) ---------- */

.verdict-card {
  text-align: center;
  padding: 24px 20px;
}

.verdict-card .v-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(0, 122, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--z2);
  margin-bottom: 12px;
}

.verdict-card p {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.verdict-card .caption { margin: 0; }

/* ---------- Slider fields (pro-app input pattern) ---------- */

.slider-field { margin: 0 0 20px; }

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.slider-head label {
  font-size: 15px;
  font-weight: 600;
}

.slider-head .hint {
  display: block;
  font-weight: 400;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
  max-width: 40ch;
}

.slider-out {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.slider-out .u {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  margin-left: 2px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0.5px solid var(--hairline);
  background: var(--card);
  color: var(--accent);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 150ms var(--ease-in), opacity 150ms;
}

.stepper:active { transform: scale(0.92); }
.stepper:disabled { opacity: 0.35; cursor: default; }

input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 44px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(120, 120, 128, 0.28);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  margin-top: -12px;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(120, 120, 128, 0.28);
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.exact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.exact-row label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 400;
}

.exact-row input {
  width: 96px;
  min-height: 44px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-control);
  padding: 8px 12px;
}

.exact-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.exact-row input[aria-invalid="true"] { border-color: var(--danger); }

/* ---------- Switch (resting-HR enable) ---------- */

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.switch-row .hint {
  display: block;
  font-weight: 400;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
  max-width: 38ch;
}

.switch {
  flex: 0 0 auto;
  width: 52px;
  height: 32px;
  border-radius: 16px;
  background: rgba(120, 120, 128, 0.32);
  border: 0;
  position: relative;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  transition: background 200ms var(--ease-in);
}

.switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 200ms var(--ease-in);
}

.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] .knob { transform: translateX(20px); }

/* ---------- Advanced disclosure ---------- */

details.advanced {
  margin-top: 16px;
  border-top: 0.5px solid var(--hairline);
  padding-top: 4px;
}

details.advanced summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details.advanced summary::-webkit-details-marker { display: none; }

/* ---------- Weekly plan rings (Strava/Oura pattern) ---------- */

.plan-card {
  display: flex;
  gap: 16px;
  align-items: center;
}

.plan-ring {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
}

.plan-ring .track { stroke: rgba(120, 120, 128, 0.25); }
.plan-ring .fill { stroke: var(--accent); transition: stroke-dashoffset 350ms var(--ease-in); }

.plan-body { min-width: 0; }

.plan-metric {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}

.plan-metric .u {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-2);
}

.plan-card .tag { margin-bottom: 4px; }

/* ---------- Gentler explainer cards ---------- */

.mini-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 560px) {
  .mini-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.mini-card {
  background: var(--card);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 20px;
}

.mini-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.mini-card p {
  font-size: 15px;
  color: var(--text-2);
  margin: 0;
}

.mini-card .mini-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ---------- By-age: chart leads ---------- */

.age-chart-card canvas { max-height: 260px; }

input[type="range"].untouched { opacity: 0.45; }

/* Screen-reader only (keeps SEO/a11y numbers in the DOM where visuals carry them) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .segmented .seg-label,
  .contrib,
  .switch,
  .switch .knob,
  .stepper,
  .plan-ring .fill {
    transition: none;
  }
}
