:root {
  /* Altimétrie — l'ascension */
  --bg: #15302A;          /* pine */
  --bg2: #0E231E;         /* pine profond */
  --card: #1B3A33;        /* carte */
  --card2: #224A40;       /* carte interne */
  --line: color-mix(in srgb, var(--accent2) 18%, transparent);
  --text: #EEF1EC;        /* neige */
  --muted: #8DB8AD;       /* glacier */
  --accent: #E2613A;      /* balise (orange) — aplats / gros éléments */
  --accent-text: #F09468; /* orange clair pour petit texte (contraste AA sur fond sombre) */
  --accent2: #8DB8AD;     /* glacier (secondaire) */
  --good: #57C99A;
  --warn: #EBA13C;
  --bad: #E0574B;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(0,0,0,.38);
  /* Échelle d'espacement (rythme vertical cohérent) */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --contour: #2B4A3F;
  --ring-track: color-mix(in srgb, var(--accent2) 20%, transparent);
  --glow: #20473D;
  --font-disp: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;
}

/* ===== Thème CLAIR — Brume (jour alpin) ===== */
html[data-theme="brume"] {
  --bg: #EAEEE8; --bg2: #DDE3DA; --card: #FFFFFF; --card2: #F1F5EF;
  --line: rgba(21,48,42,.14); --text: #15302A; --muted: #587A70;
  --accent: #D2521F; --accent-text: #B4401A; --accent2: #2E7D6B;
  --good: #2E9E76; --warn: #B07614; --bad: #C5443A;
  --shadow: 0 10px 28px rgba(21,48,42,.10);
  --contour: #CBD7CF; --ring-track: rgba(21,48,42,.10); --glow: #DCE6DD;
}
/* ===== Thème NATURE & ZEN — Zen (vert frais, lumineux) ===== */
html[data-theme="zen"] {
  --bg: #E9F0E2; --bg2: #DBE6D0; --card: #FBFCF8; --card2: #EDF3E6;
  --line: rgba(42,72,48,.14); --text: #24392A; --muted: #6E8473;
  --accent: #4E9C5E; --accent-text: #2E7344; --accent2: #7C9E66;
  --good: #3E9F61; --warn: #C2922F; --bad: #C0553B;
  --shadow: 0 10px 28px rgba(37,57,43,.12);
  --contour: #C6D3BC; --ring-track: rgba(37,57,43,.12); --glow: #DCECCE;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* iOS : supprime le délai de 300 ms / double-tap-zoom sur les éléments cliquables */
button, a, select, input, label, [data-tab], .navitem, .subnav-btn, .mode, .nut-unit, .cat-chip { touch-action: manipulation; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: radial-gradient(1100px 560px at 80% -10%, var(--glow), transparent 70%);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;              /* hauteur réelle du viewport mobile (barre d'adresse) */
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  /* Coupe tout débordement horizontal (décor #contours) SANS casser la topbar sticky
     (overflow: clip n'établit pas de conteneur de défilement, contrairement à hidden). */
  overflow-x: clip;
}

/* Typographie Altimétrie */
h1, h2, h3, .metric-value, .quadrant-label, .cpt-big-val { font-family: var(--font-disp); letter-spacing: -.01em; }
.metric-label, .badge, .day-tag, .day-date, .day-type, .food-group-t, .comp-dose, .cat-count, .exo-prog-t,
.cpt-label, .cpt-val, .pb-select, .nav .axis { font-family: var(--font-mono); }

/* ---------- Topbar ---------- */
.topbar {
  padding: 18px 20px 12px;
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; }
.logo {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
}
.logo svg { width: 100%; height: 100%; }
.brand h1 { font-size: 20px; font-weight: 800; }
.brand p { font-size: 11px; color: var(--muted); font-family: var(--font-mono); letter-spacing: .02em; }

/* ---------- Écran d'accueil : choix de profil (R6) ---------- */
body.on-accueil .navbar { display: none; }
body.on-accueil .profilbar { display: none; }
.accueil { padding: 18px 4px 30px; }
.acc-head { text-align: center; margin-bottom: 26px; }
.acc-head .eyebrow { display: block; }
.acc-title { font-family: var(--font-disp); font-weight: 800; font-size: 34px; letter-spacing: -.02em; margin: 6px 0 6px; }
.acc-head .muted { max-width: 340px; margin: 0 auto; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px; justify-content: center; max-width: 520px; margin: 0 auto; }
.acc-card { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: none; }
.acc-pick { display: flex; flex-direction: column; align-items: center; gap: 9px; background: none; border: none; cursor: pointer; padding: 0; width: 100%; }
.acc-av { width: 84px; height: 84px; border-radius: 20px; background: var(--c, var(--accent)); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp); font-weight: 800; font-size: 30px; color: #15302A; transition: transform .15s, box-shadow .15s; }
.acc-pick:hover .acc-av, .acc-card.acc-new:hover .acc-av { transform: translateY(-3px); box-shadow: 0 0 0 3px rgba(238,241,236,.25); }
.acc-pick:focus-visible .acc-av { outline: 3px solid var(--accent); outline-offset: 2px; }
.acc-nom { font-family: var(--font-disp); font-weight: 700; font-size: 14px; color: var(--text); }
.acc-actions { display: flex; gap: 4px; min-height: 26px; }
.acc-new { cursor: pointer; }
.acc-av.acc-plus { background: transparent; border: 2px dashed var(--line); color: var(--muted); font-size: 36px; font-weight: 400; }

/* Sélecteur de profil dans l'en-tête */
.profilbar { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pb-ico { font-size: 16px; opacity: .8; }
.pb-select {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 7px 10px; font-size: 13px; font-weight: 600;
  max-width: 130px; width: auto;
}
.pb-new {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--accent2);
  font-size: 18px; line-height: 1; cursor: pointer; transition: .15s;
}
.pb-new:hover { border-color: var(--accent); background: var(--card2); }

/* Sélection des activités */
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.act-chip {
  display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 12px;
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .15s; text-align: left;
}
.act-chip:hover { border-color: var(--accent2); }
.act-chip.on { background: color-mix(in srgb, var(--accent) 18%, var(--card)); border-color: var(--accent); color: var(--text); }
.act-chip.on .act-ico { color: var(--accent); }
.act-ico { font-size: 18px; }

/* Carte gestion des profils */
.profil-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; }
.profil-row { display: flex; align-items: center; gap: 8px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 4px 6px 4px 4px; }
.profil-row.actif { border-color: var(--accent); }
.profil-pick { flex: 1; text-align: left; background: none; border: none; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; padding: 8px 10px; }
.profil-row.actif .profil-pick { color: var(--accent2); }
.profil-actions { display: flex; gap: 4px; }
.profil-mini { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 6px 8px; border-radius: 8px; }
.profil-mini:hover { background: var(--card); color: var(--text); }

/* ---------- Fond : courbes de niveau ---------- */
#contours {
  position: fixed; top: -70px; left: 50%; transform: translateX(-50%);
  width: min(460px, 100vw); height: 460px;   /* jamais plus large que l'écran → zéro scroll horizontal */
  z-index: 0; pointer-events: none; opacity: .8;
}
#contours svg { width: 100%; height: 100%; }

