/* Polices Barlow et Barlow Condensed (SIL Open Font License, voir fonts/OFL.txt), hébergées avec le site */
/* Police de secours aux mêmes proportions que Barlow : le texte ne bouge pas quand la vraie police arrive */
@font-face { font-family: "Barlow Fallback"; src: local("Arial"), local("Helvetica"), local("Liberation Sans"); size-adjust: 91%; ascent-override: 103%; descent-override: 21%; line-gap-override: 0%; }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600 700; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
/* Layout épuré : en-tête transparent, beaucoup d'air, aucun cadre autour des blocs ;
   chaque outil = réglages à gauche, résultats à droite (empilés sur mobile). */
:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --field: #ebefed;
  --ink: #111a17;
  --muted: #56625e;
  --line: #e2e7e5;
  --accent: #2350d9;
  --accent-ink: #ffffff;
  --accent-soft: #e9eefc;
  --motif: #d3dcd9;
  --z1: #9cc0ea; --z2: #63a77c; --z3: #e3bb4f; --z4: #e58a45; --z5: #d4524f;
  --glass: rgba(246, 248, 247, .82);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Barlow Fallback", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1312; --surface: #151c1a; --field: #1c2522; --ink: #e8efec; --muted: #8f9c97; --line: #232d2a;
    --accent: #8aa6ff; --accent-ink: #0e1312; --accent-soft: #1b2440; --motif: #24302c; --glass: rgba(14, 19, 18, .82);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1312; --surface: #151c1a; --field: #1c2522; --ink: #e8efec; --muted: #8f9c97; --line: #232d2a;
  --accent: #8aa6ff; --accent-ink: #0e1312; --accent-soft: #1b2440; --motif: #24302c; --glass: rgba(14, 19, 18, .82);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
.wrap {
  max-width: 1040px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- En-tête ---------- */
.top {
  position: sticky; top: 0; z-index: 30; view-transition-name: top;
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.top.scrolled { background: var(--glass); border-color: var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { font: 600 20px/1 var(--body); letter-spacing: -.01em; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transition: transform .5s var(--ease); }
.brand:hover i { transform: scale(1.6); }

.menu { position: relative; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: 500 16px/1 var(--body); color: var(--ink); background: transparent; border: 0; border-radius: 999px; padding: 10px 12px 10px 16px;
  transition: background .3s var(--ease);
}
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--field); }
.menu-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .45s var(--ease); }
.menu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 300px;
  display: grid; gap: 4px; padding: 8px;
  background: var(--surface); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 20px 50px -12px rgba(10, 30, 25, .22);
}
.js .menu-panel {
  opacity: 0; visibility: hidden; transform: translateY(-6px); transform-origin: top right;
  transition: opacity .25s var(--ease), transform .45s var(--ease), visibility 0s linear .45s;
}
.js .menu-panel.open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s var(--ease), transform .45s var(--ease), visibility 0s; }
.menu-group { display: grid; }
.menu-sport { font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 12px 4px; }
.menu-panel a {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink);
  transition: background .25s var(--ease);
}
.menu-panel a svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke .25s; }
.menu-panel a b { font-weight: 500; }
.menu-panel a small { display: none; }
.menu-panel a:hover, .menu-panel a:focus-visible { background: var(--field); }
.menu-panel a:hover svg, .menu-panel a[aria-current="page"] svg { stroke: var(--accent); }
.menu-panel a[aria-current="page"] b { color: var(--accent); }
.js .menu-panel a { opacity: 0; transform: translateY(4px); transition: opacity .3s var(--ease), transform .5s var(--ease), background .25s var(--ease); }
.js .menu-panel.open a { opacity: 1; transform: none; }
.js .menu-panel.open .menu-group:nth-child(2) a { transition-delay: .03s; }
.js .menu-panel.open .menu-group:nth-child(3) a { transition-delay: .06s; }
.js .menu-panel.open .menu-group:nth-child(4) a { transition-delay: .09s; }
@media (max-width: 560px) {
  .menu { position: static; }
  .menu-panel { left: 12px; right: 12px; width: auto; }
}

/* ---------- Titres ---------- */
h1, h2, h3 { margin: 0; text-wrap: balance; font-family: var(--body); color: var(--ink); }
h1 { font-size: clamp(34px, 5.4vw, 52px); font-weight: 600; line-height: 1.08; letter-spacing: -.025em; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
h3 { font-size: 17px; font-weight: 600; }
.intro { padding-block: 56px 40px; display: grid; gap: 14px; }
.intro p { margin: 0; max-width: 56ch; color: var(--muted); font-size: 18px; }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--accent); }

/* ---------- Outil ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 56px; align-items: start; padding-bottom: 72px; }
@media (max-width: 820px) { .tool { grid-template-columns: minmax(0, 1fr); gap: 40px; } }
.panel { display: grid; gap: 22px; min-width: 0; }
.field { display: grid; gap: 8px; }
.field > label, .label { font-size: 14px; font-weight: 500; color: var(--muted); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
input, select {
  font: 500 18px/1.2 var(--body); color: var(--ink); background: var(--field);
  border: 1px solid transparent; border-radius: 12px; padding: 13px 14px; width: 100%;
  font-variant-numeric: tabular-nums; outline: none;
  transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), opacity .3s;
}
input:hover, select:hover { border-color: var(--line); }
input:focus, select:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input:disabled { opacity: .45; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { font-size: 14px; color: var(--muted); margin: 0; }
hr { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 500 14px/1 var(--body); padding: 8px 12px; border-radius: 999px; cursor: pointer;
  border: 0; background: transparent; color: var(--muted);
  transition: background .25s var(--ease), color .25s, transform .2s var(--ease);
}
.chip:hover { background: var(--field); color: var(--ink); }
.chip:active { transform: scale(.94); }

/* Sélecteur segmenté : pastille blanche qui glisse dans un rail */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--field); border-radius: 999px; position: relative; isolation: isolate; justify-self: start; }
.seg button {
  font: 500 14px/1 var(--body); padding: 9px 14px; border-radius: 999px; cursor: pointer;
  border: 0; background: transparent; color: var(--muted); transition: color .35s var(--ease);
}
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg:not(.has-ind) button[aria-pressed="true"] { background: var(--surface); }
.seg-ind { position: absolute; left: 0; top: 0; z-index: -1; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg.ready .seg-ind { transition: transform .55s var(--ease), width .55s var(--ease), height .55s var(--ease); }

.btn { font: 500 16px/1 var(--body); padding: 13px 20px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; justify-self: start; transition: transform .3s var(--ease), opacity .3s; }
.btn.ghost { background: var(--field); color: var(--ink); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); }

