/* ============================================================
   TamaRun — front-end stylesheet
   Ported from the design-canvas mockup (_ds tokens + inline styles)
   into a portable, responsive, class-based system.

   Everything is prefixed .tr- so it cannot collide with WordPress
   core block styles, plugins, or another theme.

   Contents
     1. Tokens
     2. Base / canvas
     3. Primitives (button, badge, chip, section label, input, avatar)
     4. Layout helpers
     5. Landing sections
     6. Phone / app mock
     7. Responsive
   ============================================================ */

/* ---------- 1. Tokens ------------------------------------- */

:root {
  /* Brand */
  --tr-orange: #ff8555;
  --tr-orange-deep: #f26a36;
  --tr-rust: #c34118;
  --tr-blue: #00c1ff;
  --tr-blue-deep: #00a6e0;
  --tr-teal: #007696;
  --tr-mint: #befdc2;
  --tr-mint-deep: #8fe89b;
  --tr-cream: #f8f4c2;

  /* Warm nude ramp */
  --tr-sand-0: #ffffff;
  --tr-sand-50: #fbf7f1;
  --tr-sand-100: #f5eee3;
  --tr-sand-150: #efe6d8;
  --tr-sand-200: #e7dac8;
  --tr-sand-300: #d7c5ac;
  --tr-sand-400: #b9a488;
  --tr-sand-500: #94806a;

  /* Ink */
  --tr-ink: #2a2420;
  --tr-ink-soft: #5a4f46;
  --tr-ink-muted: #8a7c6e;
  --tr-ink-invert: #ffffff;

  /* Semantic */
  --tr-surface-page: var(--tr-sand-50);
  --tr-surface-card: var(--tr-sand-0);
  --tr-surface-raised: var(--tr-sand-100);
  --tr-surface-sunken: var(--tr-sand-150);
  --tr-border: var(--tr-sand-200);
  --tr-border-strong: var(--tr-sand-300);
  --tr-accent: var(--tr-orange);
  --tr-accent-hover: var(--tr-orange-deep);
  --tr-warn-bg: #fff3ec;
  --tr-warn-border: #ffd3be;
  --tr-ok: #1b5b33;

  /* Type */
  --tr-font-display: "Archivo", "Hanken Grotesk", system-ui, sans-serif;
  --tr-font-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tr-font-script: "Caveat", cursive;
  --tr-font-mono: ui-monospace, Menlo, Consolas, monospace;

  /* Radius + shadow */
  --tr-radius-sm: 10px;
  --tr-radius-md: 16px;
  --tr-radius-lg: 20px;
  --tr-radius-xl: 24px;
  --tr-radius-pill: 999px;
  --tr-shadow-xs: 0 1px 2px rgba(42, 36, 32, 0.06);
  --tr-shadow-md: 0 8px 24px rgba(42, 36, 32, 0.09);
  --tr-shadow-pop: 6px 6px 0 var(--tr-ink);

  /* Motion */
  --tr-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --tr-dur-fast: 120ms;
  --tr-dur: 200ms;

  /* Rhythm — section padding scales with viewport */
  --tr-gutter: clamp(18px, 4vw, 30px);
  --tr-section-y: clamp(38px, 6vw, 52px);
}

/* ---------- 2. Base / canvas ------------------------------ */

