/* Muscu — feuille de style, pensée d'abord pour le téléphone.
   Couleurs claires par défaut, sombres si le téléphone est en mode sombre. */

:root {
  color-scheme: light;
  --fond: #f1f0eb;
  --surface: #fcfcfb;
  --surface-2: #ecebe5;
  --surface-3: #e0dfd8;
  --trait: #dcdad2;
  --axe: #c3c2b7;
  --encre: #0b0b0b;
  --encre-2: #52514e;
  --encre-3: #6c6a64;
  --primaire: #12130e;
  --primaire-encre: #d8f54a;
  --accent: #c8f031;
  --accent-encre: #12130e;
  --progres: #c8f031;
  --focus: #12130e;
  --succes: #006300;
  --danger: #b3261e;
  --danger-encre: #ffffff;
  --alerte: #fab219;
  --knurl: rgba(11, 11, 11, 0.075);
  --voile: rgba(11, 11, 11, 0.45);
  --ombre: 0 1px 2px rgba(11, 11, 11, 0.05), 0 8px 24px -16px rgba(11, 11, 11, 0.35);

  /* Une couleur par muscle (palette vérifiée pour le daltonisme, dans cet ordre) */
  --serie-0: #898781;
  --serie-1: #2a78d6;
  --serie-2: #eb6834;
  --serie-3: #1baf7a;
  --serie-4: #eda100;
  --serie-5: #e87ba4;
  --serie-6: #008300;
  --serie-7: #6250d6;
  --serie-8: #e34948;

  --rayon: 16px;
  --titre: "Bahnschrift", "sans-serif-condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --nav-h: 66px;
  --bas: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fond: #0d0d0c;
    --surface: #1a1a19;
    --surface-2: #252523;
    --surface-3: #31312e;
    --trait: #2f2f2c;
    --axe: #45453f;
    --encre: #f0efec;
    --encre-2: #c3c2b7;
    --encre-3: #9a988f;
    --primaire: #d4f53c;
    --primaire-encre: #12130e;
    --progres: #7e9c12;
    --focus: #d4f53c;
    --succes: #0ca30c;
    --danger: #ff8a80;
    --danger-encre: #2a0705;
    --knurl: rgba(255, 255, 255, 0.06);
    --voile: rgba(0, 0, 0, 0.62);
    --ombre: 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 30px -18px rgba(0, 0, 0, 0.9);
    --serie-1: #3987e5;
    --serie-2: #d95926;
    --serie-3: #199e70;
    --serie-4: #c98500;
    --serie-5: #d55181;
    --serie-6: #008300;
    --serie-7: #9085e9;
    --serie-8: #e66767;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 16px/1.45 var(--texte);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
main {
  max-width: 640px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 14px calc(var(--bas) + 100px);
  outline: none;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- En-têtes (avec un motif de moletage, comme la poignée d'une barre) ---------- */

.entete {
  position: relative;
  margin: 0 -14px 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 18px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--trait);
  overflow: hidden;
}
.entete::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 48%;
  background:
    repeating-linear-gradient(45deg, var(--knurl) 0 1.5px, transparent 1.5px 7px),
    repeating-linear-gradient(-45deg, var(--knurl) 0 1.5px, transparent 1.5px 7px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%);
  mask-image: linear-gradient(90deg, transparent, #000 70%);
  pointer-events: none;
}
.entete-ligne {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.entete h1 {
  font: 700 34px/1 var(--titre);
  font-stretch: 85%;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.surtitre {
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 650;
  color: var(--encre-2);
}
.retour {
  position: relative;
  z-index: 1;
  min-height: 34px;
  margin: -6px 0 8px -4px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-weight: 700;
  color: var(--encre-2);
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--trait);
  border-radius: 12px;
  background: var(--surface);
  color: var(--encre);
  font-size: 15.5px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-primaire { background: var(--primaire); border-color: var(--primaire); color: var(--primaire-encre); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-encre); }
.btn-discret { background: transparent; border-color: transparent; color: var(--encre-2); }
.btn-danger-discret { background: transparent; border-color: transparent; color: var(--danger); }
.btn-large { display: flex; width: 100%; margin: 12px 0; }
.btn-petit { min-height: 38px; padding: 6px 12px; border-radius: 10px; font-size: 14px; }
.btn-lien {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--encre-2);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-geant {
  width: 100%;
  min-height: 78px;
  border-radius: 18px;
  font: 700 23px/1 var(--titre);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--ombre);
}
.btn-geant svg { width: 30px; height: 30px; }
.btn-icone {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--trait);
  border-radius: 50%;
  background: var(--surface);
  font-size: 24px;
  line-height: 1;
}
.btn-icone:disabled { opacity: 0.3; }
.btn-ajouter {
  width: 100%;
  min-height: 60px;
  margin-top: 12px;
  border: 2px dashed var(--axe);
  background: transparent;
  font: 700 18px/1 var(--titre);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Cartes, chiffres ---------- */

.carte {
  display: block;
  margin: 12px 0;
  padding: 16px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
  text-decoration: none;
}
.carte-lien:active { transform: scale(0.995); }
.carte-titre {
  margin-bottom: 12px;
  font: 700 19px/1.2 var(--titre);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.carte-surtitre { font-size: 13px; font-weight: 650; color: var(--encre-2); }
.carte-sous-titre { margin: -6px 0 12px; font-size: 13px; color: var(--encre-3); }
.chiffre-moyen { margin-top: 4px; font: 700 32px/1.1 var(--titre); }
.chiffre-heros { margin: 6px 0 8px; font: 700 56px/1 var(--titre); letter-spacing: -0.01em; }
.chiffre-moyen small, .chiffre-heros small { font-size: 0.48em; font-weight: 600; color: var(--encre-2); }
.espace-haut { margin-top: 14px; }
.sous-titre {
  margin: 18px 0 10px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--encre-2);
}
.sous-titre:first-child { margin-top: 0; }
.vide { padding: 22px 8px; text-align: center; color: var(--encre-3); }
.vide-petit { padding: 2px 2px 6px; font-size: 14px; color: var(--encre-3); }
.aide { font-size: 13px; color: var(--encre-3); }
.pastille { display: inline-block; flex: none; width: 11px; height: 11px; border-radius: 3px; }
.badge {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--trait);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--encre);
  white-space: nowrap;
}
.mention { font-size: 12.5px; color: var(--encre-3); }
.liste-muscles { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 14px; font-weight: 600; }
.liste-muscles span { display: inline-flex; align-items: center; gap: 6px; }

