﻿:root {
  --fu-graphite: #2E2E2E;
  /* gris graphite */
  --fu-cyan: #00FFFF;
  /* cyan électrique */
  --fu-silver: #D9D9D9;
  /* argent clair */
}

/* ===== Page Construction de séance ===== */

.cs-main {
  width: 100%;
  margin: 0 auto;
  padding: 18px 16px 40px;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .cs-main {
    max-width: 1100px;
  }
}

@media (max-width: 768px) {
  .cs-main {
    padding: 14px 8px 40px;
  }
}

/* Header */

.cs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.cs-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cs-header__img {
  width: 56px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.cs-header__subtitle {
  font-size: 0.9rem;
  color: var(--fu-muted, #b3b3b3);
}

/* ===== En-tête : nom de séance éditable ===== */

.cs-session-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.9rem;
  margin: 0;
}

.cs-session-label {
  opacity: 1;
  font-weight: 500;
}

.cs-session-name {
  font-weight: 600;
}

/* Cadre autour du nom de la séance */
.cs-session-name {
  padding: 2px 6px;
  border: 1px solid rgba(217, 217, 217, 0.25);
  /* argent transparent */
  border-radius: 6px;
}

/* Quand on est en mode édition, on met un style différent */
.cs-session-name--editing {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(46, 46, 46, 0.9);
  border: 1px solid var(--fu-cyan);
}

.cs-session-edit {
  background: transparent;
  border: none;
  color: var(--fu-silver);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cs-session-edit:hover {
  color: var(--fu-cyan, #00FFFF);
  transform: translateY(-1px);
}

.cs-session-name--editing {
  padding: 2px 4px;
  border-radius: 6px;
  background: rgba(46, 46, 46, 0.9);
  border: 1px solid rgba(0, 255, 255, 0.6);
  outline: none;
}

.cs-favbadge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.3);
  font-size: 0.8rem;
}

/* ===== Toolbar (recherche + filtres + bouton ajout) ===== */

.cs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* champ de recherche */

.cs-toolbar__search {
  flex: 1 1 220px;
}

.cs-toolbar__search input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.95rem;
}

.cs-toolbar__search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

/* filtres + tri */

.cs-toolbar__filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cs-toolbar__filters select {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.85rem;
}

/* bouton "ajouter un exo" – rempli cyan */

.cs-toolbar__actions {
  display: flex;
  justify-content: flex-end;
}

.cs-toolbar__actions .fu-btn {
  background: var(--fu-cyan);
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.cs-toolbar__actions .fu-btn:hover {
  box-shadow: 0 0 0 1px var(--fu-cyan);
}

/* ===== Layout liste + aperçu ===== */


@media (max-width: 900px) {
  .cs-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .cs-toolbar__filters select {
    padding: 6px 8px;
    font-size: 0.75rem;
  }
  
  .cs-toolbar__search input {
    font-size: 0.85rem;
  }
  
  .cs-toolbar__actions .fu-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
}

/* ===== Groupes & cartes d’exercices ===== */

.cs-group {
  margin-bottom: 18px;
  min-width: 0;
}

.cs-group__title {
  font-size: 1.1rem;
  margin-bottom: 6px;
}



/* Carte globale */

.cs-exo-card {
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Haut de carte : logo + texte */

.cs-exo-card__top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.cs-exo-card__logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: contain;
}

/* Titre + muscles travaillés */

.cs-exo-card__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.cs-exo-card__name {
  font-size: 0.95rem;
  margin: 0;
  color: #d9d9d9;
  /* titre de l’exercice */
}

.cs-exo-card__muscles {
  font-size: 0.8rem;
  color: var(--fu-muted, #aaa);
  margin: 0;
}

/* Boutons d’action des cartes */

.cs-exo-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.cs-exo-card__actions .fu-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.8rem;
  border-radius: 10px;
  background: transparent;
  color: var(--fu-cyan);
  border: 1px solid var(--fu-cyan);
  cursor: pointer;
  min-width: 0;
  line-height: 1.2;
  white-space: normal;
}

/* petit effet hover */

.cs-exo-card__actions .fu-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.3);
}