.tr {
  font-family: var(--tr-font-sans);
  color: var(--tr-ink-soft);
  background: var(--tr-sand-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The mockup's "browser frame". On a real site the frame is dropped and the
   page runs edge to edge; .tr--framed restores the mockup look for previews. */
.tr--framed {
  max-width: 1180px;
  margin-inline: auto;
  border: 1.5px solid var(--tr-sand-300);
  border-radius: var(--tr-radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(42, 36, 32, 0.45);
}

.tr * {
  box-sizing: border-box;
}

.tr img {
  max-width: 100%;
}

.tr a {
  color: var(--tr-teal);
  text-decoration: none;
}

.tr a:hover {
  color: var(--tr-ink);
}

.tr p {
  text-wrap: pretty;
}

/* Heading defaults.
   `:where()` contributes zero specificity, so this rule scores 0,1,0 instead
   of 0,1,1. That matters: a single-class modifier like .tr-hero__title would
   otherwise LOSE to it and silently fall back to the default tracking and
   ink colour. Keep the :where() — removing it re-breaks every modifier. */
.tr :where(h1, h2, h3, h4) {
  font-family: var(--tr-font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--tr-ink);
  margin: 0;
}

.tr input[type="range"] {
  accent-color: var(--tr-teal);
}

.tr :focus-visible {
  outline: 3px solid var(--tr-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduced motion — the drill animation and bar transitions are decorative */
@media (prefers-reduced-motion: reduce) {
  .tr *,
  .tr *::before,
  .tr *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 3. Primitives --------------------------------- */

/* Button */
.tr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  font-family: var(--tr-font-sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  border-radius: var(--tr-radius-pill);
  border: 2px solid var(--tr-accent);
  background: var(--tr-accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--tr-dur-fast) var(--tr-ease),
    background var(--tr-dur) var(--tr-ease),
    box-shadow var(--tr-dur) var(--tr-ease);
}

.tr-btn:hover {
  background: var(--tr-accent-hover);
  border-color: var(--tr-accent-hover);
  color: #fff;
}

.tr-btn:active {
  transform: translateY(1px);
}

.tr-btn--sm {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.tr-btn--lg {
  height: 58px;
  padding: 0 34px;
  font-size: 18px;
}

.tr-btn--outline {
  background: transparent;
  border-color: var(--tr-ink);
  color: var(--tr-ink);
}

.tr-btn--outline:hover {
  background: var(--tr-ink);
  border-color: var(--tr-ink);
  color: #fff;
}

.tr-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--tr-ink);
}

.tr-btn--ghost:hover {
  background: var(--tr-surface-sunken);
  color: var(--tr-ink);
}

.tr-btn--pop {
  box-shadow: var(--tr-shadow-pop);
}

.tr-btn--block {
  display: flex;
  width: 100%;
}

/* Fills the remaining space in a .tr-row — used by the app's prev/next pair */
.tr-btn--grow {
  flex: 1;
}

/* Badge */
.tr-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-family: var(--tr-font-sans);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  border-radius: var(--tr-radius-pill);
  border: 1.5px solid transparent;
  background: var(--tr-sand-150);
  color: var(--tr-ink);
}

.tr-badge--sm {
  font-size: 11px;
  padding: 3px 9px;
  gap: 5px;
}

.tr-badge--outline {
  background: transparent;
  border-color: var(--tr-ink);
  color: var(--tr-ink);
}

.tr-badge--orange {
  background: var(--tr-orange);
  border-color: var(--tr-orange);
  color: #7a2d0e;
}

/* Pace chip */
.tr-pace {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 12px;
  background: var(--tr-surface-card);
  border: 1.5px solid var(--tr-border);
  border-radius: var(--tr-radius-pill);
  box-shadow: var(--tr-shadow-xs);
  font-family: var(--tr-font-sans);
}

.tr-pace--sm {
  padding: 5px 12px 5px 10px;
}

.tr-pace__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--tr-mint);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.08);
}

.tr-pace__dot[data-level="trote"] { background: var(--tr-blue); }
.tr-pace__dot[data-level="ritmo"] { background: var(--tr-orange); }
.tr-pace__dot[data-level="fuerte"] { background: var(--tr-rust); }

.tr-pace__label {
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  color: var(--tr-ink);
}

.tr-pace__note {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--tr-ink-muted);
}

.tr-pace--sm .tr-pace__label { font-size: 12.5px; }
.tr-pace--sm .tr-pace__note { font-size: 10.5px; }

/* Section label / eyebrow */
.tr-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tr-orange);
}

.tr-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--tr-rust);
  flex: 0 0 auto;
}

.tr-eyebrow--plain::before { display: none; }
.tr-eyebrow--teal { color: var(--tr-teal); }
.tr-eyebrow--muted { color: var(--tr-ink-muted); }
.tr-eyebrow--muted::before { background: var(--tr-ink-muted); }

/* Sections 02 (Cooper) and 06 (Join) are NOT the SectionLabel component in
   the source mockup — they are hand-written spans at 700/12.5px with no
   leading rule. The mockup is inconsistent here on purpose or by accident;
   either way these two reproduce it exactly. */
.tr-eyebrow--mint,
.tr-eyebrow--cream {
  font-size: 12.5px;
  font-weight: 700;
}

.tr-eyebrow--mint::before,
.tr-eyebrow--cream::before {
  display: none;
}

.tr-eyebrow--mint { color: var(--tr-mint); }
.tr-eyebrow--cream { color: var(--tr-cream); }

/* Field */
.tr-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tr-ink-muted);
}

/* Matches the design system's Input label: 14px / semibold. */
.tr-field__label {
  font-family: var(--tr-font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--tr-ink);
}

/* "Tu distancia" is hand-written in the mockup at 12.5px / 700, not an
   Input label — hence its own class rather than reusing .tr-field__label. */
.tr-form__legend {
  font-family: var(--tr-font-sans);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tr-ink);
  margin-bottom: 8px;
}

.tr-input {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--tr-radius-pill);
  border: 1.5px solid var(--tr-border-strong);
  background: var(--tr-sand-50);
  font-family: var(--tr-font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--tr-ink);
  transition: border-color var(--tr-dur) var(--tr-ease);
}

.tr-input:focus {
  border-color: var(--tr-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 193, 255, 0.35);
}

.tr-input--sm {
  height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 16px;
}

/* Avatar */
.tr-avatars {
  display: inline-flex;
  align-items: center;
}

/* Mirrors the design system's Avatar component exactly: display face at
   `size × 0.4`, bold, line-height 1, no border. The group overlap is
   `-size × 0.32`. Changing these drifts from the uploaded mockup. */
.tr-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: var(--tr-font-display);
  font-size: 13.6px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--tr-orange);
  flex: 0 0 auto;
  overflow: hidden;
}

.tr-avatars .tr-avatar + .tr-avatar {
  margin-left: -10.88px;
}

