/* ==========================================================================
   Tunnel Onboarding Salle de contrôle — style "setup fluide" (façon Apple), pas-à-pas
   Dépend de captain-cosmos.css (variables --cosmos-*) chargé avant ce fichier.
   ========================================================================== */

.tunnel {
  --tunnel-fond: var(--couleur-fond, #0c0a16);
  --tunnel-surface: var(--couleur-surface, #171426);
  --tunnel-texte: var(--couleur-texte, #f2f1fb);
  --tunnel-texte-att: var(--couleur-texte-attenue, #b3aecb);
  --tunnel-bordure: rgba(255, 255, 255, 0.08);
  --tunnel-accent: var(--cosmos-accent, #60a5fa);
  --tunnel-accent-2: var(--cosmos-accent-2, #34e2c8);
  --tunnel-rayon: var(--rayon, 18px);

  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 800px at 15% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(900px 700px at 100% 100%, rgba(52, 226, 200, 0.12), transparent 55%),
    var(--tunnel-fond);
  color: var(--tunnel-texte);
  overflow: hidden;
}

.tunnel[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Barre de progression
   -------------------------------------------------------------------------- */

.tunnel-progression {
  flex: none;
  padding: 28px clamp(20px, 6vw, 72px) 0;
}

.tunnel-progression-piste {
  height: 4px;
  border-radius: 999px;
  background: var(--tunnel-bordure);
  overflow: hidden;
}

.tunnel-progression-remplissage {
  height: 100%;
  width: 25%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--tunnel-accent), var(--tunnel-accent-2));
  transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.tunnel-etapes-puces {
  list-style: none;
  display: flex;
  justify-content: space-between;
  margin: 14px 0 0;
  padding: 0;
}

.tunnel-puce {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--tunnel-texte-att);
  opacity: 0.55;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.tunnel-puce span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--tunnel-bordure);
  font-size: 0.72rem;
  font-weight: 600;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.tunnel-puce em {
  font-style: normal;
  display: none;
}

@media (min-width: 720px) {
  .tunnel-puce em { display: inline; }
}

.tunnel-puce[data-etat="active"],
.tunnel-puce[data-etat="faite"] {
  opacity: 1;
  color: var(--tunnel-texte);
}

.tunnel-puce[data-etat="active"] span {
  background: linear-gradient(135deg, var(--tunnel-accent), var(--tunnel-accent-2));
  border-color: transparent;
  transform: scale(1.12);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18);
}

.tunnel-puce[data-etat="faite"] span {
  background: var(--tunnel-accent-2);
  border-color: transparent;
  color: #06231d;
}

/* --------------------------------------------------------------------------
   Corps : un écran visible à la fois, avec transition de type "slide + fade"
   -------------------------------------------------------------------------- */

.tunnel-corps {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.tunnel-ecran {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  padding: clamp(24px, 5vw, 64px) clamp(20px, 6vw, 96px);
  overflow-y: auto;
}

@media (min-width: 860px) {
  .tunnel-ecran {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.tunnel-ecran[hidden] {
  display: none;
}

/* état d'entrée/sortie piloté par onboarding-tunnel.js via ces classes */
.tunnel-ecran.tunnel-ecran--entree-suivant {
  animation: tunnel-entree-droite 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.tunnel-ecran.tunnel-ecran--entree-precedent {
  animation: tunnel-entree-gauche 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes tunnel-entree-droite {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes tunnel-entree-gauche {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: translateX(0); }
}

.tunnel-ecran-visuel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 220px;
}

.tunnel-cosmos-ancre {
  position: relative;
  z-index: 2;
}

.tunnel-fusee-ancre {
  width: min(280px, 70%);
  opacity: 0.9;
}

.tunnel-ecran-contenu {
  max-width: 560px;
}

.tunnel-titre {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tunnel-sous-titre {
  margin: 0 0 28px;
  color: var(--tunnel-texte-att);
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Champs de formulaire
   -------------------------------------------------------------------------- */

.tunnel-champ {
  margin-bottom: 20px;
}

.tunnel-champ label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tunnel-texte-att);
}

.tunnel-champ input[type="text"],
.tunnel-champ select,
.tunnel-champ textarea {
  width: 100%;
  padding: 13px 15px;
  background: var(--tunnel-surface);
  border: 1px solid var(--tunnel-bordure);
  border-radius: 12px;
  color: var(--tunnel-texte);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tunnel-champ input[type="text"]:focus,
.tunnel-champ select:focus,
.tunnel-champ textarea:focus {
  outline: none;
  border-color: var(--tunnel-accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}

.tunnel-champ-groupe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tunnel-aide {
  margin: -2px 0 10px;
  font-size: 0.8rem;
  color: var(--tunnel-texte-att);
}

.tunnel-erreur {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #ff7a7a;
}

/* Choix du rappel du cours : diapos lues ou vidéo YouTube (20/10/2026). */
.tunnel-choix-rappel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tunnel-champ label.tunnel-choix {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 12px 14px;
  background: var(--tunnel-surface);
  border: 1px solid var(--tunnel-bordure);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--tunnel-texte);
}
.tunnel-champ label.tunnel-choix:has(input:checked) {
  border-color: var(--tunnel-accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}
.tunnel-choix input { margin-top: 3px; accent-color: var(--tunnel-accent); }
.tunnel-choix strong { display: block; font-weight: 600; }
.tunnel-choix small { display: block; margin-top: 3px; color: var(--tunnel-texte-att); font-size: 0.78rem; }
.tunnel-champ-youtube { margin-top: 10px; }
.tunnel-champ-youtube .tunnel-aide { margin: 6px 0 0; }
.tunnel-apercu-youtube { margin-top: 12px; }
.tunnel-apercu-youtube-cadre { position: relative; width: 100%; max-width: 420px; aspect-ratio: 16 / 9; margin-top: 8px; border-radius: 12px; overflow: hidden; background: #000; }
.tunnel-apercu-youtube-cadre iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 560px) {
  .tunnel-choix-rappel { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Tags de classes (multi-classes)
   -------------------------------------------------------------------------- */

.tunnel-tags-conteneur {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--tunnel-surface);
  border: 1px solid var(--tunnel-bordure);
  border-radius: 12px;
  min-height: 52px;
}

.tunnel-tags-conteneur:focus-within {
  border-color: var(--tunnel-accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}

.tunnel-tag-classe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(52, 226, 200, 0.18));
  border: 1px solid rgba(124, 92, 255, 0.35);
  font-size: 0.85rem;
  font-weight: 600;
  animation: cosmos-pop 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tunnel-tag-classe button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
}

.tunnel-tag-classe button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.tunnel-tags-saisie {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  color: var(--tunnel-texte);
  font-size: 0.95rem;
  padding: 6px 4px;
}

.tunnel-tags-saisie:focus {
  outline: none;
}

/* --------------------------------------------------------------------------
   Zone de dépôt PDF (écran 2)
   -------------------------------------------------------------------------- */

.tunnel-zone-depot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  border: 1.5px dashed var(--tunnel-bordure);
  border-radius: var(--tunnel-rayon);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.tunnel-zone-depot:hover,
.tunnel-zone-depot:focus-visible,
.tunnel-zone-depot.tunnel-zone-depot--survol {
  border-color: var(--tunnel-accent);
  background: rgba(124, 92, 255, 0.06);
}

.tunnel-zone-depot-icone {
  font-size: 2rem;
  margin: 0;
}

.tunnel-zone-depot-texte {
  margin: 0;
  color: var(--tunnel-texte-att);
  font-size: 0.9rem;
  text-align: center;
}

.tunnel-lien {
  color: var(--tunnel-accent-2);
  text-decoration: underline;
}

/* balayage lumineux pendant le traitement (activé/désactivé en JS) */
.tunnel-zone-depot-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tunnel-zone-depot-scan::after {
  content: "";
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(124, 92, 255, 0.35),
    rgba(52, 226, 200, 0.35),
    transparent
  );
  animation: tunnel-scan-balayage 1.3s linear infinite;
}

@keyframes tunnel-scan-balayage {
  to { left: 130%; }
}

.tunnel-separateur {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--tunnel-texte-att);
  font-size: 0.78rem;
}

.tunnel-separateur::before,
.tunnel-separateur::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--tunnel-bordure);
}

.tunnel-statut {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--tunnel-accent-2);
}

/* --------------------------------------------------------------------------
   Aperçu interactif (écran 3)
   -------------------------------------------------------------------------- */

.tunnel-apercu-cadre {
  border: 1px solid var(--tunnel-bordure);
  border-radius: var(--tunnel-rayon);
  background: var(--tunnel-surface);
  padding: 20px;
  min-height: 180px;
}

.tunnel-apercu-widget-hote {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tunnel-apercu-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.tunnel-apercu-statut {
  margin: 0;
  font-size: 0.85rem;
  color: var(--tunnel-accent-2);
}

/* --------------------------------------------------------------------------
   Récapitulatif (écran 4)
   -------------------------------------------------------------------------- */

.tunnel-recap {
  display: grid;
  gap: 12px;
  margin: 0 0 28px;
  padding: 18px 20px;
  border: 1px solid var(--tunnel-bordure);
  border-radius: var(--tunnel-rayon);
  background: var(--tunnel-surface);
}

.tunnel-recap-ligne {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.tunnel-recap-ligne dt {
  color: var(--tunnel-texte-att);
}

.tunnel-recap-ligne dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.bouton-orbite {
  width: 100%;
  font-size: 1.02rem;
  padding: 16px 20px;
}

/* --------------------------------------------------------------------------
   Boutons génériques (repli si non déjà définis dans style.css / studio.css)
   -------------------------------------------------------------------------- */

.bouton-principal,
.bouton-secondaire,
.bouton-tertiaire {
  font-family: inherit;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.bouton-principal {
  padding: 12px 24px;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--tunnel-accent), var(--tunnel-accent-2));
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.3);
}

.bouton-principal:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(124, 92, 255, 0.4);
}

.bouton-principal:active {
  transform: translateY(0);
}

.bouton-principal:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.bouton-secondaire {
  padding: 10px 18px;
  border: 1px solid var(--tunnel-bordure);
  background: transparent;
  color: var(--tunnel-texte);
}

.bouton-secondaire:hover {
  border-color: var(--tunnel-accent);
}

.bouton-tertiaire {
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--tunnel-texte-att);
}

.bouton-tertiaire:hover {
  color: var(--tunnel-texte);
}

/* --------------------------------------------------------------------------
   Navigation bas de tunnel
   -------------------------------------------------------------------------- */

.tunnel-navigation {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px clamp(20px, 6vw, 72px) clamp(20px, 4vw, 32px);
  border-top: 1px solid var(--tunnel-bordure);
  background: rgba(12, 10, 22, 0.6);
  backdrop-filter: blur(8px);
}

.tunnel-navigation-espace {
  flex: 1;
}

@media (prefers-reduced-motion: reduce) {
  .tunnel-ecran.tunnel-ecran--entree-suivant,
  .tunnel-ecran.tunnel-ecran--entree-precedent,
  .tunnel-progression-remplissage,
  .tunnel-tag-classe,
  .tunnel-zone-depot-scan::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------------ */
/* Correctif defilement : le formulaire ne doit jamais passer sous la  */
/* ligne de flottaison de .tunnel-ecran (position:absolute+overflow).  */
/* Cause : align-items:center + visuel fusee min-height:220px          */
/* poussaient la boite "Classes cibles" hors de la zone visible.       */
/* ------------------------------------------------------------------ */
.tunnel-ecran {
  align-items: start;
  align-content: safe center;
  padding-bottom: clamp(28px, 5vw, 64px);
}

/* fenetre moyennement haute : le visuel fusee se compacte */
@media (max-height: 980px) {
  .tunnel-ecran { gap: 18px; padding-top: clamp(16px, 3vw, 32px); }
  .tunnel-ecran-visuel { min-height: 0; gap: 10px; }
  /* fusée retirée (12/09/2026) — plus d'ancre à redimensionner ici */
}

/* Fenetre basse : le visuel ne disparait pas, il se replie en BANDEAU MINIATURE au-dessus
   du formulaire — Captain Cosmos reste present (avatar + replique sur une seule ligne),
   la fusee cede la place. Choix du 01/09/2026 : masquer completement le visuel faisait
   perdre l'identite du tunnel sur un MacBook Air en fenetre non plein ecran. */
@media (max-height: 860px) {
  .tunnel-ecran {
    padding-top: clamp(12px, 2.2vw, 20px);
    gap: 14px;
  }

  .tunnel-ecran-visuel {
    --cosmos-taille-avatar: 92px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tunnel-bordure);
  }

  /* Le widget Cosmos passe en ligne meme quand il est configure en data-align="centre". */
  .tunnel-ecran-visuel .cosmos-widget,
  .tunnel-ecran-visuel .cosmos-widget[data-align="centre"] {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
    width: 100%;
  }

  /* Replique compacte : deux lignes maximum, le reste est coupe proprement. */
  .tunnel-ecran-visuel .cosmos-bulle {
    max-width: none;
    padding: 10px 14px;
    font-size: 1rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* fusée déjà retirée du DOM (12/09/2026) — plus rien à masquer ici */
}

/* Fenetre tres basse : plus que l'avatar, sans la replique. */
@media (max-height: 680px) {
  .tunnel-ecran-visuel { --cosmos-taille-avatar: 72px; padding-bottom: 8px; }
  .tunnel-ecran-visuel .cosmos-bulle { display: none; }
}


/* ======================================================================
   SPATIAL BLUEPRINT — harmonisation du tunnel (01/09/2026)
   ======================================================================
   Les jetons --tunnel-* du bloc .tunnel reprennent deja --couleur-* /
   --rayon, que studio.css definit desormais : fond, surface, texte et
   accents ont donc bascule seuls sur la palette Blueprint. Cette couche
   ne traite que ce qui restait ecrit en dur (bordures, halos violets,
   rayons genereux) et ajoute le vocabulaire de plan : trame millimetree,
   equerres d'angle, monospace pour les libelles techniques, boutons a
   enfoncement physique.

   Placee en fin de fichier, elle l'emporte a specificite egale sans
   qu'aucune regle existante n'ait ete reecrite. Sauvegarde :
   onboarding-tunnel.css.bak3
   ====================================================================== */

.tunnel {
  --tunnel-bordure: rgba(56, 189, 248, 0.25);
  --bp-cartouche: rgba(56, 189, 248, 0.55);

  /* Meme trame que le cockpit : fine tous les 24 px, forte tous les 120 px,
     halo cyan en haut. Le tunnel etant en position:fixed, la trame est deja
     solidaire de l'ecran — pas besoin de background-attachment. */
  /* --tunnel-fond vaut un degrade depuis le 12/09/2026 (theme clair/sombre) : invalide
     pour background-color (couleur unie uniquement, silencieusement ignoree -> fond
     transparent), et une simple declaration "background:" separee se fait ecraser par
     le "background-image:" qui suit (une seule couche image gagne, elles ne s'empilent
     pas entre declarations). Fix : --tunnel-fond devient la DERNIERE couche de la liste
     background-image ci-dessous, au meme titre que les autres degrades. */
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.10) 1px, transparent 1px),
    linear-gradient(rgba(56, 189, 248, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.055) 1px, transparent 1px),
    radial-gradient(120% 70% at 50% 0%, rgba(56, 189, 248, 0.09), transparent 62%),
    var(--tunnel-fond);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px, 100% 100%, 100% 100%;
  background-repeat: repeat, repeat, repeat, repeat, no-repeat;
}

/* ---------- Stepper : jalons de mission ---------- */
/* La piste devient un axe cote, les puces des reperes carres numerotes en
   monospace — plus de pastilles rondes a degrade. */
.tunnel-progression-piste {
  border-radius: 0;
  height: 2px;
  background: var(--tunnel-bordure);
}
.tunnel-progression-remplissage {
  border-radius: 0;
  background: var(--tunnel-accent);
}
.tunnel-puce {
  font-family: var(--st-police-mono, ui-monospace), monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tunnel-puce span {
  border-radius: 2px;
  width: 24px; height: 24px;
  border: 1px solid var(--tunnel-bordure);
  font-family: var(--st-police-mono, ui-monospace), monospace;
}
.tunnel-puce[data-etat="active"] span {
  background: var(--tunnel-accent);
  color: #04121e;
  border-color: var(--tunnel-accent);
  transform: none;                       /* un repere de plan ne grossit pas */
  box-shadow: 2px 2px 0 rgba(5, 10, 20, 0.9);
}
.tunnel-puce[data-etat="faite"] span {
  background: transparent;
  color: var(--tunnel-accent-2);
  border-color: var(--tunnel-accent-2);
}

/* ---------- Typographie ---------- */
.tunnel-titre { font-family: var(--st-police-titre, system-ui), sans-serif; letter-spacing: -0.02em; }
.tunnel-sous-titre { font-family: var(--st-police-titre, system-ui), sans-serif; }

/* Libelles techniques, aides, statuts et erreurs : releves, donc monospace. */
.tunnel-champ label,
.tunnel-aide,
.tunnel-statut,
.tunnel-erreur,
.tunnel-apercu-statut,
.tunnel-separateur,
.tunnel-recap-ligne,
.tunnel-tag-classe,
.tunnel-zone-depot-texte {
  font-family: var(--st-police-mono, ui-monospace), monospace;
  font-variant-numeric: tabular-nums;
}
.tunnel-champ label {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.68rem;
}
.tunnel-separateur { text-transform: uppercase; letter-spacing: 0.14em; }

/* ---------- Champs : look moderne (12/09/2026) ----------
   L'ombre en creux à angle net ("tracé technique", sans flou) donnait aux champs un
   effet enfonce/retro (retour de Bilal : "limite Windows 95"). Remplacee par un style
   plat courant : coins arrondis, bordure fine, leger halo de focus color-mix sur
   --tunnel-accent — sans toucher aux autres elements "plan technique" (cartouches,
   equerres, ombres franches) qui restent inchanges ailleurs. */
.tunnel-champ input[type="text"],
.tunnel-champ select,
.tunnel-champ textarea,
.tunnel-tags-conteneur {
  border-radius: 10px;
  border: 1px solid var(--tunnel-bordure);
  box-shadow: none;
}
.tunnel-champ input[type="text"]:focus,
.tunnel-champ select:focus,
.tunnel-champ textarea:focus,
.tunnel-tags-conteneur:focus-within {
  border-color: var(--tunnel-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tunnel-accent) 20%, transparent);
}
.tunnel-tags-saisie { font-family: var(--st-police-mono, ui-monospace), monospace; }
.tunnel-tag-classe {
  border-radius: 2px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: none;
}
.tunnel-tag-classe button { border-radius: 2px; }

/* ---------- Zone de dépôt : cadre de plan à équerres ---------- */
.tunnel-zone-depot {
  border: 1px dashed var(--tunnel-bordure);
  border-radius: var(--tunnel-rayon);
  background: rgba(56, 189, 248, 0.03);
}
.tunnel-zone-depot::before,
.tunnel-zone-depot::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--bp-cartouche);
  pointer-events: none;
}
.tunnel-zone-depot::before { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.tunnel-zone-depot::after { bottom: 6px; right: 6px; border-left: none; border-top: none; }
.tunnel-zone-depot:hover,
.tunnel-zone-depot:focus-visible,
.tunnel-zone-depot.tunnel-zone-depot--survol {
  border-color: var(--tunnel-accent);
  border-style: solid;
  background: rgba(56, 189, 248, 0.07);
}
.tunnel-zone-depot-scan::after {
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.40), transparent);
}

