/* ==========================================================================
   PROTOCOLE ZÉRO SALLE — App principale
   ========================================================================== */

.app-shell {
  padding-bottom: calc(var(--island-h) + var(--space-8) + var(--safe-bottom));
  overflow-x: clip; /* la glissade entre onglets ne doit jamais créer de défilement horizontal */
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-3);
  max-width: 560px;
  margin: 0 auto;
}

.app-greeting { min-width: 0; }

.app-greeting-label {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  font-weight: 600;
}

.app-greeting-title {
  font-size: 24px;
  font-weight: 800;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-card);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: transform 0.15s var(--ease-spring);
}

.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; }

/* Trophée favori : la médaille elle-même, sans pastille de fond */
.icon-btn.trophy-btn { background: transparent; box-shadow: none; padding: 0; overflow: visible; }
.trophy-btn .medal.is-header-medal { width: 42px; height: 42px; }
.trophy-btn .medal.is-header-medal::before { inset: 4px; }
.trophy-btn .medal.is-header-medal svg { width: 19px; height: 19px; }

/* Flamme de régularité (chip du header) */
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 14px 0 10px;
  border-radius: var(--radius-pill);
  background: var(--color-card);
  box-shadow: var(--shadow-card);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.streak-chip.is-warning { color: var(--color-text-secondary); }

/* Flamme de régularité : styles dans finitions.css (« Flamme de régularité et astres »). */

@media (prefers-reduced-motion: reduce) {
  .flame, .flame * { animation: none !important; }
}

/* Flamme hors de l'écran (js/offscreen-pause.js), ou cachée sous le voile flouté du coach : elle se met
   en pause et repart à l'identique dès qu'on la revoit. Sinon le téléphone redessinait l'écran à chaque
   image (et, coach ouvert, recalculait tout le flou plein écran) pour une flamme qu'on ne voyait pas. */
.flame.is-offscreen, .flame.is-offscreen *,
body.coach-open .flame, body.coach-open .flame * { animation-play-state: paused !important; }

/* Détail de la flamme (fenêtre) : scène sombre pour que la lumière ressorte */
.flame-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px 0 14px;
  padding: 26px 16px 16px;
  border-radius: var(--radius-md, 20px);
  background: radial-gradient(120% 90% at 50% 100%, #2a1206 0%, #0c0c12 70%);
  overflow: hidden;
}
.flame-hero-bleue { background: radial-gradient(120% 90% at 50% 100%, #0b2447 0%, #0c0c12 70%); }
.flame-hero-plasma { background: radial-gradient(120% 90% at 50% 100%, #2e1065 0%, #0c0c12 70%); }
.flame-hero-cosmique { background: radial-gradient(120% 90% at 50% 100%, #3b0764 0%, #05010d 70%); }
.flame-hero-blanche { background: radial-gradient(120% 90% at 50% 100%, #4a2a0a 0%, #0c0c12 70%); }
/* Astres : fond d'espace (pas de sol de feu) */
.flame-hero-etoile { background: radial-gradient(90% 80% at 50% 45%, #0b1f4d 0%, #05060f 72%); }
.flame-hero-neutrons { background: radial-gradient(90% 80% at 50% 45%, #062a35 0%, #04070c 72%); }
.flame-hero-trounoir { background: radial-gradient(90% 80% at 50% 45%, #2a1204 0%, #050304 72%); }
.flame-hero-galaxie { background: radial-gradient(90% 80% at 50% 45%, #121a3d 0%, #04050c 72%); }
.flame-hero-univers { background: radial-gradient(90% 80% at 50% 45%, #1a0b33 0%, #030208 72%); }

.flame-hero-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f4f1ea;
}

.flame-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }

.flame-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px 9px;
  border-radius: var(--radius-sm);
  background: #15151d;
  color: #f4f1ea;
  font-size: 11.5px;
  text-align: center;
  line-height: 1.2;
}

.flame-tier-art { height: 40px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 4px; }
.flame-tier b { font-weight: 700; }
.flame-tier span { color: #a1a1ad; font-weight: 600; font-size: 10.5px; }
.flame-tier.is-current { box-shadow: inset 0 0 0 2px var(--color-accent-bright); }
.flame-tier.is-locked { background: var(--color-card-alt); color: var(--color-text-secondary); }
.flame-tier.is-locked span { color: var(--color-text-secondary); }

@media (max-width: 360px) {
  .flame-tiers { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------------------------------
   Onglets (panneaux)
   -------------------------------------------------------------------------- */
.tab-panel {
  display: none;
  padding: var(--space-3) var(--space-5) var(--space-6);
  max-width: 560px;
  margin: 0 auto;
  min-height: 70vh;
}

.tab-panel.is-active {
  display: block;
}

/* Transition entre onglets : sortie courte, entrée plus lente et décélérée,
   dans le sens de navigation (--tab-dir : 1 vers la droite, -1 vers la gauche). */
.tab-panel.is-leaving { animation: tab-out 0.2s ease-in both; }
.tab-panel.is-entering { animation: tab-in 0.5s var(--ease-out) both; }

@keyframes tab-out {
  to { opacity: 0; transform: translateX(calc(var(--tab-dir, 1) * -24px)); }
}

@keyframes tab-in {
  from { opacity: 0; transform: translateX(calc(var(--tab-dir, 1) * 32px)); }
  to { opacity: 1; transform: none; }
}

.section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin: var(--space-6) 0 var(--space-3);
}

.section-title:first-child { margin-top: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: var(--space-6) 0 var(--space-3);
}

.section-head .section-title { margin: 0; }

.section-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Carte héros (rythme + progression vers l'objectif)
   -------------------------------------------------------------------------- */
.hero-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--color-ink);
  color: var(--color-text-on-dark);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: 0 18px 40px rgba(12, 12, 18, 0.28);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring);
}

.hero-card:active { transform: scale(0.99); }

/* Lueurs colorées : donnent de la profondeur sans image */
.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  z-index: -1;
  pointer-events: none;
}

.hero-card::before {
  width: 280px;
  height: 280px;
  top: -140px;
  right: -90px;
  background: radial-gradient(circle, rgba(255, 106, 43, 0.55), transparent 68%);
}

.hero-card::after {
  width: 240px;
  height: 240px;
  bottom: -150px;
  left: -80px;
  background: radial-gradient(circle, rgba(91, 75, 219, 0.45), transparent 70%);
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.hero-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-on-dark-2);
}

.hero-edit {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.hero-edit svg { width: 15px; height: 15px; }

.hero-rhythm {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-rhythm small {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-on-dark-2);
  margin-left: 6px;
}

.phase-pill {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.phase-pill .phase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.phase-pill.is-explosive { color: #ffb347; }
.phase-pill.is-stagnation { color: #8fb8ff; }
.phase-pill.is-normale { color: #7ee2a8; }
.phase-pill.is-analyse { color: rgba(255, 255, 255, 0.55); }
.phase-pill span { color: #fff; }

/* Barre de progression départ → objectif */
.goal-progress { margin: var(--space-5) 0 var(--space-4); }

.goal-track {
  position: relative;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--grad-accent-bright);
  width: 0;
  transition: width 1.2s var(--ease-out);
}

.goal-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-on-dark-2);
  font-variant-numeric: tabular-nums;
}

.goal-labels strong { color: #fff; }
.goal-headline {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin-bottom: var(--space-2); font-size: 14.5px; font-weight: 800; color: #fff;
}
.goal-route { font-size: 12.5px; font-weight: 700; color: var(--color-text-on-dark-2); font-variant-numeric: tabular-nums; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-ink-line);
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hero-stat-label {
  font-size: 11px;
  color: var(--color-text-on-dark-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Bannière "nouvelle semaine : choisis ton rythme"
   -------------------------------------------------------------------------- */
.recal-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--grad-accent);
  color: #fff;
  text-align: left;
  box-shadow: var(--shadow-accent);
  animation: fade-up 0.4s var(--ease-out);
}

.recal-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recal-banner-icon svg { width: 22px; height: 22px; }
.recal-banner-title { font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.recal-banner-sub { font-size: 12.5px; opacity: 0.92; margin-top: 2px; }
.recal-banner-chevron { width: 18px; height: 18px; margin-left: auto; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   Carte "Aujourd'hui"
   -------------------------------------------------------------------------- */
.today-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  margin-top: var(--space-4);
}

.today-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.today-icon svg { width: 26px; height: 26px; }
.today-body { flex: 1; min-width: 0; }

.today-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}

.today-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16.5px;
  margin-top: 2px;
}

.today-sub { font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; }

.today-cta {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--grad-accent);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}

.today-cta.is-quiet {
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Carte "Ta période & ta pesée"
   -------------------------------------------------------------------------- */
.period-card {
  --period: var(--color-green-dark);
  --period-tint: var(--color-green-tint);
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  margin-top: var(--space-3);
  border-left: 5px solid var(--period);
}

.period-card.is-explosive { --period: var(--color-accent); --period-tint: var(--color-accent-tint); }
.period-card.is-stagnation { --period: var(--color-steps); --period-tint: var(--color-steps-tint); }

.period-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); }
.period-title { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--period); margin-top: 2px; }

.period-info {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--period-tint);
  color: var(--period);
  font-weight: 800;
  flex-shrink: 0;
}

.period-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.period-bars div {
  background: var(--color-card-alt);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.period-bars span { display: block; font-size: 11.5px; font-weight: 700; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.period-bars strong { font-family: var(--font-display); font-size: 16px; font-variant-numeric: tabular-nums; }
.period-note { font-size: 13px; color: var(--color-text-secondary); line-height: 1.5; margin-top: var(--space-2); }

.period-waist {
  margin-top: var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-green-tint);
  color: var(--color-green-dark);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.period-weigh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-hairline);
  font-size: 13.5px;
  color: var(--color-text-secondary);
}

.period-weigh.is-due { color: var(--color-text); font-weight: 700; }

.island-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-accent-bright);
  box-shadow: 0 0 0 2px rgba(12, 12, 18, 0.9);
}

/* --------------------------------------------------------------------------
   Tuiles de statistiques
   -------------------------------------------------------------------------- */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.stat-tile {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stat-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}

.stat-tile-icon svg { width: 19px; height: 19px; }

.stat-tile-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-tile-value small {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-left: 2px;
}

.stat-tile-label {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-top: 4px;
}

.mini-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  overflow: hidden;
  margin-top: var(--space-3);
}

.mini-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  width: 0;
  transition: width 0.8s var(--ease-out);
}

.mini-fill.is-reward { background: linear-gradient(90deg, #ff9f0a, var(--color-reward-bright)); }

.claim-btn {
  margin-top: var(--space-3);
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--color-reward-bright);
  color: #3d2b00;
  font-weight: 800;
  font-size: 12.5px;
  padding: 0 8px;
  animation: fade-up 0.4s var(--ease-spring);
}

.claim-btn.is-claimed { background: var(--color-reward-tint); color: var(--color-reward); animation: none; }

.stat-tile-hint {
  margin-top: var(--space-3);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.cheat-budget { text-align: center; padding: var(--space-2) 0 var(--space-2); }

/* --------------------------------------------------------------------------
   Pas — anneau façon Apple Watch
   -------------------------------------------------------------------------- */
.steps-card {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  box-shadow: var(--shadow-card);
}

.steps-ring-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
}

.steps-ring-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.steps-ring-track {
  fill: none;
  stroke: var(--color-steps-tint);
  stroke-width: 11;
}

.steps-ring-progress {
  fill: none;
  stroke: url(#stepsGradient);
  stroke-width: 11;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.steps-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.steps-ring-percent {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.steps-ring-caption {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-steps);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.steps-info { flex: 1; min-width: 0; }

.steps-count {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.steps-goal-label {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.steps-input-row {
  display: flex;
  gap: var(--space-2);
}

.steps-input-row .input {
  height: 44px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  min-width: 0;
}

.steps-input-row .btn {
  height: 44px;
  width: auto;
  padding: 0 var(--space-4);
  font-size: 14px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Bilan hebdomadaire
   -------------------------------------------------------------------------- */
.report-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  border-top: 4px solid var(--color-coach);
}

.report-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.report-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  object-position: top center;
  background: var(--color-coach-tint);
  flex-shrink: 0;
}

.report-card-title { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; }
.report-card-sub { font-size: 12.5px; color: var(--color-text-secondary); }

.report-summary {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.report-highlight {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-reward);
  background: var(--color-reward-tint);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.report-focus {
  font-size: 13px;
  color: var(--color-coach);
  background: var(--color-coach-tint);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
  font-weight: 600;
}

.report-tip {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-steps);
  background: var(--color-steps-tint);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.report-stats {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.report-stats span {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}

.report-empty {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.report-empty p { font-size: 13.5px; color: var(--color-text-secondary); flex: 1; }

/* --------------------------------------------------------------------------
   Agenda — semaine, séances, calendrier
   -------------------------------------------------------------------------- */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0 10px;
  border-radius: var(--radius-sm);
}

.week-day.is-today { background: var(--color-ink); color: #fff; }

.week-day-name {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
}

.week-day.is-today .week-day-name { color: var(--color-text-on-dark-2); }

.week-day-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.week-day-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-day-mark svg { width: 13px; height: 13px; }
.mark-done { background: var(--color-green); color: #fff; }
.mark-planned { border: 2px solid var(--color-accent-bright); }
.mark-missed { background: var(--color-hairline-strong); color: var(--color-text-secondary); }
.mark-cancelled { background: var(--color-red-tint); color: var(--color-red-dark); }
.mark-rest { width: 6px; height: 6px; background: var(--color-hairline-strong); margin: 8px 0; }

.week-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.week-legend span { display: inline-flex; align-items: center; gap: 6px; }
.week-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.workout-day-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-3);
}

.workout-day-card.is-today { box-shadow: 0 0 0 2px var(--color-accent-bright), var(--shadow-card); }
.workout-day-card.is-dimmed { opacity: 0.72; }

.workout-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.workout-day-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
}

.workout-day-focus {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.workout-day-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

.workout-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-3);
}

.workout-exercise {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 11px var(--space-3);
  background: var(--color-card-alt);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.workout-exercise-name { font-weight: 600; min-width: 0; }

.workout-exercise-sets {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.workout-complete-btn {
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--grad-accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-shadow: var(--shadow-accent);
  transition: transform 0.15s var(--ease-spring), background 0.2s;
}

.workout-complete-btn:active { transform: scale(0.97); }

.workout-complete-btn.is-done {
  background: var(--color-green-tint);
  color: var(--color-green-dark);
  box-shadow: none;
  pointer-events: none;
}

.workout-complete-btn.is-locked {
  background: var(--color-bg);
  color: var(--color-text-secondary);
  pointer-events: none;
  box-shadow: none;
  font-size: 13.5px;
}

.workout-complete-btn .icon { width: 18px; height: 18px; }

.workout-result {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.workout-cancelled-banner {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  background: var(--color-red-tint);
  color: var(--color-red-dark);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  font-size: 13px;
  font-weight: 600;
}

.badge-grey { background: var(--color-bg); color: var(--color-text-secondary); }
.badge-outline { background: transparent; border: 1px solid var(--color-hairline-strong); color: var(--color-text-secondary); }
.badge-accent { background: var(--color-accent-tint); color: var(--color-accent); }

/* Calendrier (mois + année) */
.calendar-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.calendar-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  text-transform: capitalize;
}

.calendar-nav { display: flex; gap: 6px; }

.calendar-nav button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-nav button:disabled { opacity: 0.35; }
.calendar-nav svg { width: 16px; height: 16px; }

.calendar-toggle {
  display: inline-flex;
  background: var(--color-bg);
  border-radius: var(--radius-pill);
  padding: 3px;
  margin-bottom: var(--space-3);
}

.calendar-toggle button {
  height: 32px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.calendar-toggle button.is-active { background: var(--color-card); color: var(--color-text); box-shadow: var(--shadow-card); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.calendar-dow {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-text-secondary);
  padding-bottom: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  position: relative;
}

.calendar-day.is-outside { visibility: hidden; }
.calendar-day.is-future { color: var(--color-text-tertiary); }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--color-ink); font-weight: 800; }

.calendar-day.is-workout {
  background: var(--grad-accent);
  color: #fff;
  font-weight: 800;
}

.calendar-day.is-planned::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent-bright);
}

.calendar-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-hairline);
  text-align: center;
}

.calendar-stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.calendar-stat-label { font-size: 11.5px; color: var(--color-text-secondary); font-weight: 600; }

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.year-month {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--color-card-alt);
  text-align: left;
}

.year-month.is-current { box-shadow: inset 0 0 0 2px var(--color-accent-bright); }

.year-month-name {
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.year-month-name span { color: var(--color-accent); }

.year-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.year-dot {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-hairline);
}

.year-dot.is-outside { visibility: hidden; }
.year-dot.is-workout { background: var(--color-accent); }
.year-dot.is-today { box-shadow: 0 0 0 1.5px var(--color-ink); }

/* --------------------------------------------------------------------------
   Corps — Dashboard morphologique
   -------------------------------------------------------------------------- */
.glass-card {
  position: relative;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-4);
}

.glass-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 6px;
}

.glass-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.glass-footnote {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.link-btn {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 12.5px;
}

.bmi-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  margin: 2px 0 18px;
  font-variant-numeric: tabular-nums;
}

.bmi-gauge {
  position: relative;
  height: 10px;
  margin-bottom: 8px;
}

.bmi-gauge-track {
  display: flex;
  height: 100%;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.bmi-gauge-zone { height: 100%; }
.zone-low { background: var(--color-steps-bright); flex: 17.5; }
.zone-normal { background: var(--color-green); flex: 32.5; }
.zone-high { background: var(--color-reward-bright); flex: 25; }
.zone-obese { background: var(--color-red); flex: 25; }

.bmi-gauge-marker {
  position: absolute;
  top: -4px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  background: #fff;
  border: 3px solid var(--color-black);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(12, 12, 18, 0.25);
  transition: left 0.5s var(--ease-out);
}

.bmi-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-bottom: 14px;
}

.recovery-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.recovery-ring-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.recovery-ring-wrap svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.recovery-ring-track {
  fill: none;
  stroke: var(--color-green-tint);
  stroke-width: 9;
}

.recovery-ring-progress {
  fill: none;
  stroke: var(--color-green);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.7s var(--ease-out);
}

.recovery-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.recovery-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 4px;
}

.recovery-sub {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.weight-chart-range {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-bottom: 14px;
}

/* Tour de taille */
.waist-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-2);
}

.waist-stats div { background: var(--color-card-alt); border-radius: var(--radius-sm); padding: 8px 10px; min-width: 0; }
.waist-stats span { display: block; font-size: 11px; font-weight: 700; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.waist-stats strong { font-family: var(--font-display); font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.waist-history { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--space-3); }

.waist-history span {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: var(--color-text-secondary);
  background: var(--color-card-alt);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}

.waist-history strong { font-size: 13px; color: var(--color-text); font-variant-numeric: tabular-nums; }

.howto-list { padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; margin-bottom: var(--space-3); }

/* Photos avant / après */
.photo-compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin: var(--space-3) 0; }

.photo-compare button,
.photo-strip button {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-card-alt);
}

.photo-compare img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.photo-compare span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 8px 6px;
  background: linear-gradient(to top, rgba(12, 12, 18, 0.75), transparent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
}

.photo-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.photo-strip button { flex: 0 0 64px; }
.photo-strip img { width: 64px; height: 84px; object-fit: cover; }
.photo-full { width: 100%; max-height: 62dvh; object-fit: contain; border-radius: var(--radius-sm); background: var(--color-card-alt); }

label.btn.is-busy { opacity: 0.6; pointer-events: none; }
label.btn[aria-disabled="true"] { pointer-events: none; color: var(--color-text-secondary); }

/* Liste de courses */
.shop-category { margin-bottom: var(--space-3); }

.shop-category-name {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  margin: 0 0 6px 4px;
}

.shop-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  cursor: pointer;
  font-size: 14.5px;
}

.shop-item + .shop-item { border-top: 1px solid var(--color-hairline); }
.shop-item input { width: 22px; height: 22px; accent-color: var(--color-green); flex-shrink: 0; }
.shop-item-name { flex: 1; min-width: 0; }
.shop-item-qty { font-size: 13px; font-weight: 700; color: var(--color-text-secondary); white-space: nowrap; }
.shop-item.is-checked .shop-item-name { text-decoration: line-through; color: var(--color-text-tertiary); }
.shop-progress { font-size: 13px; font-weight: 700; color: var(--color-text-secondary); }

/* --------------------------------------------------------------------------
   Nutrition & états vides
   -------------------------------------------------------------------------- */
.meal-card {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  align-items: flex-start;
}

.meal-time {
  width: 54px;
  flex-shrink: 0;
  text-align: center;
  padding-top: 2px;
}

.meal-time-hour {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
}

.meal-time-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent-bright);
  margin: 8px auto 0;
}

.meal-body { flex: 1; min-width: 0; }

.meal-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 3px;
}

