/* ==========================================================================
   cockpit.css — habillage « cockpit » de la Salle de contrôle (20/10/2026)
   --------------------------------------------------------------------------
   Chargé seulement par cockpit.html (copie de index.html). Rien n'est réécrit :
   on REPLACE les écrans existants dans quatre zones fixes.
     console à gauche · instruments en haut · écran principal · poste de commande à droite
   Toutes les fenêtres .modale-fond (publication, classes, Mes Pages, confirmation des
   Pages, Atelier) s'ouvrent DANS le poste de commande au lieu de surgir au milieu.
   Téléphone (≤ 900 px) : console en bas, poste de commande en tiroir (validé par Bilal
   sur la maquette le 20/10, commit e77d5e3).
   Couleurs : jetons --r-* uniquement (refonte-studio.css).
   ========================================================================== */

body.cockpit {
  --ck-marge: 10px;
  --ck-gauche: 220px;
  --ck-haut: 64px;
  --ck-droite: 360px;
  --ck-ecran-haut: calc(var(--ck-marge) * 2 + var(--ck-haut));
  padding: var(--ck-ecran-haut) calc(var(--ck-droite) + var(--ck-marge) * 2 + 8px) 24px calc(var(--ck-gauche) + var(--ck-marge) * 2 + 8px);
  min-height: 100vh;
  box-sizing: border-box;
}

/* Ce que la console et les instruments remplacent */
.cockpit #barre-connexion-backend,
.cockpit .racine-onglets,
.cockpit .parcours-portrait,
.cockpit .parcours-etiquette,
.cockpit .classes-portrait,
.cockpit .studio-onglets,
.cockpit .apercu-barre .miroir-bascule,
.cockpit #bouton-retour-parcours,
.cockpit #interrupteur-theme-studio,
.cockpit .parcours-tuile-actions { display: none !important; }

/* --------------------------------------------------------------- cadres */
.ck-cadre {
  background: var(--r-surface);
  border: 1px solid var(--r-bordure);
  border-radius: 16px;
  box-shadow: var(--r-ombre-1);
}
.ck-etiquette {
  font-family: var(--r-police-mono);
  font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--r-texte-3);
}

/* --------------------------------------------------------------- console */
.ck-console {
  position: fixed; z-index: 60;
  top: var(--ck-marge); bottom: var(--ck-marge); left: var(--ck-marge); width: var(--ck-gauche);
  display: flex; flex-direction: column; gap: 4px; padding: 12px 10px;
}
.ck-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-family: var(--r-police-titre); font-weight: 700; font-size: 1.05rem; color: var(--r-texte); }
.ck-logo small { display: block; margin-top: 2px; }
.ck-poste {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid transparent; border-radius: 12px; background: none;
  padding: 7px 9px; text-align: left; color: var(--r-texte-2); font: inherit; cursor: pointer;
}
.ck-poste:hover { background: var(--r-surface-2); color: var(--r-texte); }
.ck-poste.actif { background: var(--r-primaire-doux); border-color: var(--r-bordure-forte); color: var(--r-texte); }
.ck-visage {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover; object-position: 50% 8%;
  background: var(--r-surface-2); border: 1px solid var(--r-bordure-forte);
}
.ck-poste.actif .ck-visage { border-color: var(--r-primaire); box-shadow: 0 0 0 2px var(--r-primaire-doux), 0 0 12px var(--r-primaire); }
.ck-noms { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ck-noms .n { font-weight: 800; }
.ck-noms .s { font-size: .74rem; color: var(--r-texte-3); }
.ck-console-bas { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--r-bordure); padding-top: 8px; }
.ck-console-bas .ck-poste { font-size: .86rem; font-weight: 700; padding: 8px 10px; }

/* --------------------------------------------------------------- instruments */
.ck-instruments {
  position: fixed; z-index: 61; /* au-dessus du poste de commande : le menu « Plus » déborde dessus */
  top: var(--ck-marge); height: var(--ck-haut);
  left: calc(var(--ck-gauche) + var(--ck-marge) * 2); right: var(--ck-marge);
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
}
.ck-fil { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 800; flex: 1; }
.ck-fil button { border: 0; background: none; font: inherit; color: var(--r-texte-2); cursor: pointer; padding: 0; }
.ck-fil button:hover { color: var(--r-primaire); }
.ck-fil .sep { color: var(--r-texte-3); }
.ck-fil .titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--r-texte); }
/* Les actions de l'en-tête du cours (Présenter, classes, ⋯ Plus, Pages) vivent ici */
.ck-instruments .studio-entete-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; margin: 0; }
body:not([data-poste="cours"]) .ck-instruments .studio-entete-actions > :not(#jeton-pages) { display: none !important; }
.ck-reglages { display: none; }

/* --------------------------------------------------------------- écran principal */
.cockpit .ecran-parcours,
.cockpit .ecran-classes,
.ck-station {
  position: fixed; z-index: 40;
  top: var(--ck-ecran-haut); bottom: var(--ck-marge);
  left: calc(var(--ck-gauche) + var(--ck-marge) * 2);
  right: calc(var(--ck-droite) + var(--ck-marge) * 2);
  border: 1px solid var(--r-bordure); border-radius: 16px;
  overflow-y: auto;
}
.ck-station { z-index: 45; background: var(--r-surface); overflow: hidden; }
.ck-station[hidden] { display: none; }
.ck-station iframe { width: 100%; height: 100%; border: 0; display: block; }
/* QR code ouvert depuis la Station (15/11/2026) : le cadre prend tout l'écran le temps de le
   projeter — sur téléphone, il était coupé (croix et titre hors de la fenêtre). La Station pose
   et retire cette classe elle-même (station.js, qrPleinEcran). !important : les règles du
   téléphone plus bas sont plus précises. */
#ck-station.ck-station--qr {
  position: fixed !important; inset: 0 !important; z-index: 2000 !important;
  padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important;
}

.cockpit .studio-entete { padding-top: 0; }
.cockpit .studio-entete-ligne { margin-bottom: 8px; }
.cockpit .parcours-tuile--parcours.ck-choisie { outline: 2px solid var(--r-primaire); outline-offset: 2px; border-radius: 18px; }

/* Sélecteur de vue d'un parcours : Plan de vol · Téléphone · Tablette · Tableau */
.ck-vues { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
body:not([data-poste="cours"]) .ck-vues { display: none; }
.ck-selecteur { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--r-bordure); border-radius: 12px; background: var(--r-surface-2); }
.ck-selecteur button { border: 0; background: none; border-radius: 9px; padding: 7px 13px; font: inherit; font-weight: 800; font-size: .86rem; color: var(--r-texte-2); cursor: pointer; }
.ck-selecteur button.actif { background: var(--r-primaire); color: var(--r-primaire-texte); }
.ck-lien { border: 1px solid var(--r-bordure-forte); background: none; border-radius: 99px; padding: 7px 14px; font: inherit; font-weight: 700; font-size: .86rem; color: var(--r-texte); cursor: pointer; }
.ck-lien:hover { border-color: var(--r-primaire); color: var(--r-primaire); }

/* La vue « plan de vol » remplace l'aperçu téléphone/tablette (mêmes données) */
body[data-vue="plan"] #onglet-editeur { display: none !important; }
.ck-plan[hidden] { display: none; }

