:root {
  --accent:        #0ea5e9;
  --accent-2:      #6366f1;
  --accent-glow:   rgba(14, 165, 233, 0.15);
  --bg:            #ffffff;
  --bg-soft:       #f8fafc;
  --bg2:           var(--surface);
  --bg3:           var(--bg-soft);
  --surface:       #ffffff;
  --surface2:      rgba(148, 163, 184, 0.08);
  --surface3:      rgba(148, 163, 184, 0.04);
  --text:          #0f172a;
  --text2:         #334155;
  --text3:         #64748b;
  --border:        #e2e8f0;
  --radius:        14px;
  --radius-sm:     8px;
  --shadow-sm:     0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md:     0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg:     0 24px 60px rgba(15, 23, 42, .10);
}

[data-theme="dark"] {
  --bg:        #0b1120;
  --bg-soft:   #0f172a;
  --surface:   #1e293b;
  --surface2:  rgba(148, 163, 184, 0.10);
  --surface3:  rgba(148, 163, 184, 0.05);
  --text:      #f1f5f9;
  --text2:     #cbd5e1;
  --text3:     #94a3b8;
  --border:    #334155;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
/* Background colour belongs on html, not body — that lets the
   stealth-style starfield canvas (#gk-stars) sit at z-index:-1
   between the html surface and the body content. JS in
   /static/js/starfield.js paints the canvas; if it fails the
   html bg is the fallback. */
html { background: var(--bg); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: transparent;
  color: var(--text);
  line-height: 1.6;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.tn-header {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 32px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.tn-header-actions { display: flex; align-items: center; gap: 10px; }

/* Crank icon → /features admin shell */
.tn-crank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  color: var(--text2);
  text-decoration: none;
  transition: color .14s, background-color .14s, transform .25s;
}
.tn-crank:hover {
  color: var(--accent);
  background: var(--surface2);
}
.tn-crank:hover svg { transform: rotate(45deg); transition: transform .25s; }
.tn-crank.is-active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Lang toggle: pill with sliding accent. */
.tn-lang-toggle {
  position: relative;
  display: inline-flex; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 99px; padding: 0; cursor: pointer;
  font: 600 11px 'Inter', sans-serif; color: var(--text2);
  height: 30px; overflow: hidden;
}
.tn-lang-opt {
  position: relative; z-index: 2;
  padding: 0 12px; line-height: 28px;
  transition: color .14s;
}
.tn-lang-toggle[data-lang="fr"] .tn-lang-opt[data-l="fr"],
.tn-lang-toggle[data-lang="en"] .tn-lang-opt[data-l="en"] { color: #fff; }
.tn-lang-slider {
  position: absolute; top: 2px; left: 2px;
  width: calc(50% - 2px); height: calc(100% - 4px);
  background: var(--accent); border-radius: 99px;
  transition: transform .18s ease;
  z-index: 1;
}
.tn-lang-toggle[data-lang="en"] .tn-lang-slider { transform: translateX(100%); }

/* Theme toggle: icon swap. Sun shows in dark mode, moon in light. */
.tn-theme-toggle {
  width: 34px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; color: var(--text2);
  transition: color .14s, border-color .14s;
}
.tn-theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.tn-theme-toggle .tn-icon-sun  { display: none; }
.tn-theme-toggle .tn-icon-moon { display: block; }
[data-theme="dark"] .tn-theme-toggle .tn-icon-sun  { display: block; }
[data-theme="dark"] .tn-theme-toggle .tn-icon-moon { display: none; }
[data-theme="dark"] .tn-header { background: rgba(11, 17, 32, 0.85); }

.tn-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; text-decoration: none; color: var(--text);
  letter-spacing: -0.01em;
}
.tn-brand-mark { width: 28px; height: 28px; border-radius: 7px; display: block; }
/* "TrIAner" — inner IA letters in accent colour, uppercase, bolder
   weight. Quiet hint that Trianer = Tr + Intelligence Artificielle
   + ner. No hover expand; full phrase lives in the title attribute. */
.tn-brand-ia {
  color: var(--accent, #0ea5e9);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
}

.tn-nav {
  display: flex; align-items: center;
  gap: 14px;            /* tighter so the connectors read as a chain */
}
/* Center the canonical .gk-nav-center cluster inside the tn-header's
   1fr grid column. Without this the buttons hug the left edge of
   the column (flex default justify-content:flex-start) — looks like
   they're floating next to the brand instead of being centered in
   the nav. The override is scoped to .tn-header so it doesn't
   affect gateka.fr's _gk_nav.html where the parent .gk-nav already
   has justify-content:space-between handling layout. */
.tn-header .gk-nav-center { justify-content: center; }
.tn-nav-link {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; color: var(--text2);
  font-weight: 500; font-size: 14px;
  padding: 6px 0; border-bottom: 2px solid transparent;
  transition: color .14s, border-color .14s;
}
.tn-nav-link:hover { color: var(--text); }
.tn-nav-link.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tn-nav-link i { font-size: 13px; line-height: 1; }   /* pinned-feature FA icons render at the same size as the emoji glyph next door */
/* Pinned features inherit .tn-nav-link styling (font-weight 500, text2
   colour, flex+gap layout). The only product-side cue stays the icon
   set in the task frontmatter — no extra color/weight overrides so the
   buttons sit visually next to per-challenge race buttons without
   competing for attention. */
.tn-nav-pinned i { color: var(--pin-color, currentColor); }   /* a hint of the feature's color, just on the icon */

/* Chain indicator: thin horizontal connector between consecutive nav
   items so the reader sees the funnel as one pipeline. Pseudo-element
   on each link except the first — sits in the gap. */
.tn-nav .tn-nav-link + .tn-nav-link::before {
  content: ''; display: block;
  position: absolute; left: -14px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent) 80%, transparent);
  opacity: .35;
}

/* ── Main ───────────────────────────────────────────────────────────── */
/* Top padding clears the canonical fixed-position _gk_nav.html
   (height = --nav-h, declared in the partial's style block). Without
   it the page top is hidden under the header. Falls back to 68px. */
.tn-main { max-width: 1200px; margin: 0 auto; padding: var(--nav-h, 68px) 0 0; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.tn-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px;
  border-radius: 10px; background: var(--accent); color: #fff;
  text-decoration: none; font-weight: 600; font-size: 14.5px;
  transition: opacity .14s, transform .14s, box-shadow .14s;
  box-shadow: 0 6px 16px var(--accent-glow);
}
.tn-btn:hover { opacity: .95; transform: translateY(-1px); box-shadow: 0 12px 24px var(--accent-glow); }
.tn-btn-light { background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(6px); }
.tn-btn-ghost {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); box-shadow: none;
}
.tn-btn-ghost:hover { background: var(--accent-glow); box-shadow: none; }
.tn-btn[disabled], .tn-btn:disabled { opacity: .55; cursor: not-allowed; }
.tn-btn[disabled]:hover { transform: none; box-shadow: 0 6px 16px var(--accent-glow); }
.tn-btn-strava { background: #fc4c02; box-shadow: 0 6px 16px rgba(252,76,2,0.25); }
.tn-btn-garmin { background: #007cc3; box-shadow: 0 6px 16px rgba(0,124,195,0.25); }

/* ── Eyebrow / typography helpers ───────────────────────────────────── */
.tn-eyebrow {
  display: inline-block;
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-glow); padding: 5px 11px; border-radius: 99px;
  margin-bottom: 18px;
}

/* ── Private-beta banner (top of every visit) ──────────────────────── */
.tn-beta {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  justify-content: center;
  padding: 10px 24px;
  background: linear-gradient(90deg, rgba(245,158,11,.12), rgba(14,165,233,.10));
  border-bottom: 1px solid rgba(245,158,11,.25);
  font-size: 13px; color: var(--text);
}
.tn-beta-badge {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase;
  background: rgba(245,158,11,.18); color: #b45309;
  padding: 3px 9px; border-radius: 99px;
}
.tn-beta-text { color: var(--text2); }
.tn-beta-cta {
  font-weight: 600; color: var(--accent); text-decoration: none;
  border-bottom: 1px solid transparent; transition: border-color .15s;
}
.tn-beta-cta:hover { border-color: var(--accent); }

/* ── Hero ───────────────────────────────────────────────────────────── */
.tn-hero {
  padding: 80px 32px 100px;
  background:
    radial-gradient(ellipse at top right, rgba(14,165,233,.08), transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(99,102,241,.06), transparent 60%);
}
.tn-hero-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center;
}
@media (min-width: 1024px) {
  .tn-hero-inner { grid-template-columns: 1.4fr 1fr; }
}
.tn-hero-text h1 {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.tn-hero-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.tn-hero-bullets {
  list-style: none; padding: 0; margin: 0 0 32px; max-width: 560px;
  display: flex; flex-direction: column; gap: 10px;
}
.tn-hero-bullets li {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 15px; line-height: 1.5; color: var(--text2);
}
.tn-hero-bullets b { color: var(--text); font-weight: 600; }
.tn-hero-bullet-ico {
  font-size: 18px; line-height: 1.4;
  flex: 0 0 24px;
}

/* Illustrative-data tags (anon home: countdown card + today band) */
.tn-demo-tag {
  position: absolute; top: 10px; right: 12px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase;
  background: rgba(245,158,11,.18); color: #b45309;
  padding: 3px 8px; border-radius: 99px;
}
.tn-hero-card { position: relative; }
.tn-hero-card-demo,
.tn-today-band-demo { opacity: .92; }
.tn-demo-banner {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(90deg, rgba(245,158,11,.16), rgba(14,165,233,.08));
  border-left: 3px solid #f59e0b;
  padding: 10px 14px; border-radius: 0 8px 8px 0;
  font-size: 13px; color: #78350f; font-weight: 500;
  margin-bottom: 12px;
}
.tn-athlete-connect {
  display: flex; justify-content: flex-end;
  margin: 0 0 18px;
}
.tn-athlete-connect .tn-btn { display: inline-flex; align-items: center; gap: 6px; }

.tn-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.tn-hero-card-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text3);
}
.tn-hero-countdown {
  display: flex; align-items: baseline; justify-content: center; gap: 10px;
  margin: 14px 0 18px;
}
.tn-hero-countdown-num {
  font-size: 88px; font-weight: 800; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1;
}
.tn-hero-countdown-unit { font-size: 16px; color: var(--text3); font-weight: 500; }
.tn-hero-card-meta {
  font-size: 13.5px; color: var(--text2);
  border-top: 1px solid var(--border); padding-top: 16px; line-height: 1.8;
}