/* ---------- Résultats ---------- */
.result { display: grid; gap: 36px; min-width: 0; }
.big { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px; }
.stat { display: flex; flex-direction: column-reverse; gap: 6px; }
.stat .v { font: 600 46px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .v small { font: 500 16px/1 var(--body); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat .k { font-size: 14px; color: var(--muted); }
.stat.main .v { color: var(--accent); }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 16px; }
th, td { padding: 11px 4px; text-align: left; white-space: nowrap; }
td { border-top: 1px solid var(--line); }
th { font-size: 13px; color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; }
td:first-child, th:first-child { padding-left: 12px; }
td:last-child, th:last-child { padding-right: 12px; }
tr.hl td { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-color: transparent; }
tr.hl td:first-child { border-radius: 10px 0 0 10px; }
tr.hl td:last-child { border-radius: 0 10px 10px 0; }
tr.hl + tr td { border-color: transparent; }
td.wrapcell { white-space: normal; min-width: 220px; }

/* Zones cardiaques */
.zones { display: grid; gap: 18px; }
.zone { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; }
.zone b { font: 600 15px/1 var(--body); color: var(--muted); }
.zone .bar { height: 8px; border-radius: 99px; position: relative; background: var(--field); overflow: hidden; }
.zone .bar span { position: absolute; top: 0; bottom: 0; border-radius: 99px; transition: left .8s var(--ease), width .8s var(--ease); }
.zone .bpm { font: 600 22px/1 var(--display); font-variant-numeric: tabular-nums; text-align: right; min-width: 92px; }
.zone .desc { grid-column: 2 / -1; font-size: 14px; color: var(--muted); }

/* Plan */
.week { display: grid; gap: 10px; padding-top: 24px; border-top: 1px solid var(--line); }
.week header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.week header h3 { font-size: 18px; }
.pill { font: 500 13px/1 var(--body); padding: 5px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.pill.rest { background: var(--field); color: var(--muted); }
.pill.race { background: var(--ink); color: var(--bg); }
.sessions { display: grid; }
.session { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 7px 0; font-size: 16px; }
.session strong { font-size: 14px; font-weight: 500; color: var(--muted); }

/* ---------- Texte (SEO) ---------- */
.content { padding-block: 24px 80px; display: grid; gap: 48px; max-width: 680px; }
.content p { margin: 0; color: var(--muted); }
.content section { display: grid; gap: 14px; }
.content .tablewrap { margin-top: 4px; }
details { border-top: 1px solid var(--line); padding-block: 16px; }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); font-size: 22px; line-height: 1; transition: transform .4s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 10px !important; }