/* ---------- Cadres d'aperçu et récapitulatif ---------- */
.tunnel-apercu-cadre,
.tunnel-recap {
  position: relative;
  border-radius: var(--tunnel-rayon);
  border: 1px solid var(--tunnel-bordure);
  box-shadow: 2px 2px 0 rgba(5, 10, 20, 0.9);
}
.tunnel-apercu-cadre::before, .tunnel-apercu-cadre::after,
.tunnel-recap::before, .tunnel-recap::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--bp-cartouche);
  pointer-events: none;
}
.tunnel-apercu-cadre::before, .tunnel-recap::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.tunnel-apercu-cadre::after, .tunnel-recap::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.tunnel-recap-ligne dd { font-variant-numeric: tabular-nums; }

/* ---------- Boutons : touche physique ---------- */
/* Deplacement d'1 px vers le haut-gauche au survol en agrandissant l'ombre
   portee, enfoncement d'1 px au clic en la supprimant. Aucun flou, aucun halo. */
.bouton-principal,
.bouton-secondaire,
.bouton-tertiaire {
  border-radius: var(--tunnel-rayon);
  font-family: var(--st-police-mono, ui-monospace), monospace;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  border: 1px solid var(--tunnel-bordure);
  box-shadow: 2px 2px 0 rgba(5, 10, 20, 0.9);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.bouton-principal {
  background: var(--tunnel-accent);
  color: #04121e;
  border-color: var(--tunnel-accent);
  font-weight: 700;
}
.bouton-principal:hover:not(:disabled),
.bouton-secondaire:hover,
.bouton-tertiaire:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(5, 10, 20, 0.95);
  filter: none;
}
.bouton-principal:active:not(:disabled),
.bouton-secondaire:active,
.bouton-tertiaire:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}
.bouton-principal:disabled { opacity: 0.35; box-shadow: none; }
.bouton-orbite {
  background: var(--tunnel-accent-2);   /* ambre : le seul bouton de mise en orbite */
  border-color: var(--tunnel-accent-2);
  color: #1c1204;
}