/* --------------------------------------------------------------- plan de vol */
.ck-plan h2 { font-family: var(--r-police-titre); margin: 0 0 4px; }
.ck-plan .ck-chapeau { margin: 0 0 16px; color: var(--r-texte-2); }
.ck-mission { border: 1px solid var(--r-bordure); background: var(--r-surface); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.ck-mission-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ck-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--r-primaire-doux); color: var(--r-primaire); border: 1px solid var(--r-bordure-forte); flex-shrink: 0; }
.ck-mission-titre { font-weight: 800; }
.ck-mission-meta { font-size: .8rem; color: var(--r-texte-3); }
/* « 🗑 Retirer ce chapitre » (finitions, 28/10/2026) : à droite de l'en-tête d'un chapitre ajouté. */
.ck-retirer-chapitre { margin-left: auto; font-size: .82rem; padding: 5px 12px; }
.ck-retrait-chapitre { margin: 10px 0 4px; }
.ck-retrait-chapitre p { margin: 0 0 10px; }
.ck-retrait-chapitre .ck-rangee { flex-wrap: wrap; }
.ck-resultat {
  margin-left: auto; display: flex; align-items: center; gap: 10px; font: inherit; font-size: .82rem; color: var(--r-texte-2);
  border: 1px solid var(--r-bordure); background: var(--r-surface-2); border-radius: 99px; padding: 5px 12px; cursor: pointer;
}
.ck-resultat:hover, .ck-resultat.sel { border-color: var(--r-primaire); }
.ck-resultat[disabled] { cursor: default; border-style: dashed; }
.ck-barre { width: 90px; height: 6px; border-radius: 99px; background: var(--r-bordure); overflow: hidden; }
.ck-barre > span { display: block; height: 100%; background: var(--r-succes); border-radius: 99px; }
.ck-barre.faible > span { background: var(--r-accent); }
.ck-activites { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 12px; }
.ck-activite {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--r-texte); cursor: pointer;
  border: 1px solid var(--r-bordure); background: var(--r-surface-2); border-radius: 12px; padding: 9px 11px;
}
.ck-activite:hover { border-color: var(--r-primaire); }
.ck-activite .type { font-family: var(--r-police-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--r-texte-3); display: flex; align-items: center; gap: 6px; }
.ck-activite .q { font-weight: 700; font-size: .9rem; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ck-voyant { width: 7px; height: 7px; border-radius: 50%; background: var(--r-succes); flex-shrink: 0; }
.ck-voyant.ambre { background: var(--r-accent); box-shadow: 0 0 6px var(--r-accent); }
.ck-plan-vide { color: var(--r-texte-2); }
/* Saut du plan de vol vers une activité de l'aperçu : on la fait briller un instant */
.cockpit .activite.ck-eclaire { outline: 3px solid var(--r-primaire); outline-offset: 3px; transition: outline-color 1.5s; }

/* --------------------------------------------------------------- poste de commande */
.ck-commande {
  position: fixed; z-index: 60;
  top: var(--ck-ecran-haut); bottom: var(--ck-marge); right: var(--ck-marge); width: var(--ck-droite);
  display: flex; flex-direction: column; overflow: hidden;
}
.ck-poignee { display: none; }
.ck-commande-tete { padding: 12px 16px 0; }
.ck-commande-corps { padding: 12px 16px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.ck-commande-corps h3 { font-family: var(--r-police-titre); font-size: 1.15rem; margin: 0; }
.ck-commande-corps p { margin: 0; }
.ck-mini { font-size: .82rem; color: var(--r-texte-3); }
.ck-bouton { border: 0; border-radius: 12px; padding: 11px 14px; font: inherit; font-weight: 800; background: var(--r-primaire); color: var(--r-primaire-texte); cursor: pointer; }
.ck-bouton.discret { background: none; border: 1px solid var(--r-bordure-forte); color: var(--r-texte); }
.ck-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ck-liste li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--r-bordure); border-radius: 10px; background: var(--r-surface-2); font-size: .9rem; }
.ck-liste .score { font-weight: 800; }
.ck-liste .aider { color: var(--r-accent); }
/* Les boutons du parcours choisi (Lien élève, Projeter, Partager, Supprimer), déplacés ici */
.ck-actions .parcours-tuile-actions { display: flex !important; flex-direction: column; align-items: stretch; gap: 6px; }
.ck-actions .parcours-tuile-actions .bouton { width: 100%; justify-content: center; }
/* L'analyse de la Scientifique (cartouche de l'en-tête), déplacée ici quand un parcours est ouvert */
.ck-commande .cartouche-analyste { display: flex; flex-direction: column; align-items: stretch; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; gap: 10px; }
.ck-commande .cartouche-analyste-portrait { width: 120px; height: auto; align-self: center; }
.ck-commande .cartouche-analyste-action .bouton { width: 100%; }

/* Personnage en pied, en apesanteur, avec sa bulle */
.ck-officier { display: grid; grid-template-columns: 130px 1fr; gap: 4px; align-items: start; min-height: 200px; }
.ck-officier img {
  width: 130px; height: 200px; object-fit: contain; object-position: bottom center;
  filter: var(--r-ombre-perso); animation: ck-flotte 4.5s ease-in-out infinite;
}
.ck-officier.entre img { animation: ck-entre .55s cubic-bezier(.2,1.35,.4,1) both, ck-flotte 4.5s ease-in-out .55s infinite; }
.ck-bulle { margin-top: 12px; background: var(--r-surface-2); border: 1px solid var(--r-bordure-forte); border-radius: 16px 16px 16px 4px; padding: 10px 12px; font-size: .9rem; }
.ck-bulle .nom { font-family: var(--r-police-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--r-primaire); margin-bottom: 3px; }
@keyframes ck-flotte { 50% { transform: translateY(-7px) rotate(-1deg); } }
@keyframes ck-entre { from { transform: translateX(60px) scale(.85); opacity: 0; } }