.tr-avatar[data-color="teal"] { background: var(--tr-teal); }
.tr-avatar[data-color="blue"] { background: var(--tr-blue); color: #063040; }
.tr-avatar[data-color="mint"] { background: var(--tr-mint); color: #1b5b33; }

/* Small shared bits */
.tr-mono {
  font-family: var(--tr-font-mono);
}

.tr-script {
  font-family: var(--tr-font-script);
}

.tr-em {
  font-style: italic;
  color: var(--tr-teal);
}

.tr-em--orange { color: var(--tr-orange); }
.tr-em--cream { color: var(--tr-cream); }

/* ---------- 4. Layout helpers ----------------------------- */

.tr-section {
  padding: var(--tr-section-y) var(--tr-gutter);
}

.tr-section--sand { background: var(--tr-sand-100); }
.tr-section--ink { background: var(--tr-ink); }
.tr-section--orange { background: var(--tr-orange); }

.tr-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tr-stack--sm { gap: 16px; }
.tr-stack--xs { gap: 10px; }

/* Horizontal cluster — wraps, keeps a consistent gap */
.tr-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tr-row--sm { gap: 8px; }
.tr-row--top { align-items: flex-start; }

/* Big section title used on the Cooper / hydration split layouts */
.tr-title-lg {
  font-size: clamp(34px, 5vw, 46px);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

/* Section heading row: title left, supporting copy right */
.tr-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.tr-head__title {
  font-size: clamp(28px, 4.2vw, 42px);
  line-height: 0.96;
  margin-top: 12px;
}

.tr-head__note {
  margin: 0;
  max-width: 40ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--tr-ink-soft);
}

/* Split: narrative column + interactive card */
.tr-split {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: clamp(24px, 4vw, 40px);
  align-items: start;
}

.tr-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tr-card {
  background: var(--tr-surface-card);
  border: 1.5px solid var(--tr-border);
  border-radius: 18px;
  padding: 18px 20px;
}

.tr-card__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tr-teal);
}

.tr-card p {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--tr-ink-soft);
}

.tr-panel {
  background: var(--tr-surface-card);
  border: 1.5px solid var(--tr-border);
  border-radius: var(--tr-radius-xl);
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tr-panel--cream {
  background: var(--tr-sand-50);
  border-color: transparent;
}

.tr-formula {
  font-family: var(--tr-font-mono);
  font-size: 13px;
  line-height: 1.7;
  background: var(--tr-surface-card);
  border: 1.5px solid var(--tr-border);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--tr-ink);
}

.tr-formula--ink {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
  color: var(--tr-mint);
  font-size: 13.5px;
}

.tr-steps {
  margin: 4px 0 0;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--tr-ink-soft);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Orange advisory note */
.tr-note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--tr-warn-bg);
  border: 1.5px solid var(--tr-warn-border);
  border-radius: 18px;
  padding: 16px 20px;
}

.tr-note img {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.tr-note p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--tr-ink-soft);
}

/* Big readout number */
.tr-readouts {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.tr-readouts--ruled {
  padding-top: 16px;
  border-top: 1.5px solid var(--tr-sand-150);
}

.tr-readouts .tr-readout--teal {
  text-align: right;
}

.tr-readouts .tr-readout--teal .tr-readout__value {
  justify-content: flex-end;
}

.tr-readout__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tr-ink-muted);
}

.tr-readout__value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--tr-ink);
}

.tr-readout__unit {
  font-family: var(--tr-font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--tr-ink-muted);
}

.tr-readout--teal .tr-readout__value { color: var(--tr-teal); }

/* ---------- 5. Landing sections --------------------------- */

/* 5.1 Countdown bar */
.tr-countdown {
  background: var(--tr-ink);
}

.tr-countdown__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 24px var(--tr-gutter) 20px;
  flex-wrap: wrap;
}

.tr-countdown__when {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tr-countdown__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tr-mint);
}

.tr-countdown__date {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #fff;
}

.tr-countdown__place {
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

.tr-countdown__clock {
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 2.4vw, 26px);
}

.tr-countdown__unit {
  text-align: right;
}

.tr-countdown__n {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: clamp(38px, 7vw, 68px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: #fff;
}

.tr-countdown__u {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tr-mint);
}

.tr-countdown__unit--dim .tr-countdown__n { color: rgba(255, 255, 255, 0.72); }
.tr-countdown__unit--dim .tr-countdown__u { color: rgba(255, 255, 255, 0.45); }

.tr-countdown__rule {
  width: 1.5px;
  height: 62px;
  background: rgba(255, 255, 255, 0.16);
}

.tr-countdown__track {
  height: 5px;
  background: rgba(255, 255, 255, 0.14);
}

.tr-countdown__fill {
  height: 100%;
  width: 0;
  background: var(--tr-orange);
  transition: width 600ms var(--tr-ease);
}

/* 5.2 Nav */
.tr-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--tr-gutter);
  background: #fff;
  border-bottom: 1.5px solid var(--tr-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.tr-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.tr-brand img {
  width: 40px;
  height: 40px;
}

.tr-brand__name {
  display: block;
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--tr-ink);
}

.tr-brand__tag {
  display: block;
  font-family: var(--tr-font-script);
  font-size: 15px;
  line-height: 1.1;
  color: var(--tr-teal);
}

.tr-nav__links {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  font-size: 14.5px;
  font-weight: 600;
}

.tr-nav__links a {
  color: var(--tr-ink-soft);
  white-space: nowrap;
}

.tr-nav__links a:hover {
  color: var(--tr-ink);
}

/* 5.3 Hero */
.tr-hero {
  background: var(--tr-sand-100);
  padding: clamp(34px, 5vw, 52px) var(--tr-gutter) clamp(30px, 4.5vw, 46px);
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(24px, 4vw, 40px);
  align-items: center;
}

.tr-hero__copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tr-hero__kicker {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tr-teal);
}

.tr-hero__title {
  font-size: clamp(42px, 7.4vw, 74px);
  line-height: 0.86;
  letter-spacing: -0.025em;
}