.meal-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  line-height: 1.5;
}

.meal-macros {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.meal-macro-chip {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-tint);
  color: var(--color-accent);
}

.meal-macro-chip + .meal-macro-chip { background: var(--color-coach-tint); color: var(--color-coach); }

.nutrition-empty, .agenda-empty {
  text-align: center;
  padding: 80px var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.nutrition-empty p, .agenda-empty p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

/* --------------------------------------------------------------------------
   DYNAMIC ISLAND — navigation flottante
   -------------------------------------------------------------------------- */
.dynamic-island {
  position: fixed;
  /* Centrage par marges auto : translateX(-50%) décalait l'île d'un demi-pixel
     (texte flou) et la faisait "sauter" pendant que sa largeur change. */
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  max-width: calc(100vw - 20px);
  bottom: calc(var(--space-4) + var(--safe-bottom));
  display: flex;
  align-items: center;
  height: var(--island-h);
  padding: 6px;
  border-radius: var(--radius-pill);
  background: rgba(12, 12, 18, 0.86);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-island);
  z-index: 500;
  gap: 2px;
  overflow: hidden;
}

.island-indicator {
  position: absolute;
  top: 6px;
  left: 0;
  height: calc(var(--island-h) - 12px);
  border-radius: var(--radius-pill);
  background: #fff;
  transition: transform 0.5s var(--ease-out), width 0.5s var(--ease-out);
  z-index: 1;
}

.island-tab {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  height: calc(var(--island-h) - 12px);
  padding: 0 14px;
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.3s var(--ease-smooth);
}

.island-tab svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.island-tab-label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.5s var(--ease-out), opacity 0.35s var(--ease-smooth);
}

.island-tab.is-active { color: var(--color-black); }

/* Pastille « liquide » glissée au doigt : effet verre, elle suit le doigt et
   s'étire (réglé en direct par le script) ; au lâcher, retour avec un rebond. */
