:root {
  --fond: #EFEDE7;
  --encre: #111216;
  --gris: #45474F;
  --gris-clair: #9C9EA6;
  --texte-doux: #2E3038;
  --bord: #D5D2C9;
  --separateur: #E7E4DD;
  --segment: #E9E7E1;
  --pointille: #D6D3CB;
  --blanc: #FFFFFF;
  --course: #C8441E;
  --muscu: #6B4FD8;
  --natation: #2F55D4;
  --accent: var(--encre);
  --bloc-fonce: #17181C;
  --barre: #DAD7CF;
  --muscu-pale: #F0ECFC;
  --tuile: #F3F1EC;
  --ombre: 0 1px 2px rgba(17, 18, 22, 0.06), 0 4px 14px rgba(17, 18, 22, 0.05);
  --vert: #1E7A45; --vert-pale: #E3F3E9; --orange: #B45309; --orange-pale: #FDF0DC; --rouge: #B42318; --rouge-pale: #FCE7E5;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

/* Thème sombre (automatique de 20h à 7h, ou forcé dans Réglages). */
:root[data-theme="sombre"] {
  --fond: #0F1013;
  --encre: #ECEDEF;
  --gris: #9C9EA6;
  --gris-clair: #6B6E76;
  --texte-doux: #C9CBD1;
  --bord: #2A2C33;
  --separateur: #23252B;
  --segment: #1F2126;
  --pointille: #3A3C42;
  --blanc: #18191D;
  --course: #E8693F;
  --muscu: #9581F2;
  --natation: #6C8CF5;
  --bloc-fonce: #22242A;
  --barre: #34363D;
  --muscu-pale: #2A2540;
  --tuile: #22242A;
  --ombre: none;
  --vert: #6FD3A0; --vert-pale: #13281D; --orange: #F5B25B; --orange-pale: #2E2414; --rouge: #FF8A80; --rouge-pale: #331716;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  transition: background-color 0.3s;
  background: var(--fond);
  color: var(--encre);
  font-family: 'Geist', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--encre); }
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }

.sport-course { --accent: var(--course); }
.sport-muscu { --accent: var(--muscu); }
.sport-natation { --accent: var(--natation); }