.tn-hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Today band (logged-in home) ─────────────────────────────────── */
.tn-today-band {
  background: linear-gradient(135deg, rgba(14,165,233,.06), rgba(99,102,241,.04));
  border-bottom: 1px solid var(--border);
  padding: 32px;
}
.tn-today-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; gap: 18px;
}
.tn-today-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 16px;
}
.tn-today-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text3);
}
.tn-today-date { font-size: 22px; font-weight: 600; }
.tn-today-quick {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.tn-today-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text2);
  text-decoration: none; cursor: help;
}
.tn-today-pill b { color: var(--text); font-weight: 700; }
.tn-today-pill-routine { cursor: pointer; transition: background .15s; }
.tn-today-pill-routine:hover { background: var(--surface2); }
.tn-today-pill-streak {
  cursor: pointer;
  background: linear-gradient(95deg, rgba(245,158,11,.18), rgba(245,158,11,.08));
  border-color: rgba(245,158,11,.45);
  text-decoration: none;
}
.tn-today-pill-streak:hover { filter: brightness(1.05); }
.tn-today-pill-streak small {
  font-weight: 500; color: var(--text2);
  margin-left: 4px; font-size: 11px;
}
.tn-today-pill-streak.is-pending {                  /* amber outline mirrors the iron-page pending dot */
  outline: 1px dashed rgba(180, 83, 9, .65);
}
.tn-today-session {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow-md);
}
.tn-today-session-label { font-size: 20px; font-weight: 600; color: var(--text); }
.tn-today-session-meta  { font-size: 13.5px; color: var(--text2); margin-top: 4px; }
.tn-today-alts          { font-size: 12.5px; color: var(--text3); margin-top: 8px; font-style: italic; }
.tn-today-intent {
  margin-top: 12px; padding: 8px 12px;
  background: rgba(245,158,11,.10); border-radius: 6px;
  font-size: 13px; color: var(--text2);
}
.tn-today-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--accent);
  text-decoration: none;
}
.tn-today-cta:hover { text-decoration: underline; }