.dynamic-island {
  touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: scale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.island-indicator {
  transition: transform 0.55s cubic-bezier(0.34, 1.32, 0.64, 1), width 0.5s var(--ease-out), scale 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s, box-shadow 0.3s;
}
.dynamic-island.is-dragging { transition: none; }
/* Pendant le geste : même pastille blanche, un peu plus lumineuse ; l'icône sous
   le doigt passe en noir comme l'onglet actif. */
.dynamic-island.is-dragging .island-indicator {
  transition: box-shadow 0.2s;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 6px 22px rgba(255, 255, 255, 0.28);
}
.dynamic-island.is-dragging .island-tab { color: rgba(255, 255, 255, 0.72); transition: color 0.15s; }
.dynamic-island.is-dragging .island-tab.is-hover { color: var(--color-black); }
.dynamic-island.is-dragging .island-tab.is-hover svg { transform: scale(1.12); transition: transform 0.15s; }

.island-tab.is-active .island-tab-label {
  max-width: 96px;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Coach IA — bouton flottant
   -------------------------------------------------------------------------- */
/* Bulle du coach : pastille avec libellé "Coach" pour qu'on comprenne tout
   de suite son rôle, et une onde discrète au chargement pour attirer l'œil. */
.coach-fab {
  position: fixed;
  right: var(--space-5);
  bottom: calc(var(--island-h) + var(--space-6) + var(--safe-bottom));
  height: 54px;
  padding: 0 18px 0 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #6d5dfc 0%, #4a37d1 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  box-shadow: 0 10px 26px rgba(91, 75, 219, 0.45);
  z-index: 600;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}

.coach-fab::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid rgba(109, 93, 252, 0.6);
  animation: fab-ring 2.4s var(--ease-out) 1s 2 both;
  pointer-events: none;
}

@keyframes fab-ring {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.35, 1.6); opacity: 0; }
}

.coach-fab:hover { box-shadow: 0 14px 32px rgba(91, 75, 219, 0.55); }
.coach-fab:active { transform: scale(0.94); }

.coach-fab svg {
  width: 23px;
  height: 23px;
  stroke: #fff;
  flex-shrink: 0;
}

.coach-fab-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.coach-fab-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent-bright);
  border: 2px solid var(--color-bg);
  display: none;
}

.coach-fab-dot.is-visible { display: block; }

/* --------------------------------------------------------------------------
   Modales du tunnel (rythme, jours, matériel, séance)
   -------------------------------------------------------------------------- */
.recal-modal {
  max-height: 88dvh;
  overflow-y: auto;
}

.sheet-full {
  max-height: 94dvh;
  min-height: 60dvh;
}

.sheet-lead {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-4);
}

.ai-thinking-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--color-coach), var(--color-accent-bright), var(--color-coach));
  animation: orb-spin 1.4s linear infinite;
  position: relative;
}

.ai-thinking-orb::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--color-bg);
}

@keyframes orb-spin {
  to { transform: rotate(360deg); }
}

.rhythm-card-modern {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--color-card);
  border: 2px solid var(--color-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s var(--ease-spring);
}

.rhythm-card-modern:active { transform: scale(0.985); }
.rhythm-card-modern.is-selected { border-color: var(--color-accent); box-shadow: 0 6px 18px rgba(207, 58, 12, 0.14); }
.rhythm-modern-header { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: 6px; }
.rhythm-modern-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.rhythm-modern-metrics { font-size: 14px; font-weight: 700; color: var(--color-accent); }
.rhythm-modern-advice { font-size: 13px; color: var(--color-text-secondary); line-height: 1.45; border-top: 1px solid var(--color-hairline); padding-top: 8px; margin-top: 8px; }
.rhythm-modern-weeks { font-size: 12px; font-weight: 700; background: var(--color-bg); padding: 4px 10px; border-radius: var(--radius-pill); color: var(--color-text-secondary); white-space: nowrap; }

.day-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: var(--space-4); }

.day-pill {
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-hairline-strong);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  background: var(--color-card);
}

.day-pill.is-active {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: #fff;
}

.form-error {
  color: var(--color-red-dark);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-3);
}

.eq-tags-host { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }

.eq-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-card);
  border: 1px solid var(--color-hairline-strong);
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 14px;
  font-size: 13px;
  font-weight: 600;
}

.eq-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  font-size: 11px;
  flex-shrink: 0;
}

.eq-tag-remove:hover { background: var(--color-red); color: #fff; }

/* Choix des exercices réellement faits (séance incomplète) */
.exercise-picker { margin-top: var(--space-3); animation: fade-up 0.3s var(--ease-out); }
.exercise-picker-hint { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 8px; }
.exercise-picker .shop-item input { accent-color: var(--color-accent); }

/* Résultat du questionnaire de fin de séance */
.session-result {
  text-align: center;
  padding: var(--space-4) 0 var(--space-2);
}

.session-result-kcal {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  letter-spacing: -0.03em;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.session-result-label { font-size: 13px; font-weight: 700; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.session-result-why { font-size: 13.5px; color: var(--color-text-secondary); line-height: 1.55; margin: var(--space-3) 0 var(--space-4); }

/* --------------------------------------------------------------------------
   Paramètres
   -------------------------------------------------------------------------- */
.settings-profile {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-ink);
  color: #fff;
  margin-bottom: var(--space-5);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.settings-profile::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  right: -60px;
  top: -100px;
  background: radial-gradient(circle, rgba(255, 106, 43, 0.5), transparent 70%);
  z-index: -1;
}

.settings-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--grad-accent-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.settings-name { font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.settings-email { font-size: 13px; color: var(--color-text-on-dark-2); word-break: break-all; }

.settings-group-title {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin: var(--space-5) 0 var(--space-2) var(--space-2);
}

.settings-version {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: var(--space-5);
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--color-hairline-strong);
  flex-shrink: 0;
  transition: background 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s var(--ease-out);
}

.switch[aria-checked="true"] { background: var(--color-green); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* --------------------------------------------------------------------------
   Pied de page légal
   -------------------------------------------------------------------------- */
.app-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: var(--space-6);
  font-size: 12px;
  font-weight: 600;
}

.app-footer-links a { color: var(--color-text-secondary); text-decoration: underline; text-underline-offset: 2px; }

/* ==========================================================================
   TROPHÉES
   ========================================================================== */
.trophy-summary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--color-ink);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.trophy-summary::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  top: -130px;
  right: -80px;
  background: radial-gradient(circle, rgba(255, 197, 61, 0.45), transparent 70%);
  z-index: -1;
}

.trophy-summary-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
.trophy-summary-count { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.trophy-summary-count small { font-size: 18px; color: var(--color-text-on-dark-2); }
.trophy-summary-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-on-dark-2); margin-bottom: 6px; }

.trophy-score {
  text-align: right;
}

.trophy-score-value { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--color-reward-bright); }

.trophy-summary .goal-track { margin-top: var(--space-4); }

.rank-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: var(--space-3);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-text-on-dark-2);
}

.rank-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rank-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Rangs : couleurs de médaille */
.rank-0 { --rank: #c9c9d1; --rank-2: #e7e7ee; --rank-ink: #55555f; }
.rank-1 { --rank: #b86b2e; --rank-2: #e8a36a; --rank-ink: #7a3f12; }  /* Bronze */
.rank-2 { --rank: #8e99a8; --rank-2: #dfe5ee; --rank-ink: #4b5563; }  /* Argent */
.rank-3 { --rank: #e0a100; --rank-2: #ffe07a; --rank-ink: #7a5600; }  /* Or */
.rank-4 { --rank: #1aa5a0; --rank-2: #8ff0e4; --rank-ink: #0b5f5b; }  /* Platine */
.rank-5 { --rank: #7a5cff; --rank-2: #6fd3ff; --rank-ink: #4331b8; }  /* Diamant */

.family-card {
  display: flex;
  gap: var(--space-4);
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-3);
  width: 100%;
  text-align: left;
}

.medal {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(from 210deg, var(--rank), var(--rank-2), var(--rank), var(--rank-2), var(--rank));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--rank) 40%, transparent);
}

.medal::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, color-mix(in srgb, var(--rank-2) 55%, #fff) 60%, var(--rank-2) 100%);
}

.medal svg { position: relative; width: 28px; height: 28px; color: var(--rank-ink); }

.rank-0 .medal, .medal.rank-0 { filter: grayscale(1); opacity: 0.55; box-shadow: none; }

.rank-5 .medal::after, .medal.rank-5::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: conic-gradient(from 0deg, #7a5cff, #6fd3ff, #ff6fd8, #7a5cff) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: orb-spin 4s linear infinite;
}

.family-body { flex: 1; min-width: 0; }
.family-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.family-name { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; }
.family-rank { font-size: 12px; font-weight: 800; color: var(--rank-ink); white-space: nowrap; }
.family-desc { font-size: 12.5px; color: var(--color-text-secondary); margin-top: 2px; }

.family-progress { margin-top: var(--space-3); }
.family-progress .mini-track { margin-top: 0; background: var(--color-bg); }
.family-progress .mini-fill { background: linear-gradient(90deg, var(--rank), var(--rank-2)); }

.family-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.family-steps { display: flex; gap: 5px; margin-top: var(--space-3); }

.family-step {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
}

.family-step.is-done { background: var(--step-color); }

.exploit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--space-3);
}

.exploit {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-2) var(--space-3);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  min-width: 0;
}

.exploit .medal { width: 54px; height: 54px; }
.exploit .medal svg { width: 24px; height: 24px; }
.exploit-name { font-size: 12px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.exploit.is-locked .exploit-name { color: var(--color-text-secondary); }
.exploit-hint { font-size: 11px; color: var(--color-text-secondary); line-height: 1.3; }
.exploit.is-favorite { box-shadow: 0 0 0 2px var(--color-reward-bright), var(--shadow-card); }

.trophy-detail-medal { display: flex; justify-content: center; margin: var(--space-2) 0 var(--space-4); }
.trophy-detail-medal .medal { width: 96px; height: 96px; }
.trophy-detail-medal .medal svg { width: 42px; height: 42px; }
.trophy-detail-ranks { display: flex; flex-direction: column; gap: 8px; margin: var(--space-4) 0; }

.trophy-detail-rank {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-card-alt);
  font-size: 13.5px;
  font-weight: 600;
}

.trophy-detail-rank .medal { width: 30px; height: 30px; box-shadow: none; }
.trophy-detail-rank .medal svg { width: 14px; height: 14px; }
.trophy-detail-rank strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.trophy-detail-rank.is-reached { background: color-mix(in srgb, var(--rank-2) 22%, #fff); }

/* Notification de trophée (glisse depuis le haut) */
.toast-trophy {
  position: fixed;
  top: max(20px, env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateY(-150px);
  background: linear-gradient(135deg, var(--color-ink), #262633);
  color: #fff;
  padding: 10px 22px 10px 10px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.6s;
  border: 1.5px solid var(--color-reward-bright);
}

.toast-trophy.is-visible { transform: translateY(0); opacity: 1; }
.toast-trophy .medal { width: 46px; height: 46px; }
.toast-trophy .medal svg { width: 20px; height: 20px; }
.toast-trophy-text { display: flex; flex-direction: column; min-width: 0; }

.toast-trophy-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--color-reward-bright);
  font-weight: 800;
}

.toast-trophy-desc { font-size: 14px; font-weight: 700; }

/* --------------------------------------------------------------------------
   Choix du cheat meal + animation du cadeau
   -------------------------------------------------------------------------- */
.cheat-choice {
  width: 100%;
  text-align: left;
  transition: background 0.2s, box-shadow 0.2s;
}

.cheat-choice .action-row-icon { transition: transform 0.2s var(--ease-spring); }
.cheat-choice:hover .action-row-icon { transform: scale(1.12) rotate(-6deg); }
.cheat-choice.is-chosen { background: var(--color-reward-tint); box-shadow: inset 0 0 0 2px var(--color-reward-bright); }
.cheat-choice.is-dimmed { opacity: 0.45; }

.gift-stage {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 12, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s var(--ease-smooth);
  overflow: hidden;
}

.gift-stage.is-on { opacity: 1; }

.gift-grow {
  position: absolute;
  width: 170px;
  height: 170px;
  /* "backwards" (et non "both") : une fois l'apparition finie, la position
     d'ouverture (.is-open) peut prendre le relais au lieu d'être bloquée. */
  animation: gift-grow 0.6s var(--ease-spring) backwards;
  transition: transform 0.6s var(--ease-out);
}

.gift-shake { width: 100%; height: 100%; animation: gift-shake 0.9s 0.6s ease-in-out both; }
.gift-shake svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45)); }
.gift-lid { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 0.55s var(--ease-out), opacity 0.55s; }