.tr-hero__lede {
  margin: 0;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.55;
  color: var(--tr-ink-soft);
}

.tr-hero__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tr-hero__social {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 6px;
  flex-wrap: wrap;
}

/* Scoped to its own class, NOT `.tr-hero__social span` — a descendant
   selector there scores 0,1,1 and would silently override the sibling
   .tr-avatar initials (0,1,0), resizing them off-spec. */
.tr-hero__count {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--tr-ink-soft);
}

/* "Grupo Intermedio · 10K a 21K" under the Cooper slider. The <b> inherits
   `bolder` against this 600, which computes to 900 — same as the mockup. */
.tr-band {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--tr-ink-soft);
}

.tr-band b {
  color: var(--tr-teal);
}

.tr-hero__media {
  position: relative;
  padding: 0 8px 34px 26px;
}

.tr-hero__frame {
  border-radius: 26px;
  overflow: hidden;
  border: 2px solid var(--tr-ink);
}

.tr-hero__frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 22%;
}

.tr-hero__stamp {
  position: absolute;
  left: 0;
  bottom: 0;
  background: #fff;
  border: 1.5px solid var(--tr-border);
  border-radius: var(--tr-radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: 0 12px 30px -16px rgba(42, 36, 32, 0.45);
}

.tr-hero__stamp img {
  display: block;
  height: 44px;
}

.tr-hero__stamp-rule {
  width: 1.5px;
  height: 40px;
  background: var(--tr-sand-150);
}

.tr-hero__stamp-date {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tr-ink-muted);
}

/* 5.4 Distance picker */
.tr-dist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  border-radius: 22px;
  border: 1.5px solid var(--tr-border);
  background: #fff;
  font-family: inherit;
  transition: transform var(--tr-dur) var(--tr-ease),
    box-shadow var(--tr-dur) var(--tr-ease);
}

.tr-dist:hover {
  transform: translateY(-3px);
}

.tr-dist[aria-pressed="true"] {
  border: 2px solid var(--tr-ink);
  box-shadow: 6px 6px 0 var(--tr-orange);
}

.tr-dist__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tr-dist__n {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--tr-ink);
}

.tr-dist__flag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--tr-teal);
  color: #fff;
  padding: 5px 11px;
  border-radius: var(--tr-radius-pill);
}

.tr-dist[aria-pressed="false"] .tr-dist__flag {
  display: none;
}

.tr-dist__name {
  font-family: var(--tr-font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--tr-ink);
}

.tr-dist p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--tr-ink-soft);
}

/* 5.5 Week navigator */
.tr-weeknav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tr-weeknav__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tr-ink-muted);
}

.tr-round {
  width: 40px;
  height: 40px;
  border-radius: var(--tr-radius-pill);
  border: 2px solid var(--tr-ink);
  background: transparent;
  color: var(--tr-ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.tr-round--solid {
  background: var(--tr-ink);
  color: #fff;
}

.tr-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tr-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  background: transparent;
  color: var(--tr-ink-soft);
  border: 1.5px solid var(--tr-border);
  font-family: inherit;
  transition: background var(--tr-dur) var(--tr-ease);
}

.tr-chip[aria-pressed="true"] {
  background: var(--tr-ink);
  color: #fff;
  border: 2px solid var(--tr-ink);
}

.tr-chip__name {
  font-family: var(--tr-font-display);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
}

.tr-chip__dates {
  font-family: var(--tr-font-mono);
  font-size: 11px;
  opacity: 0.7;
}

/* Week detail */
.tr-week {
  background: #fff;
  border: 1.5px solid var(--tr-border);
  border-radius: var(--tr-radius-xl);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tr-week[data-milestone="true"] {
  background: var(--tr-warn-bg);
  border: 2px solid var(--tr-warn-border);
}

.tr-week__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.tr-week__dates {
  font-family: var(--tr-font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--tr-ink-muted);
}

.tr-week__name {
  margin-top: 4px;
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--tr-ink);
}

.tr-week[data-milestone="true"] .tr-week__name {
  color: var(--tr-teal);
}

.tr-week__focus {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--tr-ink-soft);
  max-width: 46ch;
}

.tr-day {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 15px 0;
  border-top: 1.5px solid var(--tr-sand-150);
}

.tr-day__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tr-ink-muted);
}

.tr-day--race .tr-day__label {
  color: var(--tr-teal);
}

.tr-day__text {
  font-size: 16px;
  line-height: 1.45;
  color: var(--tr-ink);
}

.tr-day__km {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 20px;
  color: var(--tr-teal);
}

/* 5.6 Cooper (dark section) */

/* The base rule in section 2 (`.tr h1,h2,h3,h4`) has specificity 0,1,1 — a
   single class modifier would lose to it and render ink on ink. Every
   inverted title is therefore qualified with `.tr` to reach 0,2,0, and
   matches on class rather than heading level so h2/h3 both behave. */
.tr .tr-cooper__title,
.tr .tr-join__title,
.tr .tr-title--invert,
.tr-section--ink .tr-head__title,
.tr-section--orange .tr-head__title {
  color: #fff;
}

.tr-cooper__title {
  font-size: clamp(34px, 5vw, 46px);
  line-height: 0.92;
}