/* zone détails (pour plus tard) */

.cs-exo-card__details {
  font-size: 0.8rem;
  color: var(--fu-muted, #b7b7b7);
}

/* ===== Aperçu de la séance (colonne droite) ===== */

.cs-preview {
  border-radius: 16px;
  padding: 12px 12px 14px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;

  /* reste visible en scroll */
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  align-self: flex-start;
}

.cs-preview__title {
  font-size: 1rem;
}

.cs-preview__list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.cs-preview__item {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.cs-preview__item:last-child {
  border-bottom: none;
}

.cs-preview__empty {
  font-size: 0.85rem;
  color: var(--fu-muted, #a5a5a5);
}

/* bouton "Finaliser ma séance" – rempli cyan */

.cs-preview__finalize {
  margin-top: 8px;
  align-self: flex-end;
  background: var(--fu-cyan);
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.cs-preview__finalize:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.5);
}

/* Contenu de la modale "Ajouter un exercice" */
.cs-addexo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: min(420px, 95vw);
}

.cs-addexo .fu-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.cs-addexo .fu-field span {
  color: var(--fu-silver);
  font-weight: 500;
}

/* Inputs / selects / textarea dans la modale */
.cs-addexo input[type="text"],
.cs-addexo input[type="file"],
.cs-addexo select,
.cs-addexo textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 255, 0.25);
  background: #1a1a1a;
  color: var(--fu-silver);
  font-size: 0.85rem;
  line-height: 1.5;
}

.cs-addexo input[type="text"]::placeholder,
.cs-addexo textarea::placeholder {
  color: rgba(217, 217, 217, 0.6);
}

/* Textarea : un peu plus haut et redimensionnable */
.cs-addexo textarea {
  min-height: 70px;
  /* 3–4 lignes visibles */
  resize: vertical;
  /* tu peux agrandir si tu écris beaucoup */
}

.cs-addexo select {
  appearance: none;
}

/* Focus */
.cs-addexo input[type="text"]:focus,
.cs-addexo input[type="file"]:focus,
.cs-addexo select:focus,
.cs-addexo textarea:focus {
  outline: none;
  border-color: var(--fu-cyan);
  box-shadow: 0 0 0 1px rgba(0, 255, 255, 0.5);
}


/* Style du bouton "Choisir un fichier" */
.cs-addexo input[type="file"] {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--fu-cyan);
  background: #1a1a1a;
  color: var(--fu-silver);
  cursor: pointer;
}