/* Rappel de sauvegarde */
.rappel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--alerte) 50%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--alerte) 15%, var(--surface));
  font-size: 14px;
}
.rappel .btn { flex: none; }

/* ---------- Écran Séance : accueil ---------- */

.demarrer { display: grid; gap: 6px; margin: 4px 0 10px; }

/* ---------- Écran Séance : saisie ---------- */

.date-seance {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  font: 700 23px/1.12 var(--titre);
  cursor: pointer;
}
.date-seance input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.date-modifier {
  font: 600 13px var(--texte);
  color: var(--encre-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.total-seance { flex: none; text-align: right; }
.total-seance span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--encre-2);
}
.total-seance strong { font: 700 40px/1 var(--titre); font-variant-numeric: tabular-nums; }
.total-seance small { margin-left: 3px; font-size: 15px; font-weight: 700; color: var(--encre-2); }

.exercices { display: grid; gap: 12px; }
.exo {
  position: relative;
  overflow: hidden;
  padding: 12px 10px 10px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
  scroll-margin-top: 12px;
}
.exo::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 5px;
  background: var(--c);
}
.exo-tete { display: flex; justify-content: space-between; gap: 10px; padding: 0 4px 0 8px; }
.exo-titre { min-width: 0; }
.exo-titre h3 { font: 700 21px/1.1 var(--titre); }
.exo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--encre-2);
}
.exo-chiffres { flex: none; text-align: right; }
.exo-chiffres strong { font: 700 24px/1 var(--titre); font-variant-numeric: tabular-nums; }
.exo-chiffres span { margin-left: 3px; font-size: 13px; color: var(--encre-2); }
.exo-chiffres small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--encre-2); }
.exo.termine .exo-chiffres small { color: var(--succes); font-weight: 700; }
.exo-note {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: calc(100% - 8px);
  margin: 9px 0 0 8px;
  padding: 7px 10px;
  border: 1px dashed var(--axe);
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  text-align: left;
  color: var(--encre-2);
}
.exo-avant { margin: 7px 4px 0 8px; font-size: 13px; color: var(--encre-3); }