/* Cream advisory note — same shape as .tr-note, quieter ground */
.tr-note--cream {
  background: var(--tr-sand-50);
  border-color: transparent;
  border-radius: var(--tr-radius-md);
  padding: 16px 18px;
}

.tr-note--cream img {
  width: 26px;
  height: 26px;
}

.tr-note--cream p {
  font-weight: 600;
}

.tr-cooper__lede {
  margin: 0;
  max-width: 40ch;
  font-size: 15.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
}

.tr-section--ink .tr-steps {
  color: rgba(255, 255, 255, 0.72);
}

.tr-cooper__photo {
  border-radius: 18px;
  overflow: hidden;
  margin-top: 6px;
}

.tr-cooper__photo img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: 50% 45%;
}

.tr-slider {
  width: 100%;
  height: 28px;
  cursor: pointer;
}

.tr-paces {
  display: flex;
  flex-direction: column;
  border-top: 1.5px solid var(--tr-sand-150);
}

.tr-paces__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1.5px solid var(--tr-sand-150);
}

.tr-paces__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--tr-ink);
}

.tr-paces__note {
  font-size: 13px;
  color: var(--tr-ink-muted);
}

.tr-paces__value {
  font-family: var(--tr-font-mono);
  font-size: 19px;
  font-weight: 700;
  color: var(--tr-ink);
}

.tr-paces__row[data-accent="teal"] .tr-paces__value {
  color: var(--tr-teal);
}

.tr-alert {
  margin: 0;
  background: var(--tr-warn-bg);
  border: 1.5px solid var(--tr-warn-border);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tr-ink-soft);
}

.tr-saved {
  font-size: 14px;
  font-weight: 700;
  color: var(--tr-ok);
}

[hidden] {
  display: none !important;
}

/* 5.7 Tide chart */
.tr-tide {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 1.6vw, 18px);
  align-items: end;
  padding: 26px 28px 22px;
  background: #fff;
  border: 1.5px solid var(--tr-border);
  border-radius: 22px;
  height: 300px;
}

.tr-tide__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  height: 100%;
}

.tr-tide__km {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: clamp(16px, 2.4vw, 22px);
  color: var(--tr-ink);
}

.tr-tide__bar {
  width: 100%;
  max-width: 88px;
  border-radius: 14px 14px 0 0;
  background: var(--tr-orange);
  height: 0;
  transition: height 420ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.tr-tide__col--race .tr-tide__bar {
  background: var(--tr-teal);
}

.tr-tide__label {
  font-size: clamp(10px, 1.5vw, 12.5px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tr-ink-muted);
  text-align: center;
}

/* 5.8 Technique / ABC drills */
.tr-abc {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 20px;
  align-items: start;
}

.tr-abc__stage {
  background: #fff;
  border: 2px solid var(--tr-ink);
  border-radius: var(--tr-radius-xl);
  padding: 22px;
  box-shadow: 8px 8px 0 var(--tr-orange);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tr-abc__fig {
  background: var(--tr-sand-150);
  border-radius: 18px;
  display: grid;
  place-items: center;
  padding: 14px;
  height: 300px;
}

.tr-abc__fig svg {
  height: 100%;
  max-height: 272px;
  fill: none;
  stroke: var(--tr-ink);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tr-abc__title {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--tr-ink);
}

.tr-abc__work {
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tr-teal);
}

.tr-abc__how {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--tr-ink-soft);
}

.tr-abc__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tr-abc__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tr-drill {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: var(--tr-radius-md);
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px solid var(--tr-border);
  font-family: inherit;
  transition: transform var(--tr-dur) var(--tr-ease);
}

.tr-drill:hover {
  transform: translateX(3px);
}

.tr-drill[aria-pressed="true"] {
  background: #fff;
  border: 2px solid var(--tr-ink);
}

.tr-drill__n {
  font-family: var(--tr-font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--tr-ink-muted);
}

.tr-drill__body {
  flex: 1;
  display: block;
}

.tr-drill__name {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--tr-ink);
}

.tr-drill__work {
  display: block;
  font-size: 13px;
  color: var(--tr-ink-muted);
}

.tr-drill__cta {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tr-ink-muted);
}

.tr-drill[aria-pressed="true"] .tr-drill__n,
.tr-drill[aria-pressed="true"] .tr-drill__cta {
  color: var(--tr-teal);
}

@keyframes tr-draw {
  from { stroke-dashoffset: 220; }
  to { stroke-dashoffset: 0; }
}

@keyframes tr-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 5.9 Join (orange section) */
.tr-join {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 40px);
  align-items: center;
}

.tr-join__title {
  font-size: clamp(36px, 5.4vw, 50px);
  line-height: 0.9;
}

.tr-join__lede {
  margin: 0;
  max-width: 40ch;
  font-size: 16px;
  line-height: 1.55;
  color: var(--tr-warn-bg);
}