.gift-flash {
  position: absolute;
  top: calc(50% - 410px);
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 197, 61, 0.75), rgba(255, 106, 43, 0.25) 45%, transparent 70%);
  opacity: 0;
  transform: scale(0.3);
  transition: transform 0.7s var(--ease-out), opacity 0.7s;
}

.gift-stage.is-open .gift-lid { transform: translate(0, -70px) rotate(-28deg); opacity: 0; }
.gift-stage.is-open .gift-flash { opacity: 1; transform: scale(1); }
.gift-stage.is-open .gift-grow { transform: translateY(-200px) scale(0.6); }

.gift-confetti { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }

.confetti {
  position: absolute;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fly var(--d, 1.6s) var(--ease-out) forwards;
}

.gift-message {
  position: relative;
  z-index: 2;
  width: min(88vw, 360px);
  margin-top: 180px;
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background: var(--color-card);
  text-align: center;
  box-shadow: var(--shadow-float);
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.45s 0.35s var(--ease-out), transform 0.45s 0.35s var(--ease-spring);
}

.gift-stage.is-open .gift-message { opacity: 1; transform: none; pointer-events: auto; }
.gift-title { font-family: var(--font-display); font-weight: 800; font-size: 26px; }
.gift-item { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--color-accent); margin: 8px 0 12px; }
.gift-item span { color: var(--color-text-secondary); font-weight: 700; font-size: 14px; }
.gift-message p { font-size: 14px; line-height: 1.55; color: var(--color-text-secondary); margin-bottom: var(--space-4); }

.gift-stage.is-reduced .gift-grow { display: none; }
.gift-stage.is-reduced .gift-message { margin-top: 0; }

@keyframes gift-grow { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@keyframes gift-shake {
  0%, 100% { transform: rotate(0) translateX(0); }
  10% { transform: rotate(-9deg) translateX(-4px); }
  20% { transform: rotate(8deg) translateX(4px); }
  30% { transform: rotate(-10deg) translateX(-5px) scale(1.03); }
  40% { transform: rotate(10deg) translateX(5px) scale(1.03); }
  50% { transform: rotate(-12deg) translateX(-6px) scale(1.06); }
  60% { transform: rotate(12deg) translateX(6px) scale(1.06); }
  70% { transform: rotate(-8deg) scale(1.08); }
  80% { transform: rotate(8deg) scale(1.1); }
  90% { transform: rotate(-3deg) scale(1.12); }
}

@keyframes confetti-fly {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 220px)) rotate(var(--r)); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Générique de fin (écran noir)
   -------------------------------------------------------------------------- */
.endgame-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 3s ease-in-out;
}

.endgame-overlay.is-active { opacity: 1; pointer-events: auto; }

/* ==========================================================================
   MISE EN PAGE : téléphone (une colonne) → ordinateur (grilles)
   ========================================================================== */

/* Téléphone : les colonnes de l'accueil s'effacent, l'ordre des blocs est fixé ici */
.dash-grid { display: flex; flex-direction: column; }
.dash-col { display: contents; }
.dash-o0 { order: 0; } .dash-o1 { order: 1; } .dash-o2 { order: 2; } .dash-o3 { order: 3; }
.dash-o4 { order: 4; } .dash-o6 { order: 6; } .dash-o7 { order: 7; } .dash-o8 { order: 8; }

.workout-grid, .body-grid, .family-grid { display: block; }

/* Chaque bloc de l'accueil commence par son titre : il garde son espace au-dessus */
.dash-grid .dash-col > div > .section-title:first-child { margin-top: var(--space-6); }

@media (min-width: 1024px) {
  .app-header,
  .tab-panel { max-width: 1120px; }

  .tab-panel { padding: var(--space-4) var(--space-6) var(--space-7); }

  .dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--space-6);
    align-items: start;
  }

  .dash-col { display: block; min-width: 0; }
  .dash-grid .dash-col > div > .dash-first-title { margin-top: 0; }

  .workout-grid,
  .body-grid,
  .family-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: start;
  }

  .workout-grid .workout-day-card,
  .body-grid .glass-card,
  .family-grid .family-card { margin-bottom: 0; }

  .nutri-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: var(--space-6);
    align-items: start;
  }

  .nutri-grid #shoppingHost .section-title:first-child,
  .nutri-grid #shoppingHost .section-head:first-child { margin-top: var(--space-6); }

  .exploit-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .week-strip { max-width: 760px; }
  #calendarHost { max-width: 760px; }

  /* Fenêtres : cartes flottantes au lieu de feuilles collées en bas
     (préfixe "body" : coach.css, chargé après, ne doit pas écraser ces règles) */
  body .history-modal {
    bottom: var(--space-5);
    border-radius: 28px;
    max-width: 560px;
    max-height: calc(100dvh - 48px);
  }

  body .history-modal::before { display: none; }

  /* Coach : fenêtre « studio » au centre — portrait à gauche, conversation à droite.
     Elle naît du centre (zoom + fondu) au lieu de glisser depuis le côté. */
  body .coach-panel {
    inset: 0;
    margin: auto;
    width: min(940px, calc(100vw - 64px));
    height: min(740px, calc(100dvh - 64px));
    max-width: none;
    border-radius: 30px;
    display: grid;
    grid-template-columns: minmax(340px, 44%) 1fr;
    grid-template-rows: 1fr auto auto;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(10, 10, 20, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
    transform: scale(0.92);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s var(--ease-out), opacity 0.3s var(--ease-smooth), visibility 0s linear 0.4s;
  }

  body .coach-panel.is-open {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
    transition: transform 0.4s var(--ease-out), opacity 0.3s var(--ease-smooth), visibility 0s;
  }

  body .coach-avatar-stage {
    grid-column: 1;
    grid-row: 1 / -1;
    height: auto;
    border-radius: 0;
  }

  body .coach-messages { grid-column: 2; grid-row: 1; padding: var(--space-6) var(--space-6) var(--space-4); }
  body .coach-suggestions { grid-column: 2; grid-row: 2; padding: 0 var(--space-6) var(--space-3); }
  body .coach-composer { grid-column: 2; grid-row: 3; }
  body .coach-panel-handle { display: none; }
  body .coach-stage-overlay { padding: 80px var(--space-6) var(--space-6); }
  body .coach-stage-name { font-size: 24px; }
  body .coach-stage-caption { display: block; }

  .coach-fab { right: var(--space-6); bottom: var(--space-6); }
}

/* ==========================================================================
   RESPONSIVE — petits écrans (rien ne doit déborder horizontalement)
   ========================================================================== */
@media (max-width: 420px) {
  .app-header { padding: var(--space-4) var(--space-4) var(--space-3); }
  .tab-panel { padding: var(--space-3) var(--space-4) var(--space-6); }

  .hero-card { padding: var(--space-5) var(--space-4); }
  .hero-rhythm { font-size: 26px; }
  .hero-stat-value { font-size: 17px; }

  .steps-card { flex-direction: column; align-items: stretch; gap: var(--space-4); }
  .steps-ring-wrap { margin: 0 auto; }
  .steps-info { text-align: center; }

  .island-tab { padding: 0 12px; gap: 5px; }
  .island-tab.is-active .island-tab-label { max-width: 80px; }

  .coach-fab { right: var(--space-4); height: 50px; padding: 0 14px 0 12px; }
  .today-cta { padding: 0 12px; }
}

@media (max-width: 360px) {
  .island-tab { padding: 0 10px; }
  .island-tab.is-active .island-tab-label { max-width: 0; opacity: 0; }
  .tile-grid { gap: var(--space-2); }
  .stat-tile-value { font-size: 21px; }
  .app-greeting-title { font-size: 21px; }
}

/* ==========================================================================
   SÉANCE GUIDÉE (plein écran, sombre : on se concentre sur l'effort)
   ========================================================================== */
.guided-start-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-ink) 0%, #262633 100%);
  color: #fff;
  text-align: left;
  box-shadow: 0 8px 20px rgba(12, 12, 18, 0.22);
  transition: transform 0.15s var(--ease-spring);
}
.guided-start-btn:active { transform: scale(0.98); }
.guided-start-btn strong { display: block; font-size: 14.5px; }
.guided-start-btn small { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.65); margin-top: 1px; }
.guided-start-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--grad-accent-bright);
  font-size: 14px;
  padding-left: 2px;
}

body.is-guided { overflow: hidden; }
body.is-guided .coach-fab, body.is-guided .dynamic-island { visibility: hidden; }

.guided-overlay {
  position: fixed;
  inset: 0;
  z-index: 690;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  background: #0b0b11;
  color: #fff;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.3s var(--ease-smooth), transform 0.35s var(--ease-out);
  padding: max(12px, env(safe-area-inset-top, 0px)) 0 max(16px, var(--safe-bottom));
}
.guided-overlay.is-open { opacity: 1; transform: none; }
/* Lueur du haut selon le moment : chaude pendant l'effort, froide au repos, dorée à la fin (simple fondu d'opacité). */
.guided-overlay::before, .guided-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.7s var(--ease-smooth);
}
.guided-overlay::before { background: radial-gradient(130% 55% at 50% -8%, rgba(255, 92, 56, 0.34), rgba(255, 45, 111, 0.1) 45%, transparent 70%); }
.guided-overlay::after { background: radial-gradient(130% 55% at 50% -8%, rgba(56, 189, 248, 0.26), rgba(99, 102, 241, 0.08) 45%, transparent 70%); opacity: 0; }
.guided-overlay[data-phase="rest"]::before, .guided-overlay[data-phase="prep"]::before { opacity: 0; }
.guided-overlay[data-phase="rest"]::after, .guided-overlay[data-phase="prep"]::after { opacity: 1; }
.guided-overlay[data-phase="end"]::before { background: radial-gradient(130% 60% at 50% -5%, rgba(255, 197, 61, 0.3), rgba(255, 106, 43, 0.12) 45%, transparent 72%); }