.series { display: grid; gap: 4px; margin-top: 10px; }
.series-titres, .serie {
  display: grid;
  grid-template-columns: 20px minmax(0, 1.3fr) minmax(0, 1fr) 48px;
  align-items: center;
  gap: 6px;
}
.series-titres {
  padding: 0 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--encre-3);
}
.series-titres span:nth-child(2), .series-titres span:nth-child(3) { text-align: center; }
.serie { padding: 4px; border-radius: 12px; transition: background-color 0.2s; }
.serie.faite { background: color-mix(in srgb, var(--c) 17%, transparent); }
.serie-num { font: 700 17px var(--titre); text-align: center; color: var(--encre-3); }
.serie.faite .serie-num { color: var(--encre); }

/* Champ avec boutons − / + */
.pas {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--trait);
  border-radius: 12px;
  background: var(--surface-2);
}
.pas button {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: var(--encre-2);
}
.pas button:active { background: var(--surface-3); }
.pas input, .pas output {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: 700 20px/1 var(--titre);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.pas input:focus { outline: none; background: var(--surface); }

.coche {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--trait);
  border-radius: 50%;
  background: var(--surface);
  color: var(--encre-3);
  transition: transform 0.12s, background-color 0.15s;
}
.coche svg { width: 24px; height: 24px; }
.coche[aria-pressed="true"] { border-color: var(--primaire); background: var(--primaire); color: var(--primaire-encre); }
.coche:active { transform: scale(0.9); }

.exo-actions { display: flex; gap: 8px; margin-top: 10px; padding-left: 8px; }
.exo-actions .btn-discret { margin-left: auto; }

/* Liste des machines à ajouter (fenêtre du bas) */
.choix-liste { display: grid; gap: 8px; }
.choix {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  min-height: 60px;
  overflow: hidden;
  padding: 11px 14px 11px 18px;
  border: 1px solid var(--trait);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}
.choix::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 5px; background: var(--c); }
.choix:active { background: var(--surface-2); }
.choix-nom { font: 700 18px/1.15 var(--titre); }
.choix-info { font-size: 13.5px; color: var(--encre-2); }
.choix-date {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  max-width: 8em;
  font-size: 12px;
  line-height: 1.3;
  text-align: right;
  color: var(--encre-3);
}
.choix[data-deja] { opacity: 0.55; }

/* ---------- Résumés : barres par muscle, tableaux ---------- */

.barres-muscles { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.barres-muscles li {
  display: grid;
  grid-template-columns: minmax(0, 8.5em) 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
}
.bm-nom { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bm-nom span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-barre { height: 12px; overflow: hidden; border-radius: 0 4px 4px 0; background: var(--surface-2); }
.bm-barre span { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; }
.bm-val { min-width: 4.5em; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.bm-zero .bm-nom, .bm-zero .bm-val { color: var(--encre-3); font-weight: 500; }

.tableau { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tableau th, .tableau td {
  padding: 9px 4px;
  border-bottom: 1px solid var(--trait);
  text-align: left;
  vertical-align: middle;
}
.tableau thead th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--encre-3);
}
.tableau .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tableau tfoot th, .tableau tfoot td { padding-top: 12px; border-bottom: 0; font-weight: 800; }
.cellule-nom { display: flex; align-items: center; gap: 7px; }

/* ---------- Écran Résumés ---------- */

.segment {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--trait);
  border-radius: 14px;
  background: var(--surface-2);
}
.segment button, .segment label > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 4px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 700;
  text-align: center;
  color: var(--encre-2);
}
.segment label { position: relative; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment button.actif, .segment input:checked + span {
  background: var(--surface);
  color: var(--encre);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}
.segment input:focus-visible + span { outline: 2px solid var(--focus); }

.periode {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
}
.periode h2 { font: 700 18px/1.2 var(--titre); text-align: center; }
.delta { font-size: 14px; color: var(--encre-2); }
.delta strong { font-weight: 800; color: var(--encre); }
.delta-hausse strong { color: var(--succes); }

.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puces-defilantes {
  flex-wrap: nowrap;
  margin: 0 -16px;
  padding: 2px 16px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.puces-defilantes::-webkit-scrollbar { display: none; }
.puce, .puce-radio > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 13px;
  border: 1px solid var(--trait);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  color: var(--encre);
}
.puce.active, .puce-radio input:checked + span { border-color: var(--encre); background: var(--encre); color: var(--surface); }
.puce-radio { position: relative; }
.puce-radio input { position: absolute; opacity: 0; }
.puce-radio input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.select {
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--trait);
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 600;
}
.selection-valeur {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
}
.selection-valeur strong { font: 700 20px var(--titre); white-space: nowrap; }