.tr-join__sign {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tr-join__sign img {
  width: 46px;
  height: 46px;
}

.tr-join__sign span {
  font-family: var(--tr-font-script);
  font-size: 26px;
  color: var(--tr-cream);
}

.tr-join__form {
  background: #fff;
  border: 2px solid var(--tr-ink);
  border-radius: var(--tr-radius-xl);
  padding: 26px;
  box-shadow: 8px 8px 0 var(--tr-ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tr-join__form p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--tr-ink-muted);
}

.tr-segment {
  display: flex;
  gap: 8px;
}

.tr-segment button {
  flex: 1;
  border-radius: var(--tr-radius-pill);
  padding: 11px 0;
  font-family: var(--tr-font-display);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  background: transparent;
  color: var(--tr-ink-soft);
  border: 2px solid var(--tr-border);
  transition: background var(--tr-dur) var(--tr-ease);
}

.tr-segment button[aria-pressed="true"] {
  background: var(--tr-teal);
  color: #fff;
  border-color: var(--tr-teal);
}

/* ---- Fluent Forms inside the join card -------------------
   Restyles the [fluentform] output to the mockup's form: pill fields on the
   sand ground, 14px/600 labels, and a full-width orange submit.

   Selectors are three classes deep (.tr .tr-ff .ff-…) so they outrank Fluent
   Forms' own two-class defaults (.fluentform .ff-…) without needing
   !important. Two exceptions are marked below where the plugin ships inline
   or utility styles that cannot be beaten on specificity alone. */

.tr .tr-ff .fluentform,
.tr .tr-ff .frm-fluent-form {
  margin: 0;
}

/* Field group rhythm — matches the 14px gap of the original card */
.tr .tr-ff .ff-el-group {
  margin-bottom: 14px;
}

.tr .tr-ff .ff-el-group:last-of-type {
  margin-bottom: 0;
}

/* Labels */
.tr .tr-ff .ff-el-input--label label {
  font-family: var(--tr-font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--tr-ink);
  margin-bottom: 6px;
  padding: 0;
}

.tr .tr-ff .ff-el-input--label.ff-el-is-required label:after {
  color: var(--tr-rust);
}

/* Text-like fields */
.tr .tr-ff .ff-el-form-control {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--tr-radius-pill);
  border: 1.5px solid var(--tr-border-strong);
  background: var(--tr-sand-50);
  box-shadow: none;
  font-family: var(--tr-font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--tr-ink);
  transition: border-color var(--tr-dur) var(--tr-ease),
    box-shadow var(--tr-dur) var(--tr-ease);
}

.tr .tr-ff .ff-el-form-control::placeholder {
  font-weight: 500;
  color: var(--tr-ink-muted);
  opacity: 1;
}

.tr .tr-ff .ff-el-form-control:focus {
  border-color: var(--tr-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 193, 255, 0.35);
}

/* Multi-line and select need their own metrics */
.tr .tr-ff textarea.ff-el-form-control {
  height: auto;
  min-height: 110px;
  padding: 14px 18px;
  border-radius: var(--tr-radius-md);
  line-height: 1.5;
  font-weight: 500;
}

.tr .tr-ff select.ff-el-form-control {
  padding-right: 42px;
}

/* Radio groups → the mockup's horizontal segmented pills.
   Checkboxes (terms, consent) stay ordinary checkbox rows.

   The hooks .tr-ff-choices / .tr-ff-choice / .tr-ff-pill are applied by
   tamarun.js. They deliberately do NOT rely on Fluent Forms'
   .ff-el-form-check-inline, which only appears when the form designer picks
   the "inline" layout — with the default layout that class is absent and the
   pills stack vertically. */

.tr .tr-ff .ff-el-form-check {
  margin: 0;
  padding: 0;
}

.tr .tr-ff .tr-ff-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tr .tr-ff .tr-ff-choices .ff-el-form-check {
  flex: 1 1 0;
  min-width: 72px;
}

.tr .tr-ff label.tr-ff-pill {
  /* Containing block for the hidden radio below. Without it the radio is
     positioned against the page, and focusing it on click scrolls the
     viewport to the top. */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  border-radius: var(--tr-radius-pill);
  border: 2px solid var(--tr-border);
  background: transparent;
  font-family: var(--tr-font-display);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--tr-ink-soft);
  text-align: center;
  cursor: pointer;
  transition: background var(--tr-dur) var(--tr-ease),
    border-color var(--tr-dur) var(--tr-ease),
    color var(--tr-dur) var(--tr-ease);
}

.tr .tr-ff label.tr-ff-pill:hover {
  border-color: var(--tr-border-strong);
}

/* The native radio stays in the DOM for keyboard and screen-reader use, but
   the pill carries the visual state. Pinned to the pill's own centre and
   given a 1px box — a zero-size box makes scroll-into-view unpredictable. */
.tr .tr-ff label.tr-ff-pill .ff-el-form-check-input {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

/* .is-checked is set by tamarun.js; the :has() rule is the no-JS path. */
.tr .tr-ff label.tr-ff-pill.is-checked,
.tr .tr-ff label.tr-ff-pill:has(.ff-el-form-check-input:checked) {
  background: var(--tr-teal);
  border-color: var(--tr-teal);
  color: #fff;
}

.tr .tr-ff label.tr-ff-pill:has(.ff-el-form-check-input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(0, 193, 255, 0.35);
}

/* Checkboxes — terms, consent, anything not a radio group */
.tr .tr-ff .ff-el-form-check:not(.tr-ff-choice) label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-family: var(--tr-font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--tr-ink-soft);
  cursor: pointer;
}

.tr .tr-ff .ff-el-form-check:not(.tr-ff-choice) input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--tr-teal);
}

.tr .tr-ff .ff-el-form-check:not(.tr-ff-choice) label a {
  color: var(--tr-teal);
  font-weight: 700;
  text-decoration: underline;
}

/* Submit — full-width orange pill, as in the mockup */
.tr .tr-ff .ff_submit_btn_wrapper,
.tr .tr-ff .ff-el-group.ff_submit_btn_wrapper {
  margin-bottom: 0;
  text-align: left;
}