/* ---------- Nav basse (balises) ---------- */
.navbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 30;
  width: 100%; max-width: 460px;
  display: flex; justify-content: space-around;
  padding: 9px 8px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.navitem {
  flex: 1; min-height: 48px; justify-content: center; touch-action: manipulation;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .02em; padding: 4px 2px; border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.navitem:active { background: var(--card2); }
.navitem svg { width: 21px; height: 21px; }
.navitem.on { color: var(--text); }
.navitem .navdot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.navitem.on .navdot { background: var(--accent); }
.navitem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout : colonne téléphone ---------- */
.topbar > .brand, .container { max-width: 460px; }
/* padding-bas = hauteur de la nav fixe (~71px) + marge, pour qu'aucun contenu ne glisse sous le menu */
.container { margin: 0 auto; padding: 8px 16px calc(88px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; position: relative; z-index: 1; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.card.highlight { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), var(--card)); }
.card.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.muted { color: var(--muted); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.hint { color: var(--muted); font-size: 12px; margin-top: 12px; line-height: 1.5; }

/* ---------- Forms ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 6px 0 16px; }
/* Choix des jours d'entraînement (Lot D) — sur toute la largeur de la grille */
.field-jours { grid-column: 1 / -1; }
.field-jours .field-lab { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.jours-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.jour-chip { flex: 1 1 auto; min-width: 42px; position: relative; margin: 0; }
.jour-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.jour-chip span { display: block; text-align: center; padding: 9px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card2); color: var(--muted); font-family: var(--font-mono); font-size: 12px; cursor: pointer; touch-action: manipulation; user-select: none; transition: background .15s, color .15s, border-color .15s; }
.jour-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.jour-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input, select {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 12px; border-radius: 10px; font-size: 15px; width: 100%;
  font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; }
.btn.primary:hover { background: var(--accent2); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Guide de mesure ---------- */
.guide { margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); overflow: hidden; }
.guide > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: 14px; list-style: none; user-select: none; }
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary::before { content: "▸ "; color: var(--accent2); }
.guide[open] > summary::before { content: "▾ "; }
.guide-body { padding: 0 14px 14px; }
.guide-schema { display: flex; justify-content: center; padding: 8px 0 4px; }
.guide-schema svg { width: 100%; max-width: 230px; height: auto; }
.s-body { fill: var(--card2); stroke: var(--line); stroke-width: 1.5; }
.s-line { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 3 2.5; }
.s-badge { fill: var(--accent); }
.s-num { fill: #fff; font-size: 11px; font-weight: 700; text-anchor: middle; font-family: inherit; }
.guide-legend { margin: 10px 0; padding-left: 26px; display: flex; flex-direction: column; gap: 7px; }
.guide-legend li { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.guide-legend li strong { color: var(--text); }
.guide-legend li::marker { color: var(--accent2); font-weight: 700; }
.guide-tips { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 8px; }

/* ---------- Assistant de mesures guidé ---------- */
.wizard { text-align: center; position: relative; }
.wz-x { position: absolute; top: 10px; right: 12px; font-size: 16px; line-height: 1; z-index: 2; }
.wz-steps { display: flex; gap: 4px; margin-bottom: 8px; }
.wz-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--moss, var(--contour)); }
.wz-steps i.done { background: var(--accent2); }
.wz-steps i.now { background: var(--accent); }
.wz-count { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.wizard .muted { max-width: 320px; margin: 0 auto 6px; }
.wz-schema { display: flex; justify-content: center; margin: 6px 0 14px; }
.wz-schema svg { width: 150px; height: auto; }
.s-dim { fill: none; stroke: color-mix(in srgb, var(--accent2) 35%, transparent); stroke-width: 1.3; }
.s-glow { fill: none; stroke: var(--accent); stroke-width: 7; opacity: .18; }
.s-active { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 4 3; }
.wz-field { display: flex; align-items: center; gap: 10px; background: var(--card2); border: 1px solid color-mix(in srgb, var(--accent2) 25%, transparent); border-radius: 14px; padding: 6px 6px 6px 16px; margin-bottom: 12px; }
.wz-field input { flex: 1; background: none; border: none; color: var(--text); font-family: var(--font-disp); font-weight: 800; font-size: 26px; width: 100%; outline: none; text-align: left; }
.wz-field .wz-u { font-family: var(--font-mono); font-size: 13px; color: var(--muted); padding-right: 4px; }
.wz-next { flex: none; background: var(--accent); color: #fff; border: none; width: 48px; height: 48px; border-radius: 11px; font-size: 20px; cursor: pointer; }
.wizard .row { justify-content: center; }

/* ---------- Écran de séance (R2) ---------- */
.sc-toggle { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 10px 0; }
.sc-toggle input { width: auto; }
.sc-exos { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; }
.sc-exos .exo { background: var(--card2); }
.sets { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.set { width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-family: var(--font-disp); font-weight: 800; font-size: 15px; cursor: pointer; transition: .12s; }
.set:hover { border-color: var(--accent); }
.set.ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.sc-det { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.sc-det input { font-size: 14px; }
.sc-fait-lab { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; font-size: 12px; color: var(--muted); }
.sc-fait { flex: 1; font-size: 13.5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card2); color: var(--text); }
.sc-rir { font-size: 13.5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card2); color: var(--text); }
.exo-prog-sug { display: flex; align-items: center; gap: 5px; margin: 2px 0 8px; font-size: 12.5px; color: var(--accent2); }
.exo-prog-sug .muted { color: var(--muted); }
.exo-palier { display: flex; align-items: center; gap: 5px; margin: 2px 0 6px; font-size: 12px; color: var(--muted); }
.exo-palier strong { color: var(--text); font-weight: 600; }
.step-row { display: block; width: 100%; text-align: left; background: var(--card2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--text); font-size: 13.5px; cursor: pointer; line-height: 1.4; }
.step-row.ok { border-color: var(--accent2); }
.step-tick { color: var(--accent2); font-weight: 700; margin-right: 8px; }
.feel { display: flex; gap: 8px; margin: 12px 0; }
.feel-btn { flex: 1; border: 1.5px solid var(--line); background: var(--card2); color: var(--text); border-radius: 12px; padding: 12px 6px;
  cursor: pointer; font-family: var(--font-disp); font-weight: 700; font-size: 13px; }
.feel-btn .em { display: block; font-size: 20px; margin-bottom: 4px; }
.feel-btn.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.sc-note { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: var(--bg2); color: var(--text);
  font-family: var(--font-body); font-size: 14px; resize: none; }
.bilan-card .feel + .sc-note { margin-top: 4px; }

/* Icône d'aide (ⓘ) avec infobulle */
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; font-size: 11px; font-weight: 700;
  color: var(--accent2); cursor: help; position: relative; vertical-align: middle;
}
.info::after {
  content: attr(data-tip);
  position: absolute; left: 0; bottom: calc(100% + 8px);
  width: min(260px, 70vw);
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 9px 11px; font-size: 11.5px; font-weight: 500; line-height: 1.5;
  box-shadow: var(--shadow); z-index: 40;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: .12s;
  pointer-events: none; white-space: normal;
}
.info:hover::after, .info:focus::after { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Metrics ---------- */
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.exp-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.recomp-note { border-left: 3px solid var(--good); font-size: 13.5px; line-height: 1.45; }
.whatsnew-card { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.whatsnew-list { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; }
.whatsnew-list li { position: relative; padding-left: 18px; font-size: 13px; line-height: 1.4; color: var(--text); }
.whatsnew-list li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.wn-h { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.wn-h:last-child { border-bottom: 0; }
.wn-h-d { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.asc-card { border: 1px solid color-mix(in srgb, var(--accent2) 30%, var(--line)); }
.asc-route { margin-top: 2px; }
.asc-bar { height: 8px; border-radius: 999px; background: var(--ring-track); overflow: hidden; }
.asc-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .4s ease; }
.asc-meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--text); }
.asc-meta .muted { color: var(--muted); font-weight: 400; font-family: var(--font-mono); }
.asc-summit { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; color: var(--accent-text); }
.bilan-hebdo { border-left: 3px solid var(--accent2); font-size: 13.5px; line-height: 1.45; }
.cordee-add { display: flex; gap: 8px; margin: 10px 0; align-items: stretch; }
.cordee-add input { flex: 1 1 auto; min-width: 0; }
.cordee-add .btn { width: auto; flex: 0 0 auto; white-space: nowrap; }
.cordee-h { font-size: 12px; color: var(--muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 6px; }
.cordee-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.cordee-row:last-child { border-bottom: 0; }
.cordee-res { border: 1px solid var(--line); border-radius: 12px; padding: 2px 12px; margin: -2px 0 10px; background: var(--bg2); }
.lab-opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.cordee-nom { font-weight: 600; }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }
.btn.ghost { background: transparent; color: var(--muted); }
.fil-card { border: 1px solid color-mix(in srgb, var(--accent2) 28%, var(--line)); }
.coop { margin-bottom: 10px; }
.coop-bar { height: 8px; border-radius: 999px; background: var(--ring-track); overflow: hidden; }
.coop-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .4s ease; }
.coop-lab { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.fil-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.fil-row:last-child { border-bottom: 0; }
.fil-txt { font-size: 13px; line-height: 1.4; }
.kudo { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: .15s; white-space: nowrap; }
.kudo:hover { border-color: var(--accent); }
.kudo.on { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--accent-text); }
.kudo-c { flex: none; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.ea-note { border-left: 3px solid var(--warn); font-size: 13px; line-height: 1.5; }
.som-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.som-chip { flex: 1 1 auto; min-width: 52px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card2); color: var(--muted); font-family: var(--font-mono); font-size: 13px; cursor: pointer; transition: .15s; }
.som-chip:hover { border-color: var(--accent2); }
.som-chip.on { background: var(--accent2); border-color: var(--accent2); color: var(--card); font-weight: 700; }
.diet-note { border-left: 3px solid var(--accent); font-size: 13.5px; line-height: 1.45; }
.diet-note.diet-actif { border-left-color: var(--accent2); background: color-mix(in srgb, var(--accent2) 8%, var(--card)); }
.diet-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.diet-actions .btn { width: auto; }
.metric {
  background: var(--card2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
}
.metric-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; min-height: 22px; }
.metric-label { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.metric-value { font-size: 28px; font-weight: 800; line-height: 1; }
.metric-value .unit { font-size: 13px; color: var(--muted); margin-left: 3px; font-weight: 500; font-family: var(--font-mono); }

.badge { font-size: 10px; font-weight: 600; padding: 4px 9px; border-radius: 999px; white-space: nowrap; letter-spacing: .02em; }
.badge.good { background: rgba(87,201,154,.15); color: var(--good); }
.badge.warn { background: rgba(235,161,60,.15); color: var(--warn); }
.badge.bad { background: rgba(224,87,75,.16); color: var(--bad); }

.reco { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.reco li { padding-left: 22px; position: relative; font-size: 14px; line-height: 1.55; color: var(--text); }
.reco li::before { content: "▲"; position: absolute; left: 0; top: 1px; color: var(--accent); font-weight: 700; font-size: 10px; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart-empty { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
.link-del { background: none; border: none; color: var(--bad); cursor: pointer; font-size: 14px; opacity: .6; }
.link-del:hover { opacity: 1; }

/* Zone danger (suppression de compte RGPD) : repliée par défaut, visuellement à l'écart. */
.danger-zone { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.danger-zone > summary { cursor: pointer; font-size: 13px; list-style: none; }
.danger-zone > summary::-webkit-details-marker { display: none; }
.danger-zone > summary::before { content: "⚠ "; }
.danger-zone p { font-size: 13px; margin: 8px 0; }

/* ---------- Mésocycle (stepper) ---------- */
.meso-weeks { display: flex; gap: 6px; }
.mw { flex: 1; text-align: center; }
.mw .bar { height: 8px; border-radius: 4px; background: var(--moss, var(--contour)); }
.mw.done .bar { background: var(--accent2); }
.mw.now .bar { background: var(--accent); }
.mw.deload .bar { background: repeating-linear-gradient(45deg, var(--contour), var(--contour) 3px, #3a5a4e 3px, #3a5a4e 6px); }
.mw span { font-family: var(--font-mono); font-size: 9px; color: var(--muted); display: block; margin-top: 5px; }
.mw.now span { color: var(--text); }

/* ---------- Itinéraire (entraînement) ---------- */
.sectitle { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 4px 2px; }
.route { position: relative; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.route::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 16px; width: 2px; background-image: linear-gradient(var(--contour) 60%, transparent 0); background-size: 2px 8px; }
.stage { position: relative; }
.stage > .node { position: absolute; left: -22px; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--contour); z-index: 1; }
.stage.done > .node { background: var(--accent2); border-color: var(--accent2); }
.stage.today > .node { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.day-deniv { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.day-deniv .ch { color: var(--accent); font-family: var(--font-mono); font-size: 12px; letter-spacing: -1px; }
.day-deniv .lab { font-family: var(--font-mono); font-size: 9px; color: var(--muted); text-transform: uppercase; }

/* ---------- Planning (ancien, conservé) ---------- */
.planning { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.day {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 14px;
}
.day.rest { border-left-color: var(--line); opacity: .75; }
.day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.day-icon { font-size: 18px; }
.day-name { font-weight: 700; font-size: 14px; }
.day-tag { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.ti-intense { background: rgba(239,68,68,.16); color: #f87171; }
.ti-modere { background: rgba(245,158,11,.16); color: var(--warn); }
.ti-facile { background: rgba(34,197,94,.16); color: var(--good); }
.ti-repos { background: rgba(139,151,166,.16); color: var(--muted); }
.day-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.day-detail { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.d-intro { color: var(--text); font-size: 12.5px; margin-bottom: 6px; }
.d-exos { list-style: none; display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.d-exos li { position: relative; padding-left: 14px; font-size: 12.5px; color: var(--text); line-height: 1.45; }
.d-exos li::before { content: "•"; position: absolute; left: 2px; color: var(--accent2); }
.d-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; font-style: italic; line-height: 1.45; }

/* ---------- Exercices interactifs (tooltip + progression) ---------- */
.d-exos-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.exo { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.exo.todo { border-color: var(--warn); background: rgba(245,158,11,.06); }
.exo-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.exo-nom {
  font-size: 12.5px; color: var(--text); font-weight: 600;
  position: relative; cursor: help; border-bottom: 1px dotted var(--muted);
}
.exo-nom::after {
  content: attr(data-tip);
  position: absolute; left: 0; bottom: calc(100% + 8px);
  width: min(280px, 70vw);
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 9px 11px; font-size: 11.5px; font-weight: 500; line-height: 1.5;
  box-shadow: var(--shadow); z-index: 40;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: .12s;
  pointer-events: none; white-space: normal;
}
.exo-nom:hover::after, .exo-nom:focus::after, .exo-nom:focus-visible::after { opacity: 1; visibility: visible; transform: translateY(0); }
.exo-flag {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; transition: .15s; white-space: nowrap;
}
.exo-flag:hover { border-color: var(--accent); color: var(--accent2); }
.exo.todo .exo-flag { background: var(--warn); border-color: var(--warn); color: #3a2a00; }
.exo-prog { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.exo-prog-t { font-size: 10.5px; color: var(--warn); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.exo-prog ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.exo-prog li { font-size: 12px; color: var(--muted); line-height: 1.4; }
.exo-prog li.cible { color: var(--text); font-weight: 700; }

/* Échelle de progression — la « cordée » : voie d'ascension des variantes. */
.echelle-d { margin-top: 8px; }
.echelle-sum { display: flex; align-items: center; gap: 7px; cursor: pointer; list-style: none; padding: 4px 0; font-size: 12px; color: var(--muted); }
.echelle-sum::-webkit-details-marker { display: none; }
.echelle-lab { font-weight: 600; color: var(--accent2); }
.echelle-cur { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text); text-align: right; }
.echelle-chev { color: var(--muted); font-size: 11px; transition: transform .2s ease; flex: none; }
.echelle-d[open] .echelle-chev { transform: rotate(180deg); }
.echelle-help { font-size: 11.5px; color: var(--muted); line-height: 1.45; margin: 4px 0 10px; }
.echelle-route { position: relative; }
.echelle-route::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 14px; width: 2px; background: var(--line); }
.rung { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: 0; padding: 7px 6px 7px 0; cursor: pointer; color: var(--muted); }
.rung-dot { flex: none; width: 12px; height: 12px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; z-index: 1; transition: .15s; }
.rung-body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rung-nom { font-size: 13px; line-height: 1.35; }
.rung-cue { flex-basis: 100%; font-size: 11px; color: var(--muted); }
.rung-tag { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent2) 20%, transparent); color: var(--accent-text); }
.rung-tag.next { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.rung.acquis .rung-dot { background: var(--accent2); border-color: var(--accent2); }
.rung.acquis .rung-nom { color: var(--accent2); }
.rung.actuel .rung-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.rung.actuel .rung-nom { color: var(--text); font-weight: 700; }
.rung.prochaine .rung-dot { border-color: var(--accent); }
.rung.prochaine .rung-nom { color: var(--text); }
.rung:hover .rung-dot { border-color: var(--accent); }
.rung:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.day-type { font-size: 11px; color: var(--accent2); margin-top: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.chips, .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { background: var(--card2); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* ---------- Macros ---------- */
.macro { margin: 12px 0; }
.macro-bar { height: 10px; border-radius: 999px; background: var(--card2); position: relative; overflow: hidden; }
.macro-bar::after { content: ""; position: absolute; inset: 0; width: var(--pct); background: var(--col); border-radius: 999px; }
.macro-info { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; }
.macro-info span { color: var(--muted); }

/* ---------- Nutrition : aliments & compléments ---------- */
.food-group { margin: 12px 0; }
.food-group-t { font-size: 12px; font-weight: 700; color: var(--accent2); text-transform: uppercase; letter-spacing: .03em; }
.foods { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.food {
  font-size: 12.5px; padding: 6px 11px; border-radius: 999px;
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
}
.food-bad { border-color: rgba(239,68,68,.35); color: #fca5a5; background: rgba(239,68,68,.07); }

.comps { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.comp { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.comp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comp-nom { font-weight: 700; font-size: 14px; }
.comp-dose { font-size: 12.5px; color: var(--accent2); margin: 4px 0; font-weight: 600; }
.comp-pour { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ---------- Modes de suivi nutrition ---------- */
.modes { display: flex; gap: 4px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 6px 0 16px; }
.mode { flex: 1; border: none; background: none; color: var(--muted); font-family: var(--font-mono); font-size: 12px; font-weight: 600; padding: 8px 6px; border-radius: 9px; cursor: pointer; transition: .15s; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.mode:hover { color: var(--text); }
.mode.on { background: var(--accent); color: #fff; box-shadow: 0 1px 6px color-mix(in srgb, var(--accent) 30%, transparent); }

/* Mini-compteur du jour */
.cpt-big { font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.cpt-big-val { font-size: 30px; font-weight: 800; color: var(--text); }
.cpt-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.cpt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cpt-row:last-child { border-bottom: none; }
.cpt-label { font-weight: 600; font-size: 13.5px; }
.cpt-val { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cpt-btns { display: flex; gap: 6px; }
.cpt-btn {
  min-width: 38px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font-size: 15px; font-weight: 700; cursor: pointer; transition: .15s;
}
.cpt-btn:hover { border-color: var(--accent); }
.cpt-btn.plus { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Idées de repas */
.repas-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.repas { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.repas-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.repas-nom { font-weight: 700; font-size: 14px; }
.repas-titre { font-size: 12px; color: var(--accent2); font-weight: 600; }
.repas-items { list-style: none; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.repas-items li { font-size: 12.5px; color: var(--text); padding-left: 14px; position: relative; line-height: 1.45; }
.repas-items li::before { content: "•"; position: absolute; left: 2px; color: var(--accent2); }
.repas-ex { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 8px; line-height: 1.45; }

/* ---------- Nutrition : sous-navigation & journal (R4) ---------- */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.subnav-btn { flex: 1; border: none; background: none; color: var(--muted); font-size: 14px; font-weight: 500; padding: 10px 4px; margin-bottom: -1px; border-bottom: 2px solid transparent; cursor: pointer; text-align: center; transition: color .15s; }
.subnav-btn:hover { color: var(--text); }
.subnav-btn.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
/* Sous-nav à 4 onglets (Profil) : libellés resserrés pour tenir sur mobile */
.subnav-4 .subnav-btn { font-size: 12.5px; padding: 10px 2px; letter-spacing: -.01em; }
/* Roue crantée « Réglages » en haut à droite des pages Séances / Nutrition */
.page-tools { display: flex; justify-content: flex-end; margin: -2px 0 -10px; }
.page-gear { display: inline-flex; align-items: center; justify-content: center; background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 10px; transition: color .15s, background .15s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.page-gear:hover { color: var(--text); background: var(--card2); }
.page-gear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nut-head .page-gear { flex: 0 0 auto; align-self: center; }

.ring-card { display: flex; align-items: center; gap: 16px; }
.ring { width: 104px; height: 104px; flex: none; }
.ring-info .lab { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ring-info .big { font-family: var(--font-disp); font-weight: 800; font-size: 26px; line-height: 1; margin: 3px 0; }
.ring-info .sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.ring-adj { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 10.5px; color: var(--accent); }

.jp { display: flex; align-items: center; gap: 10px; margin: 9px 0; }
.jp-k { font-family: var(--font-mono); font-size: 11px; color: var(--muted); width: 58px; flex: none; text-transform: uppercase; }
.jp-bar { flex: 1; height: 8px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.jp-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.jp-v { font-family: var(--font-mono); font-size: 11px; color: var(--text); width: 56px; text-align: right; flex: none; }

.jlist { display: flex; flex-direction: column; gap: 8px; }
.jitem { display: flex; align-items: center; gap: 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; }
.jitem-info { flex: 1; min-width: 0; }
.jitem-n { font-family: var(--font-disp); font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jitem-q { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 1px; }
.jstep { display: flex; gap: 4px; flex: none; }
.jstep button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 15px; cursor: pointer; }
.jval { text-align: right; flex: none; min-width: 36px; }
.jval b { font-family: var(--font-disp); font-weight: 800; font-size: 16px; color: var(--accent); }
.jval span { font-family: var(--font-mono); font-size: 9px; color: var(--muted); display: block; }
.jx { flex: none; background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 0 2px; }
/* Item avec éditeur de quantité (portion / g / mL / cc / cas / verre) */
.jitem-q2 { display: block; }
.jitem-head { display: flex; align-items: center; gap: 10px; }
.jitem-head .jitem-n { flex: 1; min-width: 0; }
.jqty { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.jqty-b { width: 30px; height: 30px; flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 8px; color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; }
.jqty-n { width: 56px; flex: none; text-align: center; padding: 5px 4px; }
.jqty-u { width: auto; flex: none; max-width: 96px; padding: 5px 6px; }
.jqty-eq { font-family: var(--font-mono); font-size: 10px; color: var(--muted); flex: 1 1 100%; }
.jmanual { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.jmanual input { flex: 1; min-width: 90px; }
.jmanual #jm-kcal { max-width: 80px; flex: 0 0 80px; }

.fc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.fc-add { flex: none; background: var(--accent); color: #fff; border: none; font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 6px 11px; border-radius: 9px; cursor: pointer; }

/* Ajout à la volée (Journal) */
.jadd-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.jadd-row { display: flex; align-items: center; gap: 10px; background: var(--card2); border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; }
.jadd-info { flex: 1; min-width: 0; }
.jadd-n { display: block; font-family: var(--font-disp); font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jadd-q { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 1px; }
.jadd-btn { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; border: none; font-size: 20px; line-height: 1; cursor: pointer; }
.jadd-btn:hover { filter: brightness(1.08); }

/* ---------- Catalogue d'aliments ---------- */
.cat-search { margin: 4px 0 12px; font-size: 15px; }
.cat-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cat-chip {
  font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px;
  background: var(--card2); border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: .15s;
}
.cat-chip:hover { color: var(--text); }
.cat-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat-sort { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.cat-sort select { width: auto; flex: 1; }
.cat-count { font-size: 12px; color: var(--muted); margin: 12px 0 8px; font-weight: 600; }
.food-card { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.fc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fc-nom { font-weight: 700; font-size: 14.5px; }
.fc-kcal { font-weight: 700; font-size: 15px; color: var(--accent2); white-space: nowrap; }
.fc-kcal small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.fc-portion { font-size: 12.5px; color: var(--text); margin-top: 6px; line-height: 1.5; }
.fc-macros { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.fc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Toast ---------- */
/* Placé AU-DESSUS de la nav basse (≥ sa hauteur) pour ne jamais recouvrir Séances/Nutrition.
   pointer-events:none + user-select:none : les touchers passent à la nav, pas de pop-up de sélection
   du navigateur sur le texte du toast (seul le bouton « Annuler » reste cliquable). */
#toast {
  position: fixed; bottom: calc(86px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--good); color: #052e16; padding: 12px 20px; border-radius: 12px;
  font-weight: 700; font-size: 14px; box-shadow: var(--shadow); opacity: 0; transition: .25s; z-index: 35;
  pointer-events: none; user-select: none; -webkit-user-select: none;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px);
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.err { background: var(--bad); color: #fff; }
.toast-undo { pointer-events: auto; flex: none; background: rgba(0,0,0,.18); color: inherit; border: none; border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: 13px; cursor: pointer; touch-action: manipulation; }

/* ---------- Objectif ---------- */
.verdict { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.countdown { font-size: 12px; color: var(--muted); font-weight: 600; }
.verdict-msg { font-size: 14px; line-height: 1.55; margin-bottom: 14px; }
.progress { height: 12px; background: var(--card2); border-radius: 999px; overflow: hidden; margin: 6px 0 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--warn)); border-radius: 999px; transition: width .4s; }
.progress-legend { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.progress-legend small { font-size: 11px; }
.progress-legend .strong { font-size: 18px; font-weight: 700; color: var(--text); }

/* ---------- Quadrant de profil corporel ---------- */
.quadrant-label { font-size: 30px; font-weight: 800; margin: 2px 0 10px; color: var(--text); letter-spacing: -.025em; line-height: .96; }
.qaxes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.qx { font-size: 11px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); }
.qx.hi { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.qx.lo { background: color-mix(in srgb, var(--accent2) 14%, transparent); color: var(--accent2); border-color: color-mix(in srgb, var(--accent2) 30%, transparent); }

/* ---------- Héros Analyse (eyebrow, waypoints, panel) ---------- */
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.hero .verdict-msg { color: var(--muted); margin-bottom: 16px; }
.waypoints { display: flex; gap: 9px; }
.wp { flex: 1; background: color-mix(in srgb, var(--accent2) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent2) 22%, transparent); border-radius: 14px; padding: 11px 12px; }
.wp-k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.wp-v { font-family: var(--font-disp); font-weight: 800; font-size: 26px; margin-top: 4px; line-height: 1; }
.wp-v small { font-size: 12px; color: var(--muted); font-weight: 500; }
.wp.hi { background: var(--accent); border-color: var(--accent); }
.wp.hi .wp-k { color: #fbe2d7; }
.wp.hi .wp-v, .wp.hi .wp-v small { color: #fff; }
.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.panel-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.panel-label h3 { margin: 0; }
.panel-label span { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.hero-stats { display: flex; justify-content: space-between; margin: 12px 2px; }
.hs .k { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hs .v { font-family: var(--font-disp); font-weight: 700; font-size: 17px; margin-top: 2px; }
.btn.full { width: 100%; }
.backlink { background: none; border: none; color: var(--accent2); font-family: var(--font-mono); font-size: 12px; cursor: pointer; padding: 2px 0 2px; align-self: flex-start; }
.backlink:hover { color: var(--text); }

/* ---------- Objectif : versant ---------- */
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 4px; }
.versant { width: 100%; height: auto; display: block; margin: 8px 0 2px; }
.v-alt { font-family: var(--font-mono); font-size: 9.5px; fill: var(--muted); }
.v-here { font-family: var(--font-mono); font-size: 10px; fill: var(--text); }
.v-top { font-family: var(--font-mono); font-size: 9.5px; fill: var(--accent); }

/* ---------- Régularité (barres semaines) ---------- */
.weeks { display: flex; gap: 10px; align-items: flex-end; height: 90px; margin: 14px 0 4px; }
.wbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.wbar-fill { width: 100%; max-width: 44px; background: var(--accent); border-radius: 8px 8px 4px 4px; min-height: 6px; }
.wbar span { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ---------- Jour : date, pied, case à cocher ---------- */
.day-date { font-size: 11.5px; color: var(--accent2); font-weight: 600; margin-bottom: 6px; }
.day-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.check {
  border: 1px solid var(--line); background: var(--card2); color: var(--muted);
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: .15s;
}
.check:hover { border-color: var(--good); color: var(--good); }
.check.ok { background: var(--good); border-color: var(--good); color: #052e16; }
.day.done { border-left-color: var(--good); }
.day.done::after { content: ""; }
.day.today { box-shadow: 0 0 0 2px var(--accent) inset; }

.footer { text-align: center; color: var(--muted); font-size: 11px; padding: 24px 16px 0; max-width: 760px; margin: 0 auto; }

/* ---------- R5 — Desktop : rail latéral + colonne centrée (≥ 900px) ---------- */
@media (min-width: 900px) {
  body { padding-left: 100px; padding-bottom: 28px; }
  .navbar {
    top: 0; bottom: 0; left: 0; transform: none;
    width: 100px; max-width: 100px; height: 100vh;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 22px 0; border-top: none; border-right: 1px solid var(--line);
  }
  .navitem { flex: none; min-height: 0; width: 80px; padding: 12px 0; gap: 4px; font-size: 9.5px; }
  .navitem svg { width: 22px; height: 22px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .topbar > .brand, .container { max-width: 560px; }
  .container { padding-bottom: 28px; } /* rail latéral : plus de nav en bas */
  #contours { top: -50px; left: auto; right: calc(50% - 360px); transform: none; opacity: .55; }
}
@media (min-width: 1300px) {
  .topbar > .brand, .container { max-width: 680px; }
}

/* ---------- Icônes inline (cohérence monoline) ---------- */
.ic { vertical-align: -.18em; flex: none; }
h1 .ic, h2 .ic, h3 .ic, summary .ic { vertical-align: -.12em; margin-right: 3px; }
.hint .ic, .muted .ic, .d-intro .ic, .d-note .ic { vertical-align: -.16em; margin-right: 1px; }
.day-icon .ic, .act-ico .ic { vertical-align: middle; }

/* ---------- Accessibilité : contraste orange en petit texte ---------- */
.eyebrow, .panel-label span, .day-deniv .ch, .jval b { color: var(--accent-text); }
.v-top { fill: var(--accent-text); }

/* ---------- Accessibilité : tailles de texte ≥ 11px ---------- */
.navitem { font-size: 10.5px; }
.metric-label { font-size: 11px; }
.wp-k { font-size: 11px; }
.mw span { font-size: 10.5px; }
.jitem-q, .jadd-q { font-size: 11px; }
.day-deniv .lab { font-size: 10.5px; }
.badge { font-size: 11px; }
.cat-cats .cat-chip { font-size: 11px; }

/* ---------- Accessibilité : cibles tactiles ≥ ~40px ---------- */
.jstep button { width: 38px; height: 38px; }
.jadd-btn { width: 40px; height: 40px; }
.jx { padding: 9px 6px; }
.profil-mini { padding: 9px 11px; font-size: 15px; }
.fc-add { padding: 9px 13px; }
.link-del { padding: 8px 4px; }

/* ---------- Accessibilité : focus clavier sur les boutons d'action ---------- */
.set:focus-visible, .feel-btn:focus-visible, .mode:focus-visible, .subnav-btn:focus-visible,
.cat-chip:focus-visible, .jadd-btn:focus-visible, .jstep button:focus-visible, .check:focus-visible,
.fc-add:focus-visible, .act-chip:focus-visible, .profil-mini:focus-visible, .cpt-btn:focus-visible,
.btn:focus-visible, .jx:focus-visible, .data-set:focus-visible, .step-row:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- En-tête : éviter le retour à la ligne sur petit écran ---------- */
.brand > div { min-width: 0; flex: 1 1 auto; }
.brand h1 { white-space: nowrap; line-height: 1.05; }
.brand p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) {
  .brand h1 { font-size: 17px; }
  .pb-select { max-width: 96px; font-size: 12px; padding: 6px 8px; }
}

/* ---------- Sélecteur de thème ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 7px; background: var(--card2); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 6px; cursor: pointer; }
.theme-opt.on { border-color: var(--accent); }
.theme-sw { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: flex-end; justify-content: flex-end; padding: 6px; border: 1px solid var(--line); }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; }
.theme-nom { font-family: var(--font-disp); font-weight: 700; font-size: 12.5px; color: var(--text); }
.theme-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Carte Synchronisation (Supabase) ---------- */
.sync-state { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin: 6px 0 12px; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.sync-dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
code.mono { font-family: var(--font-mono); font-size: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text); padding: 1px 6px; border-radius: 6px; }
.btn.link-del { color: var(--bad); opacity: .9; }

/* ---------- Écran de connexion (compte) ---------- */
.auth { padding: 24px 6px 30px; max-width: 380px; margin: 0 auto; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .eyebrow { display: block; }
.logo-xl { display: inline-block; width: 54px; height: 54px; margin-bottom: 10px; }
.logo-xl svg { width: 100%; height: 100%; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.auth-form input { font-family: var(--font-body); font-size: 15px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card2); color: var(--text); text-transform: none; letter-spacing: 0; }
.auth-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.auth-form .btn.primary { margin-top: 8px; width: 100%; }
.auth-switch { display: block; width: 100%; margin-top: 18px; background: none; border: none; color: var(--accent-text); font-size: 13.5px; cursor: pointer; text-align: center; padding: 8px; }
.auth-switch:hover { text-decoration: underline; }
.pb-mail { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) { .pb-mail { max-width: 96px; } }

/* ---------- Portions du jour (idées de repas) ---------- */
.jour-portions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; }
.jp-t { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.jp-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); font-size: 13px; color: var(--text); }
.jp-chip strong { font-family: var(--font-disp); font-size: 15px; color: var(--accent-text); }
.jp-chip span { font-size: 11px; color: var(--muted); }

/* ---------- Cibles santé suggérées (objectif par mensurations) ---------- */
.cible-row { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.cible-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.cible-k { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-disp); font-weight: 700; font-size: 14px; color: var(--text); }
.cible-v { font-family: var(--font-mono); font-size: 17px; color: var(--muted); }
.cible-v strong { color: var(--accent-text); }
.cible-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cible-row .btn { margin-top: 10px; width: 100%; }

/* ======================================================================
   Refonte UX Nutrition & Séances
   ====================================================================== */

/* --- Primitive ProgressBar unifiée (jauge consommé / cible) --- */
.bar { height: 8px; border-radius: 999px; background: var(--card2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .35s ease; }
.bar.over > i { background: var(--bad); }
.jauge { margin-top: var(--space-3); }
.jauge:first-child { margin-top: var(--space-4); }
.jauge-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-1); gap: var(--space-2); }
.jauge-k { font-family: var(--font-disp); font-weight: 700; font-size: 13px; color: var(--text); }
.jauge-v { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.jauge.over .jauge-v { color: var(--bad); }

/* --- Utilitaires de mise en page --- */
.row.between { justify-content: space-between; align-items: center; }

/* --- Journal nutrition compacté --- */
.jmanual-d { margin-top: var(--space-3); }
.jmanual-d > summary { cursor: pointer; font-size: 12.5px; color: var(--accent-text); list-style: none; padding: var(--space-1) 0; }
.jmanual-d > summary::-webkit-details-marker { display: none; }
.jmanual-d > summary::before { content: "+ "; }
.jmanual-d[open] > summary::before { content: "− "; }

/* --- Itinéraire Séances : jours repliables --- */
details.day { padding: 0; }
details.day > summary.day-sum { list-style: none; cursor: pointer; padding: var(--space-4) var(--space-4) var(--space-3); }
details.day > summary.day-sum::-webkit-details-marker { display: none; }
details.day > .day-detail, details.day > .day-foot { padding: 0 var(--space-4) var(--space-4); }
details.day[open] > summary.day-sum { padding-bottom: var(--space-2); }
.day-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: 0; }
.day-chev { color: var(--muted); font-size: 12px; transition: transform .2s ease; flex: none; }
details.day[open] .day-chev { transform: rotate(180deg); }
.day-ok { color: var(--good); font-weight: 800; margin-left: var(--space-1); }

/* ======================================================================
   E1 — Bouton action rapide (FAB) + panneau bas + overlay d'ajout
   ====================================================================== */
.fab {
  position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 38; width: 56px; height: 56px; border-radius: 18px; border: none;
  background: var(--accent); color: #fff; box-shadow: var(--shadow);
  display: grid; place-items: center; cursor: pointer; transition: transform .18s ease, filter .15s;
}
.fab:hover { filter: brightness(1.06); }
.fab:active { transform: scale(.94); }
.fab .ic { stroke: currentColor; }
.fab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.fab-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 36; }
.fab-sheet {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 37;
  width: calc(100% - 24px); max-width: 440px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: var(--space-3); box-shadow: var(--shadow); animation: fabSheetUp .18s ease;
}
@keyframes fabSheetUp { from { transform: translate(-50%, 14px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.fab-sheet-h { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 2px 4px var(--space-2); }
.fab-act {
  display: flex; align-items: center; gap: var(--space-3); width: 100%;
  padding: 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font-family: var(--font-disp);
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: var(--space-2); text-align: left;
}
.fab-act:first-of-type { margin-top: 0; }
.fab-act .ic { color: var(--accent); flex: none; }
.fab-act:hover { border-color: var(--accent); }
.fab-act.off { opacity: .5; cursor: default; }
.fab-act.off .ic { color: var(--muted); }

/* Overlay d'ajout rapide d'aliment (par-dessus l'écran courant) */
.ov-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
.ov-card {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 41;
  width: calc(100% - 24px); max-width: 460px; max-height: 82vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: var(--space-4); box-shadow: var(--shadow);
}
.cordee-panel {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 41;
  width: calc(100% - 24px); max-width: 460px; max-height: 86vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.cordee-panel-h { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; z-index: 1; }
.cordee-panel-h > span { display: inline-flex; align-items: center; gap: 8px; }
.cordee-panel-body { padding: 6px 2px 10px; }
.cordee-panel-body .card { border: 0; box-shadow: none; background: transparent; padding: 12px 16px; }

/* ======================================================================
   E2 — Parcours découverte (bienvenue + check-list de mise en route)
   ====================================================================== */
.wel .wel-row { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2) 0; }
.wel .wel-row + .wel-row { border-top: 1px solid var(--line); }
.wel-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.wel-ic .ic { color: var(--accent); }
.wel .wel-row strong { font-family: var(--font-disp); font-size: 15px; }
.wel .wel-row p { margin: 2px 0 0; font-size: 13px; }
.wel .btn.full { margin-top: var(--space-4); }

/* OBJ1 — Assistant de mise en route (objectif typé) */
.setup { text-align: left; max-width: 460px; }
.stp-head { display: flex; align-items: center; gap: 12px; margin-bottom: var(--space-4); }
.stp-step { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.stp-q { font-family: var(--font-disp); font-weight: 800; font-size: 26px; line-height: 1.18; letter-spacing: -.01em; margin-bottom: var(--space-4); color: var(--text); }
.sexe2 { display: flex; gap: 12px; }
.sexe-c { flex: 1; min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; }
.sexe-c .ic { color: var(--muted); }
.sexe-c.sel { border-color: var(--accent); background: var(--card2); }
.sexe-c.sel .ic { color: var(--accent-text); }
.obj-list { display: flex; flex-direction: column; gap: 10px; }
.obj-c { display: flex; align-items: center; gap: 13px; text-align: left; min-height: 56px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; color: var(--text); cursor: pointer; }
.obj-c .ic { color: var(--muted); flex: none; }
.obj-c b { font-size: 15px; font-weight: 600; display: block; }
.obj-c small { font-size: 12px; color: var(--muted); }
.obj-c.sel { border-color: var(--accent); background: var(--card2); }
.obj-c.sel .ic { color: var(--accent-text); }
.stp-field { display: block; }
.stp-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card2); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); color: var(--accent-text); border-radius: 999px; padding: 6px 12px; font-family: var(--font-mono); font-size: 11px; margin-bottom: var(--space-3); }
.stp-chip .ic { color: var(--accent-text); }
.stp-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); margin-bottom: var(--space-3); color: var(--muted); font-size: 14px; }
.stp-row strong { color: var(--text); font-family: var(--font-mono); }
/* OBJ2 — auto-évaluation capacité (chips) */
.cap-row { padding: 11px 0; border-top: 1px solid var(--line); }
.cap-row:first-of-type { border-top: none; }
.cap-lab { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.cap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cap-chip { border: 1px solid var(--line); background: var(--card2); color: var(--text); border-radius: 999px; padding: 8px 13px; font-size: 13px; min-height: 38px; cursor: pointer; touch-action: manipulation; }
.cap-chip:hover { border-color: var(--accent2); }
.cap-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
/* Accueil — grille bento (tuiles de tailles variables) */
.bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; grid-auto-flow: row dense; }
.bento > .card { grid-column: span 2; border-radius: 16px; margin: 0; }
.bento > .sq { grid-column: span 1; }
.ac-sq { display: flex; flex-direction: column; gap: 7px; }
.ac-sq-n { font-family: var(--font-disp); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -.01em; }
.ac-sq-n span { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.hero-elan { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.he-n { font-family: var(--font-disp); font-weight: 800; font-size: 16px; white-space: nowrap; }
.he-bar { flex: 1; height: 7px; border-radius: 999px; background: var(--ring-track); overflow: hidden; }
.he-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.he-s { font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Accueil — tableau de bord du jour */
.ac-hero-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ac-salut { font-family: var(--font-disp); font-weight: 800; font-size: 27px; line-height: 1.05; margin: 2px 0 0; }
.ac-cairn { flex: none; }
.ac-cairn svg { width: 42px; height: 56px; }
.rit-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.rit-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--card2); }
.rit-chip.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.rit-chip .ic { color: var(--muted); }
.ac-card .eyebrow { margin-bottom: 10px; }
.ac-seance { display: flex; align-items: center; gap: 12px; }
.ac-seance-i { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--card2); display: flex; align-items: center; justify-content: center; color: var(--accent-text); }
.ac-seance-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ac-seance-t strong { font-size: 15px; }
.ac-seance-t span { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.ac-seance .btn, .ac-pas .btn { flex: none; width: auto; white-space: nowrap; }
.ac-cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; cursor: pointer; }
.ac-cap strong { font-size: 15px; }
.ac-cap-sub { color: var(--accent-text); font-family: var(--font-mono); font-size: 13px; }
.ac-chev { font-size: 24px; color: var(--muted); line-height: 1; flex: none; }
.ac-pas { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ac-pas-lab { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.ac-pas strong { font-size: 15px; }
.ac-pas .btn { flex: none; }
/* En-tête — chip compte/réglages */
.pb-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 168px; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px 5px 9px; color: var(--muted); cursor: pointer; touch-action: manipulation; }
.pb-chip:hover, .pb-chip.on { border-color: var(--accent2); color: var(--text); }
.pb-chip .pb-mail { font-size: 11px; font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-chip .ic { flex: none; }
.pb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.pb-cordee { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; color: var(--accent2); cursor: pointer; touch-action: manipulation; }
.pb-cordee:hover, .pb-cordee.on { border-color: var(--accent2); color: var(--text); }
/* Profil — zones repliables */
.prof-group { border: 1px solid var(--line); border-radius: 14px; background: var(--card); margin-bottom: var(--space-3); overflow: hidden; }
.prof-group > summary { cursor: pointer; padding: 14px 16px; font-family: var(--font-disp); font-weight: 700; font-size: 15px; list-style: none; user-select: none; display: flex; align-items: center; gap: 9px; }
.prof-group > summary::-webkit-details-marker { display: none; }
.prof-group > summary::after { content: "▸"; margin-left: auto; color: var(--accent2); font-size: 13px; }
.prof-group[open] > summary::after { content: "▾"; }
.prof-group > summary .ic { color: var(--accent-text); }
.prof-group-body { padding: 0 12px 6px; }
.prof-group-body > .card { margin-bottom: var(--space-3); }
/* SEANCE-LIBRE — formulaire « séance réalisée / remplacement » */
.lib-card { width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.lib-acts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.lib-act { position: relative; display: inline-flex; align-items: center; gap: 5px; background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer; touch-action: manipulation; }
.lib-act.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.lib-repli { font-family: var(--font-mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: .04em; background: color-mix(in srgb, var(--accent2) 26%, transparent); color: var(--accent2); padding: 1px 5px; border-radius: 6px; }
.lib-act.on .lib-repli { background: rgba(255,255,255,.22); color: #fff; }
.lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lib-grid label, .lib-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.lib-field { margin-top: 8px; }
.lib-grid input, .lib-field input { font-size: 15px; }
.lib-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-segb { flex: 1 1 auto; min-width: 70px; background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 8px; font-size: 13px; cursor: pointer; touch-action: manipulation; }
.lib-segb.on { background: var(--card2); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.lib-feel-lab { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.lib-feel { margin-bottom: 6px; }
.day-remp { font-size: 11px; color: var(--accent-text); font-family: var(--font-mono); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.day-remp .ic { color: var(--accent-text); }
.check.alt { background: none; border: 1px solid var(--line); color: var(--muted); }
.check.alt:hover { border-color: var(--accent2); color: var(--text); }
/* Allègement mensuration — titres de cadence */
.mes-cad { display: flex; align-items: center; gap: 7px; margin: 16px 0 4px; font-size: 13px; font-family: var(--font-mono); font-weight: 600; color: var(--accent2); text-transform: uppercase; letter-spacing: .04em; }
.mes-cad .ic { color: var(--accent2); }
/* COACH2 — choix de discipline (course/trail) dans l'assistant */
.evt-types { display: flex; flex-wrap: wrap; gap: 8px; }
.stp-chip-btn { flex: 1 1 28%; min-width: 92px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 0 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; touch-action: manipulation; }
.stp-chip-btn .ic { color: var(--muted); flex: none; }
.stp-chip-btn.sel { border-color: var(--accent); background: var(--card2); }
.stp-chip-btn.sel .ic { color: var(--accent-text); }
/* OBJ3 — carte profil athlète */
.pa-line { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 14px; color: var(--text); }
.pa-line .ic { color: var(--muted); flex: none; }
.pa-prud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pa-tag { display: inline-flex; align-items: center; gap: 5px; background: color-mix(in srgb, var(--warn) 16%, var(--card2)); color: var(--warn); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-family: var(--font-mono); }
.pa-tag .ic { color: var(--warn); }

.ob-card { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); }
.ob-step { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.ob-step:first-of-type { border-top: none; }
.ob-check { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); color: var(--muted); font-weight: 800; border: 1px solid var(--line); }
.ob-step.ok .ob-check { background: var(--good); color: #fff; border-color: var(--good); }
.ob-check .ic { color: var(--accent); }
.ob-txt { flex: 1; min-width: 0; }
.ob-txt strong { display: block; font-family: var(--font-disp); font-size: 14px; }
.ob-txt span { font-size: 12px; color: var(--muted); }
.ob-step.ok .ob-txt strong { color: var(--muted); text-decoration: line-through; }
.ob-btn { flex: none; padding: 8px 14px; }

/* ======================================================================
   Visite guidée (surbrillance + infobulles)
   ====================================================================== */
.tour-block { position: fixed; inset: 0; z-index: 59; }
.tour-spot {
  position: fixed; z-index: 60; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.62), 0 0 0 2px var(--accent) inset;
  transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
}
.tour-tip {
  position: fixed; z-index: 61; left: 12px; right: 12px; max-width: 440px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: var(--space-4); box-shadow: var(--shadow);
}
.tour-step { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }
.tour-tip h3 { font-family: var(--font-disp); font-size: 17px; margin: 4px 0 6px; }
.tour-tip p { font-size: 14px; color: var(--muted); margin: 0 0 var(--space-3); line-height: 1.45; }
.tour-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.tour-btns { display: flex; gap: var(--space-2); }
.tour-skip { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px 4px; }

/* ======================================================================
   Minuteurs de séance (T1-T5) — barre de minuteur + bouton maintien
   ====================================================================== */
.tmr {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 45;
  width: 100%; max-width: 460px; padding: 10px 14px;
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -10px 28px rgba(0,0,0,.22);
}
.tmr-bar { height: 6px; border-radius: 999px; background: var(--card2); overflow: hidden; margin-bottom: var(--space-2); }
.tmr-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s linear; }
.tmr-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.tmr-info { display: flex; flex-direction: column; min-width: 0; }
.tmr-lab { font-family: var(--font-disp); font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.tmr-time { font-family: var(--font-mono); font-size: 24px; font-weight: 600; line-height: 1.05; color: var(--accent-text); }
.tmr-btns { display: flex; gap: 6px; flex: none; }
.tmr-b { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font-size: 14px; cursor: pointer; }
.tmr-b:hover { border-color: var(--accent); }
.tmr-b.stop { color: var(--bad); }
.tmr-effort .tmr-bar > i { background: var(--bad); }
.tmr-repos .tmr-bar > i { background: var(--good); }
.tmr-hold .tmr-bar > i { background: var(--accent2); }
.tmr-prep .tmr-bar > i { background: var(--warn); }

.hold-btn {
  margin-left: auto; background: var(--card2); border: 1px solid var(--line); color: var(--accent-text);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.hold-btn:hover { border-color: var(--accent); }

/* ---------- Petits détails : toast undo, spinner, jours ---------- */
#toast { bottom: calc(84px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; }
.toast-undo { background: rgba(0,0,0,.2); border: none; color: inherit; border-radius: 8px; padding: 5px 12px; font-size: 13px; font-weight: 800; cursor: pointer; flex: none; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Rappels in-app (N1) ---------- */
.rappels-card { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.rappel-due { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-top: 1px solid var(--line); }
.rappel-due:first-of-type { border-top: none; }
.rappel-due span { font-size: 13.5px; min-width: 0; }
.rappel-due .btn { flex: none; padding: 6px 14px; }
.rappel-set { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.rappel-set:first-of-type { border-top: none; }
.rappel-tog { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; min-width: 0; }
.rappel-tog input { width: auto; flex: none; }
.rappel-set input[type="time"], .rappel-set select { width: auto; flex: none; max-width: 120px; }

/* ====== NUT-UI — refonte nutrition coach (Aujourd'hui / Suivi) ====== */
.nut-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.nut-head .subnav { border-bottom: none; margin-bottom: 0; flex: 1; }
.nut-units { display: flex; gap: 6px; padding-bottom: 6px; }
.nut-unit { border: 1px solid var(--line); background: none; color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 5px 10px; border-radius: 8px; cursor: pointer; transition: .15s; }
.nut-unit:hover { color: var(--text); border-color: var(--accent2); }
.nut-unit.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.coach-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.coach-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; flex: none; }
.coach-score-n { font-family: var(--font-disp); font-weight: 800; font-size: 26px; }
.coach-score-g { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 2px; }
.score-d { margin-top: var(--space-3); }
.score-d > summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
.score-d > summary::-webkit-details-marker { display: none; }
.score-d > summary::before { content: "› "; }
.score-d[open] > summary::before { content: "⌄ "; }
.score-body { margin-top: var(--space-2); display: flex; flex-direction: column; gap: 8px; }
.score-row { display: flex; align-items: center; gap: 10px; }
.score-lab { flex: 0 0 38%; font-size: 13px; }
.score-bar { flex: 1; height: 6px; background: rgba(141,184,173,.2); border-radius: 4px; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--accent2); border-radius: 4px; }
.score-pts { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--muted); min-width: 34px; text-align: right; }
.coach-line { font-family: var(--font-disp); font-size: 19px; line-height: 1.34; font-weight: 600; letter-spacing: -.01em; margin: 4px 0 0; }
.coach-step { display: flex; align-items: center; gap: 11px; margin-top: var(--space-3); background: var(--card2); border-radius: 14px; padding: 11px 13px; }
.coach-step .ic { color: var(--accent); flex: none; }
.coach-step-lab { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.coach-step-act { display: block; font-size: 14px; }
.macros-d > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 9px 0 2px; list-style: none; }
.macros-d > summary::-webkit-details-marker { display: none; }
.macros-d > summary::before { content: "› "; }
.macros-d[open] > summary::before { content: "⌄ "; }
.nut-disc { border: 1px solid var(--line); border-radius: 14px; background: var(--card); margin-top: var(--space-3); }
.nut-disc > summary { cursor: pointer; list-style: none; padding: 14px 16px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.nut-disc > summary::-webkit-details-marker { display: none; }
.nut-disc > summary .ic { color: var(--muted); }
.nut-disc > summary::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 18px; }
.nut-disc[open] > summary::after { content: "⌄"; }
.nut-disc-body { padding: 0 10px 10px; }
.nut-disc-body > .card { margin-top: 8px; background: var(--card2); }
.jalons { display: flex; flex-direction: column; gap: 8px; }
.jalon { display: flex; align-items: center; gap: 9px; background: var(--card2); border-radius: 11px; padding: 10px 12px; font-size: 14px; }
.jalon .ic { color: var(--accent); flex: none; }
.warn-hint { color: var(--warn); border-left: 2px solid var(--warn); padding-left: 8px; }
.danger-hint { color: var(--bad); border-left: 2px solid var(--bad); padding-left: 8px; }
.danger-hint .ic { color: var(--bad); }
.warn-card { border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); }
.cycle-phase { background: var(--card2); border-radius: 12px; padding: 11px 13px; margin-top: var(--space-3); }
.cycle-phase strong { display: inline-flex; align-items: center; gap: 6px; }
.serie-card { text-align: center; }
.serie-flame { color: var(--accent); display: flex; justify-content: center; }
.serie-big { font-family: var(--font-disp); font-weight: 800; font-size: 40px; line-height: 1.05; margin-top: 4px; }
.serie-big span { font-family: var(--font-mono); font-size: 14px; color: var(--muted); font-weight: 400; }
.serie-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.defi-card.fait { border: 1px solid color-mix(in srgb, var(--good) 45%, var(--line)); }
.defi-card.fait .bar i { background: var(--good); }
.badges-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.badge-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); text-align: center; opacity: .4; filter: grayscale(1); }
.badge-card .ic { color: var(--muted); }
.badge-card span { font-size: 10px; line-height: 1.15; color: var(--muted); }
.badge-card.on { opacity: 1; filter: none; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.badge-card.on .ic { color: var(--accent); }
.badge-card.on span { color: var(--text); }
.top-foods-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.top-food { flex: 0 0 auto; min-width: 122px; max-width: 152px; text-align: left; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: border-color .15s; }
.top-food:hover { border-color: var(--accent2); }
.top-food-n { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-food-s { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.suivi-courbe { margin: var(--space-2) 0; }
.suivi-stats { display: flex; gap: 9px; }
.suivi-stat { flex: 1; background: var(--card2); border-radius: 13px; padding: 11px 12px; }
.suivi-stat-l { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.suivi-stat-v { font-family: var(--font-disp); font-weight: 600; font-size: 20px; line-height: 1.2; }
.suivi-stat-v span { font-family: var(--font-mono); font-size: 10px; color: var(--muted); font-weight: 400; }
.suivi-jour { display: flex; justify-content: space-between; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); }
.suivi-jour-d { font-size: 14px; text-transform: capitalize; }
.suivi-jour-m { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.suivi-jour-k { font-family: var(--font-mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