/* ---------- Pied de navigation ---------- */
.tunnel-navigation {
  background: rgba(10, 14, 23, 0.82);
  border-top: 1px solid var(--tunnel-bordure);
  backdrop-filter: blur(6px);
}

@media (prefers-reduced-motion: reduce) {
  .bouton-principal:hover:not(:disabled),
  .bouton-secondaire:hover,
  .bouton-tertiaire:hover,
  .bouton-principal:active:not(:disabled) { transform: none; }
}

/* L'avertissement de l'écran de dépôt (02/10/2026) — décidé le 29/09 à la place d'une
   vérification automatique du fichier. Il est au-dessus du dépôt, donc lu AVANT de
   déposer : un avertissement affiché après le dépôt n'avertit plus de rien. */
.tunnel-avertissement-depot {
  margin: 14px 0 0;
  padding: 11px 14px;
  font-size: .86rem;
  line-height: 1.55;
  color: var(--st-sourdine, #4a6580);
  background: var(--st-attention-fond, rgba(245, 181, 68, .12));
  border: 1px solid var(--st-attention, #a85a12);
  border-radius: 10px;
}
.tunnel-avertissement-depot strong { color: var(--st-texte, #14314c); }

/* Échec de la fabrication (20/10/2026) : message lisible + bouton Réessayer, aucun récapitulatif. */
.tunnel-statut.tunnel-statut--erreur { color: var(--alerte, #ff7a7a); font-family: inherit; line-height: 1.5; }
#bouton-reessayer-generation { margin: 4px 0 16px; }
.tunnel-recap[hidden] { display: none; }
[data-seulement-cours][hidden] { display: none !important; }

/* Parcours relié (porte Galaxie, 27/10/2026) : la source choisie dans Galaxie remplace le dépôt,
   et l'écran 3 nomme les étoiles qui ont reçu moins de 2 questions. */
[data-sauf-relie][hidden], .tunnel-relie-source[hidden], .tunnel-etoiles[hidden] { display: none !important; }
.tunnel-relie-source,
.tunnel-etoiles {
  margin: 14px 0 16px;
  padding: 12px 14px;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--st-texte, #14314c);
  border-radius: 10px;
}
.tunnel-relie-source {
  background: var(--st-succes-fond, rgba(52, 226, 200, .12));
  border: 1px solid var(--st-succes, #1f8a5b);
}
.tunnel-relie-source p { margin: 0 0 10px; }
.tunnel-etoiles {
  background: var(--st-attention-fond, rgba(245, 181, 68, .12));
  border: 1px solid var(--st-attention, #a85a12);
}
.tunnel-etoiles-titre { margin: 0 0 4px; font-weight: 800; }
.tunnel-etoiles ul { margin: 0 0 6px; padding-left: 20px; }
.tunnel-etoiles p:last-child { margin: 0; color: var(--st-sourdine, #4a6580); }