.tr .tr-ff .ff-btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 58px;
  padding: 0 34px;
  border-radius: var(--tr-radius-pill);
  /* Fluent Forms writes the button colours as inline styles from the form
     designer, so these two need !important to win. */
  background: var(--tr-accent) !important;
  border: 2px solid var(--tr-accent) !important;
  color: #fff !important;
  font-family: var(--tr-font-sans);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--tr-dur) var(--tr-ease);
}

.tr .tr-ff .ff-btn-submit:hover {
  background: var(--tr-accent-hover) !important;
  border-color: var(--tr-accent-hover) !important;
}

/* Validation + messages */
.tr .tr-ff .ff-el-is-error .ff-el-form-control,
.tr .tr-ff .ff-el-form-control.ff-el-is-error {
  border-color: #d8533a;
}

.tr .tr-ff .error,
.tr .tr-ff .text-danger,
.tr .tr-ff .ff-el-is-error .error-text {
  font-family: var(--tr-font-sans);
  font-size: 13px;
  font-weight: 600;
  color: #d8533a;
  margin-top: 6px;
}

.tr .tr-ff .ff-message-success {
  background: var(--tr-warn-bg);
  border: 1.5px solid var(--tr-warn-border);
  border-radius: var(--tr-radius-md);
  padding: 16px 18px;
  font-family: var(--tr-font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 600;
  color: var(--tr-ink-soft);
}

/* Fluent Forms' own section headings, if the form uses them */
.tr .tr-ff .ff-el-section-title {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 18px;
  text-transform: uppercase;
  color: var(--tr-ink);
}

/* 5.10 Footer */
.tr-foot {
  background: var(--tr-ink);
  padding: 34px var(--tr-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.tr-foot__brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tr-foot__brand img {
  height: 74px;
}

.tr-foot__meta {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}

.tr-foot__meta a {
  color: var(--tr-orange);
}

.tr-foot__slogan {
  display: flex;
  align-items: center;
  gap: 18px;
}

.tr-foot__slogan span {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 22px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.tr-foot__slogan img {
  height: 46px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* ---------- 6. Phone / app mock --------------------------- */

.tr-phone {
  position: relative;
  width: 390px;
  height: 844px;
  margin-inline: auto;
  background: var(--tr-sand-50);
  border-radius: 46px;
  overflow: hidden;
  border: 10px solid #15110e;
  box-shadow: 0 40px 90px rgba(42, 36, 32, 0.3);
}

.tr-phone__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.tr-phone__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 26px 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--tr-ink);
}

.tr-phone__status .tr-mono {
  font-size: 11.5px;
  color: var(--tr-ink-muted);
}

.tr-phone__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 22px 0;
}

.tr-phone__hello {
  font-size: 14px;
  font-weight: 600;
  color: var(--tr-ink-muted);
}

.tr-phone__title {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 25px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--tr-ink);
}

.tr-phone__head img {
  width: 42px;
  height: 42px;
}

.tr-phone__view {
  padding: 16px 22px 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tr-phone__tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1.5px solid var(--tr-border);
  padding: 10px 22px 26px;
  display: flex;
  justify-content: space-between;
}

.tr-tab {
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  color: var(--tr-ink-muted);
}

.tr-tab[aria-selected="true"] {
  color: var(--tr-teal);
}

.tr-tab__icon {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 17px;
  line-height: 1;
}

.tr-tab__label {
  font-size: 11px;
  font-weight: 700;
}

/* App cards */
.tr-appcard {
  border-radius: 22px;
  overflow: hidden;
  border: 1.5px solid var(--tr-border);
  background: #fff;
}

.tr-appcard img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.tr-appcard__body {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tr-appcard__title {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 17px;
  text-transform: uppercase;
  color: var(--tr-ink);
}

.tr-appcard__meta {
  font-size: 13px;
  color: var(--tr-ink-muted);
}

.tr-appdark {
  background: var(--tr-ink);
  border-radius: 22px;
  padding: 18px 20px;
  color: #fff;
}

.tr-appdark__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.tr-appdark__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tr-mint);
}