/* Les fenêtres existantes s'ouvrent DANS le poste de commande */
.cockpit .modale-fond {
  inset: auto; top: var(--ck-ecran-haut); bottom: var(--ck-marge); right: var(--ck-marge); left: auto;
  width: var(--ck-droite); padding: 0; background: none; backdrop-filter: none;
  align-items: stretch; justify-content: stretch; z-index: 2000;
}
.cockpit .modale-fond[hidden] { display: none; }
.cockpit .modale-carte {
  max-width: none; width: 100%; max-height: none; height: 100%; border-radius: 16px; overflow-y: auto;
  box-shadow: var(--r-ombre-2); animation: ck-glisse .22s ease both;
}
@keyframes ck-glisse { from { transform: translateX(24px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ck-officier img, .cockpit .modale-carte { animation: none !important; }
}

/* ===================================================================== téléphone */
@media (max-width: 900px) {
  body.cockpit { --ck-haut: 56px; padding: calc(var(--ck-haut) + 16px) 10px 160px; }
  .ck-console {
    top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; height: auto;
    flex-direction: row; padding: 6px; gap: 4px;
  }
  .ck-logo, .ck-console-bas, .ck-noms .s { display: none; }
  .ck-poste { flex-direction: column; gap: 2px; font-size: .7rem; padding: 6px 2px; justify-content: center; text-align: center; }
  .ck-noms .n { font-weight: 700; }
  .ck-instruments { left: 8px; right: 8px; top: 8px; padding: 0 10px; gap: 8px; }
  .ck-instruments .studio-entete-actions { gap: 4px; }
  .ck-reglages { display: inline-flex; border: 1px solid var(--r-bordure); border-radius: 10px; background: var(--r-surface-2); padding: 6px 10px; font-size: 1rem; cursor: pointer; color: var(--r-texte); }

  .cockpit .ecran-parcours, .cockpit .ecran-classes, .ck-station {
    top: calc(var(--ck-haut) + 16px); left: 8px; right: 8px; bottom: 150px;
  }

  /* Tiroir : une poignée posée sur la console ; il monte dès qu'il y a quelque chose à faire */
  .ck-commande { top: auto; left: 8px; right: 8px; bottom: 94px; width: auto; max-height: 68vh; box-shadow: var(--r-ombre-2); }
  .ck-commande .ck-commande-tete { display: none; }
  .ck-commande:not(.ouvert) > :not(.ck-poignee) { display: none; }
  .ck-poignee {
    display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 10px 14px; cursor: pointer;
    font-family: var(--r-police-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--r-texte-2);
  }
  .ck-poignee .barre { width: 36px; height: 4px; border-radius: 2px; background: var(--r-bordure-forte); margin-left: auto; }
  .ck-poignee .fleche { color: var(--r-primaire); }
  .ck-commande.ouvert .ck-poignee { border-bottom: 1px solid var(--r-bordure); }
  .ck-voile { position: fixed; inset: 0; z-index: 55; background: color-mix(in srgb, var(--r-surface) 70%, transparent); border: 0; }
  .ck-officier { grid-template-columns: 90px 1fr; min-height: 140px; }
  .ck-officier img { width: 90px; height: 140px; }

  .cockpit .modale-fond { top: auto; left: 8px; right: 8px; bottom: 94px; width: auto; max-height: 75vh; height: auto; box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--r-surface) 70%, transparent); }
  .cockpit .modale-carte { height: auto; max-height: 75vh; }

  .ck-selecteur { display: flex; flex: 1; min-width: 0; }
  /* « Élèves et codes » au bout de la rangée des vues, même gabarit que les onglets (22/10/2026) */
  .ck-vues { flex-wrap: nowrap; gap: 6px; }
  .ck-vues .ck-lien { align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    padding: 6px 10px; border-radius: 12px; font-size: .72rem; white-space: nowrap; }
  .ck-vues .ck-lien .ico { font-size: 1rem; line-height: 1; }
  .ck-selecteur button { flex: 1; padding: 6px 2px; font-size: .72rem; display: flex; flex-direction: column; align-items: center; gap: 1px; white-space: nowrap; }
  .ck-selecteur .ico { font-size: 1rem; line-height: 1; }
  .ck-activites { grid-template-columns: 1fr; }
  .ck-resultat { margin-left: 0; }
}
.ck-voile[hidden] { display: none; }
#ck-c-dyn { display: flex; flex-direction: column; gap: 12px; }
#ck-c-dyn:empty { display: none; }
/* L'Atelier n'a pas besoin du titre du parcours : le fil d'Ariane le dit déjà */
body[data-poste="atelier"] .studio-entete { display: none; }
/* studio.css étire ces actions en téléphone : dans la bande d'instruments, elles prennent leur place, pas plus */
.ck-instruments .studio-entete-actions { flex: 0 0 auto; width: auto; justify-content: flex-end; }
.ck-fil { min-width: 70px; }
@media (max-width: 900px) {
  /* L'écran couvre toute la hauteur : rien de l'arrière-plan ne dépasse au-dessus de la console */
  .cockpit .ecran-parcours, .cockpit .ecran-classes, .ck-station { bottom: 0; border-radius: 16px 16px 0 0; border-bottom: 0; }
  .cockpit .ecran-parcours, .cockpit .ecran-classes { padding-bottom: 150px; }
  .ck-station { padding-bottom: 140px; }
}
.ck-fil { white-space: nowrap; }
@media (max-width: 900px) {
  /* Le titre du parcours est déjà sous la bande : en téléphone, le fil ne dit que le poste */
  .ck-fil .sep, .ck-fil .titre { display: none; }
  .ck-instruments .studio-entete-actions .bouton, .ck-instruments .studio-entete-actions .jeton { padding: 5px 8px; font-size: .78rem; }
  .ck-reglages { flex-shrink: 0; }
}

/* ---- Retours de Bilal du 20/10 (soir) ---- */
/* La Scientifique entière dans le poste de commande (la marge négative de l'ancien en-tête lui coupait la tête) */
.ck-commande .cartouche-analyste-portrait {
  margin: 0; width: 150px; height: 210px; object-fit: contain; object-position: bottom center;
  animation: ck-flotte 4.5s ease-in-out infinite;
}
.ck-commande .cartouche-analyste::before, .ck-commande .cartouche-analyste::after { display: none; }
/* L'écran du Réservoir */
.ck-reservoir { overflow-y: auto; padding: 24px 28px; }
.ck-reservoir h2 { font-family: var(--r-police-titre); margin: 0 0 4px; }
.ck-reservoir .ck-chapeau { color: var(--r-texte-2); margin: 0 0 18px; max-width: 60ch; }
#ck-reservoir-corps .modale-carte { max-width: 560px; height: auto; max-height: none; box-shadow: none; animation: none; }
#ck-reservoir-corps .modale-fermer { display: none; }
/* « Tarifs et mode d'emploi » (29/10/2026) : Captain Cosmos, puis une fiche par fonctionnalité */
.ck-reservoir-onglets { margin: 2px 0 14px; flex-wrap: wrap; }
.ck-reservoir-onglets button { display: inline-flex; align-items: center; gap: 6px; }
#ck-reservoir-corps[hidden], #ck-guide[hidden] { display: none; }
#ck-guide { max-width: 980px; }
.ck-guide-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 10px; }
.ck-guide-fiche { background: var(--r-surface); border: 1px solid var(--r-bordure-forte); border-radius: 16px; padding: 14px 16px; font-size: 14px; line-height: 1.5; }
.ck-guide-fiche h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--r-police-titre); font-size: 18px; }
.ck-guide-fiche p { margin: 0 0 6px; color: var(--r-texte-2); }
.ck-guide-fiche p b { color: var(--r-texte); }
.ck-guide-prix { margin-top: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--r-primaire); background: var(--r-primaire-doux); color: var(--r-texte); }
.ck-guide-prix ul { margin: 4px 0 0; padding-left: 18px; }
/* Écrans posés par-dessus (Station, Réservoir, Hangar, Laboratoire) : le parcours ouvert en dessous
   ne doit plus dépasser nulle part, sinon on croit voir deux écrans mélangés. */
body:is([data-poste="station"], [data-poste="pages"], [data-poste="parcours"], [data-poste="classes"])
  :is(.studio-entete, .studio-onglets, .ck-vues, .ck-plan, .onglet-panneau, .studio-publication) { visibility: hidden; }