/* Sinon le nom du fichier est illisible → on lighten un peu */
.cs-addexo input[type="file"]::-webkit-file-upload-button {
  background: var(--fu-cyan);
  color: #2E2E2E;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.cs-addexo input[type="file"]::file-selector-button {
  background: var(--fu-cyan);
  color: #2E2E2E;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

/* Hover */
.cs-addexo input[type="file"]::-webkit-file-upload-button:hover,
.cs-addexo input[type="file"]::file-selector-button:hover {
  background: #00cccc;
}

/* ===== État vide ===== */

.cs-empty {
  font-size: 0.9rem;
  color: var(--fu-muted, #b3b3b3);
  padding: 8px 4px;
}

/* ===== Aperçu : drag & drop ===== */

.cs-preview__list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-preview__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.cs-preview__item:last-child {
  border-bottom: none;
}

.cs-preview__handle {
  font-size: 0.95rem;
  cursor: grab;
  user-select: none;
  opacity: 0.7;
  padding: 0 2px;
}

.cs-preview__item.is-dragging {
  opacity: 0.5;
}

.cs-preview__remove {
  margin-left: auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 4px;
}

.cs-preview__remove:hover {
  color: #ff6b6b;
  transform: translateY(-1px);
}

/* ===== Boutons "Afficher les détails" / "Ajouter à la séance" ===== */

.cs-exo-card__actions .fu-btn {
  flex: 1;
  padding: 4px 6px;
  font-size: 0.8rem;
  border-radius: 10px;
  background: transparent;
  color: var(--fu-cyan, #00FFFF);
  border: 1px solid var(--fu-cyan, #00FFFF);
  cursor: pointer;
}

.cs-exo-card__actions .fu-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.3);
}

/* ===== Bouton "+ Ajouter un exercice" ===== */

.cs-toolbar__actions .fu-btn {
  padding-inline: 14px;
  background: var(--fu-cyan, #00e5ff);
  color: #0b0b12;
  border-radius: 999px;
  border: 1px solid var(--fu-cyan, #00e5ff);
  font-weight: 500;
}

/* ===== Bouton "Finaliser ma séance" ===== */

.cs-preview__finalize {
  margin-top: 8px;
  align-self: flex-end;
  background: var(--fu-cyan, #00e5ff);
  color: #0b0b12;
  border: 1px solid var(--fu-cyan, #00e5ff);
  border-radius: 999px;
  padding-inline: 16px;
  font-weight: 500;
}

/* ===== Largeurs : exos vs aperçu ===== */
/* Tu peux ajuster les 3fr / 1fr comme tu veux pour contrôler la largeur */

.cs-layout {
  display: grid;
  grid-template-columns: minmax(0, 3.2fr) minmax(260px, 0.8fr);
  /* ← joue ici */
  gap: 18px;
}

/* ===== Grille : 3 cartes par ligne ===== */

.cs-group__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

@media (max-width: 768px) {
  /* ✅ Mobile : un SEUL repère de largeur (comme la barre de recherche) */
  .cs-exercise-list,
  #csExerciseContainer {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  /* ⚠️ Important : ne pas centrer le container en flex (sinon les groupes "shrink" et tout part en vrille) */
  #csExerciseContainer {
    display: block;
  }

  .cs-group__title {
    text-align: left;
  }

  /* ✅ 2 colonnes : largeur bornée automatiquement, sans overflow, sans translate */
  .cs-group__list {
    gap: 12px;
    min-width: 0;

    /* Taille cible "comme avant" (≈ 210px max), mais jamais plus large que la moitié de l'espace dispo */
    --cs-card-w: min(210px, calc((100% - 12px) / 2));

    display: grid;
    grid-template-columns: repeat(2, minmax(0, var(--cs-card-w)));
    justify-content: space-between;
    justify-items: stretch;

    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    transform: none !important;
  }

  /* ✅ Aperçu (mobile) : évite que la ligne "favori + enregistrer" dépasse */
  .cs-preview__footer {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  .cs-favorite-toggle {
    width: 100%;
    justify-content: center;
  }
  .cs-preview__finalize {
    width: 100%;
    max-width: 520px;
  }
}


/* ===== Modale FormUp & Go (même style que sur la home) ===== */

.fu-modal.u-hidden {
  display: none !important;
}

.fu-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  overflow-y: auto;
  /* ✅ autorise le scroll */
  -webkit-overflow-scrolling: touch;
  /* ✅ scroll fluide iOS */
}



.fu-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
}

.fu-modal__dialog {
  position: relative;
  width: min(680px, 92vw);
  margin: 6vh auto 0;
  background: var(--fu-bg-deeper, #242424);
  border: 1px solid var(--fu-border, #3a3a3a);
  border-radius: var(--fu-radius, 14px);
  box-shadow: var(--fu-shadow, 0 2px 14px rgba(0, 0, 0, .25));
  display: grid;
  grid-template-columns: 180px 1fr;
  /* image | formulaire */
  gap: 0;
  max-height: 88vh;
  overflow-y: auto;
}


@media (max-width: 640px) {
  .fu-modal__dialog {
    grid-template-columns: 1fr;
    width: calc(100vw - 16px);
    max-width: none;
    margin: 8px auto;
    max-height: calc(100vh - 16px);

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

/* (modal centering reverted to original responsive behavior) */

@media (max-width: 640px) {
  .fu-modal__body {
    overflow: visible;
  }
}

/* 🔒 Bloque le scroll de la page quand une modale est ouverte */
body:has(.fu-modal:not(.u-hidden)),
body.cs-modal-open {
  overflow: hidden;
  height: 100vh;

  /* lock béton (évite le scroll derrière sur mobile) */
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}


.fu-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: 1px solid var(--fu-cyan);
  color: var(--fu-cyan);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}

.fu-modal__close:hover {
  filter: brightness(1.1);
}

.fu-modal__media {
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

.fu-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fu-modal__body {
  padding: 14px 16px 18px;
}

.fu-modal__title {
  color: var(--fu-cyan);
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.fu-modal__actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.fu-modal__actions .fu-btn {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  /* curseur en forme de main */
}

.fu-modal__actions .fu-btn.fu-btn--outline {
  background: transparent;
  color: var(--fu-cyan);
  border: 1px solid var(--fu-cyan);
}

.fu-modal__actions .fu-btn.fu-btn--primary {
  background: var(--fu-cyan);
  color: #0a0a0a;
  border: none;
}

/* Même effet hover que le bouton "Choisir un fichier" */
.fu-modal__actions .fu-btn.fu-btn--primary:hover {
  background: #00cccc;
  /* comme le bouton d'upload */
}

/* Pour "Annuler" : on illumine le contour/texte en même couleur */
.fu-modal__actions .fu-btn.fu-btn--outline:hover {
  border-color: #00cccc;
  color: #00cccc;
}

/* Cache les éléments marqués comme masqués */
.u-hidden {
  display: none !important;
}

/* ===== Footer de l'aperçu : favori + bouton finaliser ===== */

.cs-preview__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Toggle favori */

.cs-favorite-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--fu-silver);
}

.cs-favorite-toggle input[type="checkbox"] {
  accent-color: var(--fu-cyan);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.cs-favorite-toggle__star {
  font-size: 1rem;
  color: rgba(217, 217, 217, 0.6);
  transition: transform 0.15s ease, color 0.15s ease;
}

.cs-favorite-toggle__label {
  opacity: 0.8;
}

/* étoile "active" quand coché */
.cs-favorite-toggle input[type="checkbox"]:checked+.cs-favorite-toggle__star {
  color: var(--fu-cyan);
  transform: scale(1.1);
}

/* ===== Notes personnelles ===== */
.cs-notes {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  /* Position fixe */
  top: 90px;
  /* Se place en haut du conteneur parent, tout en restant visible */
  max-height: 250px;
  /* Limite la hauteur, ajustez si nécessaire */
  overflow-y: auto;
}

.cs-notes__title {
  font-size: 1rem;
  color: var(--fu-cyan);
}

.cs-notes__textarea {
  width: 100%;
  padding: 12px;
  font-size: 0.9rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  min-height: 120px;
  resize: vertical;
  outline: none;
}

.cs-notes__textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.cs-notes__textarea:focus {
  border-color: var(--fu-cyan);
  box-shadow: 0 0 0 1px rgba(0, 255, 255, 0.5);
}

/* ===== Page Mes séances ===== */

/* Page Mes séances : centrer le header uniquement sur cette page */
.ms-page .cs-header {
  justify-content: center;
}

.ms-page .cs-header__left {
  justify-content: center;
}

/* Titre / sous-titre */
.ms-header-title {
  font-size: 1.6rem;
  margin: 0;
  text-align: center;
  color: var(--fu-cyan, #00ffff);
  /* Cyan électrique */
}

.ms-header-subtitle {
  font-size: 0.9rem;
  margin: 4px 0 0 0;
  text-align: center;
  color: rgba(217, 217, 217, 0.8);
  /* Argent clair */
}

/* ===== Grille des cartes "Mes séances" ===== */
.ms-session-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* 2 cartes par ligne */
  gap: 18px;
  margin-top: 16px;
}

/* Sur mobile : 1 carte par ligne */
@media (max-width: 768px) {
  .ms-session-grid {
    grid-template-columns: 1fr;
  }
}

/* Ligne de séparation favoris / autres */
.ms-separator {
  grid-column: 1 / -1;
  border: 0;
  border-top: 1px solid rgba(128, 128, 128, 0.6);
  /* gris comme index */
  margin: 8px 0;
}

/* Carte séance (layout horizontal) */
.ms-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(46, 46, 46, 0.95);
  /* Gris graphite */
  border: 1px solid rgba(217, 217, 217, 0.12);
  /* Argent clair */
  color: #d9d9d9;
  /* Argent clair */
  min-height: 120px;
  /* carte un peu plus grande */
  align-items: stretch;
  /* le contenu remplit mieux la hauteur */
}

.ms-card--pinned {
  border-color: var(--fu-cyan, #00ffff);
  box-shadow: 0 0 0 1px rgba(0, 255, 255, 0.4);
}

/* Image */
.ms-card__image-wrap {
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ms-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Texte */
.ms-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ms-card__title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ms-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #d9d9d9;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.ms-card__notes {
  font-size: 0.8rem;
  color: rgba(217, 217, 217, 0.9);
  margin: 2px 0;
  /* Réduit l'espace au-dessus et en dessous des notes */
  padding: 0;
  /* Supprime le padding interne, ajuster si nécessaire */
}

/* Actions (boutons) */
.ms-card__actions {
  display: flex;
  flex-direction: column;
  /* Renommer au-dessus, puis le reste */
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.ms-card__buttons-row {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Espace entre Commencer et les icônes rondes */
}

.ms-card__rename,
.ms-card__start {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--fu-cyan, #00ffff);
  background: var(--fu-cyan, #00ffff);
  color: #000;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.ms-card__start:hover {
  box-shadow: 0 0 0 1px rgba(0, 255, 255, 0.6);
  transform: translateY(-1px);
}

.ms-card__icon-row {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Petits boutons icône (crayon + favori) */
.ms-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(217, 217, 217, 0.5);
  background: transparent;
  color: #d9d9d9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.ms-icon-btn:hover {
  border-color: var(--fu-cyan, #00ffff);
  color: var(--fu-cyan, #00ffff);
  transform: translateY(-1px);
}

/* État "favori" du bouton étoile */
.ms-icon-btn--fav[aria-pressed="true"] {
  background: var(--fu-cyan, #00ffff);
  color: #000;
  border-color: var(--fu-cyan, #00ffff);
}

/* Bouton danger (corbeille) */
.ms-icon-btn--danger {
  background: #b00020;
  border-color: #b00020;
  color: #ffffff;
}

.ms-icon-btn--danger:hover {
  background: #d00028;
  border-color: #d00028;
  transform: translateY(-1px);
}

/* Icônes (pictos texte) */
.ms-icon-pencil::before {
  content: "✎";
}

.ms-icon-duplicate::before {
  content: "⧉";
  /* icône texte pour la duplication */
}

.ms-icon-heart::before {
  content: "★";
}

/* Dates (2 lignes, tout en bas de la carte) */
.ms-card__meta {
  margin-top: auto;
  /* colle le bloc de dates en bas de la colonne texte */
  font-size: 0.78rem;
  color: rgba(217, 217, 217, 0.75);
}

/* État vide */
.ms-empty {
  margin-top: 14px;
  font-size: 0.9rem;
  color: rgba(217, 217, 217, 0.85);
}

.ms-empty a {
  color: var(--fu-cyan, #00ffff);
  text-decoration: underline;
}

/* ===== Footer collé en bas pour la page Mes Séances ===== */
.ms-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.ms-page main {
  flex: 1 0 auto;
}

.ms-page .fu-footer {
  margin-top: auto;
}

/* ===== Header "Mes séances" ===== */

.ms-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 12px;
  margin-bottom: 18px;
}

.ms-header__logo img {
  display: block;
}

.ms-header__center {
  text-align: center;
}

.ms-header-title {
  margin: 0;
  font-size: 1.4rem;
  color: var(--fu-cyan, #00ffff);
}

.ms-header-subtitle {
  margin: 4px 0 0 0;
  font-size: 0.95rem;
  color: var(--fu-muted, #b3b3b3);
}

.ms-header__right {
  text-align: right;
}

.ms-create-btn {
  font-size: 0.9rem;
  padding-inline: 14px;
}

.ms-card__rename {
  width: 100%;
  margin-bottom: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 255, 255, 0.12);
  border: 1px solid #00FFFF;
  color: #00FFFF;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
}

.ms-card__rename:hover {
  background: rgba(0, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* ===== Mes séances : organisation des boutons ===== */

.ms-card__controls {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.ms-card__start {
  flex: 1;
}

.ms-card__rename {
  flex: 0 0 auto;
}

/* Ligne des icônes rondes (éditer, dupliquer, supprimer, favori) */
.ms-card__icon-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* Bouton poubelle */
.ms-icon-trash::before {
  content: "🗑";
}

/* ===== Nouveau header "Mes séances" (vertical centré) ===== */
.ms-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  text-align: center;
}

/* Logo plus grand et centré */
.ms-header__logo-big {
  width: 120px;
  /* augmente si tu veux encore plus grand */
  height: 120px;
  object-fit: contain;
  margin-bottom: 8px;
}

/* Titre */
.ms-header-title {
  font-size: 1.9rem;
  color: var(--fu-cyan);
  margin: 0;
}

/* Sous-titre */
.ms-header-subtitle {
  font-size: 1rem;
  color: #d0d0d0;
  margin: 0 0 12px 0;
}

/* Bouton centré */
.ms-create-btn {
  margin-top: 4px;
  align-self: center;
}

/* =========================
   MODALE DÉTAILS FIX — FONCTIONNELLE
   ========================= */

#csExoDetailModal .fu-modal__dialog {
  background: #050505 !important;
  color: #fff !important;
  border-radius: 20px;
  padding: 24px !important;
  max-width: 900px !important;
  width: calc(100% - 40px) !important;
  margin: 40px auto !important;
  position: relative;
  display: block !important;
  /* ✨ Neutralise tous les flex hérités */
  overflow: hidden !important;
}

.cs-exodetail-wrapper {
  display: grid !important;
  grid-template-columns: 280px 1fr !important;
  /* ✨ Large image / large texte */
  gap: 24px !important;
  width: 100% !important;
  height: auto !important;
}

/* Colonne image */
.cs-exodetail-image {
  width: 100% !important;
  height: auto !important;
}

.cs-exodetail-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 16px;
}

/* Colonne texte */
.cs-exodetail-text {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
  overflow-y: auto !important;
  max-height: calc(100vh - 180px) !important;
  padding-right: 8px !important;
}

/* Structure textes */
.cs-exodetail-header h3 {
  margin: 0;
  font-size: 1.6rem;
}

.cs-exodetail-group,
.cs-exodetail-muscles {
  margin: 0;
  color: #bbb;
}

.cs-exodetail-section h4 {
  margin: 0 0 4px;
  color: #00eaff;
  font-size: 1.1rem;
}

.cs-exodetail-section p {
  margin: 0;
  line-height: 1.5;
}

/* ----- Croix de suppression pour les exos ajoutés par l'utilisateur ----- */

.cs-exo-card--custom {
  position: relative;
}

.cs-exo-card__delete {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cs-exo-card__delete:hover {
  transform: scale(1.15);
  background: rgba(0, 0, 0, 0.85);
  color: #ff4b4b;
  /* rouge au survol */
}

/* Spécifique à la modale "Ajouter un exercice" :
   on désactive la grille 2 colonnes et on centre mieux le panneau */
#csAddExoModal .fu-modal__dialog {
  display: block;
  /* plus de grille : toute la largeur pour le formulaire */
  max-height: 80vh;
  /* limite la hauteur totale de la modale */
  margin: 6vh auto;
  /* marge haut + bas pour qu'elle soit plus centrée */
}

/* ===============================
   MOBILE — Aperçu de séance en slide
   =============================== */

@media (max-width: 768px) {

  /* Cache l’aperçu par défaut */
  .cs-preview {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;

    height: 85vh;
    background: #0b0b12;

    z-index: 1200;

    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-radius: 16px 16px 0 0;

    /* désactive le sticky desktop */
    top: auto;
    max-height: none;
  }

  /* Aperçu visible */
  .cs-preview.is-open {
    transform: translateY(0);
  }

}

/* ===============================
   Bouton sticky "Voir l’aperçu"
   =============================== */

@media (max-width: 768px) {

  .cs-preview-toggle {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);

    padding: 14px 22px;
    border-radius: 999px;

    background: var(--fu-cyan);
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;

    border: none;
    z-index: 1300;
    cursor: pointer;
  }

}

@media (min-width: 769px) {
  .cs-preview-toggle {
    display: none;
  }
}

@media (max-width: 768px) {
  body:has(.cs-preview.is-open) {
    overflow: hidden;
    height: 100vh;
  }
}

@media (max-width: 768px) {
  body:has(.cs-preview.is-open) .fu-backtotop {
    display: none !important;
  }
}

/* ✅ Fix style bouton croix (évite le rendu iOS/Android par défaut) */
.cs-preview-close{
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .cs-preview-close {
    position: absolute;
    top: 10px;
    right: 12px;

    width: 32px;
    height: 32px;
    border-radius: 999px;

    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--fu-cyan);
    color: var(--fu-cyan);

    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1400;
  }

  .cs-preview-close:hover {
    background: rgba(0, 0, 0, 0.85);
  }
}

/* ❌ Cache la croix en desktop */
@media (min-width: 769px) {
  .cs-preview-close {
    display: none !important;
  }
}

/* ✅ Drag au doigt : barres + texte */
.cs-preview__handle{
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.cs-preview__text{
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.cs-preview__item{
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.cs-preview__list{
  overscroll-behavior: contain;
}

/* =========================================
   DRAG — curseur main ouverte/fermée
   ========================================= */

/* main ouverte (hover / prêt à drag) */
.cs-preview__item,
.cs-preview__handle,
.cs-preview__text{
  cursor: grab;
}

/* main fermée pendant le drag (ton JS met .is-dragging) */
.cs-preview__item.is-dragging,
.cs-preview__item.is-dragging .cs-preview__handle,
.cs-preview__item.is-dragging .cs-preview__text{
  cursor: grabbing !important;
}

/* main fermée au clic (utile si le drag démarre avant que .is-dragging arrive) */
.cs-preview__item:active,
.cs-preview__handle:active,
.cs-preview__text:active{
  cursor: grabbing;
}
/* =========================================
   MOBILE — stop overflow horizontal aperçu
   ========================================= */

.cs-preview,
.cs-preview__list,
.cs-preview__item{
  box-sizing: border-box;
  max-width: 100%;
}

.cs-preview{
  overflow-x: hidden; /* sécurité */
}

.cs-preview__item{
  width: 100%;
  min-width: 0; /* IMPORTANT en flex */
}

/* la poignée ne grossit pas */
.cs-preview__handle{
  flex: 0 0 auto;
}

/* le texte peut rétrécir sans pousser la largeur */
.cs-preview__text{
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* le bouton remove ne grossit pas */
.cs-preview__remove{
  flex: 0 0 auto;
}
/* =========================================
   DRAG — curseur main ouverte/fermée
   ========================================= */

/* main ouverte */
.cs-preview__item,
.cs-preview__handle,
.cs-preview__text{
  cursor: -webkit-grab;
  cursor: grab;
}

/* main fermée PENDANT le drag (classe posée sur body) */
body.cs-grabbing,
body.cs-grabbing *{
  cursor: -webkit-grabbing !important;
  cursor: grabbing !important;
}

/* le bouton remove doit rester un pointeur */
body.cs-grabbing .cs-preview__remove{
  cursor: pointer !important;
}

/* =========================================================
   ✅ FIX MOBILE — MODALES (creation_seance.html)
   - Image centrée en haut
   - Scroll complet jusqu'en bas
   ========================================================= */
@media (max-width: 640px) {
  #csExoDetailModal .fu-modal__dialog{
    margin: 8px auto !important;
    width: calc(100vw - 16px) !important;
    max-width: none !important;
    max-height: calc(100vh - 16px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #csExoDetailModal .cs-exodetail-wrapper{
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  #csExoDetailModal .cs-exodetail-image{
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
  }

  #csExoDetailModal .cs-exodetail-img{
    width: min(340px, 82vw);
    max-height: 38vh;
    height: auto;
  }

  #csExoDetailModal .cs-exodetail-text{
    overflow: visible !important;
    max-height: none !important;
    padding-right: 0 !important;
  }
}


/* =========================================================
   HARD MOBILE ALIGNMENT OVERRIDES (anti-chevauchement)
   Objectif:
   - Même repère de largeur que la barre de recherche
   - 2 colonnes stables sur mobile, sans overflow, sans translate
   - Neutralise les styles globaux (styles.css / home.css) qui centrent en flex
   ========================================================= */

.cs-exercise-list,
#csExerciseContainer,
.cs-group,
.cs-group__list {
  min-width: 0;
}

.cs-exercise-list,
#csExerciseContainer {
  width: 100%;
}

@media (max-width: 900px) {
  .cs-layout {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  /* Empêche tout parent de "shrink" le contenu */
  .cs-exercise-list {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #csExerciseContainer {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  .cs-group {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Grille 2 colonnes robuste (pas de largeur fixe + pas de translate) */
  .cs-group__list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;

    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;

    justify-content: stretch !important;
    justify-items: stretch !important;

    transform: none !important;
  }

  /* Sécurité anti scroll horizontal */
  html, body {
  max-width: 100%;
}
}

/* ===== Center muscle group titles on mobile ===== */
@media (max-width: 768px) {
  .cs-group__title{
    width: 100%;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }
}


/* === OVERRIDE: éviter les images coupées (GymVisual) === */
.cs-exodetail-img{
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}
.fu-modal__media img{
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

/* ================================
   IMAGES — rendu "comme avant"
   Cartes = cover (uniforme)
   Modales = contain (pas coupé)
   ================================ */

/* 1) CARTES (aperçu) : uniforme comme avant */
.cs-exo-card__img,
.cs-exo-card__img img{
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
}

.cs-exo-card__img{
  overflow: hidden;
  border-radius: 14px;
  background: #111;
}

.cs-exo-card__img img{
  height: 100%;
  object-fit: cover;
}

/* 2) MODALE détails : image entière */
#csExoDetailModal .cs-exodetail-img{
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

/* 3) Sécurité : images dans la zone media des modales */
.fu-modal__media img{
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

/* === Aperçus d'images ronds dans les cartes === */
.cs-exo-card__logo{
  width: 32px;
  height: 32px;
  border-radius: 9px;   /* ✅ rond */
  object-fit: cover;      /* ou contain si tu veux éviter le crop */
  background: #111;       /* optionnel: joli fond si l'image a du blanc */
  border: 1px solid rgba(255,255,255,0.12);
}