/* ---------- Mise en page ---------- */
.vue { min-height: 100dvh; }
.ecran {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(108px + var(--bas));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ecran.plein {
  min-height: 100dvh;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 0;
  gap: 12px;
}
.ecran.plein main { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pied {
  position: sticky;
  bottom: 0;
  margin: 0 -20px;
  padding: 12px 20px calc(20px + var(--bas));
  background: linear-gradient(to bottom, rgba(245, 244, 240, 0), var(--fond) 18px);
  display: flex;
  gap: 8px;
}

.entete { display: flex; justify-content: space-between; align-items: flex-end; }
.entete-seance { display: flex; justify-content: space-between; align-items: center; }
.sur-titre { margin: 0; font-size: 13px; color: var(--gris); }
.titre { margin: 2px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.titre.moyen { font-size: 26px; }
.titre.petit { font-size: 24px; }
.marque { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.etiquette { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gris); }
.section-titre { margin: 6px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.texte-doux { margin: 0; font-size: 14px; line-height: 1.45; color: var(--texte-doux); }
.aide { margin: 0; font-size: 12px; color: var(--gris); line-height: 1.4; }

/* ---------- Boutons ---------- */
.rond {
  width: 44px; height: 44px; flex: none;
  border-radius: 22px; border: 1px solid var(--bord); background: var(--blanc);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn, .btn-sec {
  height: 48px; padding: 0 18px; border-radius: 14px;
  font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; border: none;
}
.btn { background: var(--encre); color: var(--blanc); flex: 1; }
.btn-sec { background: var(--blanc); color: var(--encre); border: 1px solid var(--bord); font-weight: 500; }
.btn.grand, .btn-sec.grand { height: 52px; border-radius: 16px; font-size: 16px; }
.btn.compact, .btn-sec.compact { height: 44px; border-radius: 12px; font-size: 14px; padding: 0 16px; }
.btn.accent { background: var(--accent); }
.btn:disabled, .btn-sec:disabled { opacity: 0.45; cursor: default; }
.actions { display: flex; gap: 8px; }

/* ---------- Cartes ---------- */
.carte {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 20px;
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--ombre);
}
.carte.moyenne { border-radius: 18px; padding: 16px; gap: 12px; }
.carte.liste { padding: 6px 18px; gap: 0; }
.carte.accent { border: 1.5px solid var(--accent); }
.carte .ligne-haut { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.carte h2 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -0.01em; }
.carte.moyenne h2 { font-size: 20px; }
.carte p { margin: 0; }
.date-accent { font-size: 12px; font-weight: 600; color: var(--accent); }
.petit-gris { font-size: 12px; color: var(--gris); }

.objectif {
  background: var(--bloc-fonce); color: #FFFFFF; border-radius: 20px;
  padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px;
}
.objectif .haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.objectif .nom { margin: 0; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #B9BBC2; }
.objectif .cible { margin: 6px 0 0; font-size: 14px; color: #E6E7EA; }
.objectif .compte { margin: 0; font-family: var(--mono); font-size: 34px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
.phases { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; }
.phases div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.phases i { height: 4px; border-radius: 2px; background: #33353C; }
.phases .passee i { background: var(--gris); }
.phases .actuelle i { background: #FF7A45; }
.phases span { font-size: 11px; color: var(--gris-clair); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phases .actuelle span { color: #FFFFFF; font-weight: 600; }

.tuiles { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; }
.tuile { background: var(--tuile); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.tuile p:first-child { font-size: 11px; color: var(--gris); }
.tuile p:last-child { margin-top: 4px; font-family: var(--mono); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.tuile.bordee { background: var(--blanc); border: 1px solid var(--bord); }
.tuile.bordee p:last-child { font-size: 15px; }

.puces { display: flex; gap: 6px; flex-wrap: wrap; }
.puce { font-family: var(--mono); font-size: 12px; background: var(--fond); border-radius: 8px; padding: 5px 8px; }

/* ---------- Routine ---------- */
.check {
  display: flex; align-items: center; gap: 12px; min-height: 48px;
  border-bottom: 1px solid var(--separateur); cursor: pointer;
}
.check:last-child { border-bottom: none; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--encre); flex: none; }
.check .nom { flex: 1; font-size: 15px; }
.check input:checked + .nom { color: var(--gris); text-decoration: line-through; }
.check .dose { font-family: var(--mono); font-size: 13px; color: var(--gris); }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 18px; padding: 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
}
.mini label, .mini .lib { font-size: 12px; color: var(--gris); }
.pesee { display: flex; align-items: baseline; gap: 4px; }
.pesee input {
  width: 84px; border: none; outline: none; background: transparent; padding: 0;
  font-family: var(--mono); font-size: 22px; font-weight: 500;
}
.pesee span { font-size: 13px; color: var(--gris); }
.mini .action { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.mini .etat { font-size: 12px; color: var(--gris); }

/* ---------- Séances ---------- */
.frise {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px;
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 18px; padding: 10px 6px;
}
.frise div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.frise .j { font-size: 11px; color: var(--gris); }
.frise .n {
  width: 32px; height: 32px; border-radius: 16px; font-family: var(--mono); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.frise .auj .n { background: var(--encre); color: var(--blanc); }
.frise .points { display: flex; gap: 3px; height: 6px; }
.point { width: 6px; height: 6px; border-radius: 3px; background: var(--accent); display: inline-block; flex: none; }

.ligne {
  min-height: 52px; background: var(--blanc); border: 1px solid var(--bord); border-radius: 14px;
  padding: 8px 14px; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--encre);
}
.ligne .quand { width: 52px; flex: none; font-size: 12px; color: var(--gris); }
.ligne .quoi { flex: 1; font-size: 15px; min-width: 0; }
.ligne .info { font-family: var(--mono); font-size: 12px; color: var(--gris); text-align: right; }
.ligne .info.texte { font-family: inherit; }
.ligne.faite .quoi { color: var(--gris); text-decoration: line-through; }
.chevron { flex: none; }

.statut-garmin {
  display: flex; align-items: center; gap: 10px; background: var(--fond); border-radius: 12px; padding: 10px 12px;
}
.statut-garmin .point { background: #B4B1A9; width: 8px; height: 8px; border-radius: 4px; }
.statut-garmin.ok .point { background: var(--natation); }
.statut-garmin span:nth-child(2) { flex: 1; font-size: 13px; color: var(--texte-doux); }
.statut-garmin span:last-child { font-family: var(--mono); font-size: 13px; font-weight: 500; }

/* ---------- Fiche laps ---------- */
.consigne {
  display: flex; align-items: center; gap: 10px; background: var(--blanc);
  border: 1px solid var(--bord); border-radius: 14px; padding: 10px 12px;
}
.consigne p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--texte-doux); }
.consigne strong { color: var(--encre); }
.bloc {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.bloc.rep { border: 1.5px solid var(--accent); }
.bloc .tete { display: flex; justify-content: space-between; align-items: baseline; }
.bloc .tete p { margin: 0; font-size: 15px; font-weight: 600; }
.bloc .tete span { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--accent); }
.etape { display: flex; gap: 14px; align-items: center; }
.etape p { margin: 0; }
.etape .nom { font-size: 15px; font-weight: 500; }
.etape .detail { margin-top: 2px; font-family: var(--mono); font-size: 12px; color: var(--gris); }
.lap {
  width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--fond);
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1;
}
.lap.serre { font-size: 11px; }
.lap.effort { background: var(--encre); color: var(--blanc); }
.encadre { border: 1px dashed var(--pointille); border-radius: 14px; padding: 10px 12px; }
.encadre p:first-child { margin: 0; font-size: 11px; color: var(--gris); }
.encadre p:last-child { margin: 2px 0 0; font-size: 13px; }
.series { margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--texte-doux); white-space: pre-line; }

/* ---------- Muscu ---------- */
.segment {
  display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 3px;
  background: var(--segment); border-radius: 12px; padding: 3px;
}
.segment button {
  min-height: 38px; border: none; border-radius: 10px; background: transparent;
  font-size: 14px; color: var(--gris); padding: 0 4px;
}
.segment button[aria-pressed="true"] { background: var(--blanc); font-weight: 600; color: var(--encre); }
.segment.petit button { font-size: 13px; }
.indication { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.indication label { font-size: 12px; color: var(--gris); line-height: 1.35; }
.indication span { font-size: 12px; font-weight: 600; color: var(--muscu); white-space: nowrap; }
textarea.notes {
  flex: 1; min-height: 46dvh; resize: none; width: 100%;
  border: 1px solid var(--bord); border-radius: 18px; background: var(--blanc);
  padding: 16px; font-size: 16px; line-height: 1.55; outline: none;
}
textarea.debrief {
  min-height: 86px; resize: vertical; width: 100%;
  border: 1px solid var(--bord); border-radius: 16px; background: var(--blanc);
  padding: 12px 14px; font-size: 16px; line-height: 1.45; outline: none;
}
textarea:focus, input:focus-visible { border-color: var(--gris-clair); }
.carre {
  width: 52px; height: 52px; flex: none; border-radius: 16px; border: 1px solid var(--bord); background: var(--blanc);
  display: inline-flex; align-items: center; justify-content: center;
}
.carre.actif { border-color: var(--muscu); background: var(--muscu-pale); }
.exo { padding: 10px 0; border-bottom: 1px solid var(--separateur); display: flex; flex-direction: column; gap: 4px; }
.exo:last-child { border-bottom: none; }
.exo .haut { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.exo .nom { font-size: 15px; font-weight: 500; }
.exo .prog { font-size: 12px; color: var(--gris); white-space: nowrap; }
.exo .prog.hausse { font-weight: 600; color: var(--muscu); }
.exo .seriesx { font-family: var(--mono); font-size: 12px; color: var(--gris); }
.exo .note { font-size: 12px; color: var(--texte-doux); line-height: 1.4; }
.remarque {
  margin: 0; font-size: 13px; line-height: 1.45; color: var(--texte-doux);
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px;
}
.remarque.question { border-color: var(--muscu); }
.remarque.alerte { border-color: var(--course); }

/* ---------- Historique ---------- */
.filtres { display: flex; gap: 6px; flex-wrap: wrap; }
.filtres button {
  height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--bord);
  background: var(--blanc); font-size: 14px;
}
.filtres button[aria-pressed="true"] { background: var(--encre); color: var(--blanc); border-color: var(--encre); }
.notes-seance { margin: 0; font-size: 14px; line-height: 1.5; color: var(--texte-doux); white-space: pre-line; overflow-wrap: anywhere; }
.notes-seance.repliee { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.lien-texte { align-self: flex-start; background: none; border: none; padding: 6px 0; font-size: 13px; font-weight: 600; color: var(--accent); min-height: 32px; }
.liste-hist { background: var(--blanc); border: 1px solid var(--bord); border-radius: 18px; padding: 4px 16px; }
.hist {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0;
  border-bottom: 1px solid var(--separateur);
}
.hist:last-child { border-bottom: none; }
.hist .quoi { flex: 1; min-width: 0; }
.hist .quoi p { margin: 0; }
.hist .quoi p:first-child {
  font-size: 15px; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hist .point { flex: none; }
.hist .quoi p:last-child { font-size: 12px; color: var(--gris); margin-top: 2px; }
.hist .info { font-family: var(--mono); font-size: 12px; color: var(--gris); text-align: right; max-width: 42%; }
.bientot { border-style: dashed; }

/* ---------- Analyse ---------- */
.badge { font-size: 13px; border: 1px solid var(--bord); background: var(--blanc); border-radius: 16px; padding: 6px 12px; }
.badge.noir { background: var(--encre); color: var(--blanc); border-color: var(--encre); font-weight: 600; }
.partie { display: flex; flex-direction: column; gap: 8px; }
.partie.separee { border-top: 1px solid var(--separateur); padding-top: 14px; }
.partie h3 { margin: 0; font-size: 16px; font-weight: 600; }
.carte .texte-doux + .texte-doux { margin-top: 10px; }
.tableau { padding: 4px 16px; }
.rang { display: grid; grid-template-columns: 44px 1fr 64px 76px; gap: 8px; align-items: center; min-height: 46px; border-bottom: 1px solid var(--separateur); font-size: 14px; }
.tableau.natation .rang { grid-template-columns: 1fr 70px 56px; }
.rang:last-child { border-bottom: none; }
.rang.tete { min-height: 38px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gris); }
.rang .gris { color: var(--gris); font-size: 12px; }
.rang .fort { font-size: 16px; font-weight: 500; }
.rang.hors .fort, .rang.hors span:last-child, .rang .accent { color: var(--accent); font-weight: 600; }
.rang span:last-child { text-align: right; }
.strava { background: var(--bloc-fonce); color: #FFFFFF; border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.bloc-strava { display: flex; flex-direction: column; gap: 8px; }
.bloc-strava.separe { border-top: 1px solid #33353C; padding-top: 14px; }
.bloc-strava .ligne-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bloc-strava .lib { font-size: 13px; color: #9C9EA6; }
.strava-titre { margin: 0; font-size: 17px; font-weight: 600; }
.strava-desc { margin: 0; font-size: 15px; line-height: 1.5; color: #E6E7EA; }
.copier { height: 38px; padding: 0 16px; border-radius: 12px; border: 1px solid #5E6068; background: transparent; color: #FFFFFF; font-size: 14px; }
.btn-blanc { height: 48px; border-radius: 14px; border: none; background: #FFFFFF; color: #17181C; font-size: 15px; font-weight: 600; }
.etapes { gap: 0; padding: 8px 18px; }
.etape-analyse { display: flex; align-items: center; gap: 12px; min-height: 52px; font-size: 15px; color: var(--gris); border-bottom: 1px solid var(--separateur); }
.etape-analyse:last-child { border-bottom: none; }
.etape-analyse.courante { color: var(--encre); font-weight: 600; }
.etape-analyse.faite { color: var(--encre); }
.puce-etape { width: 28px; height: 28px; flex: none; border-radius: 14px; background: var(--fond); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; }
.etape-analyse.faite .puce-etape { background: var(--encre); color: var(--blanc); }
.roue.petite { width: 16px; height: 16px; border-width: 2px; flex: none; }

/* ---------- Coach ---------- */
.fab {
  position: fixed; right: 16px; bottom: calc(96px + var(--bas)); z-index: 11;
  height: 48px; padding: 0 18px 0 14px; border-radius: 24px;
  background: var(--encre); color: var(--fond); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(23, 24, 28, 0.22);
}
.fil { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.bulle { max-width: 88%; border-radius: 18px; padding: 11px 14px; font-size: 15px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.bulle.matt { align-self: flex-end; background: var(--encre); color: var(--fond); border-bottom-right-radius: 6px; }
.bulle.coach { align-self: flex-start; background: var(--blanc); border: 1px solid var(--bord); border-bottom-left-radius: 6px; }
.bulle.erreur { border-color: var(--course); }
.bulle .ecrit { display: flex; align-items: center; gap: 8px; color: var(--gris); }
.actions-coach { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.action-coach { font-size: 13px; border-radius: 10px; padding: 8px 10px; background: var(--fond); color: var(--texte-doux); text-decoration: none; display: flex; gap: 8px; align-items: center; }
.action-coach.ko { color: var(--course); }
.action-coach strong { color: var(--encre); }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestions button {
  min-height: 40px; padding: 8px 14px; border-radius: 20px; border: 1px solid var(--bord);
  background: var(--blanc); font-size: 14px; text-align: left;
}
.saisie-coach { display: flex; gap: 8px; align-items: flex-end; }
.saisie-coach textarea {
  flex: 1; min-height: 52px; max-height: 160px; resize: none; border: 1px solid var(--bord); border-radius: 16px;
  background: var(--blanc); padding: 14px; font-size: 16px; line-height: 1.4; outline: none;
}

/* ---------- Divers ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  border-top: 1px solid var(--bord); background: var(--blanc);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 8px 6px calc(10px + var(--bas));
}
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: var(--gris); font-size: 12px; font-weight: 500;
}
.nav-icone {
  position: relative; width: 52px; height: 32px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.nav a[aria-current="page"] { color: var(--encre); font-weight: 600; }
.nav a[aria-current="page"] .nav-icone { background: var(--encre); color: var(--blanc); }
.pastille {
  position: absolute; top: 3px; right: 12px; width: 9px; height: 9px; border-radius: 5px;
  background: var(--course); border: 2px solid var(--blanc);
}

.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--bas)); transform: translateX(-50%); z-index: 20;
  max-width: calc(100% - 40px); background: var(--encre); color: var(--blanc);
  border-radius: 14px; padding: 12px 16px; font-size: 14px; line-height: 1.4;
  box-shadow: 0 6px 24px rgba(23, 24, 28, 0.18);
}

.attente { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 0; text-align: center; }
.roue {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid var(--bord); border-top-color: var(--accent);
  animation: tourne 0.9s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .roue { animation-duration: 3s; } }

.feuille-fond { position: fixed; inset: 0; z-index: 30; background: rgba(23, 24, 28, 0.35); display: flex; align-items: flex-end; justify-content: center; }
.feuille {
  width: 100%; max-width: 480px; background: var(--fond); border-radius: 22px 22px 0 0;
  padding: 20px 20px calc(20px + var(--bas)); display: flex; flex-direction: column; gap: 12px;
  max-height: 90dvh; overflow-y: auto;
}
.feuille h2 { margin: 0; font-size: 20px; font-weight: 600; }
.jours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.jours button {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--bord); background: var(--blanc); font-size: 14px;
}
.jours button[aria-pressed="true"] { background: var(--encre); color: var(--blanc); border-color: var(--encre); }

.connexion .btn { flex: none; }
.connexion { max-width: 380px; margin: 0 auto; min-height: 100dvh; padding: 0 24px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.connexion input {
  height: 52px; border-radius: 14px; border: 1px solid var(--bord); background: var(--blanc);
  padding: 0 16px; font-size: 18px; font-family: var(--mono); outline: none; width: 100%;
}
.erreur-texte { margin: 0; font-size: 13px; color: var(--course); }

/* Écran Coach dans un onglet : la zone de saisie reste au-dessus de la barre d'onglets. */
.ecran.plein.onglet { padding-bottom: calc(76px + var(--bas)); }
.ecran.plein.onglet .pied { bottom: calc(72px + var(--bas)); padding-bottom: 12px; }

/* ---------- Repas ---------- */
.jauge { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.piste { height: 8px; border-radius: 4px; background: var(--segment); overflow: hidden; }
.piste i { display: block; height: 100%; border-radius: 4px; background: var(--encre); }
.champ { height: 48px; border-radius: 14px; border: 1px solid var(--bord); background: var(--blanc); padding: 0 14px; font-size: 16px; outline: none; width: 100%; }
label.btn { color: var(--blanc); }

/* ---------- Accueil enrichi ---------- */
.perf { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid #2A2C33; padding-top: 10px; font-size: 13px; color: #C9CBD2; flex-wrap: wrap; }
.perf strong { font-family: var(--mono); color: #FFFFFF; font-weight: 600; }
.statut { font-size: 12px; font-weight: 700; border-radius: 10px; padding: 3px 9px; white-space: nowrap; }
.statut.bon { color: var(--vert); background: var(--vert-pale); }
.statut.neutre { color: var(--gris); background: var(--tuile); }
.statut.attention { color: var(--orange); background: var(--orange-pale); }
.statut.alerte { color: var(--rouge); background: var(--rouge-pale); }
.objectif .statut.bon { color: #0E3B22; background: #7FE0A8; }
.objectif .statut.neutre { color: #FFFFFF; background: #33353C; }
.objectif .statut.attention { color: #3D2600; background: #F5B25B; }
.objectif .statut.alerte { color: #3B0B07; background: #FF8A80; }
.lien-discret { background: none; border: none; padding: 0; font-size: 13px; font-weight: 600; color: var(--gris); min-height: 32px; }
.a-venir { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; text-decoration: none; color: var(--encre); }
.a-venir .quand { width: 58px; color: var(--gris); flex: none; white-space: nowrap; font-size: 13px; }
.a-venir .quoi { flex: 1; }
.a-venir .meteo { font-family: var(--mono); font-size: 12px; color: var(--gris); }
.tendance { font-size: 12px; }
.tendance.baisse { color: var(--vert); }
.tendance.hausse { color: var(--orange); }
.piste.petite { height: 6px; margin-top: 6px; }

.choix-metrique { text-align: left; font-family: inherit; color: inherit; cursor: pointer; }
.choix-metrique[aria-pressed="true"] { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
.choix-metrique .tendance { margin-top: 2px; font-family: inherit; font-size: 11px; font-weight: 400; color: var(--gris); }
.tuile.choix-metrique p:nth-child(2) { margin-top: 4px; font-family: var(--mono); font-size: 18px; font-weight: 600; }
.tuile.choix-metrique p.tendance { margin-top: 3px; font-family: inherit; font-size: 11px; font-weight: 400; color: var(--gris); }

button.hist, a.hist { width: 100%; background: none; border: none; border-bottom: 1px solid var(--separateur); text-align: left; font-family: inherit; color: inherit; text-decoration: none; cursor: pointer; }
.liste-hist > :last-child { border-bottom: none; }

.suggestions.defilantes { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px 2px; scrollbar-width: none; }
.suggestions.defilantes::-webkit-scrollbar { display: none; }
.suggestions.defilantes button { flex: none; white-space: nowrap; min-height: 36px; padding: 6px 12px; font-size: 13px; }