/* ---- Laboratoire enrichi (20/10, demande de Bilal) ---- */
.cockpit #classes-grille[hidden] { display: none !important; }
.ck-labo { margin: 8px 0 18px; }
.ck-labo-parcours { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ck-labo-parcours .ck-lien.actif { border-color: var(--r-primaire); background: var(--r-primaire-doux); color: var(--r-primaire); }
.ck-labo-defile { overflow-x: auto; margin-top: 8px; }
.ck-labo-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: .92rem; }
.ck-labo-table th { text-align: left; font-family: var(--r-police-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--r-texte-3); padding: 0 12px; font-weight: 500; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-labo-table td { padding: 11px 12px; background: var(--r-surface-2); border-top: 1px solid var(--r-bordure); border-bottom: 1px solid var(--r-bordure); white-space: nowrap; }
.ck-labo-table td:first-child { border-left: 1px solid var(--r-bordure); border-radius: 10px 0 0 10px; font-weight: 800; }
.ck-labo-table td:last-child { border-right: 1px solid var(--r-bordure); border-radius: 0 10px 10px 0; }
.ck-labo-table td.faible { color: var(--r-accent); font-weight: 800; }
.ck-labo-table tbody tr { cursor: pointer; }
.ck-labo-table tbody tr:hover td, .ck-labo-table tbody tr.sel td { border-color: var(--r-primaire); }
.ck-etat { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; }
.ck-etat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--r-texte-3); }
.ck-etat--aider { color: var(--r-accent); }
.ck-etat--aider::before { background: var(--r-accent); box-shadow: 0 0 6px var(--r-accent); }
.ck-etat--route::before, .ck-etat--fini::before { background: var(--r-succes); }
/* Ligne « La classe » et vues à faire défiler */
.ck-labo-table tfoot td { background: var(--r-primaire-doux); border-color: var(--r-bordure-forte); }
.ck-labo-table tfoot td:first-child { color: var(--r-primaire); }
.ck-carrousel { margin-top: 18px; border: 1px solid var(--r-bordure); border-radius: 16px; background: var(--r-surface); padding: 14px 18px 12px; }
.ck-carrousel-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ck-carrousel-tete h3 { margin: 0; font-family: var(--r-police-titre); font-size: 1.05rem; text-align: center; flex: 1; }
.ck-fleche { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--r-bordure-forte); background: var(--r-surface-2); color: var(--r-texte); font-size: 1.2rem; cursor: pointer; }
.ck-fleche:hover { border-color: var(--r-primaire); color: var(--r-primaire); }
.ck-carrousel-corps { min-height: 150px; }
.ck-points { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.ck-points button { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: var(--r-bordure-forte); cursor: pointer; }
.ck-points button.actif { width: 22px; background: var(--r-primaire); }
.ck-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 10px; }
.ck-chiffres > div { border: 1px solid var(--r-bordure); background: var(--r-surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ck-chiffres b { font-family: var(--r-police-titre); font-size: 1.4rem; }
.ck-chiffres span { font-size: .8rem; color: var(--r-texte-3); }
.ck-barres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ck-barres li { display: grid; grid-template-columns: minmax(110px, 220px) 1fr auto auto; align-items: center; gap: 10px; font-size: .88rem; }
.ck-barres .lib { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-barres .ck-barre { width: 100%; height: 8px; }
.ck-barres .val { font-weight: 800; min-width: 44px; text-align: right; }
.ck-notions { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.ck-notions li > span:first-child { font-weight: 700; margin-right: 8px; }
@media (max-width: 900px) { .ck-barres li { grid-template-columns: 1fr auto; } .ck-barres .ck-barre { grid-column: 1 / -1; } }

/* ---- Corriger une activité dans le poste de commande (20/10) ---- */
.ck-activite.sel { border-color: var(--r-primaire); box-shadow: 0 0 0 2px var(--r-primaire-doux); }
.ck-source { font-size: .86rem; color: var(--r-texte-2); border-left: 3px solid var(--r-bordure-forte); padding: 4px 0 4px 10px; margin: 0; }
.ck-formulaire { display: flex; flex-direction: column; gap: 10px; }
.ck-champ { display: flex; flex-direction: column; gap: 4px; }
.ck-champ > span { font-size: .78rem; font-weight: 700; color: var(--r-texte-2); }
.ck-champ textarea {
  font: inherit; font-weight: 700; color: var(--r-texte); background: var(--r-surface-2);
  border: 1px solid var(--r-bordure-forte); border-radius: 10px; padding: 8px 10px; resize: vertical; min-height: 36px; overflow: hidden;
}
.ck-champ textarea:focus { outline: none; border-color: var(--r-primaire); box-shadow: 0 0 0 3px var(--r-primaire-doux); }
.ck-rangee { display: flex; gap: 8px; }
.ck-rangee .ck-bouton { flex: 1; }
/* Activités à relire : visibles du premier coup d'œil (Bilal : « c'est où à relire ? ») */
.ck-activite.a-relire { border-color: var(--r-accent); background: var(--r-accent-doux); }
.ck-activite.a-relire .type { color: var(--r-accent); font-weight: 700; }
.ck-activite.a-relire.sel { box-shadow: 0 0 0 2px var(--r-accent); }
/* Code personnel de l'élève dans sa fiche (Laboratoire) */
.ck-code { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--r-bordure); background: var(--r-surface-2); border-radius: 12px; padding: 10px 12px; }
.ck-code b { font-family: var(--r-police-mono); font-size: 1.15rem; letter-spacing: .08em; }

/* ---------- Destination du parcours : planète d'arrivée (21/10/2026) ---------- */
.ck-destination { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid var(--r-bordure); border-radius: 14px; background: var(--r-surface-2); }
.ck-destination img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.ck-destination-texte { flex: 1; min-width: 0; }
.ck-destination-texte strong { display: block; color: var(--r-texte); font-family: var(--r-police-titre); }
.ck-destination .ck-bouton { flex: none; padding: 8px 12px; }
.ck-planetes { display: grid; gap: 8px; margin-bottom: 12px; }
.ck-planetes-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.ck-planete, .ck-planete-auto { border: 1px solid var(--r-bordure); border-radius: 12px; background: var(--r-surface);
  color: var(--r-texte-2); font: inherit; cursor: pointer; }
.ck-planete { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; font-size: .72rem; line-height: 1.2; }
.ck-planete img { width: 52px; height: 52px; object-fit: contain; }
.ck-planete-auto { padding: 10px 12px; text-align: left; font-weight: 700; }
.ck-planete:hover, .ck-planete-auto:hover { border-color: var(--r-bordure-forte); color: var(--r-texte); }
.ck-planete.sel, .ck-planete-auto.sel { border-color: var(--r-primaire); background: var(--r-primaire-doux); color: var(--r-texte); }

/* « Élèves et codes » du Hangar (22/10/2026) : seule la vue des codes, pas les diapositives de résultats */
body.ck-codes-seuls .tdb-carrousel-fleche,
body.ck-codes-seuls .tdb-carrousel-points,
body.ck-codes-seuls .tdb-hublot-ingenieure { display: none !important; }

/* Hangar et Laboratoire : la marge du haut attendait le bandeau de connexion, caché ici (22/10/2026) */
.cockpit .ecran-parcours, .cockpit .ecran-classes { padding-top: 28px; }

/* ===================================================================== tablette (22/10/2026)
   Une tablette en portrait (601-900 px) recevait la mise en page du téléphone étirée :
   petites têtes dans une large barre, équipage caché dans le tiroir, moitié d'écran vide.
   Même décor, mêmes zones, mêmes gestes : on utilise seulement la place disponible. */
@media (min-width: 601px) and (max-width: 900px) {
  body.cockpit { padding-left: 16px; padding-right: 16px; }
  .ck-instruments { left: 16px; right: 16px; }
  .cockpit .ecran-parcours, .cockpit .ecran-classes, .ck-station { left: 16px; right: 16px; }

  /* La console : têtes plus grandes, nom dessous comme au téléphone */
  .ck-console { left: 16px; right: 16px; bottom: 12px; padding: 6px 10px; gap: 8px; }
  .ck-poste { gap: 4px; font-size: .8rem; padding: 6px 4px; white-space: nowrap; }
  .ck-visage { width: 44px; height: 44px; }

  /* Le tiroir et les fenêtres posés juste au-dessus de la console, plus haute */
  .ck-commande, .cockpit .modale-fond { left: 16px; right: 16px; bottom: 100px; }
}

/* ===================================================================== l'équipage, tiroir fermé (22/10/2026)
   Téléphone et tablette : le personnage du poste reste visible avec sa bulle au-dessus de la
   console (rien d'autre du tiroir). Tablette : en pied. Téléphone : sa tête dans un hublot. */
@media (max-width: 900px) {
  .ck-commande:not(.ouvert):has(#ck-c-dyn > .ck-officier) > .ck-commande-corps { display: flex; padding-top: 0; }
  .ck-commande:not(.ouvert) .ck-commande-corps > :not(#ck-c-dyn),
  .ck-commande:not(.ouvert) #ck-c-dyn > :not(.ck-officier) { display: none; }
  .ck-commande:not(.ouvert) .ck-officier { grid-template-columns: 96px 1fr; min-height: 0; align-items: center; }
  .ck-commande:not(.ouvert) .ck-officier img { width: 96px; height: 120px; }
  .ck-commande:not(.ouvert) .ck-bulle { margin-top: 0; }
  /* … et l'écran garde de quoi défiler au-dessus de lui */
  body.cockpit:has(.ck-commande:not(.ouvert) #ck-c-dyn > .ck-officier) .ecran-parcours,
  body.cockpit:has(.ck-commande:not(.ouvert) #ck-c-dyn > .ck-officier) .ecran-classes,
  body.cockpit:has(.ck-commande:not(.ouvert) #ck-c-dyn > .ck-officier) .ck-station { padding-bottom: 290px; }
}
@media (max-width: 600px) {
  .ck-commande:not(.ouvert) .ck-commande-corps { padding: 0 12px 10px; }
  .ck-commande:not(.ouvert) .ck-officier { grid-template-columns: 52px 1fr; gap: 10px; }
  .ck-commande:not(.ouvert) .ck-officier img {
    width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: 50% 4%;
    border: 2px solid var(--r-primaire); background: var(--r-surface-2); animation: none;
  }
  .ck-commande:not(.ouvert) .ck-bulle { padding: 6px 10px; font-size: .82rem; line-height: 1.35; }
  .ck-commande:not(.ouvert) .ck-bulle .nom { display: none; }
  .ck-commande:not(.ouvert) .ck-bulle p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  body.cockpit:has(.ck-commande:not(.ouvert) #ck-c-dyn > .ck-officier) .ecran-parcours,
  body.cockpit:has(.ck-commande:not(.ouvert) #ck-c-dyn > .ck-officier) .ecran-classes,
  body.cockpit:has(.ck-commande:not(.ouvert) #ck-c-dyn > .ck-officier) .ck-station { padding-bottom: 230px; }
  /* Poste « La Station », téléphone (15/11/2026) : Radar y répétait ce que la Station affiche
     déjà, et lui prenait 90 px sur 740. Tiroir fermé, il ne reste que la poignée ; un doigt
     dessus le rouvre, avec Radar et « ＋ Nouveau parcours ». */
  body[data-poste="station"] .ck-commande:not(.ouvert):has(#ck-c-dyn > .ck-officier) > .ck-commande-corps { display: none; }
  body.cockpit[data-poste="station"]:has(.ck-commande:not(.ouvert) #ck-c-dyn > .ck-officier) .ck-station { padding-bottom: 140px; }
}

/* Tunnel de création, téléphone (22/10/2026) : à l'écran « Source », trois boutons
   (Mes parcours, Précédent, Continuer) ne tenaient pas sur 390 px — « Continuer »
   sortait de l'écran. Espacements resserrés, libellés sur une ligne. */
@media (max-width: 600px) {
  .tunnel-navigation { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .tunnel-navigation .bouton-tertiaire { padding: 8px 6px; font-size: .86rem; white-space: nowrap; }
  .tunnel-navigation .bouton-principal { padding: 12px 16px; font-size: .95rem; white-space: nowrap; flex: none; }
}

/* Bande du haut d'un parcours ouvert (22/10/2026, demandes de Bilal) : « Présenter en classe »
   partout, « ＋ Nouveau parcours » et « ＋ Ajouter un chapitre » en doré, plus de menu « ⋯ Plus ».
   Au téléphone, libellés courts (📽 Présenter, ＋ Parcours, ＋ Chapitre) pour que tout tienne. */
#bouton-presenter-menu { display: none; }
.ck-instruments #menu-studio { display: none; }
.ck-instruments .bouton-dore { white-space: nowrap; }   /* couleurs : cockpit-decor.css (--ck-dore) */
.ck-instruments #bouton-presenter-classe { white-space: nowrap; }
.lib-maj { text-transform: none; }
@media (max-width: 700px) {
  .ck-instruments .lib-long { display: none; }
  .ck-instruments .lib-maj { text-transform: uppercase; }
}
/* Téléphone : le poste est déjà dit par la console du bas, « Présenter » devient l'icône 📽 */
@media (max-width: 600px) {
  body[data-poste="cours"] .ck-instruments .ck-fil { display: none; }
  .ck-instruments .lib-court { display: none; }
  .ck-instruments .studio-entete-actions .bouton, .ck-instruments .studio-entete-actions .jeton { padding: 5px 7px; }
}
/* Ordinateur : « Élèves et codes » juste à côté des vues, plus à l'autre bout */
.ck-vues { justify-content: flex-start; }
/* Retrait d'une classe d'un parcours publié : second clic demandé (22/10/2026) */
.tag-classe.tag-classe--a-confirmer { background: var(--r-alerte-doux); border-color: var(--r-alerte); color: var(--r-alerte); }
.tag-classe.tag-classe--a-confirmer button { width: auto; height: auto; padding: 2px 8px; border-radius: 99px; font-weight: 800; white-space: nowrap; background: var(--r-alerte); color: var(--r-surface); }
/* Les classes se gèrent dans « Élèves et codes » (bouton « ＋ Ajouter une classe », 22/10/2026,
   demande de Bilal) : plus de jeton 🏫 dans la bande du haut. */
.ck-instruments #bouton-assigner-classe { display: none; }
/* studio.css donne « display: flex » à .bandeau-avertissement, ce qui annulait l'attribut hidden :
   une barre vide restait sous « Ajouter une classe » (22/10/2026). Même parade qu'eleves-tableau.css. */
.bandeau-avertissement[hidden] { display: none; }
/* Petits téléphones (360 px) : un cran plus serré pour que la bande tienne */
@media (max-width: 380px) {
  .ck-instruments .studio-entete-actions { gap: 3px; }
  .ck-instruments .studio-entete-actions .bouton, .ck-instruments .studio-entete-actions .jeton { padding: 5px 5px; font-size: .72rem; }
  .ck-instruments { gap: 4px; padding: 0 6px; }
}

/* --- Le Laboratoire à deux portes et « Mes présentations » (constellations, 23/10/2026) -------- */
.ck-labo-ecran { overflow-y: auto; padding: 24px 28px; }
.ck-labo-ecran .ck-chapeau { color: var(--r-texte-2); margin: 0; max-width: 64ch; }
.ck-labo-titre { font-family: var(--r-police-titre); font-size: 2rem; margin: 4px 0 6px; color: var(--r-texte); }
.ck-portes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 22px; }
.ck-porte { display: flex; flex-direction: column; gap: 10px; text-align: left; font: inherit; color: var(--r-texte); cursor: pointer;
  background: var(--r-surface); border: 1px solid var(--r-bordure); border-radius: 22px; padding: 18px; box-shadow: var(--r-ombre-1); transition: transform .15s, border-color .15s; }
.ck-porte:hover, .ck-porte:focus-visible { transform: translateY(-3px); border-color: var(--r-primaire); }
.ck-porte-image { height: 220px; border-radius: 14px; background: var(--r-surface-2); display: grid; place-items: center; overflow: hidden; }
.ck-porte-image img { width: 100%; height: 100%; object-fit: contain; }
.ck-porte-titre { font-family: var(--r-police-titre); font-size: 1.5rem; font-weight: 700; }
.ck-porte-sous { color: var(--r-texte-2); line-height: 1.45; }
.ck-pres-barre { margin: 16px 0 4px; }
.ck-pres-barre .ck-bouton { flex: none; }
.ck-pres-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-top: 16px; }
.ck-pres-carte { display: flex; flex-direction: column; background: var(--r-surface); border: 1px solid var(--r-bordure); border-radius: 18px; overflow: hidden; box-shadow: var(--r-ombre-1); }
.ck-pres-carte.choisie { border-color: var(--r-primaire); box-shadow: 0 0 0 2px var(--r-primaire-doux), var(--r-ombre-1); }
.ck-pres-visuel { position: relative; height: 150px; border: 0; padding: 0; cursor: pointer; background: var(--r-surface-2); overflow: hidden; display: block; width: 100%; }
.ck-pres-visuel .planete { position: absolute; width: 190px; right: -40px; bottom: -70px; opacity: .9; }
.ck-pres-visuel .etoiles { position: absolute; left: 14px; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-wrap: wrap; gap: 2px; }
.ck-pres-visuel .etoiles img { width: 34px; height: 34px; }
.ck-pres-carte .corps { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ck-pres-carte h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; color: var(--r-texte); }
.ck-pres-carte .ck-rangee { margin-top: auto; }
.ck-pres-carte .ck-bouton { padding: 9px 8px; font-size: .9rem; }
.ck-champ input { font: inherit; color: var(--r-texte); background: var(--r-surface); border: 1px solid var(--r-bordure); border-radius: 10px; padding: 8px 10px; }
.ck-champ input:focus { outline: none; border-color: var(--r-primaire); box-shadow: 0 0 0 3px var(--r-primaire-doux); }
.ck-bouton.ck-danger { background: var(--r-danger); color: var(--r-primaire-texte); }
/* Finitions (28/10/2026) : cockpit-decor.css repeignait tout bouton plein en dégradé bleu, « danger » compris
   (« Oui, supprimer définitivement », « Retirer le chapitre »). Sélecteur plus précis : gagne quel que soit l'ordre. */
.cockpit .ck-bouton.ck-danger:not(.discret) { background: var(--r-danger); color: var(--r-primaire-texte); box-shadow: none; }
.ck-mini.ck-alerte { color: var(--r-alerte); font-weight: 700; }
@media (max-width: 900px) {
  .ck-portes { grid-template-columns: 1fr; }
  .ck-porte-image { height: 160px; }
}

/* Laboratoire · Mes classes : voir les résultats d'un parcours sur une présentation (23/10/2026). */
.ck-labo-constellation { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; font-weight: 600; color: var(--r-texte-2); }
.ck-labo-constellation select { font: inherit; font-weight: 600; color: var(--r-texte); background: var(--r-surface); border: 1px solid var(--r-bordure-forte); border-radius: 10px; padding: 6px 10px; max-width: 100%; }
.ck-champ select { font: inherit; color: var(--r-texte); background: var(--r-surface); border: 1px solid var(--r-bordure); border-radius: 10px; padding: 8px 10px; }
.ck-champ select:focus { outline: none; border-color: var(--r-primaire); box-shadow: 0 0 0 3px var(--r-primaire-doux); }

/* --- Le Laboratoire à 5 portes (24/10/2026, maquette validée par Bilal) ------------------------ */
.ck-labo-ecran { container-type: inline-size; }
.ck-porte { position: relative; }
.ck-porte.large { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 22px; }
.ck-porte.large .ck-porte-image { flex: 0 0 38%; height: 190px; }
.ck-porte-texte { display: flex; flex-direction: column; gap: 10px; }
.ck-porte-image.vide { font-size: 3.4rem; border: 2px dashed var(--r-bordure-forte); background: none; height: 190px; }
.ck-porte-num { position: absolute; top: 12px; left: 12px; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--r-police-mono); font-weight: 700; font-size: 14px; background: var(--r-primaire); color: var(--r-primaire-texte); }
.ck-porte-titre small { font-family: var(--r-police); font-size: 13px; font-weight: 700; color: var(--r-texte-3); margin-left: 6px; }
.ck-porte-compte { font-size: 13px; color: var(--r-texte-3); font-weight: 700; }
.ck-porte-depart { font-size: 13px; font-weight: 800; color: var(--r-primaire); }
.ck-porte-regle { font-size: 13px; line-height: 1.45; color: var(--r-texte-2); background: var(--r-surface-2); border-radius: 10px; padding: 8px 10px; }
.ck-porte-regle b { color: var(--r-texte); }
.ck-porte.reliee { border-style: dashed; border-color: var(--r-bordure-forte); }
/* Portes 4 et 5 : affichées, pas encore ouvertes (étapes 1 et 2 du chantier « relier »). */
.ck-porte.bientot { cursor: default; opacity: .62; }
.ck-porte.bientot:hover { transform: none; border-color: var(--r-bordure-forte); }
.ck-bientot { position: absolute; top: 12px; right: 12px; z-index: 1; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--r-alerte); background: var(--r-alerte-doux); border: 1px solid var(--r-alerte); border-radius: 999px; padding: 3px 10px; }
/* Colonne du milieu étroite (tablette en paysage, 3 colonnes) : portes compactes, toujours 2 par ligne. */
@container (max-width: 640px) {
  .ck-portes { gap: 12px; }
  .ck-porte { padding: 12px; gap: 8px; }
  .ck-porte.large { flex-direction: column; align-items: stretch; }
  .ck-porte-image, .ck-porte.large .ck-porte-image, .ck-porte-image.vide { height: 120px; flex: none; }
  .ck-porte-image.vide { font-size: 2.4rem; }
  .ck-porte-image:not(.vide) { grid-template-rows: 120px; }
  .ck-porte-image img { min-height: 0; }
  .ck-porte-titre { font-size: 1.2rem; }
  .ck-porte-titre small { display: block; margin: 2px 0 0; }
  .ck-porte-sous { font-size: .9rem; }
  .ck-porte-regle { font-size: 12px; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .ck-portes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Le fil d'Ariane reste lisible sur tablette en portrait (question ouverte de la maquette du 24/10). */
  body:not([data-poste="cours"]) .ck-fil .sep, body:not([data-poste="cours"]) .ck-fil .titre { display: inline; }
  .ck-fil { overflow: hidden; }
  /* Parcours ouvert : les boutons dorés prennent la bande, le titre est écrit juste dessous. */
  body[data-poste="cours"] .ck-fil > :not(:first-child) { display: none; }
}
@media (max-width: 600px) {
  .ck-porte.large { flex-direction: column; align-items: stretch; }
  .ck-porte.large .ck-porte-image, .ck-porte-image.vide { height: 140px; flex: none; }
}

/* --- Porte 2 « Constellations » et porte 3 « Parcours » : cartes, menu « … », filtres (24/10/2026) --- */
.ck-labo-ecran .classes-accueil { margin-bottom: 4px; }
.ck-filtre { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.ck-filtre button { font: inherit; font-size: 14px; font-weight: 700; color: var(--r-texte-2); background: var(--r-surface); border: 1px solid var(--r-bordure); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.ck-filtre button.actif { color: var(--r-primaire); border-color: var(--r-primaire); background: var(--r-primaire-doux); }
.ck-labo-ecran .ck-pres-grille { margin-top: 18px; }
.ck-pres-carte { position: relative; overflow: visible; }
.ck-pres-ouvrir { display: flex; flex-direction: column; flex: 1; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ck-pres-ouvrir .ck-pres-visuel { border-radius: 18px 18px 0 0; }
.ck-pres-ouvrir .corps h3 { padding-right: 34px; }
.ck-pied { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.ck-relie { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; font-weight: 800; line-height: 1.3; color: var(--r-accent);
  background: var(--r-accent-doux); border: 1px solid var(--r-accent); border-radius: 999px; padding: 3px 10px; }
.ck-trois { position: absolute; top: 8px; right: 8px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--r-bordure);
  background: var(--r-surface); color: var(--r-texte); font: inherit; font-size: 20px; font-weight: 800; line-height: 1; cursor: pointer; }
.ck-trois:hover, .ck-trois[aria-expanded="true"] { border-color: var(--r-primaire); }
.ck-menu { position: absolute; top: 48px; right: 8px; z-index: 5; min-width: 250px; max-width: calc(100% - 16px); display: flex; flex-direction: column; padding: 6px;
  background: var(--r-surface); border: 1px solid var(--r-bordure-forte); border-radius: 14px; box-shadow: var(--r-ombre-2); }
.ck-menu button { text-align: left; font: inherit; font-size: 15px; color: var(--r-texte); background: none; border: 0; border-radius: 9px; padding: 9px 12px; cursor: pointer; }
.ck-menu button:hover, .ck-menu button:focus-visible { background: var(--r-primaire-doux); }
.ck-menu button.danger { color: var(--r-danger); }
.ck-menu hr { border: 0; border-top: 1px solid var(--r-bordure); margin: 4px 6px; width: auto; }
.ck-nouvelle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 260px; text-align: center;
  border: 2px dashed var(--r-primaire); border-radius: 18px; background: var(--r-primaire-doux); color: var(--r-texte); font: inherit; cursor: pointer; padding: 20px; }
.ck-nouvelle b { font-family: var(--r-police-titre); font-size: 20px; color: var(--r-primaire); }
.ck-nouvelle .plus { font-size: 44px; color: var(--r-primaire); line-height: 1; }
.ck-nouvelle span:last-child { color: var(--r-texte-2); font-size: 14px; line-height: 1.4; }
/* Porte Parcours : le menu « … » des cartes (mêmes formes que la porte Constellations). */
.cockpit .parcours-tuile--parcours { position: relative; overflow: visible; }
.cockpit .parcours-tuile--parcours .parcours-tuile-titre { padding-right: 34px; }
.cockpit .parcours-tuile-actions.ck-menu:not([hidden]) { display: flex !important; }
.ck-menu button:disabled { color: var(--r-texte-3); cursor: not-allowed; background: none; }
.cockpit .parcours-tuile[hidden] { display: none; }
.cockpit #parcours-filtre[hidden] { display: none; }
.cockpit #parcours-filtre { margin: 0 0 16px; }
/* Une carte au menu ouvert passe devant ses voisines (le survol crée un empilement par carte). */
.cockpit .parcours-tuile--parcours:has(.ck-menu:not([hidden])), .ck-pres-carte:has(.ck-menu) { z-index: 6; }
.cockpit #parcours-retour-labo, .ck-labo-ecran .classes-bouton-retour { white-space: nowrap; flex: none; }
/* Le Hangar réduit (24/10/2026) : son écran, ses cartes « Faire le parcours comme un élève ». */
.ck-hangar { overflow-y: auto; padding: 24px 28px; container-type: inline-size; }
.ck-hangar[hidden] { display: none; }
.ck-hangar .ck-pres-grille { margin-top: 18px; }
.ck-hangar-carte .corps { gap: 8px; padding: 16px; }
.ck-hangar-planete { width: 58px; height: 58px; object-fit: contain; }
.ck-hangar-carte .ck-bouton { margin-top: 8px; }
.ck-hangar-note { margin-top: 18px; }
/* Le tunnel de première visite (24/10/2026) : « une constellation » ou « un parcours ». */
.ck-premier-choix { position: absolute; inset: 0; z-index: 20; overflow-y: auto; background: radial-gradient(120% 120% at 30% 10%, var(--r-ciel-b), var(--r-ciel-a)); color: var(--r-texte); padding: 32px 16px; }
.ck-premier-dedans { max-width: 960px; margin: 0 auto; }
.ck-premier-portrait { width: 120px; height: 150px; object-fit: contain; flex: none; }
.ck-premier-cartes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 22px; }
@media (max-width: 640px) { .ck-premier-cartes { grid-template-columns: 1fr; } .ck-premier-portrait { width: 80px; height: 100px; } }
/* « Faire le parcours comme un élève » (24/10/2026) : la vraie page élève sur toute la fenêtre. */
.ck-essai { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; background: var(--r-surface); }
.ck-essai-barre { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--r-bordure); background: var(--r-surface-2); }
.ck-essai-barre .ck-bouton { flex: none; }
.ck-essai-note { color: var(--r-texte-2); font-size: .9rem; }
.ck-essai-avis { font-size: .85rem; font-weight: 800; color: var(--r-alerte); background: var(--r-alerte-doux); border: 1px solid var(--r-alerte); border-radius: 999px; padding: 3px 10px; }
.ck-essai iframe { flex: 1; width: 100%; border: 0; display: block; }
.ck-essai-attente { margin: 24px; color: var(--r-texte-2); }
@media (max-width: 600px) { .ck-essai-note { display: none; } }

/* Confirmation avant de publier un parcours qui a encore des activités à relire (27/10/2026) :
   la question et ses deux boutons sur une ligne, qui passe à la ligne si la place manque. */
.studio-publication .bandeau-avertissement.bandeau-confirmation {
  flex-wrap: wrap; align-items: center; gap: 8px 12px; border-radius: 16px; padding: 10px 14px;
}
.bandeau-confirmation .bouton { padding: 6px 14px; font-size: 0.9rem; }

/* Porte 4 « Galaxie » (27/10/2026, maquette validée) : choisir une constellation, redéposer son PDF,
   cocher les pages ; le poste de commande montre les étoiles couvertes, le contrôle du PDF et le prix. */
.ck-etape { margin-top: 18px; background: var(--r-surface); border: 1px solid var(--r-bordure); border-radius: 18px; padding: 14px 16px; }
.ck-etape.grise { opacity: .45; pointer-events: none; }
.ck-etape h2 { display: flex; gap: 10px; align-items: center; font-family: var(--r-police-titre); font-size: 19px; margin: 0 0 10px; }
.ck-etape h2 .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--r-primaire); color: var(--r-primaire-texte); flex: none; }
.ck-choix-objets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ck-choix-objet { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--r-texte); background: var(--r-surface-2); border: 2px solid transparent; border-radius: 14px; padding: 10px 12px; cursor: pointer; }
.ck-choix-objet b { font-size: 15px; line-height: 1.3; }
.ck-choix-objet small { color: var(--r-texte-2); font-size: 13px; overflow-wrap: anywhere; }
.ck-choix-objet.sel { border-color: var(--r-primaire); background: var(--r-primaire-doux); }
.ck-depot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; border: 2px dashed var(--r-bordure-forte); border-radius: 14px; text-align: center; color: var(--r-texte-2); }
.ck-depot.plein { flex-direction: row; flex-wrap: wrap; justify-content: space-between; text-align: left; border-style: solid; border-color: var(--r-succes); background: var(--r-succes-doux); color: var(--r-texte); }
.ck-depot span { overflow-wrap: anywhere; }
.ck-depot-bouton { cursor: pointer; }
/* Trou de ver (27/10/2026) : plusieurs PDF déposés, et les parcours déjà reliés, grisés. */
.ck-depot-liste { flex-direction: column; align-items: stretch; }
.ck-depot-pdf { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
/* Finitions (28/10/2026) : le nom et le nombre de pages forment UN bloc qui passe à la ligne entre les mots
   (sur téléphone, « · 2 pages » était coupé en « page / s » à côté du nom). */
.ck-depot-pdf .nom { flex: 1; min-width: 0; overflow-wrap: break-word; }
.ck-depot-pdf .nom b { overflow-wrap: anywhere; }
.ck-choix-objet:disabled { opacity: .5; cursor: not-allowed; }
/* Finitions (28/10/2026) : une grille qui remplit toute la largeur (plus de bande vide à droite). */
.ck-pages-pdf { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 8px; }
.ck-page-pdf { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 12px; border: 2px solid var(--r-bordure); background: var(--r-surface-2); cursor: pointer; font-size: 13px; text-align: center; }
.ck-page-pdf .feuille { width: 52px; height: 68px; border-radius: 4px; background: var(--r-surface); border: 1px solid var(--r-bordure-forte); display: grid; place-items: center; font-weight: 800; }
.ck-page-pdf:has(input:checked) { border-color: var(--r-primaire); background: var(--r-primaire-doux); }
.ck-page-pdf .et { color: var(--r-primaire); font-weight: 800; }
.ck-page-pdf input { margin: 0; }
.ck-rangee-titre { margin: 14px 0 0; }
.ck-cmd-titre { font-family: var(--r-police-titre); font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.ck-etoiles-liste { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; padding: 0; list-style: none; font-size: 14px; }
.ck-etoiles-liste li { display: flex; gap: 8px; align-items: center; }
.ck-etoiles-liste img { width: 24px; height: 24px; }
.ck-etoiles-liste .hors { color: var(--r-texte-3); text-decoration: line-through; }
.ck-encadre { margin: 10px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--r-bordure-forte); font-size: 14px; line-height: 1.5; }
.ck-encadre.attention { border-color: var(--r-alerte); background: var(--r-alerte-doux); }
.ck-encadre.bon { border-color: var(--r-succes); background: var(--r-succes-doux); }
.ck-encadre.prix { border-color: var(--r-primaire); background: var(--r-primaire-doux); font-size: 15px; }
.ck-encadre.prix .grand { display: block; font-family: var(--r-police-titre); font-size: 22px; font-weight: 700; color: var(--r-texte); margin-bottom: 4px; }
.ck-confirme { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-weight: 700; cursor: pointer; }
.ck-grille-prix { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.ck-grille-prix td { padding: 3px 6px; border-top: 1px solid var(--r-bordure); }
.ck-grille-prix td:last-child { white-space: nowrap; text-align: right; }
.ck-grille-prix tr.ici td { font-weight: 800; color: var(--r-primaire); }
.ck-bouton:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(1); transform: none; }
@media (max-width: 600px) {
  .ck-etape { padding: 12px; }
  .ck-pages-pdf { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  /* Porte 3 : la tuile « Créer un parcours » sur une ligne, pour que le titre de la 1re carte se lise au-dessus du
     poste de commande dès l'arrivée. */
  .cockpit .parcours-tuile--nouveau { min-height: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 12px; padding: 12px 16px; text-align: left; }
  .cockpit .parcours-tuile--nouveau .parcours-plus { grid-row: span 2; font-size: 2rem; }
  .cockpit .ecran-parcours .classes-accueil { margin-bottom: 14px; }
}

/* Panneaux (étape 4, 28/10/2026) : la proposition juste après un chapitre ajouté à un parcours relié,
   et l'étiquette « N chapitre(s) sans panneau » sur la carte du parcours (porte 3). */
.ck-proposition { position: fixed; z-index: 350; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(600px, calc(100vw - 32px));
  padding: 16px 18px; border-radius: 16px; border: 1px solid var(--r-primaire); background: var(--r-surface-2); color: var(--r-texte); box-shadow: var(--r-ombre-1); }
.ck-proposition p { margin: 0 0 12px; line-height: 1.5; }
.ck-proposition .ck-rangee { flex-wrap: wrap; }
.ck-sans-panneau { font-size: 12px; font-weight: 800; color: var(--r-alerte); background: var(--r-alerte-doux); border: 1px solid var(--r-alerte); border-radius: 999px; padding: 2px 8px; }

/* Icônes CosmoStudy (28/10/2026) — remplacent les émoticônes ; voir /assets/icones/catalogue.js */
.icone-cs { display: inline-block; vertical-align: middle; flex: none; object-fit: contain; }
.ck-bouton .icone-cs, .ck-lien .icone-cs, button .ico .icone-cs { margin-right: 2px; }
.ck-porte-titre { display: flex; align-items: center; gap: 8px; }
.ck-logo > span:first-child { display: inline-flex; }