.gs-top { display: flex; align-items: center; gap: 12px; padding: 4px 16px 0; max-width: 640px; width: 100%; margin: 0 auto; }
.gs-top-mid { flex: 1; min-width: 0; }
.gs-top-line { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.gs-top-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-top-clock { flex-shrink: 0; font-size: 12.5px; font-weight: 800; color: rgba(255, 255, 255, 0.55); font-variant-numeric: tabular-nums; }
.gs-top-clock.is-paused { color: #facc15; }
.gs-test-tag { display: inline-block; padding: 1px 7px; border-radius: 99px; background: #facc15; color: #111; font-size: 10px; font-weight: 800; text-transform: uppercase; vertical-align: 1px; }
/* Un segment par exercice : plein quand il est fait, il se remplit série après série. */
.gs-progress { display: flex; gap: 4px; }
.gs-progress i { flex: 1; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.11); overflow: hidden; }
.gs-progress i.is-current { background: rgba(255, 255, 255, 0.22); }
.gs-progress b { display: block; height: 100%; border-radius: inherit; background: var(--grad-accent-bright); }
.gs-icon-btn { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); display: flex; align-items: center; justify-content: center; color: #fff; }
.gs-icon-btn svg { width: 18px; height: 18px; }

.gs-body {
  position: relative;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 20px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
/* Centré en hauteur, sans jamais couper le haut quand le contenu dépasse (petits écrans). */
.gs-body > :first-child { margin-top: auto; }
.gs-body > :last-child { margin-bottom: auto; }
.gs-body.gs-intro > :first-child { margin-top: 14px; }
.gs-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #ff8a3d; margin-bottom: 6px; }
.gs-body.is-rest .gs-eyebrow { color: #7dd3fc; }
.gs-title { font-family: var(--font-display); font-size: clamp(26px, 7vw, 36px); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 16px; overflow-wrap: anywhere; }
.gs-sub { color: rgba(255, 255, 255, 0.7); font-size: 14.5px; line-height: 1.5; margin: 0 0 18px; }
.gs-hint { color: rgba(255, 255, 255, 0.48); font-size: 12.5px; line-height: 1.5; margin-top: 16px; }

/* Trois chiffres clés (accueil et fin de séance). */
.gs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin: 0 0 18px; }
.gs-stats div { padding: 12px 6px 11px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.gs-stats strong { display: block; font-family: var(--font-display); font-size: 23px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.gs-stats span { font-size: 11.5px; font-weight: 700; color: rgba(255, 255, 255, 0.58); }

.gs-list { list-style: none; counter-reset: gs; width: 100%; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.gs-list li { counter-increment: gs; display: flex; align-items: center; gap: 11px; padding: 11px 14px 11px 11px; border-radius: 15px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); font-size: 14px; font-weight: 600; }
.gs-list li::before { content: counter(gs); width: 26px; height: 26px; flex-shrink: 0; border-radius: 9px; background: rgba(255, 138, 61, 0.15); color: #ffb38a; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.gs-list span { flex: 1; min-width: 0; }
.gs-list b { color: rgba(255, 255, 255, 0.58); font-weight: 700; font-size: 12.5px; white-space: nowrap; }

/* Anneau du compte à rebours : dégradé dans le trait, lueur fixe derrière (aucun filtre recalculé à chaque image). */
.gs-ring { position: relative; flex-shrink: 0; width: min(60vw, 240px); aspect-ratio: 1; margin: 6px 0 20px; }
.gs-ring::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 106, 43, 0.17), transparent 68%); }
.gs-body.is-rest .gs-ring::before { background: radial-gradient(circle, rgba(56, 189, 248, 0.17), transparent 68%); }
.gs-ring svg { position: relative; width: 100%; height: 100%; transform: rotate(-90deg); }
.gs-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 9; }
.gs-ring-fill { fill: none; stroke: url(#gs-grad-work); stroke-width: 9; stroke-linecap: round; }
.gs-body.is-rest .gs-ring-fill { stroke: url(#gs-grad-rest); }
.gs-ring-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gs-big { font-family: var(--font-display); font-size: clamp(60px, 19vw, 92px); font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.gs-ring-inner small { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, 0.58); margin-top: 4px; }
/* Repos : −15 s / +15 s de part et d'autre de l'anneau. */
.gs-ring-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 20px; }
.gs-ring-row .gs-ring { width: min(50vw, 220px); margin: 0; }
.gs-adjust { width: 54px; height: 54px; flex-shrink: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); color: #fff; transition: transform 0.15s var(--ease-spring); }
.gs-adjust svg { width: 16px; height: 16px; }
.gs-adjust small { font-size: 10.5px; font-weight: 800; color: rgba(255, 255, 255, 0.65); }
.gs-adjust:active { transform: scale(0.9); }

.gs-cue { max-width: 42ch; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 197, 61, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 197, 61, 0.14); color: #ffe6a8; font-size: 13.5px; line-height: 1.45; }
.gs-next { color: rgba(255, 255, 255, 0.75); font-size: 14px; line-height: 1.5; max-width: 40ch; }
.gs-next strong { color: #fff; }
.gs-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.gs-link { color: rgba(255, 255, 255, 0.62); font-size: 13px; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.25); text-underline-offset: 3px; background: none; padding: 6px 2px; }
.gs-link:hover { color: #fff; }

.gs-actions { padding: 12px 20px 0; max-width: 560px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.gs-row { display: flex; gap: 10px; }
.gs-row > * { flex: 1; }
.gs-primary, .gs-secondary { height: 56px; flex-shrink: 0; border-radius: 18px; font-size: 16px; font-weight: 800; transition: transform 0.15s var(--ease-spring), opacity 0.2s; }
.gs-primary { width: 100%; background: var(--grad-accent-bright); color: #fff; box-shadow: 0 10px 26px rgba(255, 60, 80, 0.32); }
.gs-primary.is-quiet { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.gs-secondary { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); color: #fff; }
.gs-primary:active, .gs-secondary:active { transform: scale(0.97); }

.gs-end-badge { position: relative; width: 92px; height: 92px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 44px; background: var(--grad-accent-bright); box-shadow: 0 0 0 10px rgba(255, 106, 43, 0.14), 0 16px 40px rgba(255, 60, 80, 0.4); margin-bottom: 20px; animation: gs-pop 0.6s var(--ease-spring) both; }
.gs-end-badge i { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 197, 61, 0.65); animation: gs-end-ring 1.5s 0.35s ease-out both; }
.gs-end-badge i + i { animation-delay: 0.7s; }
.gs-end-stats div { animation: gs-rise 0.5s var(--ease-out) both; }
.gs-end-stats div:nth-child(2) { animation-delay: 0.08s; }
.gs-end-stats div:nth-child(3) { animation-delay: 0.16s; }

@keyframes gs-pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes gs-end-ring { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.3); } }
@keyframes gs-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .guided-overlay, .guided-overlay::before, .guided-overlay::after, .gs-end-badge, .gs-end-stats div { transition: none; animation: none; }
  .gs-end-badge i { display: none; }
}

/* ==========================================================================
   BILAN DU DIMANCHE · CARTE À PARTAGER · MODE DÉVELOPPEUR
   ========================================================================== */
.recap-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  border-radius: var(--radius-md);
  background: radial-gradient(120% 120% at 0% 100%, #2a1206 0%, #0c0c12 70%);
  color: #fff;
  margin-bottom: 12px;
}
.recap-hero.flame-hero-bleue { background: radial-gradient(120% 120% at 0% 100%, #0b2447 0%, #0c0c12 70%); }
.recap-hero.flame-hero-plasma, .recap-hero.flame-hero-cosmique { background: radial-gradient(120% 120% at 0% 100%, #2e1065 0%, #0c0c12 70%); }
.recap-hero-flame { flex-shrink: 0; width: 70px; display: flex; justify-content: center; }
.recap-hero-label { font-size: 11.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.recap-hero-title { font-family: var(--font-display); font-size: 17px; font-weight: 800; line-height: 1.3; margin: 3px 0; }
.recap-hero-sub { font-size: 12.5px; color: rgba(255, 255, 255, 0.7); }

.recap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.recap-tile { padding: 14px; border-radius: var(--radius-sm); background: var(--color-card-alt); }
.recap-tile strong { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.recap-tile span { font-size: 12px; font-weight: 600; color: var(--color-text-secondary); }

.recap-trophies { display: flex; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--color-reward-tint); color: var(--color-reward); font-size: 13px; line-height: 1.45; margin-bottom: 12px; }
.recap-coach { padding: 14px; border-radius: var(--radius-sm); background: var(--color-card-alt); margin-bottom: 14px; }
.recap-coach-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-coach); margin-bottom: 8px; }
.recap-coach-text { font-size: 14px; line-height: 1.55; margin: 0 0 10px; }
.recap-coach .report-focus { margin-bottom: 0; }

.share-preview { display: flex; align-items: center; justify-content: center; min-height: 260px; margin-bottom: 12px; }
.share-preview img { width: 100%; max-width: 320px; border-radius: 18px; box-shadow: 0 16px 40px rgba(12, 12, 18, 0.35); }
.share-toggle { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 14px; font-weight: 600; margin-bottom: 14px; cursor: pointer; }
.share-toggle input { width: 18px; height: 18px; accent-color: var(--color-accent); }
/* Composition de la carte : flamme, trophées, chiffres */
.share-label { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-tertiary); margin: 14px 0 8px; }
.share-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.share-pick {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px;
  border: 2px solid var(--color-hairline-strong); background: var(--color-card); color: var(--color-text);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.share-pick.is-small { padding: 8px 12px; font-size: 13px; }
.share-pick:active, .share-trophy:active { transform: scale(0.96); }
.share-pick.is-on { border-color: var(--color-accent); background: var(--color-accent-tint); color: var(--color-accent); }
.share-pick-icon { font-size: 18px; }
.share-trophies { display: flex; gap: 10px; overflow-x: auto; padding: 10px 2px 4px; margin-top: 4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.share-trophy {
  flex: 0 0 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px;
  border-radius: 16px; border: 2px solid var(--color-hairline); background: var(--color-card); color: var(--color-text);
  font: inherit; cursor: pointer; scroll-snap-align: start; transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.share-trophy .medal { width: 48px; height: 48px; }
.share-trophy .medal svg { width: 22px; height: 22px; }
.share-trophy span { font-size: 11.5px; font-weight: 700; line-height: 1.2; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.share-trophy small { font-size: 10.5px; color: var(--color-text-tertiary); font-weight: 600; }
.share-trophy.is-on { border-color: var(--color-accent); background: var(--color-accent-tint); }
.share-hint { margin-top: 6px; }

.dev-btn { font-size: 11px; font-weight: 900; letter-spacing: 0.04em; color: #fff; background: linear-gradient(135deg, #2c2c34, #0c0c12); }
.dev-status { padding: 12px; border-radius: var(--radius-sm); background: #fff8e1; border: 1px dashed #d4a017; margin-bottom: 8px; }
.dev-status p { font-size: 13px; line-height: 1.5; margin: 0 0 10px; color: #6b4e00; }
.dev-status .btn { height: 42px; font-size: 14px; }
.dev-section { padding: 14px 0; border-bottom: 1px solid var(--color-hairline); }
.dev-section:last-child { border-bottom: none; }
.dev-section h3 { font-size: 14px; font-weight: 800; margin: 0 0 10px; }
.dev-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.dev-chip { padding: 8px 12px; border-radius: var(--radius-pill); background: var(--color-card-alt); border: 1px solid var(--color-hairline-strong); font-size: 12.5px; font-weight: 700; transition: transform 0.15s var(--ease-spring); }
.dev-chip:hover { border-color: var(--color-text); }
.dev-chip:active { transform: scale(0.95); }
.dev-inline { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.dev-inline .input { flex: 1; min-width: 0; height: 40px; }
.dev-note { font-size: 12px; color: var(--color-text-secondary); margin: 6px 0; }
.dev-flame-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.dev-flame-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 18px 8px 12px; border-radius: var(--radius-sm); background: radial-gradient(120% 90% at 50% 100%, #2a1206 0%, #0c0c12 70%); color: #fff; font-size: 12.5px; }
.dev-flame-cell span { color: rgba(255, 255, 255, 0.6); font-size: 11px; }
@media (min-width: 600px) { .dev-flame-grid { grid-template-columns: repeat(4, 1fr); } }

/* Animation de fin : voir css/finale.css */

/* Prélude de l'animation de fin : l'app perd ses couleurs petit à petit */
.app-shell, .dynamic-island, .coach-fab { transition: filter 3s ease; }
body.is-finale-dimming .app-shell,
body.is-finale-dimming .dynamic-island,
body.is-finale-dimming .coach-fab { filter: contrast(1.35) saturate(0.2) brightness(0.45); }
/* Interface sombre : l'app est déjà sombre, on appuie plus fort pour que le changement se voie */
html[data-theme="dark"] body.is-finale-dimming .app-shell,
html[data-theme="dark"] body.is-finale-dimming .dynamic-island,
html[data-theme="dark"] body.is-finale-dimming .coach-fab { filter: contrast(1.5) saturate(0) brightness(0.3); }
/* Voile qui se referme depuis les bords, comme une salle qui s'éteint (visible dans les deux interfaces) */
body.is-finale-dimming::after {
  content: ""; position: fixed; inset: 0; z-index: 9000; pointer-events: none;
  background: radial-gradient(ellipse 75% 60% at 50% 42%, transparent 20%, rgba(0, 0, 0, 0.92) 100%);
  animation: finale-vignette 3s ease forwards;
}
@keyframes finale-vignette { from { opacity: 0; transform: scale(1.35); } to { opacity: 1; transform: scale(1); } }

/* ==========================================================================
   ANIMATION D'ENTRÉE (« Bonjour » puis zoom, blocs de l'accueil en cascade)
   ========================================================================== */
.intro {
  position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(90% 70% at 50% 45%, #1d1622 0%, #0c0c12 70%);
  transition: opacity 0.45s ease;
}
.intro-glow { position: absolute; width: 60vmin; height: 60vmin; border-radius: 50%; background: radial-gradient(circle, rgba(255, 106, 43, 0.35), rgba(255, 45, 111, 0) 70%); filter: blur(10px); opacity: 0; transform: scale(0.6); transition: opacity 1.2s ease, transform 1.4s var(--ease-out); }
.intro.is-in .intro-glow { opacity: 1; transform: scale(1); }
.intro-text { position: relative; text-align: center; color: #fff; will-change: transform; }
.intro-hello { font-family: var(--font-display); font-weight: 800; font-size: clamp(44px, 13vw, 84px); letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.intro-hello span { display: inline-block; opacity: 0; transform: translateY(18px) scale(0.92); filter: blur(5px); }
.intro.is-in .intro-hello span { animation: intro-letter 0.6s var(--ease-out) forwards; animation-delay: calc(var(--i) * 40ms); }
.intro-name { margin-top: 10px; font-size: clamp(18px, 5vw, 26px); font-weight: 700; color: rgba(255, 255, 255, 0.7); opacity: 0; transform: translateY(10px); transition: opacity 0.6s ease 0.35s, transform 0.6s var(--ease-out) 0.35s; }
.intro.is-in .intro-name { opacity: 1; transform: none; }
/* Plongée dans le « o » : le prénom et les autres lettres s'effacent, le « o » s'ouvre sur l'accueil. */
.intro.is-zoom .intro-name { opacity: 0; transition: opacity 0.3s ease; }
.intro.is-zoom .intro-glow { opacity: 0; transition: opacity 0.5s ease; }
@keyframes intro-letter { to { opacity: 1; transform: none; filter: blur(0); } }

.home-enter { animation: home-block-in 0.65s var(--ease-out) both; animation-delay: var(--enter-delay, 0ms); }
@keyframes home-block-in {
  from { opacity: 0; transform: translateY(34px) scale(0.94); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
.island-enter { animation: island-in 0.7s var(--ease-spring) 0.35s both; }
@keyframes island-in { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .intro { display: none; } .home-enter, .island-enter { animation: none; } }

/* Rareté Émeraude (rang 6) : halo argenté qui tourne (gris, plus de vert autour de la médaille), reflet qui traverse la médaille,
   deux éclats en orbite, étincelles qui scintillent. Rang 7 « Hors catégorie » (l'Absolu) : encore au-dessus —
   double halo irisé, lueur dorée qui respire, trois étoiles en orbite. Tout en transformations (léger). */
.rank-6 { --rank: #047857; --rank-2: #6ee7b7; --rank-ink: #064e3b; }
.rank-7 { --rank: #b8860b; --rank-2: #f5c542; --rank-ink: #1b1b24; }
.medal.rank-6, .rank-6 .medal {
  background: conic-gradient(from 200deg, #064e3b, #10b981, #a7f3d0, #10b981, #064e3b, #34d399, #ecfdf5, #34d399, #064e3b);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.5);
}
.medal.rank-6::before, .rank-6 .medal::before { background: radial-gradient(circle at 35% 30%, #fff 0%, #d1fae5 45%, #34d399 88%, #059669 100%); }
.medal.rank-7, .rank-7 .medal {
  isolation: isolate;
  background: conic-gradient(from 0deg, #f5c542, #ff4fd8, #6fd3ff, #8cff9e, #f5c542);
  box-shadow: 0 8px 30px rgba(245, 197, 66, 0.5);
}
.medal.rank-7::before, .rank-7 .medal::before { background: radial-gradient(circle at 35% 30%, #fff 0%, #fdf1c7 50%, #f5c542 100%); }
.medal > span { position: absolute; pointer-events: none; }
.medal > svg { z-index: 1; }
.medal-aura {
  inset: -4px; border-radius: 50%; border: 2px solid transparent;
  background: conic-gradient(from 0deg, transparent 0deg, #d1d1d6 50deg, #ffffff 95deg, transparent 140deg, transparent 180deg, #aeaeb2 230deg, #f5f5f7 275deg, transparent 320deg) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: orb-spin 2.4s linear infinite;
}
.rank-7 .medal-aura { background: conic-gradient(from 0deg, #f5c542, #ff4fd8, #6fd3ff, #8cff9e, #f5c542) border-box; animation-duration: 3s; }
.medal-aura.is-2 { inset: -9px; border-width: 1.5px; opacity: 0.75; animation-duration: 5s; animation-direction: reverse; }
.medal-sheen { inset: 5px; border-radius: 50%; overflow: hidden; }
.medal-sheen::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  transform: skewX(-20deg); animation: medal-sheen 3.2s ease-in-out infinite;
}
.rank-7 .medal-sheen::before { animation-duration: 2.6s; }
.medal-orbit { inset: -12%; border-radius: 50%; animation: orb-spin 3.6s linear infinite; }
.medal-orbit i {
  position: absolute; width: 11%; height: 11%; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #d1d1d6 55%, rgba(209, 209, 214, 0) 75%);
}
.medal-orbit i:nth-child(1) { top: -3%; left: 44.5%; }
.medal-orbit i:nth-child(2) { bottom: -3%; left: 44.5%; }
.rank-7 .medal-orbit { animation-duration: 4.2s; }
.rank-7 .medal-orbit i:nth-child(1) { background: radial-gradient(circle, #fff 0%, #f5c542 55%, transparent 75%); }
.rank-7 .medal-orbit i:nth-child(2) { bottom: 18%; left: -3%; background: radial-gradient(circle, #fff 0%, #ff4fd8 55%, transparent 75%); }
.rank-7 .medal-orbit i:nth-child(3) { bottom: 18%; right: -3%; background: radial-gradient(circle, #fff 0%, #6fd3ff 55%, transparent 75%); }
.medal-spark {
  width: 16%; height: 16%; background: #fff; opacity: 0;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: medal-twinkle 2.2s ease-in-out infinite;
}
.medal-spark.s1 { top: -6%; right: 2%; }
.medal-spark.s2 { top: 42%; left: -10%; animation-delay: -0.7s; width: 12%; height: 12%; }
.medal-spark.s3 { bottom: -4%; right: 10%; animation-delay: -1.4s; }
.medal-spark.s4 { top: 4%; left: 6%; animation-delay: -1s; width: 12%; height: 12%; }
.rank-6 .medal-spark { background: #f2f2f7; }
.rank-7 .medal-spark { background: #fff7d6; }
.medal-glow {
  z-index: -1; inset: -32%; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 197, 66, 0.55) 0%, rgba(255, 79, 216, 0.18) 45%, transparent 68%);
  animation: medal-glow 2.4s ease-in-out infinite;
}
@keyframes medal-sheen { 0%, 55% { transform: translateX(0) skewX(-20deg); } 100% { transform: translateX(420%) skewX(-20deg); } }
@keyframes medal-twinkle { 0%, 100% { transform: scale(0.3) rotate(0deg); opacity: 0; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }
@keyframes medal-glow { 0%, 100% { transform: scale(0.88); opacity: 0.7; } 50% { transform: scale(1.08); opacity: 1; } }
/* Petites médailles (liste des rangs) : pas d'étincelles ni d'orbite, juste le halo et le reflet */
.trophy-detail-rank .medal-orbit, .trophy-detail-rank .medal-spark, .trophy-detail-rank .medal-glow { display: none; }
.exploit.is-ultimate:not(.is-locked) { box-shadow: 0 0 0 2px #f5c542, 0 10px 30px rgba(245, 197, 66, 0.35); }
.exploit.is-ultimate.is-locked { background: linear-gradient(135deg, #15151d, #262633); color: #f5c542; }
.exploit.is-ultimate.is-locked .exploit-hint { color: #f5c542; }

/* Courbe de poids */
.weight-chart { margin: 12px -4px 8px; padding: 6px 0 0; border-radius: var(--radius-sm); background: linear-gradient(180deg, var(--color-card-alt), transparent); }
.weight-chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.wc-grid { stroke: var(--color-hairline); stroke-width: 1; }
.wc-axis { font-size: 10px; font-weight: 600; fill: var(--color-text-secondary); }
.wc-target { stroke: var(--color-green, #22c55e); stroke-width: 1.5; stroke-dasharray: 5 5; }
.wc-target-label { font-size: 10.5px; font-weight: 800; fill: var(--color-green-dark, #15803d); }
.wc-line { fill: none; stroke: url(#wcLine); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: wc-draw 1.4s var(--ease-out) 0.15s forwards; }
.wc-area { opacity: 0; animation: wc-fade 0.8s ease 0.9s forwards; }
.wc-dot { fill: #fff; stroke: #ff6a2b; stroke-width: 2; }
.wc-last { fill: #ff2d6f; stroke: #fff; stroke-width: 2.5; }
.wc-pulse { fill: #ff2d6f; opacity: 0.25; transform-box: fill-box; transform-origin: center; animation: wc-pulse 2s ease-out infinite; }
.wc-bubble rect { fill: var(--color-ink, #0c0c12); }
.wc-bubble text { font-size: 11px; font-weight: 800; fill: #fff; }
@keyframes wc-draw { to { stroke-dashoffset: 0; } }
@keyframes wc-fade { to { opacity: 1; } }
@keyframes wc-pulse { 0% { transform: scale(0.6); opacity: 0.45; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wc-line { animation: none; stroke-dashoffset: 0; } .wc-area { animation: none; opacity: 1; } .wc-pulse { animation: none; } }

/* Courbe de poids — version sobre (couleurs neutres, aucune animation en boucle) */
.weight-chart { background: none; }
.wc-line { stroke: var(--color-text, #16161e); stroke-width: 2.4; animation-duration: 1s; }
.wc-dot { fill: var(--color-card, #fff); stroke: var(--color-text, #16161e); stroke-width: 1.6; }
.wc-last { fill: var(--color-text, #16161e); stroke: var(--color-card, #fff); stroke-width: 2; }
.wc-pulse { display: none; }
.wc-target { stroke: var(--color-text-secondary, #6b6b76); stroke-width: 1.2; stroke-dasharray: 4 4; }
.wc-target-label { font-size: 10px; font-weight: 700; fill: var(--color-text-secondary, #6b6b76); }
.wc-bubble rect { fill: var(--color-text, #16161e); }
.wc-bubble text { font-size: 10.5px; font-weight: 700; }

/* Comparateur avant / après : deux photos superposées, un curseur à glisser */
.ba-slider { --pos: 50%; position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 62vh; border-radius: var(--radius-md); overflow: hidden; background: #0c0c12; user-select: none; -webkit-user-select: none; }
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, 0.45); pointer-events: none; }
.ba-knob {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: #0c0c12; font: 900 15px/1 system-ui, sans-serif; letter-spacing: 2px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.ba-tag { position: absolute; bottom: 10px; padding: 5px 10px; border-radius: 999px; background: rgba(12, 12, 18, 0.65); color: #fff; font-size: 11.5px; font-weight: 700; pointer-events: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ba-tag.is-before { left: 10px; }
.ba-tag.is-after { right: 10px; top: 10px; bottom: auto; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.ba-slider.is-hinting .ba-before, .ba-slider.is-hinting .ba-line { animation: ba-hint 2.4s ease-in-out; }
.ba-slider.is-hinting .ba-before { animation-name: ba-hint-clip; }
@keyframes ba-hint { 0%, 100% { left: 50%; } 30% { left: 32%; } 65% { left: 68%; } }
@keyframes ba-hint-clip { 0%, 100% { clip-path: inset(0 50% 0 0); } 30% { clip-path: inset(0 68% 0 0); } 65% { clip-path: inset(0 32% 0 0); } }
.ba-delta { margin: 10px 0 0; text-align: center; font-weight: 800; color: var(--color-accent); }

/* Défis de la semaine (accueil) */
.dash-o5 { order: 5; }
.challenge-count { font-size: 12px; font-weight: 700; color: var(--color-text-tertiary); }
.challenges-card { position: relative; padding: 6px 16px 14px; border-radius: var(--radius-lg, 22px); background: var(--color-card); box-shadow: var(--shadow-card); overflow: hidden; }
.challenges-card.is-loading { display: flex; align-items: center; gap: 12px; padding: 18px 16px; font-size: 14px; color: var(--color-text-secondary); }
.challenges-card.is-complete { box-shadow: 0 0 0 2px var(--color-reward-bright), var(--shadow-card); }
.challenge { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-hairline); }
.challenge:last-of-type { border-bottom: 0; }
.challenge-emoji { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--color-accent-tint); }
.challenge.is-done .challenge-emoji { background: var(--color-green-tint); }
.challenge-body { flex: 1; min-width: 0; }
.challenge-title { font-weight: 800; font-size: 15px; color: var(--color-text); }
.challenge.is-done .challenge-title { color: var(--color-green-dark); }
.challenge-desc { font-size: 13px; line-height: 1.4; color: var(--color-text-secondary); margin-top: 2px; }
.challenge-track { height: 6px; border-radius: 999px; background: var(--color-card-alt); margin-top: 8px; overflow: hidden; }
.challenge-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--color-accent), var(--color-accent-bright)); transition: width 0.8s var(--ease-out); }
.challenge.is-done .challenge-track i { background: var(--color-green); }
.challenge-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--color-text-tertiary); }
.challenge-auto { font-weight: 600; }
.challenge-check { padding: 6px 12px; border-radius: 999px; border: 0; background: var(--color-text); color: var(--color-bg); font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.challenge-check:disabled { background: var(--color-green-tint); color: var(--color-green-dark); cursor: default; }
.challenge-foot { margin: 8px 0 0; font-size: 12.5px; color: var(--color-text-secondary); }
.challenge-burst { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.challenge-burst i { position: absolute; width: 8px; height: 8px; border-radius: 2px; background: var(--c); animation: challenge-burst 1.2s cubic-bezier(0.2, 0.8, 0.3, 1) forwards; }
@keyframes challenge-burst { from { transform: rotate(var(--a)) translateX(0); opacity: 1; } to { transform: rotate(var(--a)) translateX(140px) rotate(180deg); opacity: 0; } }

/* ==========================================================================
   COACH+ · PARRAINAGE · ANNONCES · TABLEAU DE BORD · MATÉRIEL
   ========================================================================== */
.plus-badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; vertical-align: middle;
  background: linear-gradient(135deg, #f5c542, #ff8a3d); color: #2a1a06; font: 900 11px/1.2 system-ui, sans-serif; letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(245, 160, 66, 0.35);
}
.plus-badge.is-big { font-size: 22px; padding: 8px 18px; }
.plus-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 14px; }
.plus-hero p { margin: 0; font-weight: 800; color: var(--color-green-dark); }
.plus-table { border-radius: var(--radius-md); background: var(--color-card-alt); padding: 6px 14px; margin: 4px 0 16px; }
.plus-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--color-hairline); font-size: 13.5px; align-items: center; }
.plus-row:last-child { border-bottom: 0; }
.plus-row span:nth-child(2), .plus-row strong { text-align: center; }
.plus-row.is-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-tertiary); }
.plus-row strong { color: var(--color-accent); font-weight: 900; }
.plus-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--color-text-tertiary); font-size: 12px; font-weight: 700; }
.plus-or::before, .plus-or::after { content: ""; flex: 1; height: 1px; background: var(--color-hairline-strong); }

.ref-code-box { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--color-card-alt); margin: 6px 0 12px; }
.ref-code-label { font-size: 12px; font-weight: 700; color: var(--color-text-tertiary); }
.ref-code { flex: 1; font-family: var(--font-display); font-size: 26px; font-weight: 900; letter-spacing: 0.14em; color: var(--color-text); }
.ref-code-box .btn { width: auto; padding: 0 16px; height: 40px; }
.ref-progress { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 13px; font-weight: 700; color: var(--color-text-secondary); }
.ref-dots { display: flex; gap: 8px; }
.ref-dots i { width: 28px; height: 28px; border-radius: 50%; background: var(--color-card-alt); box-shadow: inset 0 0 0 2px var(--color-hairline-strong); }
.ref-dots i.is-on { background: linear-gradient(135deg, #f5c542, #ff8a3d); box-shadow: none; }
.ref-redeem { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--color-hairline); }

.coach-plus-offer { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 86%; padding: 12px 14px; border-radius: 16px; background: var(--color-reward-tint); font-size: 13.5px; line-height: 1.4; color: var(--color-text); }
.coach-plus-offer .btn { width: auto; height: 38px; padding: 0 16px; font-size: 13.5px; }

.gallery-tile.is-plus-only { cursor: pointer; }
.gallery-plus { display: block; margin-top: 4px; font: 900 9.5px/1 system-ui, sans-serif; letter-spacing: 0.04em; color: #2a1a06; background: linear-gradient(135deg, #f5c542, #ff8a3d); padding: 3px 6px; border-radius: 999px; }
.gallery-lock { flex-direction: column; }

.announce-list { display: flex; flex-direction: column; gap: 12px; }
.announce { display: flex; gap: 14px; padding: 14px; border-radius: var(--radius-md); background: var(--color-card-alt); }
.announce-emoji { flex-shrink: 0; width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px; border-radius: 14px; background: var(--color-card); }
.announce-body { min-width: 0; }
.announce-body h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--color-text); }
.announce-date { font-size: 12px; font-weight: 600; color: var(--color-text-tertiary); margin-top: 2px; }
.announce-text p { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--color-text-secondary); }
.announce-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-hairline); }
.announce-row > span { font-size: 20px; }
.announce-row > div { flex: 1; min-width: 0; }
.announce-row strong { display: block; font-size: 14px; }
.announce-row small { color: var(--color-text-tertiary); font-size: 12px; }

.dev-chip.is-on { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.admin-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.admin-tile { padding: 12px 8px; border-radius: 14px; background: var(--color-card-alt); text-align: center; }
.admin-tile strong { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 900; color: var(--color-text); }
.admin-tile span { font-size: 11px; font-weight: 700; color: var(--color-text-tertiary); line-height: 1.2; display: block; margin-top: 2px; }
.admin-tile.is-green strong { color: var(--color-green-dark); }
.admin-tile.is-red strong { color: var(--color-red-dark); }
.admin-tile.is-gold strong { color: var(--color-reward); }
.admin-list { margin-top: 10px; }
.admin-client { padding: 12px 0; border-bottom: 1px solid var(--color-hairline); }
.admin-client.is-inactive { opacity: 0.75; }
.admin-client-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 8px; }
.admin-client-main strong { font-size: 15px; }
.admin-client-main small { width: 100%; color: var(--color-text-tertiary); font-size: 12px; }
.admin-client-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12.5px; color: var(--color-text-secondary); }
.admin-client-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.admin-client-meta small { color: var(--color-text-tertiary); font-size: 11.5px; }
@media (min-width: 600px) { .admin-tiles { grid-template-columns: repeat(4, 1fr); } }

.eq-tag.is-new { box-shadow: inset 0 0 0 2px var(--color-green); }
.eq-changes { min-height: 18px; margin: 10px 0; font-size: 13px; font-weight: 700; color: var(--color-accent); }

/* ==========================================================================
   JOURNAL DES REPAS (onglet Nutrition)
   ========================================================================== */
.meal-journal { padding: 18px; margin-bottom: var(--space-5); }
.mj-top { display: flex; gap: 18px; align-items: center; }
.mj-gauge { position: relative; width: 124px; height: 124px; flex-shrink: 0; }
.mj-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mj-gauge-track { fill: none; stroke: var(--color-card-alt); stroke-width: 11; }
.mj-gauge-fill { fill: none; stroke: var(--color-accent); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset 0.9s var(--ease-out, ease); }
.mj-gauge.is-over .mj-gauge-fill { stroke: #ff8a3d; }
.mj-gauge.is-done .mj-gauge-fill { stroke: var(--color-green, #34c759); }
.mj-gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.mj-gauge-center strong { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mj-gauge-center span { font-size: 11.5px; color: var(--color-text-secondary); }
.mj-side { flex: 1; min-width: 0; }
.mj-macro-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.mj-macro-head strong { font-variant-numeric: tabular-nums; }
.mj-bar { height: 8px; border-radius: 999px; background: var(--color-card-alt); overflow: hidden; }
.mj-bar i { display: block; height: 100%; border-radius: inherit; background: var(--color-coach, #6d5dfc); transition: width 0.8s var(--ease-out, ease); }
.mj-mini { display: flex; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--color-text-secondary); }
.mj-mini strong { color: var(--color-text); }
.mj-status { margin: 10px 0 0; font-size: 13px; line-height: 1.4; color: var(--color-text-secondary); }
.mj-list { margin-top: 14px; border-top: 1px solid var(--color-hairline); }
.mj-item { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--color-hairline); font-size: 14px; }
.mj-item-time { font-size: 12px; color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }
.mj-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mj-item-kcal { font-size: 12.5px; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mj-item-del { width: 28px; height: 28px; border-radius: 50%; background: var(--color-card-alt); color: var(--color-text-secondary); font-size: 16px; line-height: 1; }
.mj-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 14px; }
.mj-actions .btn { width: 100%; padding: 0 14px; white-space: nowrap; }
.mj-photo-btn { cursor: pointer; }
.mj-preview { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-md); margin-bottom: 12px; }
.mj-items { margin: 8px 0 12px; padding-left: 18px; font-size: 13.5px; }
.mj-items small { color: var(--color-text-tertiary); }
.mj-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.mj-edit label span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; color: var(--color-text-secondary); }
.mj-tip { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--color-coach-tint, rgba(109, 93, 252, 0.1)); font-size: 13.5px; line-height: 1.45; }
@media (max-width: 380px) { .mj-top { flex-direction: column; align-items: stretch; } .mj-gauge { margin: 0 auto; } }

/* ==========================================================================
   CLASSEMENT DE LA TEAM (parrainage)
   ========================================================================== */
.team-card { padding: 14px 16px; margin-bottom: var(--space-5); }
.team-list { list-style: none; margin: 0; padding: 0; }
.team-row { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--color-hairline); font-size: 14.5px; }
.team-row:last-child { border-bottom: 0; }
.team-row.is-me { background: var(--color-coach-tint, rgba(109, 93, 252, 0.1)); border-radius: 12px; border-bottom-color: transparent; padding-left: 8px; padding-right: 8px; }
.team-rank { font-size: 18px; text-align: center; font-weight: 800; color: var(--color-text-secondary); }
.team-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-name small { font-weight: 600; color: var(--color-text-tertiary); }
.team-stat { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--color-text-secondary); }
.ref-team-title { font-size: 15px; margin: 18px 0 6px; }

/* Tableau de bord éditeur v2 : onglets, graphiques, entonnoir, fiche client */
.admin-tabs { display: flex; gap: 6px; padding: 4px; margin-bottom: 14px; border-radius: 14px; background: var(--color-card-alt); }
.admin-tab { flex: 1; padding: 9px 6px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--color-text-secondary); }
.admin-tab.is-on { background: var(--color-card); color: var(--color-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.admin-bug { padding: 12px 0; border-bottom: 1px solid var(--color-hairline); }
.admin-bug.is-done { opacity: 0.6; }
.admin-bug-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.admin-bug-head strong { font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-bug-head small { flex-shrink: 0; font-size: 11.5px; color: var(--color-text-tertiary); }
.admin-bug-text { margin: 6px 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-bug-meta { margin: 0 0 6px; font-size: 12px; color: var(--color-text-secondary); }
.admin-bug-more { margin: 4px 0; font-size: 12px; color: var(--color-text-secondary); }
.admin-bug-more pre { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--color-card-alt); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; }
.admin-bug .dev-chip { margin-top: 6px; }
.admin-group-title { margin: 16px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: var(--color-text-tertiary); }
.admin-charts { display: grid; gap: 10px; margin: 12px 0 4px; }
.admin-chart { padding: 12px 12px 8px; border-radius: 14px; background: var(--color-card-alt); }
.admin-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 700; color: var(--color-text-secondary); margin-bottom: 6px; }
.admin-chart-head strong { font-size: 18px; color: var(--color-text); font-variant-numeric: tabular-nums; }
.admin-chart-head small { font-size: 11px; font-weight: 600; color: var(--color-text-tertiary); }
.admin-chart-plot { position: relative; }
.admin-chart-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.admin-bar { fill: var(--color-accent); opacity: 0.55; }
.admin-bar.is-today { opacity: 1; }
.admin-hit { fill: transparent; cursor: pointer; }
.admin-hit.is-hover { fill: var(--color-text); fill-opacity: 0.06; }
.admin-baseline { stroke: var(--color-hairline-strong, var(--color-hairline)); stroke-width: 1; }
.admin-axis { font-size: 9.5px; fill: var(--color-text-tertiary); font-weight: 600; }
.admin-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 5px 9px; border-radius: 8px; background: var(--color-text); color: var(--color-bg); font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; z-index: 2; }
.admin-funnel { display: grid; gap: 8px; }
.admin-funnel-row { display: grid; grid-template-columns: 140px 1fr auto 40px; gap: 8px; align-items: center; font-size: 13px; }
.admin-funnel-label { color: var(--color-text-secondary); font-weight: 600; }
.admin-funnel-bar { height: 12px; border-radius: 999px; background: var(--color-card-alt); overflow: hidden; }
.admin-funnel-bar i { display: block; height: 100%; border-radius: inherit; background: var(--color-accent); }
.admin-funnel-row strong { font-variant-numeric: tabular-nums; }
.admin-funnel-row small { color: var(--color-text-tertiary); font-size: 11.5px; text-align: right; }
.admin-box { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--color-card-alt); font-size: 13.5px; }
.admin-box.is-alert { box-shadow: inset 0 0 0 1.5px var(--color-red-dark); }
.admin-box > strong { display: block; margin-bottom: 6px; }
.admin-line-item { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--color-hairline); word-break: break-all; }
.admin-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.admin-toolbar select { width: auto; }
button.admin-client { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--color-hairline); cursor: pointer; }
button.admin-client:hover { background: var(--color-card-alt); }
.admin-client-goal { display: grid; gap: 5px; margin-top: 6px; font-size: 12.5px; font-weight: 600; }
.admin-mini-bar { display: block; height: 6px; border-radius: 999px; background: var(--color-card-alt); overflow: hidden; }
.admin-mini-bar i { display: block; height: 100%; background: var(--color-green-dark, #1f9d55); border-radius: inherit; }
.admin-tag { padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; background: var(--color-card-alt); color: var(--color-text-secondary); }
.admin-tag.is-alert { background: color-mix(in srgb, var(--color-red-dark) 15%, transparent); color: var(--color-red-dark); }
.admin-detail-goal { font-weight: 700; font-size: 14px; margin: 6px 0 8px; }
.admin-spark { display: block; width: 100%; height: auto; margin: 4px 0 10px; overflow: visible; }
.admin-line { fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.admin-dot { fill: var(--color-accent); stroke: var(--color-card); stroke-width: 2; }
.admin-target { stroke: var(--color-green-dark, #1f9d55); stroke-dasharray: 4 4; stroke-width: 1.5; }
.admin-facts { display: grid; grid-template-columns: minmax(120px, 42%) 1fr; gap: 6px 12px; margin: 8px 0 14px; font-size: 13.5px; }
.admin-facts dt { color: var(--color-text-tertiary); }
.admin-facts dd { margin: 0; font-weight: 600; word-break: break-word; }

@media (max-width: 420px) { .admin-funnel-row { grid-template-columns: 110px 1fr auto 34px; } }

/* ==========================================================================
   DÉMONSTRATIONS D'EXERCICES (3D, images style avatar, ou lien vidéo)
   ========================================================================== */
button.workout-exercise.is-demo { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: transform 0.15s var(--ease-spring, ease), background 0.2s; }
button.workout-exercise.is-demo:active { transform: scale(0.98); }
.demo-play { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; background: var(--color-accent); color: #fff; font-size: 8px; vertical-align: 1px; flex-shrink: 0; }
.demo-player { position: relative; width: 100%; aspect-ratio: 1; max-height: 360px; margin: 4px auto 12px; border-radius: var(--radius-md); overflow: hidden; background: #e9e9ee; }
.demo-player.is-compact { width: min(62vw, 260px); max-height: 260px; margin: 6px auto 10px; }
.demo-player video, .demo-player img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
/* Vidéos du coach (16:9, fond sombre du studio) : le cadre épouse la vidéo. */
.demo-player.is-video { aspect-ratio: 16 / 9; max-height: none; background: #17171b; }
.demo-player.is-video video { object-fit: cover; }
.demo-player.is-video.is-compact { width: min(86vw, 420px); max-height: none; }
/* Deux images (départ / arrivée) qui alternent en fondu : une petite animation. */
.demo-player.is-frames .demo-frame-2 { animation: demo-swap 2.4s ease-in-out infinite; }
@keyframes demo-swap { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
.demo-badge { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; font-weight: 800; }
.demo-missing { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--color-card-alt); font-size: 13.5px; line-height: 1.45; color: var(--color-text-secondary); text-align: left; }
.demo-missing p { margin: 0; }
.demo-missing span { font-size: 20px; }
.demo-sets { text-align: center; font-weight: 800; font-size: 16px; margin: 0 0 6px; }
@media (prefers-reduced-motion: reduce) { .demo-player.is-frames .demo-frame-2 { animation-duration: 5s; } }
.admin-client-presence { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary); }
.admin-online { color: var(--color-green-dark, #1f9d55); font-weight: 800; }
.admin-session-day { padding: 7px 0; border-bottom: 1px solid var(--color-hairline); font-size: 13px; }
.admin-session-day > span { display: block; font-weight: 700; margin-bottom: 4px; }
.admin-session-day > span::first-letter { text-transform: uppercase; }
.admin-session { display: inline-block; margin: 0 6px 4px 0; padding: 3px 8px; border-radius: 8px; background: var(--color-card); font-variant-numeric: tabular-nums; }
.admin-session small { color: var(--color-text-tertiary); }

/* Galerie des visuels (mode développeur) */
.vis-row { margin-bottom: 14px; }
.vis-row-title { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.vis-row-title small { font-weight: 600; color: var(--color-text-tertiary); margin-left: 4px; }
.vis-tiers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.vis-tile { position: relative; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--color-card-alt); padding: 0; border: 0; cursor: zoom-in; }
.vis-tile img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.vis-tile span { position: absolute; right: 5px; bottom: 3px; font-size: 11px; font-weight: 900; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.vis-ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.vis-ex { padding: 8px; border-radius: 14px; background: var(--color-card-alt); }
.vis-ex .demo-player.is-compact { width: 100%; margin: 0 0 6px; }
.vis-ex .demo-missing { margin: 0 0 6px; font-size: 11.5px; padding: 8px; }
.vis-ex-name { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
/* Vidéos de la galerie : toucher = grande visionneuse */
.vis-ex.is-zoomable { position: relative; cursor: zoom-in; transition: transform 0.15s var(--ease-spring); }
.vis-ex.is-zoomable:active { transform: scale(0.97); }
.vis-ex.is-zoomable:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.vis-ex-expand { position: absolute; top: 13px; right: 13px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(10, 10, 12, 0.55); color: #fff; pointer-events: none; }
.vis-ex-expand .ico { width: 14px; height: 14px; }
body .history-modal.vis-zoom-modal { max-width: min(1100px, calc(100vw - 24px)); }
.vis-zoom-video { display: block; width: 100%; max-height: 70dvh; background: #000; border-radius: 16px; }
.vis-zoom-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.vis-zoom-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; flex: 1; }
.vis-zoom-hint { align-self: center; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-secondary); }
.vis-zoom-tools .dev-chip { display: inline-flex; align-items: center; gap: 5px; }
.vis-zoom-tools .dev-chip .ico { width: 14px; height: 14px; }
.vis-zoom-nav { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; border: 1px solid var(--color-hairline-strong); background: var(--color-card-alt); color: var(--color-text); display: grid; place-items: center; cursor: pointer; transition: transform 0.15s var(--ease-spring); }
.vis-zoom-nav:active { transform: scale(0.92); }
.vis-zoom-nav .ico { width: 20px; height: 20px; }
.vis-zoom-count { font-size: 12.5px; font-weight: 800; color: var(--color-text-secondary); min-width: 52px; text-align: center; }
@media (max-width: 640px) {
  /* Téléphone : flèches + compteur sur une ligne, vitesses et plein écran en dessous */
  .vis-zoom-tools { order: 3; flex-basis: 100%; flex-wrap: nowrap; }
  .vis-zoom-tools .dev-chip { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
  .vis-zoom-count { flex: 1; }
  .vis-zoom-full-label { display: none; }
}
.vis-badge { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 800; background: var(--color-card); color: var(--color-text-secondary); }
.vis-badge.is-3d { background: var(--color-accent); color: #fff; }
.vis-badge.is-img { background: var(--color-coach); color: #fff; }

/* Compteur de jours (choix des jours de séance) */
.days-counter { margin: 10px 0 4px; text-align: center; font-size: 13.5px; font-weight: 700; color: var(--color-text-secondary); }
.days-counter.is-ok { color: var(--color-green-dark, #1f9d55); }
