/* Fitness – design system */
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Thème clair (par défaut) */
  --bg: #f3f5f8;
  --glow-1: rgba(46, 230, 197, 0.16);
  --glow-2: rgba(190, 240, 60, 0.18);
  --card: #ffffff;
  --card-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -14px rgba(16, 24, 40, 0.16);
  --surface: rgba(16, 24, 40, 0.035);
  --surface-2: rgba(16, 24, 40, 0.06);
  --surface-3: rgba(16, 24, 40, 0.1);
  --line: rgba(16, 24, 40, 0.08);
  --line-2: rgba(16, 24, 40, 0.15);
  --text: #101828;
  --muted: #5b6577;
  --faint: #8e97a8;
  --volt: #d4fb3f;
  --volt-soft: rgba(170, 220, 20, 0.18);
  --mint: #0ea58c;
  --accent: #0b9682;
  --accent-line: rgba(11, 150, 130, 0.35);
  --grad: linear-gradient(135deg, #d4fb3f 0%, #3fe8c8 100%);
  --grad-ink: linear-gradient(135deg, #4d9a00 0%, #0b9682 100%);
  --ring-a: #a6e22e;
  --ring-b: #14b8a6;
  --on-volt: #0b1200;
  --protein: #ef5b36;
  --carbs: #e09600;
  --fat: #7c5cf0;
  --water: #1a9ee0;
  --danger: #e2334f;
  --field: #ffffff;
  --field-focus: #ffffff;
  --sheet: #ffffff;
  --nav: rgba(255, 255, 255, 0.9);
  --nav-side: rgba(255, 255, 255, 0.82);
  --nav-shadow: 0 16px 40px -18px rgba(16, 24, 40, 0.28);
  --scrim: rgba(16, 24, 40, 0.32);
  --toast-bg: #101828;
  --toast-fg: #ffffff;
  --btn-dark: rgba(16, 24, 40, 0.06);
  --glass: rgba(255, 255, 255, 0.72);
  --primary-shadow: 0 10px 24px -12px rgba(110, 150, 0, 0.55);
  --hero: radial-gradient(120% 140% at 100% 0%, rgba(212, 251, 63, 0.55), transparent 55%), radial-gradient(120% 120% at 0% 100%, rgba(63, 232, 200, 0.38), transparent 55%), linear-gradient(160deg, #fbfff3, #eefbf7 70%);
  --hero-rest: radial-gradient(120% 140% at 100% 0%, rgba(76, 201, 255, 0.3), transparent 55%), linear-gradient(160deg, #f6fbff, #eef4fa 70%);
  --hero-border: rgba(16, 24, 40, 0.06);
  --hero-shadow: 0 24px 48px -30px rgba(11, 150, 130, 0.45);
  --dots: rgba(16, 24, 40, 0.06);
  --r-lg: 24px;
  --display: 'Archivo', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --tab-h: 72px;
  --side-w: 256px;
  color-scheme: light;
}
/* Thème sombre (au choix dans « Moi ») */
:root[data-theme='dark'] {
  --bg: #07090d;
  --glow-1: rgba(46, 230, 197, 0.11);
  --glow-2: rgba(215, 255, 60, 0.06);
  --card: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  --card-shadow: none;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-3: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f3f6f9;
  --muted: #8a94a6;
  --faint: #5b6577;
  --volt: #d7ff3c;
  --volt-soft: rgba(215, 255, 60, 0.14);
  --mint: #2ee6c5;
  --accent: #d7ff3c;
  --accent-line: rgba(215, 255, 60, 0.4);
  --grad: linear-gradient(135deg, #d7ff3c 0%, #2ee6c5 100%);
  --grad-ink: linear-gradient(135deg, #d7ff3c 0%, #2ee6c5 100%);
  --ring-a: #d7ff3c;
  --ring-b: #2ee6c5;
  --protein: #ff7a59;
  --carbs: #ffc145;
  --fat: #a78bfa;
  --water: #4cc9ff;
  --danger: #ff5470;
  --field: rgba(255, 255, 255, 0.045);
  --field-focus: rgba(255, 255, 255, 0.07);
  --sheet: #10151c;
  --nav: rgba(16, 20, 27, 0.82);
  --nav-side: rgba(10, 13, 18, 0.7);
  --nav-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  --scrim: rgba(0, 0, 0, 0.55);
  --toast-bg: #f3f6f9;
  --toast-fg: #0b0f14;
  --btn-dark: rgba(0, 0, 0, 0.35);
  --glass: rgba(255, 255, 255, 0.09);
  --primary-shadow: 0 10px 30px -12px rgba(215, 255, 60, 0.7);
  --hero: radial-gradient(120% 140% at 100% 0%, rgba(215, 255, 60, 0.28), transparent 55%), radial-gradient(120% 120% at 0% 100%, rgba(46, 230, 197, 0.3), transparent 55%), linear-gradient(160deg, #13201c, #0b1014 70%);
  --hero-rest: radial-gradient(120% 140% at 100% 0%, rgba(76, 201, 255, 0.22), transparent 55%), linear-gradient(160deg, #111a24, #0b0f15 70%);
  --hero-border: rgba(215, 255, 60, 0.18);
  --hero-shadow: 0 30px 60px -30px rgba(46, 230, 197, 0.35);
  --dots: rgba(255, 255, 255, 0.07);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 15.5px/1.5 var(--body);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 0% -8%, var(--glow-1), transparent 60%),
    radial-gradient(700px 480px at 100% 0%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
.i { flex: none; display: inline-block; vertical-align: middle; }

/* ---------- Mise en page ---------- */
#app {
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 36px);
}
.auth-mode #app { padding-bottom: 32px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 20px; }
.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
h1, .h1 {
  font: 800 2rem/1.05 var(--display);
  font-stretch: 112%;
  letter-spacing: -0.02em;
  margin: 4px 0 0;
}
h2, .h2 { font: 700 1.15rem/1.2 var(--display); font-stretch: 108%; margin: 0; letter-spacing: -0.01em; }
h3, .h3 { font: 650 1rem/1.3 var(--body); margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.85rem; }
.xs { font-size: 0.75rem; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; font-stretch: 105%; }
.grad-text { background: var(--grad-ink); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head a { font-size: 0.85rem; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.grid { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout { display: grid; gap: 0 24px; grid-template-columns: minmax(0, 1fr); }
.stack > * + * { margin-top: 12px; }

/* ---------- Surfaces ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card.flat { background: var(--surface); }
.card.tight { padding: 14px; }
.card.link { text-decoration: none; display: block; transition: transform 0.2s var(--ease), border-color 0.2s; }
.card.link:active { transform: scale(0.985); }
@media (hover: hover) { .card.link:hover { border-color: var(--line-2); } }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 22px;
  background: var(--hero);
  border: 1px solid var(--hero-border);
  box-shadow: var(--hero-shadow);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dots) 1px, transparent 1px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(120deg, transparent 30%, #000);
  mask-image: linear-gradient(120deg, transparent 30%, #000);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: 1.75rem; font-weight: 800; font-stretch: 115%; line-height: 1.05; margin: 10px 0 6px; }
.hero.rest { background: var(--hero-rest); border-color: rgba(76, 201, 255, 0.2); box-shadow: none; }

.bubble {
  width: 40px; height: 40px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--text);
  flex: none;
}
.bubble.volt { background: var(--volt-soft); color: var(--accent); }
.bubble.mint { background: rgba(46, 230, 197, 0.16); color: var(--mint); }
.bubble.water { background: rgba(76, 201, 255, 0.14); color: var(--water); }
.bubble.protein { background: rgba(255, 122, 89, 0.14); color: var(--protein); }
.bubble.carbs { background: rgba(255, 193, 69, 0.14); color: var(--carbs); }
.bubble.fat { background: rgba(167, 139, 250, 0.14); color: var(--fat); }
.bubble.danger { background: rgba(255, 84, 112, 0.12); color: var(--danger); }
.bubble.lg { width: 52px; height: 52px; border-radius: 16px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
  white-space: nowrap;
}
.chip.volt { background: var(--volt); color: var(--on-volt); }
.chip.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.chip.glass { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Boutons ---------- */
button, .btn {
  font: 650 0.97rem/1 var(--body);
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  min-height: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s, opacity 0.2s;
  user-select: none;
  -webkit-user-select: none;
}
button:active, .btn:active { transform: scale(0.96); }
button:disabled { opacity: 0.45; pointer-events: none; }
.btn.primary, button.primary { background: var(--volt); color: var(--on-volt); box-shadow: var(--primary-shadow); }
.btn.grad, button.grad { background: var(--grad); color: var(--on-volt); }
.btn.ghost, button.ghost { background: transparent; border: 1px solid var(--line-2); }
.btn.dark, button.dark { background: var(--btn-dark); }
.btn.soft, button.soft { background: var(--volt-soft); color: var(--text); }
.btn.danger, button.danger { background: rgba(255, 84, 112, 0.12); color: var(--danger); }
.btn.block, button.block { width: 100%; }
.btn.sm, button.sm { min-height: 38px; padding: 0 14px; border-radius: 12px; font-size: 0.88rem; }
.icon-btn {
  width: 44px; height: 44px; min-height: 0; padding: 0;
  border-radius: 14px;
  background: var(--surface-2);
}
.icon-btn.sm { width: 34px; height: 34px; border-radius: 11px; }
.icon-btn.round { border-radius: 50%; }
.icon-btn.clear { background: transparent; }
@media (hover: hover) {
  button:hover, .btn:hover { background-color: var(--surface-3); }
  .btn.primary:hover, button.primary:hover { background: #e2ff6a; }
  .btn.grad:hover, button.grad:hover { filter: brightness(1.06); }
  .btn.danger:hover, button.danger:hover { background: rgba(255, 84, 112, 0.2); }
}

/* ---------- Formulaires ---------- */
label.lbl { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; letter-spacing: 0.01em; }
input, select, textarea {
  font: 500 1rem var(--body);
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--field);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}
select option { background: var(--sheet); }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background-color: var(--field-focus); }
.field + .field { margin-top: 16px; }
.input-icon { position: relative; }
.input-icon > .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 46px; }
.error { color: var(--danger); font-size: 0.88rem; min-height: 1.3em; margin-top: 10px; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; pointer-events: none; }
.choice span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 15px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid transparent;
  font-weight: 600; font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.choice input:checked + span { background: var(--volt); color: var(--on-volt); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.choices.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.cards .choice span { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 18px; min-height: 112px; height: 100%; }
.choices.cards .choice span small { font-weight: 500; font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.choices.cards .choice input:checked + span small { color: rgba(11, 18, 0, 0.7); }
.choices.cards .choice input:checked + span .bubble { background: rgba(0, 0, 0, 0.12); color: var(--on-volt); }

.seg {
  display: flex; gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button {
  flex: 1;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font: 600 0.88rem var(--body);
  color: var(--muted);
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
  background: transparent;
}
.seg .on { background: var(--surface-3); color: var(--text); }

/* Stepper (séries) */
.stepper { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 8px; }
.stepper .val { flex: 1; min-width: 0; text-align: center; }
.stepper input {
  border: 0; background: transparent; text-align: center; padding: 0; min-height: 40px;
  font: 800 1.9rem var(--display); font-stretch: 110%; font-variant-numeric: tabular-nums;
}
.stepper input:focus { background: transparent; }
.stepper .unit { font-size: 0.7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.stepper button { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 14px; flex: none; }

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.list > .item:first-child { border-top: 0; padding-top: 0; }
.list > .item:last-child { padding-bottom: 0; }
.list .item .meta { text-align: right; }
.thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); }

/* ---------- Données ---------- */
.ring { position: relative; display: grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring circle { fill: none; }
.ring .track { stroke: var(--surface-3); }
.ring .bar { stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

.stat { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.stat .val { font: 800 1.45rem/1 var(--display); font-stretch: 108%; font-variant-numeric: tabular-nums; }
.stat .lab { font-size: 0.74rem; color: var(--muted); font-weight: 600; }

.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--grad); width: 0; transition: width 1.1s var(--ease); }
.bar.protein > i { background: var(--protein); }
.bar.carbs > i { background: var(--carbs); }
.bar.fat > i { background: var(--fat); }
.bar.water > i { background: var(--water); }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; border-radius: 16px; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.week .d.today { background: var(--surface-2); color: var(--text); }
.week .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--line-2); color: var(--faint); }
.week .dot.planned { border: 1.5px solid var(--accent-line); color: var(--accent); }
.week .dot.done { border: 0; background: var(--grad); color: var(--on-volt); }

.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; width: 74%; max-width: 280px; }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gridline { stroke: var(--line); }
.chart .axis { fill: var(--faint); font: 600 10px var(--body); }
.chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .pt { fill: var(--bg); stroke-width: 2; }

.empty { text-align: center; padding: 30px 18px; color: var(--muted); }
.empty .bubble { margin: 0 auto 12px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

/* ---------- Navigation ---------- */
#nav {
  position: fixed; z-index: 30;
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  height: var(--tab-h);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 6px;
  border-radius: 26px;
  background: var(--nav);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line);
  box-shadow: var(--nav-shadow);
  max-width: 520px; margin: 0 auto;
}
#nav .brand, #nav .user { display: none; }
#nav a {
  flex: 1;
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 0.68rem; font-weight: 600;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.2s;
}
#nav a.on { color: var(--text); }
#nav a.on .i { color: var(--accent); }
#nav a.go { flex: 0 0 64px; }
#nav a.go .orb {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: var(--on-volt);
  box-shadow: var(--primary-shadow);
  transition: transform 0.2s var(--ease);
}
#nav a.go .orb .i { color: var(--on-volt); }
#nav a.go:active .orb { transform: scale(0.92); }
#nav a.go .lbl-go { display: none; }
#nav a.go.live .orb { animation: pulse 1.8s infinite; }

@media (min-width: 960px) {
  body { font-size: 15px; }
  #app { margin-left: var(--side-w); max-width: none; padding: 40px 48px 64px; }
  #app > .view { max-width: 1060px; margin: 0 auto; }
  #nav {
    left: 0; top: 0; bottom: 0; right: auto;
    width: var(--side-w); height: auto;
    margin: 0; max-width: none;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px;
    padding: 28px 16px;
    border-radius: 0; border: 0; border-right: 1px solid var(--line);
    background: var(--nav-side);
    box-shadow: none;
  }
  #nav .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 26px; font: 800 1.25rem var(--display); font-stretch: 115%; text-decoration: none; color: var(--text); }
  #nav .brand img { width: 34px; height: 34px; border-radius: 10px; }
  #nav a { flex: none; height: 48px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; border-radius: 14px; font-size: 0.93rem; color: var(--muted); }
  #nav a.on { background: var(--surface-2); }
  #nav a.go { flex: none; order: -1; margin-bottom: 14px; background: var(--grad); color: var(--on-volt); justify-content: center; height: 50px; }
  #nav a.go .orb { width: auto; height: auto; background: none; box-shadow: none; color: inherit; }
  #nav a.go.live .orb { animation: none; }
  #nav a.go .lbl-go { display: inline; font-weight: 700; }
  #nav a.go .lbl-tab { display: none; }
  #nav .user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 10px; border-radius: 16px; text-decoration: none; }
  #nav .user .avatar { width: 36px; height: 36px; font-size: 0.9rem; }
  h1, .h1 { font-size: 2.5rem; }
  .layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .layout > .wide { grid-column: 1 / -1; }
  .hscroll { margin: 0; padding: 2px 0 6px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .hscroll > * { width: auto; max-width: none; }
  .grid-machines { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .sheet { left: 50% !important; right: auto !important; bottom: auto !important; top: 50%; width: 480px; transform: translate(-50%, -50%); border-radius: 28px !important; animation: zoom 0.3s var(--ease) !important; }
  .sheet.closing { animation: fade 0.18s reverse forwards !important; }
  .sheet .grabber { display: none; }
  .toast { bottom: 32px !important; left: calc(50% + var(--side-w) / 2) !important; }
}

/* ---------- Feuille modale ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade 0.25s var(--ease); }
.scrim.closing { animation: fade 0.2s reverse forwards; }
.sheet {
  position: fixed; z-index: 41;
  left: 0; right: 0; bottom: 0;
  max-height: 92dvh; overflow-y: auto;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  animation: up 0.35s var(--ease);
  overscroll-behavior: contain;
}
.sheet.closing { animation: down 0.22s ease-in forwards; }
.sheet .grabber { width: 40px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 14px; }
.sheet h2 { margin-bottom: 4px; }

/* ---------- Séance ---------- */
.workout-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.clock-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); font: 700 1rem var(--display); font-variant-numeric: tabular-nums; }
.clock-pill .live { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.4s infinite; }
.ex-card { padding: 20px; }
.ex-card .ex-name { font: 800 1.55rem/1.1 var(--display); font-stretch: 112%; letter-spacing: -0.01em; }
.setdots { display: flex; gap: 6px; flex-wrap: wrap; }
.setdots i { width: 22px; height: 6px; border-radius: 9px; background: var(--surface-3); }
.setdots i.done { background: var(--grad); }
.rest-ring { margin: 6px auto 4px; width: min(74vw, 290px); aspect-ratio: 1; }
.rest-ring .big { font: 800 4rem/1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.rest-ring.go .big { background: var(--grad-ink); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rest-ring.over .bar { stroke: var(--carbs) !important; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row .n { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); font: 700 0.8rem var(--display); flex: none; }

/* ---------- Machines ---------- */
.machine { padding: 0; overflow: hidden; }
.machine .ph { aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); position: relative; }
.machine .ph img { width: 100%; height: 100%; object-fit: cover; }
.machine .body { padding: 12px 14px 14px; }
.photo-drop { aspect-ratio: 4 / 3; border-radius: 20px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; text-align: center; color: var(--muted); overflow: hidden; cursor: pointer; position: relative; }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; height: 100%; }

/* ---------- Nutrition ---------- */
.datebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.datebar .label { font: 700 1rem var(--display); text-align: center; flex: 1; }
.macro { display: flex; flex-direction: column; gap: 6px; }
.macro .top { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; gap: 6px; }
.meal-entry { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.glasses { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.glass { height: 44px; min-height: 0; padding: 0; border-radius: 12px; background: var(--surface-2); color: var(--faint); }
.glass.full { background: rgba(76, 201, 255, 0.18); color: var(--water); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 130px; }
.bars .b { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: var(--surface-3); transition: height 0.9s var(--ease); min-height: 4px; }
.bars .b.on i { background: var(--grad); }
.bars .b span { font-size: 0.7rem; color: var(--faint); font-weight: 600; }
.food-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 12px; width: 100%; background: transparent; min-height: 0; text-align: left; font-weight: 500; }
.food-row:first-child { border-top: 0; }
.food-row:active { background: var(--surface); transform: none; }
.scanner { position: relative; border-radius: 22px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 32% 10%; border: 2px solid var(--volt); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45); }

/* ---------- Auth ---------- */
.auth { min-height: calc(100dvh - 60px); display: grid; align-content: center; gap: 28px; max-width: 440px; margin: 0 auto; }
.auth .logo { width: 60px; height: 60px; border-radius: 18px; box-shadow: 0 16px 40px -12px rgba(46, 230, 197, 0.6); }
.auth h1 { font-size: 2.6rem; font-stretch: 118%; line-height: 0.98; margin-top: 18px; }
.auth-mode #nav { display: none; }
@media (min-width: 960px) { .auth-mode #app { margin-left: 0; } }

/* ---------- Divers ---------- */
.toast {
  position: fixed; z-index: 60;
  left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: var(--toast-bg); color: var(--toast-fg);
  padding: 12px 18px; border-radius: 16px;
  font-weight: 650; font-size: 0.92rem;
  box-shadow: 0 20px 40px -12px rgba(16, 24, 40, 0.45);
  max-width: calc(100% - 32px);
  width: max-content;
  animation: toast 0.35s var(--ease);
}
.toast.record { background: var(--grad); color: var(--on-volt); }
.skeleton { border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-volt); font: 800 1.05rem var(--display); text-decoration: none; flex: none; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.6rem; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- Animations ---------- */
.view > * { animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes zoom { from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 12px) scale(0.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(215, 255, 60, 0.55); } 50% { box-shadow: 0 0 0 10px rgba(215, 255, 60, 0); } }
@keyframes blink { 50% { opacity: 0.3; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.pop { animation: pop 0.4s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.rest-ring svg { width: 100%; height: 100%; }
button.item { color: inherit; }
#nav a { min-width: 0; }
#nav .lbl-tab { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav .lbl-long { display: none; }
#nav .brand { order: -2; }
.card.link.row { display: flex; }
.chip.glass { background: var(--glass); color: var(--text); }
@media (min-width: 960px) {
  #nav .lbl-long { display: inline; }
  #nav .lbl-short { display: none; }
}
@media (max-width: 599px) { .seg .i { display: none; } .seg a, .seg button { padding: 0 8px; } }
@keyframes scanline { from { background-position: 0 -40%; } to { background-position: 0 140%; } }

/* ---------- Séance : démarrage, file d'exercices, transitions ---------- */
.start-free { display: flex !important; align-items: center; gap: 14px; text-align: left; width: 100%; min-height: 0; padding: 18px; font-weight: inherit; }
.start-free h2 { font-size: 1.2rem; }
.day-card { text-align: left; min-height: 0; padding: 18px; display: block; font-weight: inherit; width: 100%; }
.day-card.today { border-color: var(--accent-line); }
.queue { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.queue::-webkit-scrollbar { display: none; }
.q-item {
  flex: none; scroll-snap-align: start;
  display: flex; align-items: center; gap: 10px;
  min-height: 0; height: 58px; max-width: 220px;
  padding: 6px 12px 6px 6px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--card-shadow);
  font-weight: 500; text-align: left;
}
.q-item .q-img { width: 44px; height: 44px; border-radius: 11px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); }
.q-item .q-txt { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.q-item .q-name { font-size: 0.82rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.q-item .q-sub { font-size: 0.7rem; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.q-item.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--card-shadow); }
.q-item.done { opacity: 0.62; }
.q-item.done .q-sub { color: var(--accent); }
.q-item.add { border-style: dashed; box-shadow: none; background: transparent; }
@media (hover: hover) { .q-item:hover { background-color: var(--card); border-color: var(--line-2); } }
.ex-card { padding: 0; overflow: hidden; }
.ex-card .ex-body { padding: 18px 20px 20px; }
.ex-media { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.ex-media img { width: 100%; height: 100%; object-fit: cover; }
.transition { padding: 20px; }
.next-ex { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.next-ex .next-img { width: 92px; height: 92px; border-radius: 18px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); }
.rest-next { text-align: center; margin: 2px 0 14px; color: var(--muted); font-size: 0.92rem; display: flex; align-items: center; justify-content: center; gap: 6px; }
.rest-next b { color: var(--text); }
.link-btn { display: block; margin: 12px auto 0; min-height: 40px; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.88rem; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) { .link-btn:hover { background: transparent; color: var(--text); } }

/* ---------- Choix d'exercices (plein écran sur mobile) ---------- */
.sheet.full { top: 0; max-height: none; height: 100dvh; border-radius: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.chooser { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chooser-head { padding: calc(env(safe-area-inset-top) + 14px) 16px 10px; border-bottom: 1px solid var(--line); background: var(--sheet); }
.chooser-head h2 { margin: 0; font-size: 1.3rem; }
.chooser-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 24px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.chooser-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--sheet); }
.chooser-foot button { min-height: 56px; }
.filter-row { display: flex; gap: 6px; overflow-x: auto; margin: 12px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row .chip { min-height: 34px; padding: 0 14px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.filter-row .chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.list-label { margin: 18px 0 6px; }
.ex-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 0; padding: 8px; margin: 2px 0; border-radius: 16px; background: transparent; text-align: left; font-weight: 500; border: 1px solid transparent; }
.ex-row .name { font-weight: 650; line-height: 1.25; }
.ex-row.picked { background: var(--volt-soft); border-color: var(--accent-line); }
.ex-row:active { transform: scale(0.99); }
.ex-thumb { width: 64px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); }
.ex-row .tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; font: 800 0.8rem var(--display); }
.ex-row.picked .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.ex-row.create { margin-top: 12px; border: 1.5px dashed var(--line-2); }
.ex-row.create .ex-thumb { color: var(--accent); }
.create-form { margin-top: 12px; }
.create-form .choices { gap: 6px; }
.create-form .choice span { padding: 9px 12px; font-size: 0.85rem; }
@media (min-width: 960px) {
  .sheet.full { top: 50% !important; height: min(86vh, 820px); width: 560px; border-radius: 28px !important; }
  .queue { margin: 0 0 14px; padding: 2px 0 8px; }
}

/* ---------- Profil, partenaires, photo de séance ---------- */
.avatar.has-photo { padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xl { width: 96px; height: 96px; font-size: 2rem; }
.avatar.sm { width: 36px; height: 36px; font-size: 0.85rem; }
.avatar.xs { width: 22px; height: 22px; font-size: 0.65rem; }
.avatar-edit { position: relative; display: inline-block; cursor: pointer; margin: 0 auto; }
.avatar-edit input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; padding: 0; cursor: pointer; }
.avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); border: 3px solid var(--sheet); }
.invite-code { font: 800 2.6rem/1.1 var(--display); letter-spacing: 0.14em; margin: 6px 0 10px; }
.chip.tag { min-height: 36px; padding: 4px 12px 4px 5px; border: 1px solid var(--line-2); background: transparent; font-weight: 600; }
.chip.tag.on { background: var(--volt-soft); border-color: var(--accent); }
.session-photo .sp-img { margin: -18px -18px 0; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; aspect-ratio: 4 / 5; max-height: 520px; background: var(--surface-2); }
.session-photo .sp-img img { width: 100%; height: 100%; object-fit: cover; }
.sp-actions { display: flex; gap: 10px; margin-top: 14px; }
.sp-actions label { cursor: pointer; }
.target { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--accent); }
.target b { display: block; color: var(--text); font-size: 0.92rem; }
.target span { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; line-height: 1.35; }
.target.up { background: var(--volt-soft); border-color: var(--accent-line); }
.ready { padding: 0 0 14px; overflow: hidden; }
.ready > :not(img) { margin-left: 14px; margin-right: 14px; }
.ready-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 12px; background: var(--surface-2); }
.ready-load { display: flex; align-items: center; gap: 6px; margin: 6px 14px 4px; font: 800 1.25rem var(--display); }
.ready-load .muted { font-weight: 600; font-size: 1rem; }
.feed-item { overflow: hidden; }
.feed-photo { margin: -18px -18px 14px; width: calc(100% + 36px); max-width: none; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.invite-card { gap: 14px; align-items: center; }
.repeat-card { display: flex !important; align-items: center; gap: 12px; text-align: left; width: 100%; min-height: 0; padding: 14px; font-weight: inherit; }
.repeat-card .thumbs { display: grid; grid-template-columns: repeat(2, 26px); gap: 3px; flex: none; }
.repeat-card .thumbs img, .repeat-card .thumbs span { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); }
.usual { color: var(--accent); font-weight: 600; }

/* ---------- Hors connexion ---------- */
.net-pill {
  position: fixed; z-index: 70; left: 50%; top: calc(env(safe-area-inset-top) + 8px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; width: max-content; max-width: calc(100% - 32px);
  padding: 6px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 650;
  background: var(--card); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--card-shadow); cursor: pointer;
}
.net-pill.off { background: var(--toast-bg); color: var(--toast-fg); border-color: transparent; }
.net-pill[hidden] { display: none; }
body.net-on #app { padding-top: calc(env(safe-area-inset-top) + 52px); }

/* ---------- Notifications ---------- */
.notif-hero { text-align: center; padding: 26px 18px; }
.notif-hero .bubble { margin: 0 auto; }
.install-tip { display: flex; gap: 10px; text-align: left; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md, 14px); background: var(--surface); font-size: 0.86rem; line-height: 1.45; }
.install-tip svg { flex: none; margin-top: 2px; color: var(--accent); }
.toggle-row { cursor: pointer; }
.sub-field { padding: 0 0 12px 56px; }
.sub-field[hidden] { display: none; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background 0.2s; cursor: pointer; margin: 0; padding: 0; border: 0; min-height: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Coach ---------- */
.coach-review h2 { font-size: 1.3rem; line-height: 1.25; }
.mini-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface); }
.mini-stat b { font: 800 1.2rem var(--display); }
.mini-stat b .muted { font-size: 0.85rem; }
.mini-stat b.up { color: var(--accent); }
.mini-stat b.down { color: var(--danger); }
.mini-stat span { font-size: 0.72rem; color: var(--muted); }
.cr-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 0.98rem; }
.cr-h svg { color: var(--accent); }
.cr-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 0.9rem; line-height: 1.45; }
.cr-motiv { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--volt-soft); font-weight: 600; font-size: 0.9rem; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; margin-bottom: 12px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 0.92rem; line-height: 1.45; }
.msg p + p { margin-top: 6px; }
.msg ul { margin: 6px 0; padding-left: 18px; }
.msg.me { align-self: flex-end; background: var(--grad); color: var(--on-volt); border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg.typing { display: flex; gap: 4px; padding: 14px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: 0.2s; }
.msg.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.chat-form { display: flex; gap: 8px; margin-top: 12px; }
.chat-form input { flex: 1; min-width: 0; }
.chat-form button { flex: none; width: 52px; padding: 0; }
.chat .chips { margin-top: 4px; }
.spin { display: inline-flex; animation: spin 1s linear infinite; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