/* Today: candidate alternatives strip */
.tn-today-cands {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px;
}
.tn-today-cands-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.tn-today-cands-label {
  font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase;
  font-weight: 700; color: var(--text3);
}
.tn-today-model {
  font-size: 11px; font-weight: 600; cursor: help;
  padding: 2px 8px; border-radius: 99px;
}
.tn-today-model-fitted { background: rgba(22,163,74,.12); color: #15803d; }
.tn-today-model-prior  { background: rgba(148,163,184,.16); color: #475569; }
.tn-today-cands-list { list-style: none; margin: 0; padding: 0; }
.tn-today-cand {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.tn-today-cand:last-child { border-bottom: 0; }
.tn-today-cand-rank {
  font-size: 10.5px; font-weight: 700; color: var(--text3);
  width: 14px; text-align: center;
}
.tn-today-cand-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px;
  flex-shrink: 0;
}
.tn-today-cand-tag-planned        { background: rgba(14,165,233,.14); color: #0c4a6e; }
.tn-today-cand-tag-cross          { background: rgba(168,85,247,.14); color: #7e22ce; }
.tn-today-cand-tag-rest           { background: rgba(148,163,184,.18); color: #475569; }
.tn-today-cand-tag-recommandation { background: rgba(22,163,74,.18); color: #15803d; }
/* Tiny weather icon next to outdoor-discipline rows. */
.tn-today-cand-weather {
  display: inline-block;
  margin: 0 2px 0 0;
  font-size: 14px; line-height: 1;
  vertical-align: -2px;
  cursor: help;
}
/* "+" separator between rows — pseudo-element on each row except
   the last; pinned in the gap below the row, centred horizontally,
   reads as "you can do this OR that". */
/* "+" separator between rows removed — the hairline border-bottom
   on each row already separates them, the circle was visual noise. */

/* ── Multi-day window plans (4 j) — same chrome as the candidates
   list: transparent bg, hairline border-bottom between rows, "+"
   separator pseudo. Each row carries narrative · sequence · stats
   stacked vertically. See memory pin
   project_trianer_multiday_alternatives.md "Presentation style". */
.tn-today-plans { margin: 14px 0 16px; }
.tn-today-plans-list {
  list-style: none; padding: 0; margin: 8px 0 0;
  position: relative;
}
.tn-today-plan {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  background: transparent;
  position: relative;
}
.tn-today-plan:last-child { border-bottom: 0; }
.tn-today-plan-best {
  border-left: 3px solid #15803d;
  padding-left: 10px;
  background: rgba(22,163,74,.04);
}
.tn-today-plan-narrative {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
  color: var(--text);
}
.tn-today-plan-tag {
  color: #15803d; font-size: 14px;
}
.tn-today-plan-seq {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tn-today-plan-day {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(148,163,184,.20));
  white-space: nowrap;
}
.tn-today-plan-day.is-long {
  background: rgba(249,115,22,.12);
  border-color: rgba(249,115,22,.35);
  color: #c2410c; font-weight: 700;
}
.tn-today-plan-day.is-actual {
  background: rgba(22,163,74,.12);
  border-color: rgba(22,163,74,.30);
  color: #15803d;
}
.tn-today-plan-day small {
  opacity: .7; font-size: 9.5px;
}
.tn-today-plan-arrow {
  color: var(--text3, #94a3b8);
  font-size: 12px; opacity: .55;
}
.tn-today-plan-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11.5px;
}
.tn-today-plan-stat {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  color: var(--text2, #475569);
  font-variant-numeric: tabular-nums;
}
.tn-today-plan-trimp { color: #075985; }
.tn-today-plan-tsb   { color: var(--text2); }
.tn-today-plan-acwr  { color: var(--text2); }
/* Plan rows: hairline border-bottom is the separator; no '+' chrome. */
/* Recommendation row gets a soft green tint + accent rank star so it
   reads as the lead suggestion above the alternatives. */
.tn-today-cand-recommandation {
  background: rgba(22,163,74,.06);
  border-left: 3px solid #15803d;
  padding-left: 8px;
}
.tn-today-cand-recommandation .tn-today-cand-rank {
  color: #15803d; font-size: 14px;
}
.tn-today-cand-recommandation .tn-today-cand-label {
  font-weight: 600;
}
.tn-today-cand-label { flex: 1; min-width: 0; color: var(--text); }
.tn-today-cand-meta  { color: var(--text3); font-size: 12px; }
.tn-today-cand-score {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px; font-weight: 700; color: var(--text);
  cursor: help;
}

/* ── Sections ───────────────────────────────────────────────────────── */
.tn-section { padding: 80px 32px; max-width: 1200px; margin: 0 auto; }
.tn-section-head { text-align: center; margin-bottom: 56px; }
.tn-section-head h2 {
  font-size: 36px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0; max-width: 720px; margin: 0 auto;
}
.tn-section-sub {
  margin: 18px auto 0; max-width: 600px;
  font-size: 15px; color: var(--text2);
}

/* ── Native integrations strip ────────────────────────────────────── */
.tn-conn-strip {
  padding: 32px 24px 36px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.tn-conn-strip-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text3);
  margin-bottom: 18px;
}
.tn-conn-strip-logos {
  display: flex; gap: 28px; align-items: center;
  justify-content: center; flex-wrap: wrap;
}
.tn-conn-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  cursor: help;
  transition: opacity .15s, transform .15s;
}
.tn-conn-logo svg { width: 100%; height: 100%; }
.tn-conn-logo:hover { transform: translateY(-2px); }

/* Active integrations get the brand colour */
.tn-conn-logo-on.tn-conn-strava { color: #fc4c02; }
.tn-conn-logo-on.tn-conn-garmin { color: #007cc3; }

/* Upcoming integrations stay grey + slightly muted */
.tn-conn-logo-off {
  color: var(--text3);
  opacity: .55;
}
.tn-conn-logo-off:hover { opacity: .85; }

/* ── Pillars ────────────────────────────────────────────────────────── */
.tn-pillars {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.tn-pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tn-pillar:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.tn-pillar-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-glow); color: var(--accent);
  border-radius: 12px; font-size: 22px;
  margin-bottom: 18px;
}
.tn-pillar h3 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.tn-pillar p  { color: var(--text2); font-size: 14.5px; margin: 0; line-height: 1.6; }
.tn-pillar-soon { opacity: 0.72; }
.tn-pillar-soon .tn-pillar-icon { background: rgba(245, 158, 11, .15); color: #d97706; }

/* ── Methodology — 3-block tight card ──────────────────────────────── */
.tn-section-method { background: var(--bg-soft); max-width: none; padding: 64px 32px; }
.tn-method-card {
  max-width: 1100px; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px 44px; box-shadow: var(--shadow-sm);
}
.tn-method-card h2 {
  font-size: 28px; font-weight: 700; letter-spacing: -0.01em;
  margin: 8px 0 28px;
}
.tn-method-grid-3 {
  display: grid; gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .tn-method-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.tn-method-block { position: relative; padding-left: 0; }
.tn-method-num {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--accent); margin-bottom: 8px;
}
.tn-method-block p {
  margin: 0; color: var(--text2);
  font-size: 14px; line-height: 1.55;
}


/* ── Trainer pages (forms + simulation) ────────────────────────────── */
.tn-trainer { max-width: 800px; margin: 32px auto; padding: 0 32px; }
.tn-trainer h1 { font-size: 28px; font-weight: 700; margin: 0 0 24px; letter-spacing: -0.01em; }

/* Step indicator (1 → 2 → 3 → 4 wizard) */
.tn-stepper {
  list-style: none; padding: 0; margin: 0 0 32px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: var(--surface2); border-radius: var(--radius); padding: 8px;
}
.tn-step a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--text2);
  font-size: 13px; font-weight: 500;
  transition: background .14s, color .14s;
}
.tn-step a:hover { background: var(--surface); color: var(--text); }
.tn-step.is-active a { background: var(--accent); color: #fff; box-shadow: 0 4px 12px var(--accent-glow); }
.tn-step.is-done a { color: var(--text3); }
.tn-step.is-done .tn-step-num::before { content: "✓ "; color: #16a34a; }
.tn-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); color: var(--text2);
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.tn-step.is-active .tn-step-num { background: rgba(255,255,255,0.25); color: #fff; }
.tn-step-icon { font-size: 14px; }
.tn-step-label { font-weight: 600; }
@media (max-width: 720px) {
  .tn-stepper { grid-template-columns: repeat(2, 1fr); }
  .tn-step-label { display: none; }
}

.tn-physio-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 24px;
}
.tn-physio-card h3 { margin: 0 0 16px; font-size: 14px; color: var(--text2);
                     letter-spacing: 0.5px; font-weight: 600; }
.tn-physio-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.tn-physio-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; background: var(--surface2); border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.tn-physio-item-missing { border-left-color: var(--text3); opacity: 0.7; }
.tn-physio-label { font-size: 11px; text-transform: uppercase;
                   letter-spacing: 1px; color: var(--text3); font-weight: 600; }
.tn-physio-value { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.tn-physio-source { font-size: 11px; color: var(--text3); line-height: 1.4; }
.tn-physio-note { margin: 16px 0 0; font-size: 12.5px; color: var(--text3); }
.tn-physio-note code { background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-size: 11.5px; }

/* Constraints card on /features (collapsible <details>) */
.tn-constraints-card { padding: 0; }
.tn-constraints-card > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: baseline; gap: 14px;
  padding: 18px 22px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
}
.tn-constraints-card > summary::-webkit-details-marker { display: none; }
.tn-constraints-card > summary::after {
  content: "▾"; margin-left: auto; opacity: .55; font-size: 12px;
  transition: transform .14s;
}
.tn-constraints-card[open] > summary::after { transform: rotate(180deg); }
.tn-constraints-card > summary:hover { background: var(--surface2); }
.tn-constraints-card[open] > summary { border-bottom: 1px solid var(--border); }
.tn-constraints-card > form,
.tn-constraints-card > .tn-saved { padding: 0 22px 22px; }

/* Daily routine list */
.tn-routine { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.tn-routine-item {
  display: flex; align-items: stretch; gap: 14px;
  padding: 14px 16px; background: var(--surface2);
  border-radius: var(--radius); border-left: 3px solid var(--accent);
  transition: background .14s, opacity .14s;
}
.tn-routine-item:has(input:checked) { opacity: 0.55; background: var(--surface3); }
.tn-routine-num {
  flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-glow); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  align-self: center;
}
.tn-routine-illu {
  flex-shrink: 0; width: 64px; height: 64px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  align-self: center;
}
.tn-routine-illu svg { width: 100%; height: 100%; }
.tn-routine-illu-img {
  width: 110px; height: 70px;     /* wider for multi-phase illustrations */
  padding: 4px;
}
.tn-routine-illu-img img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  display: block;
}
@media (max-width: 480px) { .tn-routine-illu { display: none; } }
.tn-routine-body { flex: 1 1 auto; min-width: 0; }
.tn-routine-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tn-routine-icon { font-size: 18px; }
.tn-routine-name { font-weight: 600; font-size: 15px; color: var(--text); }
.tn-routine-reps {
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px;
  letter-spacing: 0.3px; margin-left: auto;
}
.tn-routine-purpose { margin: 4px 0 0; font-size: 13px; color: var(--text2); line-height: 1.5; }
.tn-routine-cues {
  margin-top: 6px; font-size: 12px;
}
.tn-routine-cues > summary {
  cursor: pointer; color: var(--accent); font-weight: 600;
  list-style: none; padding: 2px 0;
}
.tn-routine-cues > summary::-webkit-details-marker { display: none; }
.tn-routine-cues > summary::before { content: "▸ "; }
.tn-routine-cues[open] > summary::before { content: "▾ "; }
.tn-routine-cues ol { margin: 4px 0 0; padding-left: 18px; color: var(--text2); line-height: 1.5; }
.tn-routine-cues li { margin: 2px 0; }

.tn-routine-video {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  text-decoration: none;
  padding: 4px 10px; border: 1px solid var(--accent);
  border-radius: 99px;
  transition: background .14s, color .14s;
}
.tn-routine-video:hover { background: var(--accent); color: #fff; }
.tn-routine-video svg { flex-shrink: 0; }

.tn-routine-check {
  flex-shrink: 0; align-self: center; cursor: pointer;
  position: relative; width: 26px; height: 26px;
}
.tn-routine-check input { opacity: 0; position: absolute; width: 100%; height: 100%; cursor: pointer; }
.tn-routine-checkmark {
  position: absolute; inset: 0;
  border: 2px solid var(--border); border-radius: 8px;
  transition: background .14s, border-color .14s;
}
.tn-routine-check:hover .tn-routine-checkmark { border-color: var(--accent); }
.tn-routine-check input:checked + .tn-routine-checkmark {
  background: var(--accent); border-color: var(--accent);
}
.tn-routine-check input:checked + .tn-routine-checkmark::after {
  content: ""; position: absolute; left: 7px; top: 3px;
  width: 7px; height: 12px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tn-routine-total {
  margin-top: 18px; text-align: center;
  font-size: 13px; color: var(--text3);
  background: var(--surface2); padding: 10px; border-radius: 8px;
}
.tn-routine-total #routine-done { font-weight: 700; color: var(--accent); font-size: 14px; }

/* Routine intent textarea */
.tn-routine-intent {
  background: var(--surface2); padding: 12px 14px; border-radius: 8px;
  margin-bottom: 16px;
}
.tn-routine-intent label {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; opacity: .7; font-weight: 600; margin-bottom: 6px;
}
.tn-routine-intent textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; font-size: 13px; line-height: 1.4;
  font-family: inherit;
}
.tn-routine-intent textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tn-routine-intent-status {
  font-size: 11px; margin-top: 4px; height: 14px; opacity: .8;
}

/* Routine 14d streak strip */
.tn-routine-streak { margin-bottom: 14px; }
.tn-routine-streak-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  opacity: .65; font-weight: 600; margin-bottom: 4px;
}
.tn-routine-streak-pills {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.tn-streak-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 6px; font-size: 11px; font-weight: 600;
  border: 1px solid;
}
.tn-streak-empty   { background: rgba(148,163,184,.10); color: #94a3b8;
                     border-color: rgba(148,163,184,.20); }
.tn-streak-partial { background: rgba(245,158,11,.15);  color: #b45309;
                     border-color: rgba(245,158,11,.30); }
.tn-streak-full    { background: rgba(22,163,74,.15);   color: #15803d;
                     border-color: rgba(22,163,74,.35); }

/* Challenge cards (Mes défis) */
.tn-challenge-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.tn-challenge-card {
  position: relative;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .14s, box-shadow .14s;
}
.tn-challenge-card.is-primary {
  border-left: 3px solid var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.tn-challenge-badge {
  position: absolute; top: 14px; right: 14px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; padding: 3px 9px; border-radius: 99px;
}
.tn-challenge-head { display: flex; align-items: baseline; gap: 8px; padding-right: 60px; }
.tn-challenge-head h4 {
  margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--text);
}
.tn-challenge-link { color: var(--accent); text-decoration: none; font-size: 14px; }
.tn-challenge-link:hover { text-decoration: underline; }

.tn-challenge-date { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tn-challenge-date-d { font-size: 14px; color: var(--text2); font-weight: 500; }
.tn-challenge-countdown {
  background: var(--accent-glow); color: var(--accent);
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px;
}

.tn-challenge-distances { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.tn-challenge-leg {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; background: var(--surface); border-radius: 8px;
}
.tn-challenge-leg-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tn-challenge-leg-icon { font-size: 16px; }
.tn-challenge-leg-d    { font-weight: 700; font-size: 14px; color: var(--text); }
.tn-challenge-leg-elev { font-size: 11px; color: var(--text3); }
.tn-challenge-leg-time {
  margin-left: auto; font-size: 13px; font-weight: 700;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.tn-challenge-total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 8px; padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; border-radius: 8px;
}
.tn-challenge-total-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }
.tn-challenge-total-value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Goal-vs-constraints gap panel */
.tn-gap {
  margin-top: 10px; padding: 12px 14px;
  border-radius: 8px; font-size: 12.5px;
  display: flex; flex-direction: column; gap: 4px;
  border-left: 3px solid var(--text3);
}
.tn-gap-on_track   { background: rgba(22,163,74,.08);  border-left-color: #16a34a; }
.tn-gap-stretch    { background: rgba(245,158,11,.10); border-left-color: #f59e0b; }
.tn-gap-infeasible { background: rgba(220,38,38,.10);  border-left-color: #dc2626; }
.tn-gap-row { display: flex; justify-content: space-between; gap: 12px; }
.tn-gap-label { color: var(--text3); }
.tn-gap-val   { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.tn-gap-msg   { margin-top: 4px; line-height: 1.45; color: var(--text2); }
.tn-gap-msg a { color: var(--accent); }

/* Réaliste / Ambitieux toggle + projection grid */
.tn-mode-toggle {
  display: flex; gap: 0; margin: 8px 0 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; padding: 3px; width: fit-content;
}
.tn-mode-opt {
  background: transparent; border: 0; cursor: pointer;
  padding: 5px 14px; border-radius: 99px;
  font: 600 12px 'Inter', sans-serif; color: var(--text2);
  transition: background .14s, color .14s;
}
.tn-mode-opt:hover { color: var(--text); }
.tn-mode-opt.is-active {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.tn-mode-projection {
  display: grid; gap: 4px; margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface); border-radius: 8px;
  font-size: 12px;
}
.tn-mode-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px;
  align-items: baseline;
}
.tn-mode-row > span { color: var(--text3); }
.tn-mode-row > b    { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.tn-mode-row > small { color: var(--text3); font-size: 11px; min-width: 100px; text-align: right; }
.tn-mode-row-warn > b { color: #dc2626; }
.tn-challenge-leg-pace {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-left: 26px; font-size: 12px;
}
.tn-challenge-leg-target { color: var(--accent); font-weight: 600; }
.tn-challenge-leg-pct    { color: var(--text3); }
.tn-challenge-leg-zone {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 99px;
}
.tn-zone-z1    { background: rgba(148,163,184,.18); color: #475569; }
.tn-zone-z2    { background: rgba(34,197,94,.14);  color: #15803d; }
.tn-zone-z2_z3 { background: rgba(245,158,11,.16); color: #b45309; }
.tn-zone-z3_z4 { background: rgba(245,158,11,.22); color: #92400e; }
.tn-zone-z4    { background: rgba(220,38,38,.15);  color: #b91c1c; }
.tn-zone-z5    { background: rgba(220,38,38,.25);  color: #991b1b; }

.tn-challenge-actions {
  position: absolute; bottom: 12px; right: 12px;
  margin: 0; padding: 0; background: transparent;
}
.tn-challenge-remove {
  background: transparent; border: 0; color: var(--text3);
  font-size: 13px; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: background .12s, color .12s;
}
.tn-challenge-remove:hover { background: rgba(220,38,38,.12); color: #dc2626; }

/* Tabs (used inside physio cards for the discipline curves) */
.tn-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tn-tab {
  padding: 10px 16px; border: 0; background: transparent; cursor: pointer;
  font: 600 14px 'Inter', -apple-system, sans-serif;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  transition: color .14s, border-color .14s;
  margin-bottom: -1px;
}
.tn-tab:hover { color: var(--text); }
.tn-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tn-tab-pane { display: none; }
.tn-tab-pane.is-active { display: block; }

/* Editable variant: same card frame, big bold input replaces the value. */
.tn-physio-edit { transition: border-left-color .14s, box-shadow .14s; }
.tn-physio-edit:focus-within {
  border-left-color: var(--accent-2);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.tn-physio-input {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 2px 0 0;
  font: 600 18px/1 'Inter', -apple-system, sans-serif;
  letter-spacing: -0.01em;
  color: var(--text);
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.tn-physio-input:hover { cursor: pointer; }
.tn-physio-input:focus { color: var(--accent); }
/* Subtle hint that the cards are editable: dotted underline on hover. */
.tn-physio-edit:hover .tn-physio-input { border-bottom: 1px dashed var(--text3); }
.tn-physio-edit:focus-within .tn-physio-input { border-bottom: 1px solid var(--accent); }
/* Number input spinners off — the dashed underline is enough affordance. */
.tn-physio-input[type="number"]::-webkit-inner-spin-button,
.tn-physio-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tn-physio-input[type="number"] { -moz-appearance: textfield; }
/* Native select arrow visible (it's the only affordance for the select). */
.tn-physio-input[name="sex"] { padding-right: 14px; }

.tn-autofill {
  background: var(--accent-glow); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
  display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  font-size: 13.5px; color: var(--text2);
}
.tn-btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px;
  background: var(--accent); color: #fff; border: 0;
  text-decoration: none; font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: opacity .12s;
}
.tn-btn-secondary:hover { opacity: 0.9; }
.tn-warning {
  background: rgba(245, 158, 11, .12); color: #b45309;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px;
}

/* /features header row + Sync Garmin button */
.tn-features-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.tn-features-head h1 { margin: 0; }
.tn-sync-form { margin: 0; }
/* Legacy wide button — kept for any pages still using it. The /features
   iron pane now uses .tn-sync-wheel below (icon-only circles). */
.tn-btn-sync {
  background: linear-gradient(135deg, #fc4c02 0%, #f97316 100%);
  font-size: 13px; padding: 10px 18px;
  box-shadow: 0 4px 12px rgba(252, 76, 2, 0.3);
}
.tn-btn-sync:hover { box-shadow: 0 8px 20px rgba(252, 76, 2, 0.35); }
/* Sync wheels — circular logo buttons. Outline by default, fills on
   hover. Brand colour comes from --c per variant; freshness meta
   surfaces via data-tip (no permanent caption clutter). A circular
   sync-arrow halo (::before) sits 6 px outside the wheel and rotates
   on hover + during submission so the action reads as "synchronise". */
.tn-sync-wheel {
  position: relative;
  width: 42px; height: 42px; padding: 0;
  border-radius: 50%;
  border: 2px solid var(--c, currentColor);
  background: transparent; color: var(--c, currentColor);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; line-height: 1;
  font-family: inherit;
  overflow: visible;
  transition: transform .12s ease, background .12s ease,
              color .12s ease, box-shadow .12s ease;
}
.tn-sync-wheel:hover {
  transform: scale(1.06);
  background: var(--c, currentColor); color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.tn-sync-wheel:active { transform: scale(.96); }
.tn-sync-wheel--garmin { --c: #007cc3; }   /* Garmin signature blue */
.tn-sync-wheel--strava { --c: #fc4c02; }   /* Strava signature orange */
.tn-sync-wheel-mark { font-size: 18px; }
.tn-sync-wheel .fa-strava { font-size: 20px; }
/* Rotating sync-arrow halo — 270° arc with an arrowhead, recoloured
   to the brand via mask. Idle = static and slightly faded; on hover
   it does one full 1.4 s turn; while .is-syncing (added by JS on form
   submit, removed on pageshow) it keeps spinning. */
.tn-sync-wheel::before {
  content: '';
  position: absolute; inset: -7px;
  background: var(--c, currentColor);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12a9 9 0 1 1-3-6.7L21 8'/><polyline points='21 3 21 8 16 8'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12a9 9 0 1 1-3-6.7L21 8'/><polyline points='21 3 21 8 16 8'/></svg>") center / contain no-repeat;
  opacity: .55;
  pointer-events: none;
  transition: opacity .15s ease;
}
.tn-sync-wheel:hover::before {
  opacity: .9;
  animation: tn-sync-spin 1.4s ease-in-out 1;
}
.tn-sync-wheel.is-syncing::before {
  opacity: 1;
  animation: tn-sync-spin .9s linear infinite;
}
@keyframes tn-sync-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.tn-saved-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.tn-btn-next { padding: 10px 18px; font-size: 14px; box-shadow: 0 4px 12px var(--accent-glow); }
.tn-saved {
  background: rgba(22,163,74,.12); color: #15803d; padding: 10px 14px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  display: inline-block;
}
.tn-trainer-next-hint {
  text-align: right; margin-top: 20px; color: var(--text3); font-size: 14px;
}
.tn-trainer-next-hint a { color: var(--accent); font-weight: 600; text-decoration: none; }
.tn-trainer-next-hint a:hover { text-decoration: underline; }
.tn-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.tn-form-intro { color: var(--text2); margin: 0 0 20px; font-size: 14.5px; }
.tn-h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin: 24px 0 12px; }
.tn-grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.tn-field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.tn-field-wide { grid-column: 1 / -1; }
.tn-field span { color: var(--text2); font-weight: 500; }
.tn-field small { color: var(--text3); font-size: 11.5px; margin-top: 2px; }
.tn-field input, .tn-field select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.tn-field input:focus, .tn-field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.tn-radio-group {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px;
  display: flex; gap: 24px; flex-wrap: wrap; margin: 0 0 16px;
}
.tn-radio-group legend { font-size: 12px; padding: 0 6px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; }
.tn-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.tn-radio input { width: 16px; height: 16px; accent-color: var(--accent); }
.tn-form .tn-btn { margin-top: 20px; }

/* Simulation result cards */
.tn-sim-card-block { position: relative; margin-bottom: 18px; }
.tn-sim-card-active { border-left: 3px solid var(--accent); }
.tn-sim-title { font-size: 22px; margin: 0 0 16px; color: var(--accent); }
.tn-sim-total {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 16px;
  display: flex; align-items: baseline; gap: 16px;
}
.tn-sim-total-label { font-size: 13px; opacity: 0.85; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.tn-sim-total-value { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; }
.tn-sim-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Input-pace marker inside each leg card */
.tn-sim-input {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600; color: var(--accent);
}

/* Inline T1 / T2 editor inside each challenge card */
.tn-sim-transitions {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.tn-sim-transitions > summary {
  cursor: pointer; list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
}
.tn-sim-transitions > summary::-webkit-details-marker { display: none; }
.tn-sim-transitions > summary::before {
  content: '▸'; font-size: 11px; color: var(--text3); margin-right: 4px;
  transition: transform .15s;
}
.tn-sim-transitions[open] > summary::before { transform: rotate(90deg); }
.tn-sim-transitions-summary {
  font-size: 12px; color: var(--text3); margin-left: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.tn-sim-transitions-form,
.tn-sim-perf-form {
  display: flex; gap: 12px; align-items: end; flex-wrap: wrap;
  margin-top: 10px;
}
.tn-sim-transitions-form .tn-field,
.tn-sim-perf-form .tn-field { flex: 1; min-width: 150px; margin: 0; }
.tn-sim-transitions-form button,
.tn-sim-perf-form button { flex: 0 0 auto; }

/* Race route map */
.tn-sim-map {
  border-radius: var(--radius-sm); overflow: hidden;
  margin-top: 8px;
}

/* ── Nutrition & ravitaillement — unified card ──────────────── */
.tn-fuel-card { padding: 24px 26px; }

/* Big totals strip at the top */
.tn-fuel-totals {
  display: grid; gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 6px 0 24px;
}
.tn-fuel-total {
  background: linear-gradient(135deg, rgba(14,165,233,.08), rgba(99,102,241,.04));
  padding: 18px 14px; text-align: center;
}
.tn-fuel-total-num {
  display: block;
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.tn-fuel-total-lbl {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text3); font-weight: 600;
}

/* One block per leg */
.tn-fuel-legs { display: flex; flex-direction: column; gap: 18px; }
.tn-fuel-leg {
  border-left: 4px solid var(--leg-color, var(--accent));
  padding-left: 14px;
}
.tn-fuel-leg-swim { --leg-color: #0ea5e9; }
.tn-fuel-leg-bike { --leg-color: #f59e0b; }
.tn-fuel-leg-run  { --leg-color: #16a34a; }

.tn-fuel-leg-head {
  display: flex; align-items: baseline; gap: 10px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.tn-fuel-leg-icon { font-size: 18px; line-height: 1; }
.tn-fuel-leg-name {
  font-size: 15px; font-weight: 700; color: var(--text);
}
.tn-fuel-leg-stats {
  font-size: 12.5px; color: var(--text3);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

/* Stops as a vertical track */
.tn-fuel-stops {
  list-style: none; padding: 4px 0 0; margin: 0;
  position: relative;
}
.tn-fuel-stops::before {
  /* faint connector line through the dots */
  content: ''; position: absolute;
  left: 4px; top: 12px; bottom: 12px;
  width: 1px; background: var(--leg-color, var(--border));
  opacity: .25;
}
.tn-fuel-stop {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(110px, auto) 1.6fr 1fr auto;
  gap: 8px 14px; align-items: center;
  padding: 8px 0;
  font-size: 13px; line-height: 1.4;
  border-bottom: 1px dashed transparent;
}
.tn-fuel-stop + .tn-fuel-stop { border-top: 1px dashed rgba(128,128,128,.10); }
.tn-fuel-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--leg-color, var(--accent));
  box-shadow: 0 0 0 3px var(--surface);
  margin-left: 0;
}
.tn-fuel-stop-pos {
  font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.tn-fuel-stop-pos small { font-weight: 500; color: var(--text3); }
.tn-fuel-stop-targets {
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}
.tn-fuel-stop-targets strong { color: var(--text); font-weight: 700; }
.tn-fuel-stop-pick { color: var(--text3); font-size: 12.5px; }
.tn-fuel-stop-caf-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; font-weight: 700;
  color: #b45309;                                  /* warm amber so it stands out */
  background: rgba(245, 158, 11, .14);
  padding: 2px 8px; border-radius: 999px;
  white-space: nowrap;
}
.tn-fuel-stop-caf .tn-fuel-dot {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .25);   /* matching ring on the timeline */
}
.tn-fuel-stops-empty {
  font-size: 12.5px; color: var(--text3); font-style: italic;
  margin: 4px 0 0;
}

/* Compact stack on narrow viewports */
@media (max-width: 720px) {
  .tn-fuel-stop {
    grid-template-columns: 18px 1fr auto;
    grid-template-areas:
      'dot pos kcal'
      '.   drink drink'
      '.   food food';
  }
  .tn-fuel-dot       { grid-area: dot; }
  .tn-fuel-stop-pos  { grid-area: pos; }
  .tn-fuel-stop-kcal { grid-area: kcal; }
  .tn-fuel-stop-drink{ grid-area: drink; }
  .tn-fuel-stop-food { grid-area: food; }
}

.tn-fuel-note { margin-top: 18px; font-size: 12px; color: var(--text3); }
.tn-sim-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.tn-sim-card h3 { font-size: 16px; margin: 0 0 14px; color: var(--accent); font-weight: 600; }
.tn-sim-card dl { margin: 0; display: grid; gap: 10px; }
.tn-sim-card dt { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin-top: 4px; }
.tn-sim-card dd { margin: 0; font-size: 17px; font-weight: 600; }
.tn-sim-card dd small { color: var(--text3); font-size: 12px; font-weight: 400; margin-left: 6px; }
.tn-empty h3 { color: var(--text); }
.tn-empty ul { text-align: left; max-width: 360px; margin: 12px auto; padding-left: 20px; }
.tn-empty a { color: var(--accent); }

/* ── Features page ──────────────────────────────────────────────────── */
.tn-features { padding: 32px; max-width: 1280px; margin: 0 auto; }
.tn-features h1 { font-size: 32px; margin: 0 0 24px; }
/* Wrapper around the cached iron_fragment on /features. Transparent
   so the global meteor / cloud atmos shows through; padding keeps
   the inner spacing intact. The visible content (stones, charts,
   text) carries its own contrast. */
.tn-iron-frame {
  background: transparent; border: 0;
  border-radius: var(--radius); padding: 24px;
}
@media (max-width: 720px) {
  /* Reclaim the 48 px of horizontal padding on phones — the inner
     iron-root cards already carry their own padding, so the outer
     frame can sit flush. The "Course cible …" subtitle was wrapping
     into a narrow column because of these 24 px gutters. */
  .tn-iron-frame { padding: 8px 0; }
}
.tn-empty {
  color: var(--text3); padding: 64px 24px; text-align: center;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.tn-empty code { background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-size: 13px; }

/* ── Admin-shell pane partials (athlete / course / routine) ───────────
   Visual language built around the admin shell, not the standalone
   trainer pages: lighter cards, KPI strip on top, slim section rules
   instead of heavy h3 emoji titles. Reused by every pane that wants a
   "live metrics + form + sub-tabs" layout. */

/* KPI strip — Garmin-derived live metrics, dashboard-style tiles. */
.tn-pane-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}
.tn-pane-kpi {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  background: var(--surface2, rgba(148,163,184,.06));
  border: 1px solid var(--border, rgba(148,163,184,.18));
  border-radius: 8px;
}
.tn-pane-kpi-num {
  font-size: 22px; font-weight: 700; line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.tn-pane-kpi-lbl {
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--text2);
}
.tn-pane-kpi-src {
  font-size: 11px; color: var(--text3); margin-top: 2px;
}

/* Section divider — one rule between blocks, no shadow boxes. Lets the
   admin shell's existing card framing be the only one in play. */
.tn-pane-section {
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--border, rgba(148,163,184,.20));
}
.tn-pane-section:first-child,
.tn-pane-kpis + .tn-pane-section { border-top: 0; padding-top: 0; margin-top: 0; }
.tn-pane-section-head { margin-bottom: 14px; }
.tn-pane-section-head h4 {
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; color: var(--text2);
  margin: 0 0 4px;
}
.tn-pane-section-sub {
  font-size: 12.5px; color: var(--text3); margin: 0;
}

/* Form — labelled stack, two columns on wide screens. */
.tn-pane-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
  align-items: end;
}
.tn-pane-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.tn-pane-field > span {
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--text2);
}
.tn-pane-field > span small {
  text-transform: none; font-weight: 400; color: var(--text3); margin-left: 6px;
}
.tn-pane-field input,
.tn-pane-field select {
  padding: 7px 10px;
  font: inherit; font-size: 14px;
  background: var(--surface, white);
  border: 1px solid var(--border, rgba(148,163,184,.30));
  border-radius: 6px;
  color: var(--text);
}
.tn-pane-field input:focus,
.tn-pane-field select:focus {
  outline: 2px solid var(--accent, #0ea5e9); outline-offset: -1px;
}
.tn-pane-form-actions {
  grid-column: 1 / -1;
  display: flex; justify-content: flex-end; margin-top: 4px;
}

/* Form-state strip — top-of-pane "how am I doing today" tiles for the
   athlete pane. Same visual register as .tn-pane-kpi (compact tiles)
   but each one carries an icon + a tag/bar for richer at-a-glance signal. */
.tn-pane-section-form .tn-pane-form-state {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.tn-pane-form-tile {
  position: relative;
  display: grid; grid-template-columns: 28px 1fr; align-items: center;
  gap: 4px 10px;
  padding: 12px 14px;
  background: var(--surface2, rgba(148,163,184,.06));
  border: 1px solid var(--border, rgba(148,163,184,.18));
  border-radius: 8px;
}
.tn-pane-form-icon {
  grid-row: 1 / span 2;
  font-size: 22px; line-height: 1;
}
.tn-pane-form-num {
  font-size: 20px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.tn-pane-form-num small {
  font-size: 13px; font-weight: 500; color: var(--text3);
  margin-left: 2px;
}
.tn-pane-form-lbl {
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--text2);
  grid-column: 2;
}
.tn-pane-form-tag {
  grid-column: 1 / -1;
  font-size: 11px; font-weight: 500; color: #b45309;
  margin-top: 4px; padding-top: 4px;
  border-top: 1px dashed rgba(180,83,9,.30);
}
.tn-pane-form-tile-streak {
  background: linear-gradient(95deg, rgba(245,158,11,.10), rgba(245,158,11,.04));
  border-color: rgba(245,158,11,.28);
}
.tn-pane-form-tile-streak.is-pending { outline: 1px dashed rgba(180,83,9,.55); }

/* Routine 14-day bar — single row of 14 cells, colour by completion. */
.tn-pane-routine-bar {
  grid-column: 1 / -1;
  display: flex; gap: 3px; margin-top: 6px;
}
.tn-pane-routine-cell {
  flex: 1; height: 8px; border-radius: 2px;
  background: rgba(148,163,184,.30);
}
.tn-pane-routine-cell.is-full    { background: #16a34a; }
.tn-pane-routine-cell.is-partial { background: #f59e0b; }
.tn-pane-routine-cell.is-skip    { background: rgba(148,163,184,.30); }

/* ── Perf-drift banner (transplanted from the iron-page header into
   Ma forme). The HTML still uses .ir-perf-* classes the renderer
   emits; replicating the styles here un-scoped lets the same fragment
   render correctly in either host. */
.ir-perf {
  background: var(--accent-glow, rgba(14,165,233,.10));
  border: 1px solid rgba(14,165,233,.30);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 18px;
}
.ir-perf-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.ir-perf-icon { font-size: 22px; line-height: 1; }
.ir-perf-title { font-weight: 700; font-size: 14px; color: var(--text); }
.ir-perf-sub { font-size: 12.5px; color: var(--text2); margin-top: 3px; }
.ir-perf-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; margin-top: 8px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(148,163,184,.20));
  border-radius: 8px;
  font-size: 13px;
}
.ir-perf-label { font-weight: 700; min-width: 120px; color: var(--text); }
.ir-perf-meta  { flex: 1; color: var(--text2); font-variant-numeric: tabular-nums; }
.ir-perf-meta b { color: var(--text); }
.ir-perf-btn {
  padding: 7px 14px; border-radius: 6px;
  border: 1px solid; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  transition: filter .14s, transform .14s;
}
.ir-perf-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.ir-perf-btn-accept { background: var(--accent, #0ea5e9); border-color: var(--accent, #0284c7); color: #fff; }
.ir-perf-btn-test   { background: transparent; border-color: rgba(14,165,233,.55); color: var(--accent, #0c4a6e); }

/* Same logic for the objective banner — also moved from iron-page header. */
.ir-objective-banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin: 0 0 18px;
  background: var(--surface2, rgba(148,163,184,.06));
  border: 1px solid var(--border, rgba(148,163,184,.25));
  border-left: 4px solid var(--accent, #0ea5e9);
  border-radius: 10px;
}
.ir-objective-banner-icon { font-size: 22px; line-height: 1; }
.ir-objective-banner-title { font-weight: 700; font-size: 14px; color: var(--text); margin: 0 0 4px; }
.ir-objective-banner-msg   { font-size: 12.5px; color: var(--text2); margin: 0; }

/* Past challenges — slim list of detected triathlon days. */
.tn-past-challenges { list-style: none; margin: 0; padding: 0;
                      display: flex; flex-direction: column; gap: 8px; }
.tn-past-challenge {
  display: grid; grid-template-columns: minmax(110px, auto) minmax(120px, auto) 1fr;
  align-items: center; gap: 8px 14px;
  padding: 10px 14px;
  background: var(--surface2, rgba(148,163,184,.06));
  border: 1px solid var(--border, rgba(148,163,184,.20));
  border-left: 4px solid var(--accent, #0ea5e9);
  border-radius: 8px;
}
.tn-past-class { font-weight: 700; color: var(--text); font-size: 14px; }
.tn-past-date  { font-size: 12.5px; color: var(--text2); font-variant-numeric: tabular-nums; }
.tn-past-legs  { font-size: 12.5px; color: var(--text3); font-variant-numeric: tabular-nums; }


/* ── Mes défis — map ↔ table interaction (epic #3) ──────────────────
   The map sits below its legs table inside the same challenge card so
   the eye doesn't have to scan vertically to correlate them. Hovering
   a leg row dims other Plotly traces and pops the matching one; the
   row itself gets an accent ring. */
.tn-challenge-map {
  margin: 14px 0 4px;
  border-radius: 10px;
  overflow: hidden;                     /* clip Plotly's outer rect */
  border: 1px solid var(--border, rgba(148,163,184,.18));
}
/* Plotly fights with our div borders if its own div has any margin —
   strip top margin defensively. */
.tn-challenge-map > div { margin: 0 !important; }
.tn-challenge-leg {
  cursor: pointer;
  transition: background .14s, box-shadow .14s;
  border-radius: 6px;
}
.tn-challenge-leg:hover,
.tn-challenge-leg.is-map-hover {
  background: var(--accent-glow, rgba(14,165,233,.08));
  box-shadow: inset 2px 0 0 var(--accent, #0ea5e9);
}

/* ── Gamified accept-challenge flow (epic accept_challenge_gamified) ──
   Hero CTA card sits where the legacy form used to. Click → modal
   slides in, 4 steps with progress dots. Stamp animation on submit. */
.tn-accept-cta-card { padding: 22px 26px; }
.tn-accept-cta {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.tn-accept-cta-body { flex: 1; min-width: 260px; }
.tn-accept-fallback {
  border-top: 1px solid var(--border, rgba(148,163,184,.18));
  padding-top: 12px;
}
.tn-accept-fallback summary {
  cursor: pointer; color: var(--text3, #64748b);
  font-size: 13px;
}

/* Modal shell */
.tn-accept-modal[hidden] { display: none; }
.tn-accept-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.tn-accept-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .60);
  backdrop-filter: blur(2px);
}
.tn-accept-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: 92vh; overflow: hidden;
  background: var(--surface, #fff);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
  display: flex; flex-direction: column;
  animation: tnAcceptPop .22s ease-out;
}
@keyframes tnAcceptPop {
  from { opacity: 0; transform: scale(.97) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.tn-accept-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border, rgba(148,163,184,.18));
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
}
.tn-accept-head h3 { margin: 0; font-size: 17px; }
.tn-accept-progress {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 6px; font-size: 11.5px;
}
.tn-accept-progress li {
  display: flex; align-items: center; gap: 6px;
  color: var(--text3, #94a3b8);
}
.tn-accept-progress li span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface2, rgba(148,163,184,.20));
  font-weight: 700;
}
.tn-accept-progress li.is-active { color: var(--text); }
.tn-accept-progress li.is-active span {
  background: var(--accent, #0ea5e9); color: #fff;
}
.tn-accept-progress li.is-current span {
  box-shadow: 0 0 0 4px var(--accent-glow, rgba(14,165,233,.20));
}
.tn-accept-close {
  appearance: none; background: transparent; border: 0;
  font-size: 22px; line-height: 1; color: var(--text3, #94a3b8);
  cursor: pointer; padding: 0 4px;
}
.tn-accept-close:hover { color: var(--text); }

.tn-accept-form { display: contents; }
.tn-accept-step {
  display: none;
  padding: 22px 28px;
  overflow-y: auto; flex: 1;
}
.tn-accept-step.is-active { display: block; }
.tn-accept-prompt {
  font-size: 16px; font-weight: 600; color: var(--text);
  margin: 0 0 16px;
}

/* Step 1 — format cards */
.tn-format-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.tn-format-card {
  appearance: none; cursor: pointer;
  background: var(--surface2, rgba(148,163,184,.06));
  border: 2px solid var(--border, rgba(148,163,184,.20));
  border-radius: 12px;
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  align-items: flex-start;
  text-align: left; font: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}
.tn-format-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15,23,42,.08);
  border-color: rgba(14,165,233,.45);
}
.tn-format-card.is-active {
  border-color: var(--accent, #0ea5e9);
  background: var(--accent-glow, rgba(14,165,233,.10));
  box-shadow: 0 8px 22px var(--accent-glow, rgba(14,165,233,.18));
}
.tn-format-icon { font-size: 28px; line-height: 1; }
.tn-format-name { font-size: 16px; font-weight: 700; color: var(--text); }
.tn-format-meta { font-size: 12px; color: var(--text2, #475569); font-variant-numeric: tabular-nums; }
.tn-format-time { font-size: 12px; color: var(--text3, #64748b); margin-top: 2px; }

/* Step 2 — race list */
.tn-accept-course-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 320px; overflow-y: auto;
}
.tn-accept-race-card {
  appearance: none; cursor: pointer;
  text-align: left; font: inherit;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(148,163,184,.20));
  border-radius: 8px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
  transition: background .14s, border-color .14s;
}
.tn-accept-race-card:hover {
  border-color: rgba(14,165,233,.45);
  background: var(--surface2, rgba(148,163,184,.06));
}
.tn-accept-race-card.is-active {
  border-color: var(--accent, #0ea5e9);
  background: var(--accent-glow, rgba(14,165,233,.10));
}
.tn-accept-race-name { font-weight: 700; color: var(--text); }
.tn-accept-race-meta { font-size: 12px; color: var(--text3, #64748b); font-variant-numeric: tabular-nums; }
.tn-accept-empty {
  font-size: 13px; color: var(--text3, #64748b); font-style: italic;
}

/* Step 3 — engagement cards */
.tn-engagement-grid {
  display: grid; gap: 10px;
}
.tn-engagement-card {
  appearance: none; cursor: pointer;
  text-align: left; font: inherit;
  background: var(--surface2, rgba(148,163,184,.06));
  border: 2px solid var(--border, rgba(148,163,184,.20));
  border-radius: 10px;
  padding: 14px 16px;
  display: grid; grid-template-columns: 32px 1fr; gap: 4px 12px; align-items: center;
  transition: border-color .14s, background .14s;
}
.tn-engagement-card:hover { border-color: rgba(14,165,233,.45); }
.tn-engagement-card.is-active {
  border-color: var(--accent, #0ea5e9);
  background: var(--accent-glow, rgba(14,165,233,.10));
}
.tn-engagement-icon { grid-row: span 2; font-size: 24px; line-height: 1; }
.tn-engagement-name { font-weight: 700; color: var(--text); font-size: 14px; }
.tn-engagement-desc { font-size: 12.5px; color: var(--text2, #475569); }
.tn-engagement-hint {
  margin-top: 14px; padding: 10px 12px;
  background: rgba(245, 158, 11, .14);
  border: 1px solid rgba(245, 158, 11, .40);
  border-radius: 8px;
  font-size: 12.5px; color: #b45309;
}

/* Step 4 — summary + animated stamp */
.tn-accept-summary {
  display: grid; gap: 6px;
  font-size: 14px; max-width: 360px; margin: 0 auto 32px;
}
.tn-accept-summary-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px dashed rgba(148,163,184,.25);
}
.tn-accept-summary-row span { color: var(--text3, #94a3b8); }
.tn-accept-summary-row b { color: var(--text); }
.tn-accept-stamp {
  display: block; margin: 0 auto;
  width: max-content;
  padding: 12px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 28px; font-weight: 800;
  letter-spacing: 4px;
  color: #b91c1c;
  border: 4px solid #b91c1c;
  border-radius: 6px;
  transform: rotate(-8deg) scale(.5);
  opacity: 0;
  transition: transform .35s cubic-bezier(.25, 1.5, .5, 1), opacity .25s;
  text-shadow: 0 0 1px rgba(185, 28, 28, .3);
}
.tn-accept-stamp.is-stamped { transform: rotate(-8deg) scale(1.05); opacity: 1; }

/* Footer */
.tn-accept-foot {
  display: flex; gap: 10px; justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border, rgba(148,163,184,.18));
  background: var(--surface2, rgba(148,163,184,.04));
}
.tn-accept-foot .tn-btn {
  /* Override box-shadow that's heavy outside hero CTAs */
  box-shadow: none;
}
.tn-accept-foot .tn-btn:hover { box-shadow: 0 4px 10px var(--accent-glow); }

@media (max-width: 600px) {
  .tn-accept-progress label { display: none; }
  .tn-accept-step { padding: 16px 18px; }
}

/* Spot-anchored session suggestion (epic nlp_session_naming) — leads
   the home Today card and the Planning emotional view. The clinical
   label demoted to a small italic line so power users still see it. */
.tn-today-session-suggest {
  font-size: 17px; font-weight: 700; color: var(--text);
  line-height: 1.35; margin-bottom: 4px;
}
.tn-today-session-label-sub {
  font-size: 12.5px; font-weight: 500; color: var(--text3, #94a3b8);
  font-style: italic;
}


/* ── Roadmap pane (epic-list view of tasks/Trianer/*.md kind=epic) ──── */
.tn-roadmap { padding: 4px 0; }
.tn-roadmap-head { margin-bottom: 22px; }
.tn-roadmap-head h3 { margin: 0 0 4px; font-size: 18px; }
.tn-roadmap-sub {
  font-size: 12.5px; color: var(--text3, #64748b); margin: 0;
}
.tn-roadmap-sub code {
  font-size: 11px; padding: 1px 5px; border-radius: 4px;
  background: var(--surface2, rgba(148,163,184,.12));
}
.tn-roadmap-group { margin-bottom: 26px; }
.tn-roadmap-group-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text2, #475569);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border, rgba(148,163,184,.18));
}
.tn-roadmap-group-icon { font-size: 16px; }
.tn-roadmap-group-count {
  margin-left: auto; padding: 2px 9px;
  font-size: 11.5px; font-weight: 700;
  background: var(--surface2, rgba(148,163,184,.16));
  border-radius: 999px; color: var(--text2, #475569);
}
.tn-roadmap-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.tn-roadmap-item {
  padding: 14px 18px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(148,163,184,.18));
  border-radius: 8px;
}
.tn-roadmap-group-done .tn-roadmap-item {
  border-left: 3px solid #16a34a;
}
.tn-roadmap-group-review .tn-roadmap-item {
  border-left: 3px solid #2563eb;
}
.tn-roadmap-group-in_progress .tn-roadmap-item {
  border-left: 3px solid #f59e0b;
}
.tn-roadmap-group-backlog .tn-roadmap-item {
  border-left: 3px solid var(--border, rgba(148,163,184,.40));
  opacity: .92;
}
.tn-roadmap-item-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.tn-roadmap-item-title {
  font-weight: 700; font-size: 14.5px; color: var(--text);
}
.tn-roadmap-badges {
  margin-left: auto;
  display: inline-flex; gap: 8px; flex-wrap: wrap;
}
.tn-roadmap-badge {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  background: var(--surface2, rgba(148,163,184,.10));
  border-radius: 999px;
  white-space: nowrap;
}
.tn-roadmap-badge-date {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; color: var(--text3, #64748b);
}
.tn-roadmap-item-summary {
  margin: 4px 0 0; font-size: 13px;
  color: var(--text2, #475569); line-height: 1.5;
}
.tn-roadmap-empty {
  padding: 24px; text-align: center;
  color: var(--text3, #94a3b8); font-style: italic;
}

/* Sync row — compact icon-only Garmin + Strava wheels (see .tn-sync-wheel
   above). Was a wide two-button row with freshness captions; the meta
   moved into the data-tip popover. */
.tn-sync-row {
  display: inline-flex; gap: 10px;
  margin: 0 0 14px;
}

/* ── Mes activités pane (fit_index list + per-activity detail) ─────── */
.tn-activity-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.tn-activity-filters { display: inline-flex; gap: 4px; }
.tn-act-pill {
  background: var(--surface2, rgba(148,163,184,.12));
  color: var(--text2, #475569);
  border: 0; border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.tn-act-pill:hover { background: rgba(14,165,233,.15); color: #075985; }
.tn-act-pill.is-active { background: var(--accent, #0ea5e9); color: #fff; }
.tn-activity-search {
  flex: 1; min-width: 180px; max-width: 320px;
  padding: 7px 12px; font-size: 13px;
  border: 1px solid var(--border, rgba(148,163,184,.30));
  border-radius: 8px; background: var(--surface, #fff);
  color: var(--text, #0f172a); font-family: inherit;
}
.tn-activity-count {
  font-size: 12px; color: var(--text3, #64748b);
  font-variant-numeric: tabular-nums;
}
.tn-activity-table-wrap { overflow-x: auto; border-radius: 10px; }
.tn-activity-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.tn-activity-table th, .tn-activity-table td {
  padding: 9px 10px; text-align: left;
  border-bottom: 1px solid var(--border, rgba(148,163,184,.18));
}
.tn-activity-table th {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text3, #64748b);
  background: var(--surface2, rgba(148,163,184,.06));
}
.tn-act-num { text-align: right; }
.tn-activity-row { cursor: pointer; transition: background .12s; }
.tn-activity-row:hover { background: rgba(14,165,233,.08); }
.tn-act-icon { font-size: 18px; margin-right: 6px; vertical-align: middle; }
.tn-act-sport { vertical-align: middle; text-transform: capitalize; }
.tn-act-date { white-space: nowrap; color: var(--text2, #475569); }
.tn-activity-empty {
  padding: 32px 18px; background: var(--surface2, rgba(148,163,184,.08));
  border-radius: 10px; color: var(--text3, #64748b); font-size: 14px;
}
.tn-activity-empty pre { margin-top: 10px; font-size: 12px; }
@media (max-width: 720px) {
  /* Hide the columns that hurt the most on narrow phones — keep date,
     sport, duration, TRIMP visible. Distance/pace/HR live on the
     detail page anyway. */
  .tn-activity-table th:nth-child(4),
  .tn-activity-table td:nth-child(4),
  .tn-activity-table th:nth-child(5),
  .tn-activity-table td:nth-child(5),
  .tn-activity-table th:nth-child(6),
  .tn-activity-table td:nth-child(6) { display: none; }
  .tn-activity-search { max-width: none; }
}

/* Activity detail page */
.tn-activity-detail { max-width: 960px; margin: 18px auto; padding: 0 14px; }
.tn-act-back {
  display: inline-block; margin-bottom: 12px;
  font-size: 13px; color: var(--text3, #64748b); text-decoration: none;
}
.tn-act-back:hover { color: var(--accent, #0ea5e9); }
.tn-act-head h1 {
  display: flex; align-items: center; gap: 12px;
  font-size: 22px; margin: 0 0 4px;
}
.tn-act-head h1 small {
  font-size: 13px; color: var(--text3, #64748b); font-weight: 400;
}
.tn-act-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin: 14px 0 22px;
}
.tn-act-stats > div {
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(148,163,184,.20));
  border-radius: 10px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.tn-act-stats span {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text3, #64748b);
}
.tn-act-stats b {
  font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text, #0f172a);
}
.tn-act-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(148,163,184,.20));
  border-radius: 12px; padding: 16px; margin-bottom: 18px;
}
.tn-act-card h2 { font-size: 15px; margin: 0 0 12px; }
.tn-act-zones { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tn-act-zone {
  display: grid; grid-template-columns: 50px 1fr 110px;
  align-items: center; gap: 10px; font-size: 12.5px;
}
.tn-act-zone-label { font-weight: 700; color: var(--text2, #475569); }
.tn-act-zone-bar {
  background: var(--surface2, rgba(148,163,184,.15));
  border-radius: 6px; height: 14px; overflow: hidden;
}
.tn-act-zone-bar > div { height: 100%; background: var(--accent, #0ea5e9); transition: width .25s; }
.tn-act-zone-z1 .tn-act-zone-bar > div { background: #94a3b8; }
.tn-act-zone-z2 .tn-act-zone-bar > div { background: #22c55e; }
.tn-act-zone-z3 .tn-act-zone-bar > div { background: #facc15; }
.tn-act-zone-z4 .tn-act-zone-bar > div { background: #f97316; }
.tn-act-zone-z5 .tn-act-zone-bar > div { background: #dc2626; }
.tn-act-zone-val {
  text-align: right; color: var(--text3, #64748b);
  font-variant-numeric: tabular-nums;
}

/* ── Generic data-tip popover ──────────────────────────────────────────
   Any element with [data-tip="..."] gets a styled popover on hover /
   focus instead of the slow OS title tooltip (we use data-tip, not
   title, so the OS tooltip doesn't compete). Designed for the
   tn-today-pill quantities on the home page but reusable anywhere. */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 200px; max-width: 320px;
  padding: 8px 12px;
  background: var(--surface, #1e293b);
  color: var(--text, #f1f5f9);
  border: 1px solid var(--border, rgba(148,163,184,.30));
  border-radius: 8px;
  font-size: 12.5px; font-weight: 400; line-height: 1.45;
  text-align: left; letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(15,23,42,.20);
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
  z-index: 100;
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition: opacity .15s ease, transform .15s ease;
}
/* Pills near the right edge of the screen — flip the popover to the
   left so it doesn't get clipped. The :nth-last-child(-n+2) catches
   the last two pills in any flex row. */
.tn-today-quick > [data-tip]:nth-last-child(-n+2)::after {
  left: auto; right: 0;
  transform: translateX(0) translateY(-4px);
}
.tn-today-quick > [data-tip]:nth-last-child(-n+2):hover::after,
.tn-today-quick > [data-tip]:nth-last-child(-n+2):focus-visible::after {
  transform: translateX(0) translateY(0);
}

/* ── Coach card — global rules so any page can render the pre-built
   HTML the iron pane produces (today.fragments.coach_html). Iron has
   a duplicate scoped under .iron-root for visual consistency on the
   planning view; this block makes the same markup render cleanly
   anywhere. */
/* Inside the home Today band, the coach card sheds ALL its visual
   chrome (gradient, border, shadow, padding) — the today band is
   already a panel with its own background, so the coach lines should
   read as part of it, not as a nested card. Just leaves the text. */
.tn-today-coach .ir-coach-card {
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
.ir-coach-card {
  margin: 6px 0 10px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(14,165,233,.08), rgba(168,85,247,.08));
  border: 1px solid rgba(14,165,233,.25);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(15,23,42,.06);
}
.ir-coach-debrief {
  font-size: 13px; font-weight: 600;
  color: var(--text, #0f172a);
  margin-bottom: 2px;
}
.ir-coach-tomorrow {
  font-size: 12px; color: var(--text2, #475569);
  margin-top: 2px;
}
.ir-coach-tom-label {
  font-weight: 700; color: #0c4a6e;
  letter-spacing: .03em;
}
.ir-coach-tom-link {
  color: var(--text, #0f172a); text-decoration: none;
  border-bottom: 1.5px dashed rgba(14,165,233,.45);
}
.ir-coach-tom-link:hover {
  border-bottom-color: var(--accent, #0ea5e9); color: var(--accent, #0ea5e9);
}
.ir-coach-tom-meta { opacity: .75; }
.ir-coach-risk {
  margin-top: 6px; padding: 6px 10px;
  background: rgba(245,158,11,.12);
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 12.5px; color: #92400e;
}