/* ---------- Accueil ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; padding-bottom: 80px; }
.card {
  display: grid; gap: 6px; align-content: start; padding: 24px; border-radius: 18px;
  text-decoration: none; color: var(--ink);
  transition: background .4s var(--ease), transform .5s var(--ease);
}
.card:hover { background: var(--surface); transform: translateY(-2px); }
.card .unit { font: 600 40px/1 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; margin-bottom: 10px; transition: transform .6s var(--ease); transform-origin: left; }
.card:hover .unit { transform: translateX(4px); }
.card h3 { font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.foot { color: var(--muted); font-size: 14px; }
.foot .wrap { padding-block: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }

/* ================= Mouvement ================= */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .3s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .6s var(--ease) both; }
::view-transition-group(bg) { animation-duration: .9s; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.intro > *, .tool > *, .cards > * { animation: rise .9s var(--ease) both; }
.intro > :nth-child(2) { animation-delay: .05s; }
.intro > :nth-child(3) { animation-delay: .1s; }
.tool > :nth-child(1), .cards > :nth-child(1) { animation-delay: .15s; }
.tool > :nth-child(2), .cards > :nth-child(2) { animation-delay: .22s; }
.cards > :nth-child(3) { animation-delay: .29s; }
.cards > :nth-child(4) { animation-delay: .36s; }
.cards > :nth-child(5) { animation-delay: .43s; }
@supports (animation-timeline: view()) {
  /* Mouvement seul, sans fondu : le texte reste lisible pendant le défilement */
  @keyframes rise-y { from { transform: translateY(14px); } }
  .content section { animation: rise-y linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
}
details[open] p { animation: rise .5s var(--ease) both; }

/* Changements de résultats */
.tick { animation: fade .5s var(--ease); }
@keyframes fade { from { opacity: .3; } }
tr.flash td { animation: flash 1.2s var(--ease); }
.week.flash .session { animation: fade .6s var(--ease); }
@keyframes flash { from { background-color: var(--accent-soft); } }
tr.enter, .week.enter { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.zone .bar span { animation: grow 1.1s var(--ease) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }

/* Fond : quelques lignes fines, propres à chaque sport */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; view-transition-name: bg; }
.bg svg { position: absolute; width: 100%; height: 100%; animation: bg-in 1.6s var(--ease) both; }
.bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, var(--bg) 30%, transparent 75%); }
@media (max-width: 820px) { .bg::after { background: linear-gradient(180deg, transparent 0%, var(--bg) 55%); } }
@keyframes bg-in { from { opacity: 0; } }
.m-line { fill: none; stroke: var(--motif); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.m-dash { fill: none; stroke: var(--motif); stroke-width: 6; }
.m-dot { fill: var(--accent); opacity: .5; }
.m-pulse { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60 940; animation: pulse 8s linear infinite; vector-effect: non-scaling-stroke; }
@keyframes pulse { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
.spin { transform-box: fill-box; transform-origin: center; animation: spin var(--d, 60s) linear infinite; }
.spin.rev { animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media print {
  .top, .foot, .content, .bg, form.panel, .noprint { display: none !important; }
  .tool { display: block; }
  body { background: #fff; color: #000; }
}

/* ================= Couleurs par sport =================
   Course = bleu piste, cardio = rouge, vélo = vert, muscu = ambre (disque de 15 kg). */
:root {
  --c-course: #2350d9; --c-cardio: #b3283f; --c-velo: #096c49; --c-muscu: #8f5205;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --c-course: #8aa6ff; --c-cardio: #ff7b90; --c-velo: #4fd19e; --c-muscu: #f5b04a; }
}
:root[data-theme="dark"] { --c-course: #8aa6ff; --c-cardio: #ff7b90; --c-velo: #4fd19e; --c-muscu: #f5b04a; }

/* Chaque page prend la teinte de son sport : fond, champs, accent */
body[data-bg="piste"], body[data-bg="accueil"] { --accent: var(--c-course); }
body[data-bg="coeur"] { --accent: var(--c-cardio); }
body[data-bg="velo"] { --accent: var(--c-velo); }
body[data-bg="fonte"] { --accent: var(--c-muscu); }
body[data-bg] {
  --bg: color-mix(in srgb, var(--accent) 7%, #f7f8f8);
  --field: color-mix(in srgb, var(--accent) 10%, #ffffff);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, #ffffff);
  --line: color-mix(in srgb, var(--accent) 14%, #e6eae8);
  --motif: color-mix(in srgb, var(--accent) 28%, #e2e7e5);
  --glass: color-mix(in srgb, var(--bg) 82%, transparent);
}
body[data-bg="accueil"] { --bg: #f4f6fb; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-bg] {
    --bg: color-mix(in srgb, var(--accent) 7%, #0d1111);
    --field: color-mix(in srgb, var(--accent) 11%, #161c1b);
    --accent-soft: color-mix(in srgb, var(--accent) 18%, #141a19);
    --line: color-mix(in srgb, var(--accent) 14%, #222a28);
    --motif: color-mix(in srgb, var(--accent) 22%, #1e2624);
    --accent-ink: #0d1111;
  }
  :root:not([data-theme="light"]) body[data-bg="accueil"] { --bg: #0e1118; }
}
:root[data-theme="dark"] body[data-bg] {
  --bg: color-mix(in srgb, var(--accent) 7%, #0d1111);
  --field: color-mix(in srgb, var(--accent) 11%, #161c1b);
  --accent-soft: color-mix(in srgb, var(--accent) 18%, #141a19);
  --line: color-mix(in srgb, var(--accent) 14%, #222a28);
  --motif: color-mix(in srgb, var(--accent) 22%, #1e2624);
  --accent-ink: #0d1111;
}
:root[data-theme="dark"] body[data-bg="accueil"] { --bg: #0e1118; }

/* Halo coloré derrière le haut de page */
.bg::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(-6vw, 4vh) scale(1.08); } }

/* Titre : un mot en couleur, résultats et puces dans la teinte */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 6px 12px; border-radius: 99px; background: var(--accent-soft); }
.stat .v { color: var(--ink); }
.stat.main .v { color: var(--accent); }
.stat:not(.main) { padding-left: 14px; border-left: 2px solid var(--line); }
.btn { background: var(--accent); color: var(--accent-ink); }
.brand i { background: var(--accent); }

/* Menu et cartes : chaque outil dans la couleur de son sport */
.menu-panel a[href="allure.html"], .menu-panel a[href="plan-entrainement.html"], .card[href="allure.html"], .card[href="plan-entrainement.html"] { --c: var(--c-course); }
.menu-panel a[href="zones-cardiaques.html"], .card[href="zones-cardiaques.html"] { --c: var(--c-cardio); }
.menu-panel a[href="musculation.html"], .card[href="musculation.html"] { --c: var(--c-muscu); }
.menu-panel a svg { stroke: var(--c); padding: 3px; border-radius: 6px; width: 26px; height: 26px; background: color-mix(in srgb, var(--c) 14%, transparent); }
.menu-panel a { grid-template-columns: 26px minmax(0, 1fr); }
.menu-panel a:hover svg, .menu-panel a[aria-current="page"] svg { stroke: var(--c); }
.menu-panel a[aria-current="page"] b { color: var(--c); }

.card { background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.card:hover { background: color-mix(in srgb, var(--c) 15%, var(--surface)); }
.card .unit { color: var(--c); }
.cards { gap: 14px; }

/* Gros chiffres : jamais coupés, les blocs passent à la ligne entiers */
.big { display: flex; flex-wrap: wrap; gap: 24px 40px; }
.stat .v { white-space: nowrap; }
@media (max-width: 480px) { .stat .v { font-size: 38px; } }
.menu-panel a[href="carnet.html"], .card[href="carnet.html"] { --c: var(--c-muscu); }
.intro .cta { justify-self: start; font-weight: 500; text-decoration: none; padding: 8px 14px; border-radius: 99px; background: var(--accent-soft); transition: background .3s var(--ease); }
.intro .cta:hover { background: var(--field); }

/* Un élément masqué reste masqué, même si une règle lui donne un display */
[hidden] { display: none !important; }
.menu-panel a[href="carnet-course.html"], .card[href="carnet-course.html"] { --c: var(--c-course); }

/* ================= Calories ================= */
:root { --c-food: #6a3cc8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-food: #b79cff; } }
:root[data-theme="dark"] { --c-food: #b79cff; }
body[data-bg="jauge"] { --accent: var(--c-food); }
.menu-panel a[href="calories.html"], .card[href="calories.html"] { --c: var(--c-food); }
.tool + .tool { border-top: 1px solid var(--line); padding-top: 56px; }
.panel h2 { margin-bottom: -4px; }
.foods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
@media (max-width: 560px) { .foods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.food { display: grid; gap: 2px; padding: 16px 14px; border-radius: 14px; background: var(--surface); }
.food b { font: 600 34px/1 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.food span { font-weight: 500; }
.food small { font-size: 12.5px; color: var(--muted); }
.macros { display: grid; gap: 16px; margin-top: 14px; }
.macro { display: grid; gap: 6px; }
.macro-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 500; }
.macro-top span { display: flex; align-items: center; gap: 8px; }
.macro-top i { width: 9px; height: 9px; border-radius: 50%; }
.macro-top b { font: 600 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.macro-top b small { font: 500 14px var(--body); color: var(--muted); margin-left: 3px; }
.macro-bar { height: 10px; border-radius: 99px; background: var(--field); overflow: hidden; }
.macro-bar span { display: block; height: 100%; border-radius: 99px; transition: width .8s var(--ease); animation: grow 1s var(--ease) both; transform-origin: left; }
.macro small { font-size: 13px; color: var(--muted); }
.needle { transform-box: view-box; transform-origin: 1180px 760px; animation: sweep 9s ease-in-out infinite alternate; }
.needle path { stroke: var(--accent); stroke-width: 2; opacity: .5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
@keyframes sweep { from { transform: rotate(-62deg); } to { transform: rotate(58deg); } }

/* Bilan de la journée */
.d-datenav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.d-datenav .chip { font-size: 20px; padding: 8px 14px; background: var(--field); }
.d-addrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.d-addrow .btn { border-radius: 12px; }
.d-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--field); }
.d-bar span { height: 100%; transition: width .8s var(--ease); }
.d-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.d-legend span { display: inline-flex; align-items: center; gap: 6px; }
.d-legend i { width: 9px; height: 9px; border-radius: 50%; }
.d-legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.d-list { display: grid; margin-top: 8px; }
.d-sess { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.d-sess > i { width: 9px; height: 9px; border-radius: 50%; background: var(--t); }
.d-sess span { display: grid; gap: 2px; min-width: 0; }
.d-sess small { color: var(--muted); font-size: 13px; }
.d-sess strong { font: 600 22px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-del { border: 0; background: var(--field); color: var(--muted); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; transition: background .25s, color .25s; }
.d-del:hover { background: var(--z5); color: #fff; }
.d-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 150px; margin: 14px 0 10px; }
.d-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer; padding: 0; color: var(--muted); font: 500 12px var(--body); }
.d-col small { font-size: 11px; font-variant-numeric: tabular-nums; }
.d-col em { font-style: normal; }
.d-stack { width: 100%; max-width: 34px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, var(--field)); display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; transition: height .8s var(--ease); }
.d-stack span { background: color-mix(in srgb, var(--accent) 55%, var(--field)); transition: height .8s var(--ease); }
.d-col.on .d-stack { background: color-mix(in srgb, var(--accent) 16%, var(--field)); }
.d-col.on .d-stack span { background: var(--accent); }
.d-col.on em, .d-col.on small { color: var(--accent); font-weight: 600; }

/* ================= Habillage v2 : cartes douces, icônes, accueil par thème, pied de page ================= */
:root { --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 14px 34px -18px rgba(16, 24, 40, .22); --radius: 22px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -18px rgba(0, 0, 0, .7); } }
:root[data-theme="dark"] { --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -18px rgba(0, 0, 0, .7); }

/* Intro des outils : pastille avec l'icône de l'outil */
.eyebrow svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.intro { padding-block: 64px 44px; }
.intro h1 { font-size: clamp(36px, 5.8vw, 58px); }

/* Formulaires et résultats en cartes */
.tool { gap: 40px; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.panel h2 { font-size: 22px; }
.result .big {
  padding: 24px 26px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--surface) 75%, transparent));
  box-shadow: var(--shadow);
}
.stat:not(.main) { border-left-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.result h2 { margin-bottom: 4px; }
.tablewrap { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 6px 10px; }
.tablewrap td { border-top-color: color-mix(in srgb, var(--line) 70%, transparent); }
.zones { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.macros, .d-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.d-list .d-sess:last-child { border-bottom: 0; }
.d-list .hint { padding-block: 6px; }
.d-week { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px 14px; height: 190px; }
.food { box-shadow: var(--shadow); border-radius: 18px; transition: transform .4s var(--ease); }
.food:hover { transform: translateY(-2px); }
.tool + .tool { border-top: 0; padding-top: 16px; }

/* Plan d'entraînement : une carte par semaine */
#r-weeks { gap: 12px !important; }
.week { background: var(--surface); border: 0; border-radius: 18px; box-shadow: var(--shadow); padding: 18px 20px; }
.session { padding: 6px 0; }

/* FAQ en carte */
.content section > div:has(> details) { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 22px; }
.content section > div:has(> details) details:first-child { border-top: 0; }
.content section > div:has(> details) details:last-child { border-bottom: 0; }

/* Menu : deux colonnes avec descriptions */
.menu-panel { width: 540px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; padding: 10px; border-radius: 20px; }
.menu-group:first-child { grid-row: span 2; }
.menu-panel a { grid-template-columns: 30px minmax(0, 1fr); align-items: start; padding: 10px; }
.menu-panel a svg { width: 30px; height: 30px; padding: 5px; border-radius: 9px; }
.menu-panel a small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
@media (max-width: 560px) {
  .menu-panel { width: auto; left: 12px; right: 12px; grid-template-columns: minmax(0, 1fr); max-height: calc(100vh - 90px); overflow-y: auto; }
  .menu-group:first-child { grid-row: auto; }
}

/* Accueil */
.home-intro { padding-block: 80px 40px; gap: 18px; }
.home-intro h1 { font-size: clamp(42px, 7.4vw, 80px); line-height: 1.02; letter-spacing: -.035em; }
.hl-word { color: var(--accent); background: linear-gradient(transparent 70%, color-mix(in srgb, var(--accent) 18%, transparent) 70%); }
.home-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.home-jump a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: 15px; padding: 9px 16px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); transition: transform .3s var(--ease), color .3s; }
.home-jump a:hover { transform: translateY(-2px); color: var(--accent); }
.home-sec { display: grid; gap: 18px; padding-bottom: 48px; scroll-margin-top: 80px; }
.home-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.home-head h2 { font-size: 26px; letter-spacing: -.02em; }
.home-head p { margin: 0; color: var(--muted); }
.home-sec .cards { padding-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); padding: 24px; gap: 8px;
  position: relative; overflow: hidden; isolation: isolate;
}
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 60%); transition: opacity .4s var(--ease); opacity: .7; }
.card:hover { background: var(--surface); transform: translateY(-4px); box-shadow: 0 2px 4px rgba(16, 24, 40, .06), 0 24px 44px -20px color-mix(in srgb, var(--c) 45%, transparent); }
.card:hover::before { opacity: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, var(--surface)); }
.card-ic svg { width: 24px; height: 24px; fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card .unit { font-size: 30px; margin-bottom: 0; }
.card-go { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--c); display: inline-flex; gap: 6px; }
.card-go span { transition: transform .4s var(--ease); }
.card:hover .card-go span { transform: translateX(5px); }
.card:hover .unit { transform: none; }

/* Pied de page : plan du site */
.foot { margin-top: 24px; background: color-mix(in srgb, var(--surface) 55%, transparent); border-top: 1px solid var(--line); }
.foot .wrap { border-top: 0; }
.foot .foot-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; padding-block: 48px 28px; }
.foot-brand { display: grid; gap: 12px; align-content: start; }
.foot-brand p { margin: 0; max-width: 34ch; color: var(--muted); }
.foot nav { display: grid; gap: 10px; align-content: start; }
.foot nav b { color: var(--ink); font-weight: 600; font-size: 14px; }
.foot nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; transition: color .25s; }
.foot nav a:hover { color: var(--accent); }
.foot .foot-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-block: 18px 32px; border-top: 1px solid var(--line); font-size: 13px; }
@media (max-width: 760px) {
  .foot .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}

/* Carnet de séances (muscu) : sections et exercices en cartes */
#carnet .cf-intro .eyebrow { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 6px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 500; }
#carnet #view > section, #carnet #view > .excard {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; border-top: 0;
}
#carnet #view > section.empty { box-shadow: none; background: transparent; }
#carnet #view > .sess, #carnet #view > details.pday { background: var(--surface); padding-inline: 18px; border-bottom: 1px solid var(--line); }
#carnet #view > .month + .sess, #carnet #view > .month + details.pday { border-radius: var(--radius) var(--radius) 0 0; }
#carnet #view > .sess:not(:has(+ .sess)), #carnet #view > details.pday:not(:has(+ details.pday)) { border-radius: 0 0 var(--radius) var(--radius); border-bottom: 0; }
#carnet #view > details.pday:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
/* Les colonnes de résultats ne s'élargissent jamais au-delà de l'écran */
.result { grid-template-columns: minmax(0, 1fr); }
.result > *, .week, .sessions, .session > * { min-width: 0; }
.session { overflow-wrap: anywhere; }

/* Calories en fin de séance (carnets) */
#carnet .tiles.tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#carnet .kcal-end, .j-end {
  display: grid; gap: 4px; padding: 18px 20px; border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--surface) 70%, transparent));
}
#carnet .kcal-end span, .j-end span { font-size: 13px; color: var(--muted); font-weight: 500; }
#carnet .kcal-end b, .j-end b { font: 600 44px/1.05 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; animation: rise .6s var(--ease) both; }
#carnet .kcal-end small, .j-end small { font-size: 13px; color: var(--muted); }

/* Enregistrement dans le compte */
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.sync::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.sync[data-s="ok"]::before { background: #2f9e5b; }
.sync[data-s="saving"]::before { background: #d9a400; }
.sync[data-s="err"]::before { background: #d14343; }
.tempo-toast { position: fixed; left: 50%; top: calc(76px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); }

/* ---------- Compte ---------- */
.top .menu { margin-left: auto; }
.acct { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font: 500 15px/1 var(--body); color: var(--ink); text-decoration: none; background: var(--field); position: relative; transition: background .3s var(--ease); }
.acct:hover, .acct[aria-current="page"] { background: var(--accent-soft); }
.acct svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.acct::after { content: ""; position: absolute; top: 6px; left: 26px; width: 7px; height: 7px; border-radius: 50%; border: 2px solid var(--bg); background: transparent; }
.acct[data-s="ok"]::after { background: #2f9e5b; }
.acct[data-s="saving"]::after { background: #d9a400; }
.acct[data-s="offline"]::after, .acct[data-s="err"]::after { background: #d14343; }
@media (max-width: 520px) { .acct span { display: none; } .acct { padding: 9px; } .acct::after { left: 20px; } .top .wrap { gap: 8px; } }
.sync[data-s="offline"]::before { background: #d14343; }

.acc { display: grid; gap: 28px; max-width: 520px; padding-bottom: 72px; }
.acc-card { display: grid; gap: 18px; padding: 24px; border-radius: var(--radius, 20px); background: var(--surface); box-shadow: var(--shadow); }
.acc-card h2 { margin: 0; }
.acc-card form { display: grid; gap: 16px; }
.acc-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.acc-err { color: #c03434; font-size: 14px; margin: 0; }
.acc-ok { color: #23824a; font-size: 14px; margin: 0; }
.acc-check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.acc-check input { width: 18px; height: 18px; padding: 0; }
.btn.danger { background: #c03434; color: #fff; }
.acc-email { font-weight: 600; word-break: break-all; }
.acc details summary { cursor: pointer; font-weight: 500; }
.acc details[open] summary { margin-bottom: 14px; }

.acc-link { justify-self: start; background: none; border: 0; padding: 0; font: 500 14px/1.4 var(--body); color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Logo */
.brand img { width: 30px; height: 30px; border-radius: 8px; flex: none; transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
.foot .brand img { width: 26px; height: 26px; }

/* Icônes du menu : pastille colorée, dimensions fixes (rendu identique sur Safari) */
.menu-panel a { grid-template-columns: 30px minmax(0, 1fr); }
.menu-panel a .mi { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--c, var(--accent)); background: var(--accent-soft); background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent); }
.menu-panel a .mi svg { display: block; width: 18px; height: 18px; padding: 0; border-radius: 0; background: none; stroke: currentColor; flex: none; }
.menu-panel a:hover .mi, .menu-panel a[aria-current="page"] .mi { background: color-mix(in srgb, var(--c, var(--accent)) 24%, transparent); }

/* Profil */
#profil { scroll-margin-top: 90px; }
.pf { display: grid; gap: 16px; }
.pf .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf .row.pf-3 { grid-template-columns: repeat(3, 1fr); }
.pf label small { font-weight: 400; color: var(--muted); }
.pf-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pf-sum > div { background: var(--field); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.pf-sum small { color: var(--muted); font-size: 12px; }
.pf-sum b { font-size: 18px; }
.pf-sum .hint { grid-column: 1 / -1; margin: 0; }
.prof-note { margin-top: 4px; }
.prof-note a, .pf-sum a { color: var(--accent); }

/* Total sport */
.sp-list { display: grid; gap: 10px; margin-top: 12px; }
.sp-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(60px, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--field); }
.sp-name { display: grid; gap: 2px; min-width: 0; }
.sp-name small { color: var(--muted); font-size: 12px; }
.sp-bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--t) 14%, transparent); overflow: hidden; }
.sp-bar span { display: block; height: 100%; border-radius: inherit; background: var(--t); transition: width .6s var(--ease); }
.sp-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-weeks { display: flex; align-items: flex-end; gap: 8px; height: 150px; margin-top: 14px; }
.sp-wk { flex: 1; height: 100%; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; min-width: 0; }
.sp-wk span { align-self: end; width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: var(--accent); transition: height .6s var(--ease); }
.sp-wk small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sp-wk em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) { .sp-row { grid-template-columns: minmax(0, 1fr) auto; } .sp-bar { grid-column: 1 / -1; grid-row: 2; } }

/* Calories : rappel du profil */
.cal-prof { margin-top: 14px; font-size: 15px; color: var(--muted); }
.cal-prof a, #n-src a, #d-err a, #n-err a, #day-form a { color: var(--accent); }

/* Explication de l'option choisie */
.opt-desc { margin: 6px 0 0; font-size: 13px; line-height: 1.45; }
.j-typeinfo { margin: 8px 0 4px; font-size: 13px; line-height: 1.45; }

/* ---------- Illustrations des exercices ---------- */
.ex-move, .ex-map { display: block; width: 100%; height: auto; }
.ex-move .gr { stroke: var(--line); stroke-width: 2; }
.ex-move .pr { fill: color-mix(in srgb, var(--muted) 30%, transparent); }
.ex-move .pr-l { stroke: color-mix(in srgb, var(--muted) 55%, transparent); stroke-width: 4; stroke-linecap: round; }
.ex-move .cb { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 3; }
.ex-move .lm, .ex-move .lb { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ex-move .lm { stroke: var(--ink); stroke-width: 7; }
.ex-move .lb { stroke: color-mix(in srgb, var(--ink) 40%, transparent); stroke-width: 7; }
.ex-move .hd { fill: var(--ink); }
.ex-move .eq { fill: var(--accent); }
.ex-move .eq-plate { fill: none; stroke: var(--accent); stroke-width: 4; }
.ex-move .eq-l { stroke: var(--accent); stroke-width: 2.5; }
.ex-map .sil { fill: color-mix(in srgb, var(--muted) 16%, transparent); }
.ex-map .m0, .ex-map .m1, .ex-map .m2 { stroke: var(--surface, #fff); stroke-width: .9; stroke-linejoin: round; }
.ex-map .m0 { fill: color-mix(in srgb, var(--muted) 32%, transparent); }
.ex-map .m1 { fill: var(--accent); }
.ex-map .m2 { fill: color-mix(in srgb, var(--accent) 42%, var(--surface, #fff)); }
.ex-map .mlabel { font: 600 11px/1 var(--body, system-ui); fill: var(--muted); text-anchor: middle; }

/* ---------- Menu des outils (refonte) ---------- */
.menu-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--field); }
.menu-btn .mb-grid { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.menu-btn .mb-chev { width: 15px; height: 15px; }
.menu-btn[aria-expanded="true"] .mb-chev { transform: rotate(180deg); }
.menu-btn[aria-expanded="true"] svg.mb-grid { transform: none; }
.menu-panel {
  display: block; width: min(780px, calc(100vw - 32px)); right: 0; left: auto; padding: 18px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgba(17, 26, 23, .28), 0 2px 6px rgba(17, 26, 23, .06);
}
.mp-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mp-col { display: grid; align-content: start; gap: 2px; padding: 4px; }
.mp-head { display: flex; align-items: center; gap: 8px; font: 700 15px/1 var(--display); letter-spacing: .02em; color: var(--c); padding: 8px 10px 10px; }
.mp-head::before { content: ""; width: 18px; height: 4px; border-radius: 4px; background: var(--c); }
.menu-panel .mp-col a { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 14px; align-items: center; }
.menu-panel .mp-col a .mi { width: 36px; height: 36px; border-radius: 11px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.menu-panel .mp-col a .mi svg { width: 19px; height: 19px; }
.menu-panel .mp-col a span:last-child { display: grid; gap: 2px; min-width: 0; }
.menu-panel .mp-col a b { font-weight: 600; font-size: 15.5px; line-height: 1.2; }
.menu-panel .mp-col a small { display: block; font-size: 13px; line-height: 1.3; color: var(--muted); }
.menu-panel .mp-col a:hover, .menu-panel .mp-col a:focus-visible { background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.menu-panel .mp-col a[aria-current="page"] { background: color-mix(in srgb, var(--c) 11%, var(--surface)); }
.menu-panel .mp-col a[aria-current="page"] b { color: var(--c); }
.menu-panel .mp-foot a { grid-template-columns: none; align-items: center; }
.mp-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.menu-panel .mp-foot a { display: inline-flex; padding: 8px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink); text-decoration: none; background: var(--field); }
.menu-panel .mp-foot a:hover, .menu-panel .mp-foot a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.js .menu-panel .mp-col a, .js .menu-panel .mp-foot a { opacity: 0; transform: translateY(4px); transition: opacity .3s var(--ease), transform .5s var(--ease), background .2s; }
.js .menu-panel.open .mp-col a, .js .menu-panel.open .mp-foot a { opacity: 1; transform: none; }
.js .menu-panel.open .mp-col:nth-child(2) a { transition-delay: .04s; }
.js .menu-panel.open .mp-col:nth-child(3) a { transition-delay: .08s; }
@media (max-width: 760px) {
  .menu-panel { position: fixed; top: 66px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 82px); overflow-y: auto; padding: 12px; }
  .mp-cols { grid-template-columns: 1fr; gap: 0; }
  .mp-col + .mp-col { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
}
@media (max-width: 420px) { .menu-btn span { display: none; } .menu-btn { padding: 10px 12px; } }
@media (prefers-reduced-motion: reduce) { .js .menu-panel .mp-col a, .js .menu-panel .mp-foot a { transition: none; } }

/* ---------- Page d'accueil ---------- */
.home { --sky: #dff0fb; }
.h-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; padding-top: clamp(28px, 6vw, 72px); padding-bottom: clamp(40px, 7vw, 88px); }
.h-title { font: 700 clamp(64px, 10.5vw, 132px)/.86 var(--display); letter-spacing: -.02em; text-transform: none; margin: 0 0 28px; }
.h-lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; max-width: 34em; margin: 0 0 30px; color: var(--ink); }
.h-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.h-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; border-radius: 999px; border: 0; font: 600 16.5px/1.1 var(--body); text-decoration: none; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s; }
.h-btn:hover { transform: translateY(-2px); }
.h-btn:focus-visible, .h-tool:focus-visible, .h-back-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.h-btn-muscu { background: var(--c-muscu); color: #fff; box-shadow: 0 10px 24px -12px var(--c-muscu); }
.h-btn-run { background: var(--surface); color: var(--c-course); box-shadow: inset 0 0 0 2px var(--c-course); }
.h-btn-ink { background: var(--ink); color: var(--bg); }
.h-btn-ghost { background: var(--field); color: var(--ink); }
.h-small { font-size: 14.5px; color: var(--muted); margin: 0; max-width: 34em; }
.h-small a { color: var(--ink); }

.h-visual { position: relative; aspect-ratio: 1 / .92; }
.h-tile { position: absolute; border-radius: 28px; overflow: hidden; background: var(--sky); box-shadow: 0 30px 60px -30px rgba(17, 26, 23, .35); }
.h-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.h-tile-run { left: 0; top: 0; width: 66%; aspect-ratio: 1; }
.h-tile-lift { right: 0; bottom: 0; width: 48%; aspect-ratio: 1; border: 6px solid var(--bg); }
.h-chip { position: absolute; display: grid; gap: 2px; padding: 10px 14px; border-radius: 16px; background: var(--surface); box-shadow: 0 14px 30px -14px rgba(17, 26, 23, .35); }
.h-chip small { font-size: 12.5px; color: var(--muted); line-height: 1.2; }
.h-chip b { font: 700 26px/1 var(--display); letter-spacing: .01em; }
.h-chip-1 { right: 6%; top: 10%; } .h-chip-1 b { color: var(--c-course); }
.h-chip-2 { left: 8%; bottom: 14%; } .h-chip-2 b { color: var(--c-muscu); }
.h-chip-3 { left: 52%; top: 46%; } .h-chip-3 b { color: var(--c-cardio); }
@media (prefers-reduced-motion: no-preference) {
  .h-tile, .h-chip { animation: h-in .9s var(--ease) both; }
  .h-tile-lift { animation-delay: .12s; } .h-chip-1 { animation-delay: .35s; } .h-chip-2 { animation-delay: .45s; } .h-chip-3 { animation-delay: .55s; }
}
@keyframes h-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.h-back { padding-bottom: 40px; }
.h-back h2 { font: 700 28px/1.1 var(--display); margin: 0 0 14px; }
.h-back-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.h-back-item { display: grid; gap: 4px; padding: 16px 18px; border-radius: 18px; text-decoration: none; color: var(--ink); background: var(--surface); border-left: 5px solid var(--c); }
.h-back-item small { color: var(--muted); font-size: 13.5px; }
.h-back-item b { font-weight: 600; font-size: 17px; line-height: 1.3; }
.h-back-item span { color: var(--c); font-weight: 600; font-size: 14.5px; margin-top: 4px; }

/* Les trois couloirs */
.h-lanes { padding: 24px 0 8px; }
.h-lanes-head { margin-bottom: 22px; }
.h-lanes-head h2, .h-steps h2, .h-app h2 { font: 700 clamp(36px, 5vw, 56px)/1 var(--display); letter-spacing: -.01em; margin: 0 0 10px; }
.h-lanes-head p { color: var(--muted); margin: 0; font-size: 18px; }
.h-lane { position: relative; background: color-mix(in srgb, var(--c) 7%, var(--bg)); border-top: 3px solid var(--surface); }
.h-lane:last-of-type { border-bottom: 3px solid var(--surface); }
.h-lane::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--c); }
.h-lane-in { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr) 180px; gap: 32px; align-items: center; padding-block: 34px; }
.h-lane-intro h3 { font: 700 clamp(34px, 4vw, 48px)/1 var(--display); color: var(--c); margin: 0 0 10px; }
.h-lane-intro p { margin: 0; color: var(--ink); line-height: 1.55; max-width: 26em; }
.h-tools { display: grid; gap: 8px; }
.h-tool { position: relative; display: grid; gap: 3px; padding: 14px 44px 14px 18px; border-radius: 16px; background: var(--surface); text-decoration: none; color: var(--ink); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.h-tool b { font-weight: 600; font-size: 17px; color: var(--c); }
.h-tool span { font-size: 15px; line-height: 1.4; color: var(--ink); opacity: .82; }
.h-tool::after { content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; border-top: 2px solid var(--c); border-right: 2px solid var(--c); transform: translateY(-50%) rotate(45deg); transition: right .25s var(--ease); }
.h-tool:hover { transform: translateX(4px); box-shadow: 0 10px 24px -16px rgba(17, 26, 23, .35); }
.h-tool:hover::after { right: 14px; }
.h-lane-img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; background: var(--sky); border: 5px solid var(--surface); }

/* Étapes */
.h-steps { padding-top: clamp(56px, 8vw, 96px); }
.h-steps ol { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: st; }
.h-steps li { counter-increment: st; display: grid; gap: 8px; align-content: start; padding-top: 16px; border-top: 3px solid var(--ink); }
.h-steps li::before { content: counter(st); font: 700 54px/1 var(--display); color: var(--accent); }
.h-steps li b { font-size: 20px; font-weight: 600; }
.h-steps li span { color: var(--ink); opacity: .82; line-height: 1.55; }
.h-steps li a { color: var(--accent); font-weight: 600; margin-top: 4px; }

/* Application */
.h-app { padding-block: clamp(56px, 8vw, 96px) 72px; }
.h-app-in { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); gap: 40px; align-items: center; padding: clamp(24px, 4vw, 44px); border-radius: 30px; background: var(--ink); color: var(--bg); }
.h-app h2 { color: var(--bg); }
.h-facts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.h-facts li { display: grid; gap: 2px; padding-left: 18px; border-left: 3px solid var(--c-course); opacity: .92; }
.h-facts li:nth-child(2) { border-color: var(--c-muscu); } .h-facts li:nth-child(3) { border-color: var(--c-cardio); }
.h-facts b { font-weight: 600; }
.h-app-cta { display: grid; gap: 12px; justify-items: start; }
.h-app .h-small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.h-app .h-btn-ink { background: var(--bg); color: var(--ink); }
.h-app .h-btn-ghost { background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); }

@media (max-width: 900px) {
  .h-hero { grid-template-columns: 1fr; gap: 36px; }
  .h-visual { max-width: 520px; width: 100%; justify-self: center; }
  .h-lane-in { grid-template-columns: minmax(0, 1fr) 120px; gap: 18px 20px; }
  .h-lane-intro { grid-column: 1; grid-row: 1; }
  .h-lane-img { grid-column: 2; grid-row: 1; width: 120px; height: 120px; }
  .h-tools { grid-column: 1 / -1; }
  .h-steps ol { grid-template-columns: 1fr; gap: 22px; }
  .h-app-in { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .h-title { font-size: clamp(56px, 18vw, 80px); }
  .h-ctas .h-btn { width: 100%; }
  .h-lane-in { grid-template-columns: minmax(0, 1fr) 84px; padding-block: 26px; }
  .h-lane-img { width: 84px; height: 84px; border-width: 3px; }
  .h-chip b { font-size: 21px; } .h-chip { padding: 8px 11px; }
  .h-chip-3 { left: 46%; }
}

/* ---------- Plan : dates et suivi ---------- */
.session { grid-template-columns: 104px minmax(0, 1fr); }
.session strong { text-transform: none; }
.session.is-race span { font-weight: 600; color: var(--ink); }
.session.is-today { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; background: var(--accent-soft); }
.session.is-today strong { color: var(--accent); }
.week-dates { font: 400 14px/1 var(--body); color: var(--muted); margin-left: 6px; }
.follow { display: grid; gap: 14px; padding: 18px 20px; border-radius: 18px; background: var(--accent-soft); }
.follow > div:first-child { display: grid; gap: 4px; }
.follow b { font-size: 17px; }
.follow span { color: var(--muted); font-size: 15px; line-height: 1.45; }
.follow-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.follow-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 420px) { .session { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Lexique (plan d'entraînement) ---------- */
.lexique { background: var(--surface); border-radius: 18px; padding: 16px 20px; box-shadow: var(--shadow); }
.lexique summary { cursor: pointer; font-weight: 600; font-size: 16px; }
.lexique dl { margin: 12px 0 0; display: grid; gap: 12px; }
.lexique dt { font-weight: 600; font-size: 15px; }
.lexique dd { margin: 2px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.lexique .hint { margin-top: 14px; }

/* ---------- Protéines ---------- */
.prot { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.prot h3 { font-size: 15px; margin: 10px 0 0; }
.prot-lead { font-size: 17px; line-height: 1.6; margin: 0; }
.prot-lead b { font-size: 20px; font-variant-numeric: tabular-nums; }
.prot-lead select { width: auto; display: inline-block; padding: 4px 8px; font-size: 16px; margin-left: 2px; }
.prot-foods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 24px; }
.prot-foods li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.prot-foods b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Bilan de la semaine (accueil) ---------- */
.h-week { margin-top: 22px; display: grid; gap: 12px; }
.h-week h3 { font: 600 17px/1.2 var(--body); margin: 0; }
.h-week-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.h-wt { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border-top: 4px solid var(--c); }
.h-wt b { font: 700 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.h-wt span { font-size: 14px; font-weight: 500; }
.h-wt small { font-size: 12.5px; color: var(--muted); }
.h-recs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--c-muscu) 12%, var(--surface)); font-size: 14px; }
.h-recs span { color: var(--muted); }

/* ---------- À propos ---------- */
.about-me { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
.about-av { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font: 700 32px/1 var(--display); letter-spacing: .02em; }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.about-links .btn { text-decoration: none; display: inline-flex; align-items: center; }
.about-feats, .about-tech { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 14px; }
.about-feats li, .about-tech li { display: grid; gap: 3px; padding-left: 16px; border-left: 3px solid var(--line); }
.about-feats li:nth-child(1) { border-color: var(--c-muscu); } .about-feats li:nth-child(2) { border-color: var(--c-course); } .about-feats li:nth-child(3) { border-color: var(--c-cardio); }
.about-feats span, .about-tech span { color: var(--muted); line-height: 1.5; }
@media (max-width: 520px) { .about-me { grid-template-columns: 1fr; } .about-av { width: 64px; height: 64px; font-size: 24px; } }
.h-made { padding-block: 8px 48px; }
.h-made p { margin: 0; max-width: 62ch; color: var(--muted); font-size: 15px; line-height: 1.55; }
.h-made a { color: var(--accent); font-weight: 600; white-space: nowrap; }
#about-code .btn { text-decoration: none; display: inline-flex; }
