/* ============================================================
   FastLife â€” Premium dark fitness UI
   Mobile-first Â· system fonts only Â· no external assets
   ============================================================ */

:root {
  /* Fond & surfaces */
  --bg: #05070d;
  --bg-2: #090d16;
  --card: rgba(255, 255, 255, .045);
  --card-solid: #10151f;
  --card2: #171e2b;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);

  /* Texte */
  --text: #f2f6fc;
  --muted: #8e9bb0;

  /* Accents â€” utilisÃ©s aussi en inline par app.js (--accent, --red) */
  --accent: #2be8b5;           /* menthe vive : anneau, jeÃ»ne */
  --accent2: #22d3ee;          /* cyan */
  --accent-deep: #04241b;
  --orange: #ffb020;           /* calories */
  --amber2: #ff7a18;
  --red: #ff4d6d;
  --pink: #ff4fa3;             /* sport */
  --pink2: #f472b6;
  --violet: #a78bfa;           /* XP / niveau */
  --violet2: #6366f1;
  --gold: #ffd166;

  /* Glows */
  --glow-mint: 0 0 24px rgba(43, 232, 181, .35);
  --glow-pink: 0 0 22px rgba(255, 79, 163, .30);
  --glow-violet: 0 0 22px rgba(167, 139, 250, .32);

  --nav-h: 66px;
  --r-lg: 20px;
  --r-md: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* FIX tactile CRITIQUE : un Ã©lÃ©ment [hidden] doit TOUJOURS Ãªtre cachÃ©,
   mÃªme si une classe lui donne un display (sinon la modale invisible
   recouvre l'Ã©cran et bloque tous les touchers) */
[hidden] { display: none !important; }

button, .chip, .cal-day, label { touch-action: manipulation; }
button { font-family: inherit; }
button:active { transform: scale(.96); }
input, textarea, select { font-size: 16px !important; font-family: inherit; } /* anti-zoom iOS */

/* AccessibilitÃ© & finitions globales */
::selection { background: rgba(43, 232, 181, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  height: 100%;
  overscroll-behavior: none;
}

/* Ambiance : halos radiaux discrets derriÃ¨re tout le contenu */
body {
  background:
    radial-gradient(ellipse 90% 42% at 50% -8%, rgba(34, 211, 238, .12), transparent 60%),
    radial-gradient(ellipse 70% 38% at 12% 108%, rgba(167, 139, 250, .10), transparent 60%),
    radial-gradient(ellipse 60% 30% at 95% 55%, rgba(43, 232, 181, .05), transparent 65%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 42%);
  /* PERF : pas de background-attachment:fixed â€” repaint complet Ã  chaque frame de scroll sur mobile */
}

#content {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
}

/* ---------- Onglets ---------- */
.tab { display: none; }
.tab.active { display: block; animation: tab-in .32s cubic-bezier(.22, 1, .36, 1); }
@keyframes tab-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Apparition des blocs (fade + slide, lÃ©ger stagger)
   PERF : .phase exclu â€” la liste est mise Ã  jour chaque seconde pendant un jeÃ»ne */
.card, .meal, .badge, .fast-times, .goal-picker {
  animation: rise .4s cubic-bezier(.22, 1, .36, 1) backwards;
}
.meal:nth-child(2), .badge:nth-child(2) { animation-delay: .04s; }
.meal:nth-child(3), .badge:nth-child(3) { animation-delay: .08s; }
.meal:nth-child(4), .badge:nth-child(4) { animation-delay: .12s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Titres ---------- */
.page-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; min-height: 42px;
}
h1 {
  font-size: 30px; font-weight: 900; letter-spacing: -1px;
  background: linear-gradient(120deg, #fff 30%, rgba(255, 255, 255, .55));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-title {
  font-size: 12px; margin: 26px 0 12px; color: var(--muted);
  font-weight: 800; text-transform: uppercase; letter-spacing: 1.6px;
}

/* ---------- Cartes (verre) ---------- */
.card {
  /* PERF : fond opaque au lieu de verre translucide + backdrop-filter (trÃ¨s coÃ»teux au scroll mobile) */
  background: linear-gradient(160deg, #161e2d, #10151f 60%);
  border-radius: var(--r-lg);
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* ---------- SÃ©rie (streak) ---------- */
.streak-pill {
  background: linear-gradient(135deg, rgba(255, 176, 32, .18), rgba(255, 122, 24, .10));
  color: var(--orange);
  border: 1px solid rgba(255, 176, 32, .38);
  padding: 7px 14px; border-radius: 999px;
  font-weight: 800; font-size: 14px;
  box-shadow: 0 0 16px rgba(255, 176, 32, .18);
}

/* ---------- Anneau de jeÃ»ne ---------- */
.ring-wrap { position: relative; width: 268px; margin: 6px auto 8px; }
.ring { width: 100%; transform: rotate(-90deg); display: block; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 13; }
.ring-fill {
  fill: none;
  stroke: var(--accent); /* app.js pilote stroke + dashoffset en inline */
  stroke-width: 13; stroke-linecap: round;
  stroke-dasharray: 722; stroke-dashoffset: 722;
  transition: stroke-dashoffset .8s cubic-bezier(.22, 1, .36, 1), stroke .4s;
  /* PERF : glow statique unique â€” animer un drop-shadow repeint le GPU Ã  60 fps en continu */
  filter: drop-shadow(0 0 8px currentColor);
  color: var(--accent);
}
/* La "respiration" est dÃ©placÃ©e sur l'opacity d'un halo (compositÃ©e, coÃ»t quasi nul) */
.ring-wrap::after {
  content: ""; position: absolute; inset: 12%;
  border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 34px rgba(43, 232, 181, .28);
  animation: halo-breathe 3.2s ease-in-out infinite;
}
@keyframes halo-breathe {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 5px;
  padding: 34px;
}
.ring-label {
  color: var(--muted); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
}
.ring-time {
  font-size: 46px; font-weight: 900;
  font-variant-numeric: tabular-nums; letter-spacing: -2px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(43, 232, 181, .3); /* PERF : rayon rÃ©duit, texte rÃ©Ã©crit chaque seconde */
}
.ring-sub { color: var(--accent); font-size: 13px; font-weight: 700; min-height: 17px; }

/* ---------- BanniÃ¨re de phase ---------- */
.phase-banner {
  background: linear-gradient(110deg, rgba(43, 232, 181, .14), rgba(34, 211, 238, .10));
  border: 1px solid rgba(43, 232, 181, .30);
  color: var(--text);
  border-radius: var(--r-md); padding: 13px 15px; font-size: 14px; font-weight: 600;
  margin: 12px 0; text-align: center;
  box-shadow: var(--glow-mint), inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* ---------- Objectif (chips) ---------- */
.goal-picker { margin: 16px 0 4px; }
.goal-title {
  color: var(--muted); font-size: 11px; margin-bottom: 10px;
  font-weight: 800; text-transform: uppercase; letter-spacing: 1.6px;
}
.goal-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--card); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}
.chip:active { transform: scale(.93); }
.chip.sel {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--accent-deep); border-color: transparent;
  box-shadow: var(--glow-mint);
  transform: translateY(-1px);
}

/* ---------- Heures dÃ©but / objectif ---------- */
.fast-times {
  display: flex; justify-content: space-around; margin: 16px 0 4px;
  background: var(--card); border-radius: var(--r-md); padding: 14px;
  border: 1px solid var(--line);
}
.fast-times div { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fast-times span {
  color: var(--muted); font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.2px;
}
.fast-times b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Boutons ---------- */
.big-btn {
  display: block; width: 100%; margin-top: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--accent-deep); border: 0; border-radius: 18px;
  padding: 17px; font-size: 17px; font-weight: 900; letter-spacing: -.2px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(43, 232, 181, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.big-btn:active {
  transform: scale(.965) translateY(1px);
  box-shadow: 0 3px 12px rgba(43, 232, 181, .28);
  filter: brightness(1.08);
}
.big-btn.stop {
  background: linear-gradient(135deg, var(--amber2), var(--red));
  color: #fff;
  box-shadow: 0 8px 26px rgba(255, 77, 109, .38), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.big-btn.stop:active { box-shadow: 0 3px 12px rgba(255, 77, 109, .30); }
.big-btn.small { padding: 14px; font-size: 15px; margin-top: 10px; border-radius: 15px; }
.big-btn:disabled { opacity: .4; box-shadow: none; }

.ghost-btn {
  display: block; width: 100%; margin-top: 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line); color: var(--muted); border-radius: 16px;
  padding: 13px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.ghost-btn:active { background: rgba(255, 255, 255, .08); color: var(--text); }
.ghost-btn.small { margin-top: 10px; padding: 13px; }

.small-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--accent-deep); border: 0; border-radius: 12px;
  padding: 12px 18px; font-weight: 800; font-size: 14px; cursor: pointer; margin-top: 12px;
  box-shadow: 0 5px 18px rgba(43, 232, 181, .28);
}
.small-btn:active { box-shadow: 0 2px 8px rgba(43, 232, 181, .22); }

/* ---------- Phases du jeÃ»ne ---------- */
.phases-list { margin-top: 26px; display: flex; flex-direction: column; gap: 9px; }
.phase {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 15px; font-size: 14px;
  opacity: .45; transition: opacity .3s ease, border-color .3s ease;
}
.phase.reached { opacity: 1; border-color: rgba(43, 232, 181, .28); }
.phase.current {
  opacity: 1;
  border-color: rgba(43, 232, 181, .55);
  background: linear-gradient(120deg, rgba(43, 232, 181, .13), rgba(34, 211, 238, .06));
  box-shadow: var(--glow-mint), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.phase .ico { font-size: 22px; }
.phase b { display: block; font-size: 14px; font-weight: 800; }
.phase span { color: var(--muted); font-size: 12px; }
.phase .h {
  margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 800;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.phase.current .h { color: var(--accent); }

/* ---------- Navigation de date ---------- */
.date-nav { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.nav-arrow {
  background: var(--card); border: 1px solid var(--line-strong); color: var(--text);
  width: 34px; height: 34px; border-radius: 12px; font-size: 19px; cursor: pointer;
  line-height: 1; transition: background .15s ease;
}
.nav-arrow:active { background: rgba(255, 255, 255, .10); }

/* ---------- Calories ---------- */
.cal-numbers { display: flex; justify-content: space-around; align-items: flex-end; text-align: center; margin-bottom: 14px; }
.cal-numbers b { font-size: 22px; font-weight: 800; display: block; font-variant-numeric: tabular-nums; }
.cal-numbers span {
  color: var(--muted); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
.cal-remaining b {
  color: var(--accent); font-size: 38px; font-weight: 900; letter-spacing: -1.5px;
  text-shadow: 0 0 24px rgba(43, 232, 181, .40);
}

.bar {
  background: rgba(255, 255, 255, .07); height: 12px; border-radius: 999px;
  overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4);
}
.bar-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--amber2));
  box-shadow: 0 0 12px rgba(255, 176, 32, .55);
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
}
.bar-fill.over {
  background: linear-gradient(90deg, var(--amber2), var(--red));
  box-shadow: 0 0 14px rgba(255, 77, 109, .55);
}
.bar-fill.xp {
  background: linear-gradient(90deg, var(--violet), var(--violet2));
  box-shadow: 0 0 12px rgba(167, 139, 250, .55);
}

.macros { display: flex; justify-content: space-around; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.macros b { color: var(--text); font-weight: 800; }
.burned-row {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; text-align: center;
}
.burned-row b { color: var(--pink2); font-weight: 800; }
.kcal.burn { color: var(--pink2); text-shadow: 0 0 14px rgba(244, 114, 182, .35); }

/* Sport : les hÃ©ros passent en rose */
.sport-summary .cal-remaining b {
  color: var(--pink);
  text-shadow: 0 0 24px rgba(255, 79, 163, .40);
}

/* ---------- Listes repas / sÃ©ances ---------- */
.meal-list { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.meal {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 13px 15px;
  transition: border-color .2s ease;
}
.meal .ico {
  font-size: 18px; width: 40px; height: 40px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  border-radius: 13px;
}
.meal .info { flex: 1; min-width: 0; }
.meal .info b { display: block; font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal .info span { color: var(--muted); font-size: 12px; }
.meal .kcal { font-weight: 900; font-size: 15px; color: var(--orange); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meal .del { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px; opacity: .7; }
.meal .del:active { opacity: 1; color: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 14px; line-height: 1.6; }

/* ---------- Boutons d'ajout ---------- */
.add-row { display: flex; gap: 9px; margin-top: 18px; }
.add-btn {
  flex: 1; background: var(--card); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: var(--r-md); padding: 13px 6px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background-color .18s ease;
}
.add-btn:active { background: rgba(255, 255, 255, .09); }
.add-btn.ai {
  border-color: rgba(43, 232, 181, .40);
  background: linear-gradient(140deg, rgba(43, 232, 181, .14), rgba(34, 211, 238, .06));
  box-shadow: 0 0 14px rgba(43, 232, 181, .12), inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* ---------- Calendrier ---------- */
.cal-grid-head {
  display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
  color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 1px;
  margin-bottom: 8px; text-transform: uppercase;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal-day {
  aspect-ratio: 1; border-radius: 13px; background: var(--card);
  border: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer; position: relative; transition: transform .12s ease;
}
.cal-day:active { transform: scale(.92); }
.cal-day.out { opacity: 0; pointer-events: none; }
.cal-day.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(43, 232, 181, .35);
}
.cal-day.done {
  background: linear-gradient(145deg, rgba(43, 232, 181, .30), rgba(34, 211, 238, .14));
  border-color: rgba(43, 232, 181, .55);
}
.cal-day.partial {
  background: linear-gradient(145deg, rgba(255, 176, 32, .22), rgba(255, 122, 24, .10));
  border-color: rgba(255, 176, 32, .45);
}
.cal-day .dots { display: flex; gap: 3px; min-height: 5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.dot.done { background: var(--accent); }
.dot.partial { background: var(--orange); }
.dot.meal { background: #818cf8; }
.dot.sport { background: var(--pink2); }
.legend {
  display: flex; gap: 14px; justify-content: center; margin-top: 16px;
  color: var(--muted); font-size: 12px; flex-wrap: wrap; font-weight: 600;
}
.legend .dot { width: 8px; height: 8px; margin-right: 4px; }
.day-detail { margin-top: 16px; font-size: 14px; }
.day-detail h4 { margin-bottom: 10px; font-weight: 800; text-transform: capitalize; }
.day-detail p { color: var(--muted); margin: 5px 0; }
.day-detail b { color: var(--text); }

/* ---------- Profil : niveau & XP ---------- */
.level-card {
  margin-bottom: 16px;
  border-color: rgba(167, 139, 250, .30);
  background: linear-gradient(150deg, rgba(167, 139, 250, .14), rgba(99, 102, 241, .05) 60%);
  box-shadow: 0 10px 34px rgba(99, 102, 241, .18), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.level-top { display: flex; align-items: center; gap: 15px; margin-bottom: 14px; }
.level-badge {
  width: 58px; height: 58px; border-radius: 18px; flex: none;
  background: linear-gradient(135deg, var(--violet), var(--violet2));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #fff;
  box-shadow: var(--glow-violet), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.level-name { font-size: 19px; font-weight: 900; letter-spacing: -.4px; }
.level-xp { color: var(--violet); font-size: 13px; font-weight: 700; }
.level-next { color: var(--muted); font-size: 12px; margin-top: 8px; text-align: right; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { text-align: center; padding: 16px 8px; }
.stat b { font-size: 26px; font-weight: 900; display: block; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 11px; font-weight: 600; }

/* ---------- Badges ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge {
  background: linear-gradient(160deg, rgba(255, 209, 102, .13), rgba(255, 255, 255, .03) 65%);
  border: 1px solid rgba(255, 209, 102, .38);
  border-radius: var(--r-md);
  padding: 14px 6px 12px; text-align: center;
  box-shadow: 0 0 8px rgba(255, 209, 102, .12), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.badge .ico { font-size: 28px; text-shadow: 0 0 8px rgba(255, 209, 102, .45); }
.badge b { display: block; font-size: 12px; font-weight: 800; margin-top: 5px; }
.badge span { color: var(--muted); font-size: 10px; }
.badge.locked {
  opacity: .35; filter: grayscale(1);
  background: var(--card); border-color: var(--line); box-shadow: none;
}
.badge.locked .ico { filter: none; }

/* ---------- RÃ©glages / formulaires profil ---------- */
.settings label { display: flex; flex-direction: column; gap: 7px; font-size: 14px; color: var(--muted); }
.settings input, .settings select {
  background: var(--card2); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 12px; padding: 12px; width: 100%;
  transition: border-color .18s ease;
}
.settings input:focus, .settings select:focus { border-color: var(--accent); outline: none; }
.settings select { margin-top: 10px; }
#objChips { margin-bottom: 14px; }
.profile-grid { margin-top: 4px; }
.profile-grid input, .profile-grid select { margin: 0; }
.field-label {
  color: var(--muted); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.2px; margin: 8px 0 6px; display: block;
}
.pane select {
  width: 100%; background: var(--card2); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 12px; padding: 13px; margin-bottom: 10px;
}
.pane input[type=date], .pane input[type=time] {
  width: 100%; background: var(--card2); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 12px; padding: 13px; margin-bottom: 10px; color-scheme: dark;
}
.target-result { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.target-result b { color: var(--accent); font-weight: 800; }
.account-card { margin-top: 12px; }
.account-row { font-size: 14px; color: var(--muted); }
.account-row b { color: var(--text); font-weight: 800; }

/* ---------- Navigation bottom ---------- */
#nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  /* PERF : fond quasi opaque au lieu d'un blur 20px recalculÃ© Ã  chaque frame de scroll */
  background: rgba(6, 9, 15, .97);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  max-width: 100%;
}
#nav button {
  flex: 1; background: none; border: 0; color: var(--muted);
  font-size: 10px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; cursor: pointer; font-weight: 700;
  letter-spacing: .2px; position: relative;
  transition: color .2s ease;
}
#nav button span { font-size: 23px; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
#nav button.active { color: var(--accent); }
#nav button.active span {
  transform: translateY(-2px) scale(1.12);
}
#nav button.active::before {
  content: ""; position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 10px rgba(43, 232, 181, .8);
}

/* ---------- Modale ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(2, 4, 9, .85);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-box {
  background: linear-gradient(180deg, #131a27, #0d1320);
  width: 100%; max-width: 480px;
  border-radius: 26px 26px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--line-strong); border-bottom: 0;
  box-shadow: 0 -18px 60px rgba(0, 0, 0, .6);
  animation: slideup .3s cubic-bezier(.22, 1, .36, 1);
  /* La boÃ®te dÃ©file si le contenu dÃ©passe (rÃ©ponses IA longues) */
  max-height: 90vh; max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
@keyframes slideup {
  from { transform: translateY(70px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { font-size: 18px; font-weight: 900; letter-spacing: -.3px; }
.close {
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  color: var(--muted); width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 14px;
}
.close:active { background: rgba(255, 255, 255, .14); color: var(--text); }

.pane textarea, .pane input[type=text], .pane input[type=number] {
  width: 100%; background: var(--card2); border: 1px solid var(--line-strong);
  color: var(--text); border-radius: 13px; padding: 13px;
  margin-bottom: 10px; font-family: inherit; resize: none;
  transition: border-color .18s ease;
}
.pane textarea:focus, .pane input:focus { border-color: var(--accent); outline: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 input { margin-bottom: 0 !important; }
.grid2 .big-btn, .grid2 .ghost-btn { margin-top: 12px; }

.photo-drop {
  display: flex; align-items: center; justify-content: center;
  min-height: 148px; border: 2px dashed rgba(43, 232, 181, .35); border-radius: 18px;
  background: rgba(43, 232, 181, .04);
  text-align: center; color: var(--muted); cursor: pointer; margin-bottom: 10px;
  overflow: hidden; transition: border-color .2s ease, background .2s ease;
}
.photo-drop:active { border-color: var(--accent); background: rgba(43, 232, 181, .08); }
.photo-drop img { max-width: 100%; max-height: 220px; border-radius: 12px; }
.photo-drop small { font-size: 12px; }

.loading { text-align: center; padding: 30px 0; color: var(--muted); }
.spinner {
  width: 42px; height: 42px; margin: 0 auto 16px;
  border: 4px solid rgba(255, 255, 255, .08); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
  filter: drop-shadow(0 0 8px rgba(43, 232, 181, .4));
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.result-item b { font-weight: 800; }
.result-item span { color: var(--muted); font-size: 12px; display: block; }
.result-item .kcal { font-weight: 800; white-space: nowrap; color: var(--orange); font-variant-numeric: tabular-nums; }
.result-item .kcal.burn { color: var(--pink2); }
.result-total { font-weight: 900; font-size: 16px; padding: 13px 0 4px; letter-spacing: -.2px; }
.result-notes { color: var(--muted); font-size: 12px; margin-bottom: 4px; }

/* ---------- Connexion ---------- */
.login {
  position: fixed; inset: 0; z-index: 100;
  background:
    radial-gradient(ellipse 85% 45% at 50% -5%, rgba(34, 211, 238, .14), transparent 60%),
    radial-gradient(ellipse 70% 40% at 50% 110%, rgba(43, 232, 181, .10), transparent 60%),
    var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-box {
  width: 100%; max-width: 340px; text-align: center;
  display: flex; flex-direction: column; gap: 10px;
  animation: rise .5s cubic-bezier(.22, 1, .36, 1);
}
.login-logo {
  font-size: 58px;
  filter: drop-shadow(0 0 22px rgba(43, 232, 181, .55));
  animation: logo-float 3.4s ease-in-out infinite;
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.login-box h2 {
  font-size: 32px; font-weight: 900; letter-spacing: -1.2px;
  background: linear-gradient(120deg, #fff, var(--accent) 85%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.login-box input {
  background: var(--card2); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 15px; padding: 15px; text-align: center; font-weight: 700;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.login-box input:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px rgba(43, 232, 181, .15);
}
.pin-dots { display: flex; gap: 18px; justify-content: center; margin: 14px 0 4px; }
.pin-dots i {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line-strong);
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.pin-dots i.on {
  background: var(--accent); border-color: var(--accent);
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(43, 232, 181, .7);
}
.pin-dots.shake { animation: shake .35s ease; }
.pin-dots.shake i.on {
  background: var(--red); border-color: var(--red);
  box-shadow: 0 0 12px rgba(255, 77, 109, .7);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(6px); }
}
.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px;
  margin-top: 8px;
}
.keypad button {
  background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
  border: 1px solid var(--line); color: var(--text);
  font-size: 23px; font-weight: 800; padding: 17px 0; border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .07);
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease, color .12s ease;
}
.keypad button:active {
  background: linear-gradient(160deg, rgba(43, 232, 181, .22), rgba(34, 211, 238, .10));
  border-color: rgba(43, 232, 181, .5);
  color: var(--accent);
  transform: scale(.92);
  box-shadow: 0 0 14px rgba(43, 232, 181, .25);
}
.keypad button[data-k="del"] { font-size: 18px; color: var(--muted); }
.login-err { color: var(--red); font-size: 13px; font-weight: 600; min-height: 16px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%);
  background: #141b28;
  color: var(--text); border: 1px solid rgba(43, 232, 181, .35);
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 700; z-index: 99;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5), 0 0 18px rgba(43, 232, 181, .15);
  animation: toast-in .28s cubic-bezier(.22, 1, .36, 1);
  white-space: nowrap; max-width: 90vw;
  overflow: hidden; text-overflow: ellipsis;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.94); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ---------- AccessibilitÃ© : mouvement rÃ©duit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Conseil du coach (IA) ---------- */
.coach-box {
  margin: 12px 0 4px;
  padding: 14px 15px;
  border-radius: var(--r-md, 16px);
  background: linear-gradient(120deg, rgba(167, 139, 250, .14), rgba(43, 232, 181, .10));
  border: 1px solid rgba(167, 139, 250, .35);
  box-shadow: 0 0 18px rgba(167, 139, 250, .18), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.coach-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--violet, #a78bfa); margin-bottom: 6px;
}
.coach-text { font-size: 14px; line-height: 1.55; color: var(--text); }
.goal-hint b { color: var(--accent); }

/* ---------- Dashboard (Accueil) ---------- */
.dash-head { align-items: flex-start; }
.dash-hello {
  font-size: 26px; font-weight: 900; letter-spacing: -1px;
  background: linear-gradient(120deg, #fff 30%, rgba(255,255,255,.55));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dash-date { color: var(--muted); font-size: 13px; margin-top: 3px; text-transform: capitalize; }
.dash-avatar {
  width: 46px; height: 46px; border-radius: 16px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--violet, #a78bfa), var(--violet2, #6366f1));
  color: #fff; font-size: 19px; font-weight: 900;
  box-shadow: var(--glow-violet, 0 0 22px rgba(167,139,250,.32));
}
.dash-hero {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px;
}
.dash-stat {
  background: linear-gradient(160deg, #161e2d, #10151f 60%);
  border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: var(--r-md, 16px); padding: 13px 6px; text-align: center;
}
.dash-stat b { display: block; font-size: 24px; font-weight: 900; letter-spacing: -1px; }
.dash-stat span { color: var(--muted); font-size: 11px; font-weight: 700; }
.dash-card { margin-bottom: 12px; cursor: pointer; }
.dash-card:active { transform: scale(.985); }
.dash-card-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--muted); margin-bottom: 10px;
}
.dash-go { font-size: 20px; color: var(--muted); font-weight: 400; }
.dash-big { font-size: 15px; margin-bottom: 10px; }
.dash-big b {
  font-size: 30px; font-weight: 900; letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.dash-big.mint b  { color: var(--accent);  text-shadow: 0 0 22px rgba(43,232,181,.4); }
.dash-big.amber b { color: var(--orange);  text-shadow: 0 0 22px rgba(255,176,32,.35); }
.dash-big.pink b  { color: var(--pink, #ff4fa3); text-shadow: 0 0 22px rgba(255,79,163,.35); }
.dash-sub { color: var(--muted); font-size: 13px; margin-top: 8px; }
.dash-card .big-btn { margin-top: 12px; }

/* Bande des 7 derniers jours */
.wk-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.wk { text-align: center; }
.wk span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.wk i {
  display: block; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line, rgba(255,255,255,.08));
}
.wk.done i {
  background: linear-gradient(160deg, rgba(43,232,181,.55), rgba(34,211,238,.35));
  border-color: rgba(43,232,181,.5);
  box-shadow: 0 0 12px rgba(43,232,181,.3);
}
.wk.partial i {
  background: linear-gradient(160deg, rgba(255,176,32,.45), rgba(255,122,24,.25));
  border-color: rgba(255,176,32,.4);
}
.wk.today span { color: var(--accent); }
.wk.today i { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Fiche dÃ©taillÃ©e d''une phase ---------- */
.phase { cursor: pointer; }
.phase-go { font-style: normal; color: var(--muted); margin-left: 4px; }
.phase-banner { cursor: pointer; }
.phase-info-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.phase-info-ico {
  font-size: 34px; width: 60px; height: 60px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(43,232,181,.18), rgba(34,211,238,.08));
  border: 1px solid rgba(43,232,181,.3); border-radius: 18px;
  box-shadow: 0 0 18px rgba(43,232,181,.2);
}
.phase-info-range {
  font-size: 13px; font-weight: 800; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 4px;
}
.phase-status { font-size: 12px; font-weight: 700; }
.phase-status.now  { color: var(--accent); }
.phase-status.done { color: var(--muted); }
.phase-status.todo { color: var(--orange); }
.phase-info-body { font-size: 14px; line-height: 1.65; color: var(--text); margin-bottom: 6px; }
.phase-info-sec {
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--muted); margin: 16px 0 8px;
}
.phase-info-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.phase-info-list li {
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  padding: 9px 12px 9px 30px; position: relative;
  background: rgba(255,255,255,.04); border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: 12px;
}
.phase-info-list li::before {
  content: "â€¢"; position: absolute; left: 13px; color: var(--accent); font-weight: 900;
}
.phase-info-disclaimer {
  margin-top: 16px; font-size: 11.5px; color: var(--muted);
  line-height: 1.5; text-align: center; opacity: .8;
}
/* scroll géré par .modal-box */

/* ---------- Plan optimal IA ---------- */
.plan-intro, .plan-modal-intro { color: var(--muted); font-size: 13px; line-height: 1.55; margin-bottom: 12px; }
.plan-card { border-color: rgba(167,139,250,.4); box-shadow: 0 6px 18px rgba(0,0,0,.3), 0 0 20px rgba(167,139,250,.12); }
.plan-head {
  font-size: 15px; font-weight: 900; margin-bottom: 14px;
  color: var(--violet, #a78bfa); letter-spacing: -.3px;
}
.plan-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.plan-metrics > div {
  background: rgba(167,139,250,.08); border: 1px solid rgba(167,139,250,.22);
  border-radius: 14px; padding: 12px; text-align: center;
}
.plan-metrics b { display: block; font-size: 19px; font-weight: 900; letter-spacing: -.5px; }
.plan-metrics span { color: var(--muted); font-size: 11px; font-weight: 700; }
.plan-bf {
  text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 10px;
  padding: 8px; background: rgba(255,255,255,.03); border-radius: 10px;
}
.plan-bf b { color: var(--pink, #ff4fa3); }
.plan-approach { font-size: 14px; line-height: 1.6; margin-bottom: 6px; }
.plan-sec {
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--muted); margin: 14px 0 8px;
}
.plan-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.plan-list li {
  font-size: 13.5px; line-height: 1.5; padding: 9px 12px 9px 30px; position: relative;
  background: rgba(255,255,255,.04); border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 12px;
}
.plan-list li::before { content: "âœ“"; position: absolute; left: 12px; color: var(--accent); font-weight: 900; }
.plan-warning {
  margin-top: 12px; padding: 11px 13px; font-size: 13px; line-height: 1.5;
  background: rgba(255,176,32,.10); border: 1px solid rgba(255,176,32,.35);
  border-radius: 12px; color: #ffd18a;
}
.plan-actions { margin-top: 14px; }
.plan-actions .small-btn, .plan-actions .ghost-btn { margin-top: 0; width: 100%; }
.plan-disclaimer { margin-top: 12px; font-size: 11px; color: var(--muted); line-height: 1.5; text-align: center; opacity: .8; }
#planCard .small-btn { background: linear-gradient(135deg, var(--violet, #a78bfa), var(--violet2, #6366f1)); color: #fff; }

/* ---------- Hydratation ---------- */
.dash-big.water b { color: #38bdf8; text-shadow: 0 0 12px rgba(56,189,248,.4); }
.water-unit { font-size: 15px; color: var(--muted); }
.water-unit b { color: var(--muted); font-weight: 700; }
.bar-fill.water { background: linear-gradient(90deg, #38bdf8, #22d3ee); }
.water-top { margin-bottom: 8px; }
.water-btns { display: flex; gap: 8px; margin-top: 12px; }
.water-btn {
  flex: 1; background: rgba(56,189,248,.10); border: 1px solid rgba(56,189,248,.30);
  color: #7dd3fc; border-radius: 12px; padding: 12px 4px; font-size: 14px; font-weight: 800; cursor: pointer;
  transition: background-color .15s ease;
}
.water-btn:active { background: rgba(56,189,248,.22); }
.water-btn.undo { flex: 0 0 46px; color: var(--muted); background: rgba(255,255,255,.04); border-color: var(--line); }

/* Interrupteur (rÃ©glages) */
.switch-row { flex-direction: row !important; align-items: center; justify-content: space-between; gap: 12px; }
.switch-sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.switch-row input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 46px !important; height: 28px; flex-shrink: 0;
  background: var(--card2); border: 1px solid var(--line-strong); border-radius: 999px; position: relative; cursor: pointer;
  transition: background-color .2s ease;
}
.switch-row input[type=checkbox]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform .2s ease;
}
.switch-row input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
.switch-row input[type=checkbox]:checked::after { transform: translateX(18px); }

/* ---------- Coach : bouton sÃ©ance ---------- */
.coach-cta {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: linear-gradient(135deg, rgba(255,79,163,.16), rgba(167,139,250,.12));
  border: 1px solid rgba(255,79,163,.35); color: var(--text);
  border-radius: var(--r-lg); padding: 15px 16px; margin-bottom: 16px; cursor: pointer;
  box-shadow: 0 0 20px rgba(255,79,163,.12);
}
.coach-cta:active { transform: scale(.985); }
.coach-cta-ico { font-size: 26px; }
.coach-cta b { display: block; font-size: 15px; font-weight: 800; }
.coach-cta small { color: var(--muted); font-size: 12px; }
.coach-cta-go { margin-left: auto; font-size: 22px; color: var(--muted); }

/* Boutons segmentÃ©s (formulaire sÃ©ance) */
.seg { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 60px; background: var(--card2); border: 1px solid var(--line-strong);
  color: var(--text); border-radius: 12px; padding: 11px 6px; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.seg button.sel { background: linear-gradient(135deg, var(--pink,#ff4fa3), var(--violet,#a78bfa)); border-color: transparent; color: #fff; }

/* Affichage de la sÃ©ance */
.wo-head { margin-bottom: 6px; }
.wo-title { font-size: 18px; font-weight: 900; letter-spacing: -.4px; }
.wo-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.wo-sec { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 16px 0 8px; }
.wo-list.wo-simple { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.wo-list.wo-simple li { font-size: 13.5px; color: var(--text); padding: 8px 12px 8px 26px; position: relative; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 10px; }
.wo-list.wo-simple li::before { content: "â€¢"; position: absolute; left: 12px; color: var(--pink,#ff4fa3); font-weight: 900; }
.wo-ex { display: flex; flex-direction: column; gap: 8px; }
.wo-ex-item { background: rgba(255,79,163,.06); border: 1px solid rgba(255,79,163,.22); border-radius: 12px; padding: 11px 13px; }
.wo-ex-name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wo-ex-name b { font-size: 14.5px; font-weight: 800; }
.wo-ex-detail { color: var(--pink2,#f472b6); font-size: 14px; font-weight: 800; white-space: nowrap; }
.wo-ex-sub { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
/* scroll géré par .modal-box */

/* ---------- Historique IA ---------- */
.history-link {
  width: 100%; margin-top: 10px; background: rgba(255,255,255,.03);
  border: 1px solid var(--line); color: var(--muted);
  border-radius: var(--r-md); padding: 12px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.history-link:active { background: rgba(255,255,255,.08); color: var(--text); }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.hist-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 14px; padding: 11px 13px;
}
.hist-ico { font-size: 22px; cursor: pointer; }
.hist-info { flex: 1; min-width: 0; cursor: pointer; }
.hist-info b { display: block; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-info span { color: var(--muted); font-size: 12px; }
.hist-del { background: none; border: 0; color: var(--muted); font-size: 15px; cursor: pointer; padding: 4px; flex-shrink: 0; }
.ghost-btn.full { grid-column: 1 / -1; }

/* ---------- Exercices enrichis (affichage sÃ©ance) ---------- */
.wo-start-btn { margin: 4px 0 6px; }
.wo-ex-how { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 6px 0; }
.wo-demo {
  margin-top: 8px; background: rgba(255,79,163,.10); border: 1px solid rgba(255,79,163,.30);
  color: var(--pink,#ff4fa3); border-radius: 10px; padding: 8px 12px; font-size: 12.5px;
  font-weight: 800; cursor: pointer;
}
.wo-demo:active { background: rgba(255,79,163,.2); }

/* ---------- SÃ©ance guidÃ©e (plein Ã©cran) ---------- */
.wo-session {
  position: fixed; inset: 0; z-index: 120;
  background: linear-gradient(180deg, #0a0e17, #05070d);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.wo-session-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px;
}
.wo-session-title { flex: 1; font-size: 17px; font-weight: 900; letter-spacing: -.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-prog-count { font-size: 14px; font-weight: 800; color: var(--pink,#ff4fa3); font-variant-numeric: tabular-nums; }
.wo-prog-bar { height: 5px; background: rgba(255,255,255,.08); margin: 0 16px; border-radius: 99px; overflow: hidden; }
.wo-prog-bar > div { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--pink,#ff4fa3), var(--violet,#a78bfa)); transition: width .3s ease; }

.wo-restbar {
  margin: 12px 16px 0; padding: 14px; border-radius: 16px; text-align: center;
  background: linear-gradient(135deg, rgba(56,189,248,.16), rgba(34,211,238,.10));
  border: 1px solid rgba(56,189,248,.4);
}
.wo-rest-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; color: #7dd3fc; }
.wo-rest-time { font-size: 40px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -1px; margin: 2px 0 8px; color: #38bdf8; }
.wo-rest-actions { display: flex; gap: 8px; justify-content: center; }
.wo-rest-actions button {
  background: rgba(255,255,255,.08); border: 1px solid var(--line-strong); color: var(--text);
  border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 800; cursor: pointer;
}
.wo-rest-actions button:active { background: rgba(255,255,255,.16); }

.wo-session-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.wo-g-item { background: var(--card2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; transition: opacity .2s, border-color .2s; }
.wo-g-item.done { opacity: .55; border-color: rgba(43,232,181,.5); background: rgba(43,232,181,.06); }
.wo-g-top { display: flex; gap: 12px; }
.wo-g-check {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900; color: var(--muted); cursor: pointer;
}
.wo-g-item.done .wo-g-check { background: var(--accent); border-color: var(--accent); color: var(--accent-deep); }
.wo-g-info { flex: 1; min-width: 0; }
.wo-g-name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wo-g-name b { font-size: 15.5px; font-weight: 800; }
.wo-g-detail { color: var(--pink2,#f472b6); font-size: 14px; font-weight: 800; white-space: nowrap; }
.wo-g-how { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 5px; }
.wo-g-actions { display: flex; gap: 8px; margin-top: 12px; }
.wo-g-demo {
  flex: 0 0 auto; background: rgba(255,79,163,.10); border: 1px solid rgba(255,79,163,.30);
  color: var(--pink,#ff4fa3); border-radius: 12px; padding: 11px 16px; font-size: 13px; font-weight: 800; cursor: pointer;
}
.wo-g-done {
  flex: 1; background: rgba(43,232,181,.12); border: 1px solid rgba(43,232,181,.35);
  color: var(--accent); border-radius: 12px; padding: 11px; font-size: 14px; font-weight: 800; cursor: pointer;
}
.wo-g-done:active { background: rgba(43,232,181,.24); }
.wo-g-item.done .wo-g-done { background: rgba(255,255,255,.05); border-color: var(--line); color: var(--muted); }
.wo-session-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.wo-session-foot .big-btn { margin: 0; }

/* ---------- Bouton "pourquoi" (affichage statique) ---------- */
.wo-why-btn {
  background: rgba(167,139,250,.10); border: 1px solid rgba(167,139,250,.30);
  color: var(--violet,#a78bfa); border-radius: 10px; padding: 7px 11px;
  font-size: 12px; font-weight: 800; cursor: pointer; margin-top: 6px;
}
.wo-why-btn:active { background: rgba(167,139,250,.2); }
.wo-why-box {
  margin-top: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  background: rgba(167,139,250,.08); border: 1px solid rgba(167,139,250,.25);
  border-radius: 10px; color: var(--text);
}

/* ---------- SÃ©ance guidÃ©e : bouton son + sÃ©ries ---------- */
.wo-sound { background: rgba(255,255,255,.07); border: 1px solid var(--line); color: var(--text); width: 34px; height: 34px; border-radius: 50%; font-size: 15px; cursor: pointer; flex-shrink: 0; }
.wo-g-name { align-items: center; }
.wo-g-why {
  flex-shrink: 0; background: rgba(167,139,250,.12); border: 1px solid rgba(167,139,250,.35);
  color: var(--violet,#a78bfa); width: 26px; height: 26px; border-radius: 50%;
  font-size: 13px; font-weight: 900; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.wo-g-setline { font-size: 13.5px; color: var(--text); margin-top: 5px; }
.wo-g-setline b { color: var(--pink,#ff4fa3); font-size: 15px; }
.wo-g-reps { color: var(--pink2,#f472b6); font-weight: 800; }
.wo-g-dots { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.wo-g-dots i {
  width: 22px; height: 8px; border-radius: 99px;
  background: rgba(255,255,255,.10); border: 1px solid var(--line-strong);
}
.wo-g-dots i.on { background: linear-gradient(90deg, var(--pink,#ff4fa3), var(--violet,#a78bfa)); border-color: transparent; }
.wo-g-why-box {
  margin-top: 8px; padding: 9px 11px; font-size: 12.5px; line-height: 1.5;
  background: rgba(167,139,250,.08); border: 1px solid rgba(167,139,250,.25);
  border-radius: 10px; color: var(--text);
}
.wo-g-set {
  flex: 1; background: linear-gradient(135deg, var(--pink,#ff4fa3), var(--violet,#a78bfa));
  border: 0; color: #fff; border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 800; cursor: pointer;
}
.wo-g-set:active { transform: scale(.97); }
.wo-g-item.done .wo-g-set { background: rgba(255,255,255,.06); color: var(--muted); }

/* ---------- Coach repas : bouton + options ---------- */
.coach-cta.meal {
  background: linear-gradient(135deg, rgba(43,232,181,.16), rgba(255,176,32,.12));
  border-color: rgba(43,232,181,.35); box-shadow: 0 0 20px rgba(43,232,181,.12);
}
.mc-option {
  background: rgba(43,232,181,.05); border: 1px solid rgba(43,232,181,.22);
  border-radius: 16px; padding: 14px; margin-bottom: 12px;
}
.mc-opt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mc-opt-name { font-size: 16px; font-weight: 800; }
.mc-opt-kcal { color: var(--accent); font-size: 15px; font-weight: 900; white-space: nowrap; }
.mc-opt-desc { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 4px; }
.mc-opt-macros { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.mc-opt-ings ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.mc-opt-ings li { font-size: 13px; padding-left: 18px; position: relative; }
.mc-opt-ings li::before { content: "â€¢"; position: absolute; left: 5px; color: var(--accent); font-weight: 900; }
.mc-opt-why-btn {
  margin-top: 10px; background: rgba(167,139,250,.10); border: 1px solid rgba(167,139,250,.30);
  color: var(--violet,#a78bfa); border-radius: 10px; padding: 7px 11px; font-size: 12px; font-weight: 800; cursor: pointer;
}
.mc-opt-why {
  margin-top: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  background: rgba(167,139,250,.08); border: 1px solid rgba(167,139,250,.25); border-radius: 10px;
}
.mc-opt-add {
  width: 100%; margin-top: 12px; background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 0; color: var(--accent-deep); border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 800; cursor: pointer;
}
.mc-opt-add:active { transform: scale(.98); }
.mc-opt-add.added { background: rgba(255,255,255,.06); color: var(--muted); }

/* ---------- Heure de dÃ©but cliquable (correction du jeÃ»ne) ---------- */
.fast-times .editable { cursor: pointer; border-radius: 12px; padding: 4px 10px; margin: -4px -10px; transition: background-color .15s ease; }
.fast-times .editable:active { background: rgba(43,232,181,.10); }
.fast-times .editable span { color: var(--accent); }

/* ---------- Grille multi-photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.photo-thumb { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-strong); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-rm {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(2,4,9,.8); border: 1px solid rgba(255,255,255,.25); color: #fff;
  font-size: 15px; font-weight: 900; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.photo-add {
  aspect-ratio: 1; border: 2px dashed rgba(43,232,181,.4); border-radius: 14px;
  background: rgba(43,232,181,.05); color: var(--accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; text-align: center;
}
.photo-add:active { background: rgba(43,232,181,.12); }
.photo-add-plus { font-size: 30px; font-weight: 300; line-height: 1; }
.photo-add small { font-size: 10px; color: var(--muted); padding: 0 4px; }
.photo-hint { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