.graphique { display: block; width: 100%; height: auto; margin-top: 8px; touch-action: manipulation; }
.g-grille { stroke: var(--trait); stroke-width: 1; }
.g-base { stroke: var(--axe); stroke-width: 1; }
.g-axe { font: 500 11px var(--texte); font-variant-numeric: tabular-nums; fill: var(--encre-3); }
.g-axe-choisi { font-weight: 800; fill: var(--encre); }
.g-selection { fill: var(--surface-2); }
.g-cible { fill: transparent; cursor: pointer; }

.legende {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--encre-2);
}
.legende li { display: inline-flex; align-items: center; gap: 6px; }
details.valeurs { margin-top: 12px; }
details.valeurs summary {
  min-height: 36px;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--encre-2);
  cursor: pointer;
}

/* ---------- Historique ---------- */

.groupe-titre {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 2px 10px;
  font: 700 17px var(--titre);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.groupe-total {
  margin-left: auto;
  font: 600 14px var(--texte);
  letter-spacing: 0;
  text-transform: none;
  color: var(--encre-2);
}
.liste { display: grid; gap: 8px; }
.ligne-seance {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--trait);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
}
.ligne-seance:active { background: var(--surface-2); }
.ls-date {
  display: grid;
  place-content: center;
  height: 52px;
  border-radius: 12px;
  background: var(--surface-2);
  line-height: 1.05;
  text-align: center;
}
.ls-date strong { font: 700 22px var(--titre); }
.ls-date small { font-size: 11.5px; color: var(--encre-2); }
.ls-corps { display: grid; gap: 4px; min-width: 0; }
.ls-muscles { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 12px; font-size: 14px; font-weight: 600; }
.ls-muscles > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ls-corps small { font-size: 12.5px; color: var(--encre-3); }
.ls-vol { text-align: right; }
.ls-vol strong { display: block; font: 700 20px var(--titre); font-variant-numeric: tabular-nums; }
.ls-vol small { font-size: 12px; color: var(--encre-2); }

/* ---------- Machines ---------- */

.ligne-machine {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--trait);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
}
.ligne-machine::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 5px; background: var(--c); }
.ligne-machine:active { background: var(--surface-2); }
.lm-corps { display: grid; flex: 1; gap: 3px; min-width: 0; }
.lm-corps strong { font: 700 18px/1.15 var(--titre); }
.lm-corps small { font-size: 13.5px; color: var(--encre-2); }
.lm-corps .lm-note { font-style: italic; color: var(--encre-3); }
.chevron { font-size: 24px; line-height: 1; color: var(--encre-3); }

.formulaire { display: grid; gap: 20px; margin-top: 4px; }
.champ { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.champ-titre {
  padding: 0;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--encre-2);
}
.champ > input, .champ > textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--trait);
  border-radius: 12px;
  background: var(--surface);
  font-size: 17px;
}
.champ > textarea { min-height: 92px; line-height: 1.4; resize: vertical; }
.trio { display: grid; gap: 8px; }
.trio-ligne {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 190px);
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--trait);
  border-radius: 14px;
  background: var(--surface);
  font-weight: 600;
}
.liste-changements { margin: 0 0 10px; padding-left: 18px; font-weight: 600; color: var(--encre); }

/* ---------- Réglages ---------- */

.boutons-ligne { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; }
.boutons-ligne .btn { flex: 1 1 140px; }
.interrupteur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  padding: 6px 0;
  border-bottom: 1px solid var(--trait);
  font-size: 15.5px;
}
.interrupteur input {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-3);
  transition: background-color 0.2s;
  appearance: none;
}
.interrupteur input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}
.interrupteur input:checked { background: var(--primaire); }
.interrupteur input:checked::after { background: var(--primaire-encre); transform: translateX(20px); }
.reglage-ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  border-bottom: 1px solid var(--trait);
  font-size: 15.5px;
}
.reglage-ligne .pas { flex: none; width: 180px; }
.reglage-ligne output { font-size: 18px; }
.ligne-muscle {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--trait);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}
.ligne-muscle .pastille { grid-row: span 2; width: 14px; height: 14px; }
.ligne-muscle strong { font-weight: 700; }
.ligne-muscle small { grid-column: 2; font-size: 13px; color: var(--encre-3); }
.ligne-muscle .chevron { grid-column: 3; grid-row: 1 / span 2; }
.nuancier { display: flex; flex-wrap: wrap; gap: 10px; }
.nuancier label { position: relative; }
.nuancier input { position: absolute; opacity: 0; }
.nuancier span {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  border: 3px solid transparent;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--surface);
}
.nuancier input:checked + span { border-color: var(--encre); }
.nuancier input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.nuancier span.prise::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface);
}