.tr-appdark__when {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.tr-appdark__big {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 50px;
  line-height: 1;
}

.tr-appdark__unit {
  font-family: var(--tr-font-display);
  font-weight: 800;
  font-size: 17px;
  text-transform: uppercase;
  color: var(--tr-mint);
}

.tr-progress {
  margin-top: 14px;
  height: 8px;
  border-radius: var(--tr-radius-pill);
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.tr-progress__fill {
  height: 100%;
  border-radius: var(--tr-radius-pill);
  background: var(--tr-orange);
  width: 0;
  transition: width 420ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.tr-progress--light {
  background: var(--tr-sand-200);
  height: 6px;
  margin: 0;
}

.tr-progress--light .tr-progress__fill {
  background: var(--tr-teal);
}

.tr-appdark__note {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.tr-appweek {
  background: #fff;
  border: 1.5px solid var(--tr-border);
  border-radius: var(--tr-radius-lg);
  padding: 15px 17px;
}

.tr-appweek[data-milestone="true"] {
  background: var(--tr-warn-bg);
  border: 2px solid var(--tr-warn-border);
}

.tr-appweek__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.tr-appweek__name {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 17px;
  text-transform: uppercase;
  color: var(--tr-ink);
}

.tr-appweek[data-milestone="true"] .tr-appweek__name {
  color: var(--tr-teal);
}

.tr-appweek__dates {
  font-family: var(--tr-font-mono);
  font-size: 11.5px;
  color: var(--tr-ink-muted);
}

.tr-check {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.tr-check + .tr-check {
  margin-top: 8px;
}

.tr-check__box {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: transparent;
  border: 2px solid var(--tr-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
}

.tr-check[aria-pressed="true"] .tr-check__box {
  background: var(--tr-teal);
  border-color: var(--tr-teal);
  color: #fff;
}

.tr-check__body {
  flex: 1;
  display: block;
}

.tr-check__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tr-ink-muted);
}

.tr-check__text {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  color: var(--tr-ink-soft);
}

.tr-check[aria-pressed="true"] .tr-check__text {
  color: var(--tr-ink-muted);
}

.tr-stat {
  background: #fff;
  border: 1.5px solid var(--tr-border);
  border-radius: 18px;
  padding: 14px;
}

.tr-stat__n {
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 30px;
  color: var(--tr-ink);
}

.tr-stat--teal .tr-stat__n {
  color: var(--tr-teal);
}

.tr-stat__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tr-ink-muted);
}

.tr-share {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid var(--tr-ink);
}

.tr-share img.tr-share__bg {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.tr-share__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(42, 36, 32, 0.82) 0%,
    rgba(42, 36, 32, 0.15) 55%,
    transparent 100%
  );
}

.tr-share__body {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
}

.tr-share__eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tr-cream);
}

.tr-share__title {
  margin-top: 6px;
  font-family: var(--tr-font-display);
  font-weight: 900;
  font-size: 34px;
  line-height: 0.92;
  text-transform: uppercase;
  color: #fff;
}

.tr-share__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.tr-share__foot img {
  width: 38px;
  height: 38px;
}

/* 6.1 Phone internals
   The phone is a fixed 390px column no matter how wide the viewport is, so
   its inner grids must NOT follow the page-level breakpoints below. These
   two-class selectors outrank the single-class rules in section 7. */

.tr-phone .tr-grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tr-phone .tr-panel {
  padding: 18px;
  gap: 14px;
  border-radius: var(--tr-radius-lg);
}

.tr-phone .tr-abc__stage {
  padding: 18px;
  border-radius: 22px;
  box-shadow: 5px 5px 0 var(--tr-orange);
}

.tr-phone .tr-abc__fig {
  height: 210px;
  border-radius: var(--tr-radius-md);
  padding: 10px;
}

.tr-phone .tr-abc__title {
  font-size: 20px;
}

.tr-phone .tr-paces {
  border-top: none;
  padding: 6px 18px 12px;
}

.tr-phone .tr-paces__value {
  font-size: 17px;
}

.tr-phone .tr-appcard .tr-paces__row:last-child {
  border-bottom: none;
}

.tr-progress--light {
  flex: 1;
}

/* Flat stat tile — sits on the sunken ground inside the app panels */
.tr-stat--flat {
  flex: 1;
  background: var(--tr-sand-150);
  border: none;
  border-radius: var(--tr-radius-md);
  padding: 12px 14px;
}

.tr-stat--flat .tr-stat__n {
  font-size: 26px;
}

.tr-avatar--lg {
  width: 58px;
  height: 58px;
  font-size: 23.2px; /* 58 × 0.4 */
}

.tr-teal {
  color: var(--tr-teal);
}

/* ---------- 7. Responsive --------------------------------- */

@media (max-width: 1080px) {
  .tr-abc {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .tr-hero,
  .tr-split,
  .tr-join {
    grid-template-columns: 1fr;
  }

  .tr-hero__media {
    padding: 0 0 34px 0;
    max-width: 520px;
  }

  .tr-grid-3 {
    grid-template-columns: 1fr;
  }

  /* Distance picker stays 3-up as long as it fits */
  .tr-grid-3--dist {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .tr-nav {
    flex-wrap: wrap;
  }

  .tr-nav__links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  /* Keep the CTA from being clipped at the end of the scroll strip */
  .tr-nav__links .tr-btn {
    margin-right: 2px;
  }

  .tr-nav__links::-webkit-scrollbar {
    display: none;
  }

  .tr-tide {
    height: 240px;
    padding: 20px 14px 16px;
  }
}

@media (max-width: 640px) {
  .tr--framed {
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .tr-countdown__inner {
    gap: 16px;
  }

  .tr-countdown__rule {
    height: 40px;
  }

  .tr-grid-3--dist {
    grid-template-columns: 1fr;
  }

  .tr-dist {
    padding: 16px 18px;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }

  .tr-dist__top {
    flex: 0 0 auto;
  }

  .tr-dist__n {
    font-size: 34px;
  }

  .tr-day {
    grid-template-columns: 1fr auto;
    gap: 4px 14px;
  }

  .tr-day__label {
    grid-column: 1 / -1;
  }

  .tr-week,
  .tr-panel {
    padding: 20px 18px;
  }

  .tr-hero__stamp {
    position: static;
    margin-top: -18px;
  }

  .tr-abc__fig {
    height: 240px;
  }

  .tr-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Phone mock: drop the bezel, let the app run full width */
  .tr-phone {
    width: 100%;
    max-width: 430px;
    height: 720px;
    border-width: 6px;
    border-radius: 32px;
  }
}