/* ---------- Fenêtres ---------- */

dialog.fenetre {
  width: min(100% - 32px, 440px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--encre);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
}
dialog.fenetre::backdrop { background: var(--voile); }
dialog.fenetre[open] { animation: apparaitre 0.18s ease-out; }
.question { display: grid; gap: 14px; padding: 22px 20px 16px; }
.question h2 { font: 700 22px/1.15 var(--titre); }
.question-texte { color: var(--encre-2); }
.question-texte p + p { margin-top: 8px; }
.question-boutons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.question-boutons .btn { flex: 1 1 auto; }
dialog.feuille {
  width: 100%;
  max-width: 640px;
  max-height: 88dvh;
  margin: auto auto 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-radius: 22px 22px 0 0;
}
dialog.feuille[open] { animation: monter-feuille 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.feuille-tete {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--trait);
  background: var(--surface);
}
.feuille-tete h2 { font: 700 22px var(--titre); text-transform: uppercase; }
.feuille-corps { padding: 0 14px 22px; }
.feuille-corps .groupe-titre { margin-top: 18px; }

/* ---------- Minuteur de repos ---------- */

#minuteur {
  position: fixed;
  z-index: 25;
  right: 10px;
  bottom: calc(var(--bas) + 8px);
  left: 10px;
  max-width: 620px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px;
  background: var(--encre);
  color: var(--surface);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.55);
  animation: monter 0.25s ease-out;
}
#minuteur[hidden] { display: none; }
.minuteur-barre { height: 5px; background: color-mix(in srgb, var(--surface) 18%, transparent); }
.minuteur-barre span { display: block; height: 100%; background: var(--progres); transform-origin: left; }
.minuteur-corps { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; }
.minuteur-titre { font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.minuteur-temps { margin: 0 auto 0 4px; font: 700 30px/1 var(--titre); font-variant-numeric: tabular-nums; }
#minuteur button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 15%, transparent);
  color: inherit;
  font-size: 14px;
  font-weight: 700;
}
#minuteur.termine { background: var(--accent); color: var(--accent-encre); animation: pulser 0.6s ease-in-out 3; }
#minuteur.termine button { background: rgba(0, 0, 0, 0.1); }
#minuteur.termine [data-m="-15"], #minuteur.termine [data-m="15"] { display: none; }

/* ---------- Barre du bas ---------- */

.onglets {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: var(--bas);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--trait);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
.onglets a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: none;
  color: var(--encre-3);
}
.onglets .icone {
  display: grid;
  place-items: center;
  width: 56px;
  height: 30px;
  border-radius: 999px;
  transition: background-color 0.2s;
}
.onglets svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.onglets a.actif { color: var(--encre); }
.onglets a.actif .icone { background: var(--accent); color: var(--accent-encre); }

/* ---------- Messages ---------- */

#toasts {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: calc(var(--bas) + 86px);
  left: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}
.toast {
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--encre);
  color: var(--surface);
  font-size: 14.5px;
  font-weight: 650;
  box-shadow: var(--ombre);
  animation: monter 0.2s ease-out;
  transition: opacity 0.3s;
}
.toast.sortie { opacity: 0; }

#bandeau-maj {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 14px 8px;
  background: var(--accent);
  color: var(--accent-encre);
  font-size: 14px;
  font-weight: 700;
}
#bandeau-maj[hidden] { display: none; }
#bandeau-maj .btn { border-color: transparent; background: var(--accent-encre); color: var(--accent); }

/* ---------- Animations ---------- */

@keyframes monter { from { opacity: 0; transform: translateY(10px); } }
@keyframes apparaitre { from { opacity: 0; transform: scale(0.97); } }
@keyframes monter-feuille { from { opacity: 0.4; transform: translateY(40%); } }
@keyframes pulser { 50% { transform: scale(1.02); } }
main.entree > * { animation: monter 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
main.entree > :nth-child(2) { animation-delay: 0.04s; }
main.entree > :nth-child(3) { animation-delay: 0.08s; }
main.entree > :nth-child(4) { animation-delay: 0.12s; }
main.entree > :nth-child(5) { animation-delay: 0.16s; }
main.entree > :nth-child(n + 6) { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
