/* ==========================================================================
   Effet « Le duel » — section IA de l'accueil général (16/11/2026)
   Tiré de la proposition _propositions/duel.html, validée par Maxime. Va avec
   assets/js/effets/duel.js (voir l'en-tête du fichier pour l'usage).
   La même demande est faite à une IA seule (à gauche) et à votre IA branchée par
   Ctrl-Data (à droite) : un devis, des échéances, un comparatif. Puis la comparaison
   en 4 lignes.
   Sommaire : 1. le duel (en-tête, onglets, écrans, documents) · 2. le scénario
   (classes de phase posées par duel.js) · 3. la comparaison en 4 lignes ·
   4. mouvement réduit.
   Jetons seulement (base.css) : aucune couleur écrite en dur, deux modes.
   Sans JavaScript : les trois travaux s'affichent l'un sous l'autre, remplis.
   ========================================================================== */

/* ---------- 1. Le duel : en-tête, onglets, deux écrans ---------- */
.duel-section { overflow-x: clip; }
.duel-tete { display: grid; gap: var(--espace-6); }
.duel-tete__textes { display: grid; gap: var(--espace-5); align-items: end; }
.duel-tete__titre { max-width: 19ch; font-size: clamp(2.1rem, .85rem + 3.7vw, 4.6rem); }
.duel-tete__ligne { max-width: 30ch; }
@media (min-width: 1000px) {
  .duel-tete__textes { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: clamp(24px, 3vw, 56px); }
  .duel-tete__ligne { padding-bottom: .3em; }
}

.duel { margin-top: clamp(36px, 4vw, 56px); }

/* Onglets (rectangulaires) + Rejouer */
.duel__commandes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: clamp(16px, 2vw, 24px);
}
html:not(.js) .duel__commandes { display: none; }
.js .duel:not(.duel--pret) .duel__commandes { visibility: hidden; }
.duel__onglets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex: 1 1 34rem;
  max-width: 48rem;
}
.duel__onglet {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px 13px;
  overflow: hidden;
  text-align: left;
  font-size: var(--t-petit);
  font-weight: 500;
  line-height: 1.2;
  color: var(--texte-2);
  border: 1px solid var(--filet-fort);
  border-radius: var(--rayon);
  -webkit-tap-highlight-color: transparent;
  transition: color var(--duree-courte) ease, background-color var(--duree-courte) ease, border-color var(--duree-courte) ease;
}
.duel__onglet:hover { color: var(--texte); border-color: var(--texte-2); }
.duel__onglet[aria-selected="true"] { color: var(--fond); background-color: var(--texte); border-color: var(--texte); }
.duel__onglet-num {
  flex: none;
  font-family: var(--police-mono);
  font-size: var(--t-mono-petit);
  letter-spacing: var(--interlettrage-mono);
  opacity: .72;
}
.duel__jauge {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background-color: var(--tampon);
  transform: scaleX(0);
  transform-origin: left center;
}
.duel__rejouer { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.duel__rejouer svg {
  width: 15px; height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  transition: transform .7s var(--sortie);
}
.duel__rejouer:hover svg { transform: rotate(-200deg); }
@media (max-width: 559px) {
  .duel__commandes { flex-wrap: nowrap; gap: 6px; align-items: stretch; }
  .duel__onglets { flex: 1 1 auto; gap: 6px; }
  .duel__onglet { flex-direction: column; gap: 3px; padding: 8px 9px 10px; font-size: .8125rem; }
  .duel__rejouer { flex: none; display: grid; place-items: center; width: 48px; padding: 0; }
  .duel__rejouer-texte {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* La zone : les trois questions empilées dans la même case (hauteur fixe, pas de saut) */
.duel__panneaux { position: relative; }
.js .duel__panneaux { display: grid; }
.js .duel__panneau { grid-area: 1 / 1; }
.js .duel__panneau:not(.est-actif) { visibility: hidden; }
html:not(.js) .duel__panneau + .duel__panneau { margin-top: var(--espace-7); }
.duel__panneau { display: grid; border-radius: var(--rayon); }
.duel__panneau:focus-visible { outline-offset: 8px; }

.duel__scene {
  display: grid;
  grid-template-columns: minmax(0, 4fr) auto minmax(0, 8fr);
  gap: clamp(14px, 1.8vw, 28px);
}

/* « Même demande », entre les deux écrans */
.duel__versus {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: none;
  padding-block: 18px;
  font-family: var(--police-mono);
  font-size: var(--t-mono-petit);
  font-weight: 500;
  letter-spacing: var(--interlettrage-mono);
  text-transform: uppercase;
  color: var(--texte-2);
}
.duel__versus span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.duel__versus::before,
.duel__versus::after { content: ""; flex: 1; width: 1px; background-color: var(--filet-fort); }

/* Les écrans */
.ecran {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  border-radius: var(--rayon);
}
.ecran--seule { background-color: var(--fond-2); border: 1px solid var(--filet); }
.ecran-aimant {
  min-width: 0;
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translate3d(var(--tx, 0px), var(--ty, 0px), 0);
}
.ecran--ctrl {
  background-color: var(--fond-2);
  border: 1px solid var(--filet-fort);
  box-shadow: 0 36px 80px -38px var(--ombre-feuille), 0 2px 6px -2px var(--ombre-feuille);
}
.ecran--ctrl::before { /* le trait tampon en haut de l'écran mis en valeur */
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 3px;
  background-color: var(--tampon);
  border-radius: var(--rayon) var(--rayon) 0 0;
}
.ecran__reflet {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background-image: radial-gradient(380px circle at var(--gx, 50%) var(--gy, 0%), color-mix(in srgb, var(--texte) 8%, transparent), transparent 72%);
  opacity: var(--reflet, 0);
}
.ecran__barre {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: none;
  padding: 12px clamp(14px, 1.6vw, 20px);
  border-bottom: 1px solid var(--filet);
  font-family: var(--police-mono);
  font-size: var(--t-mono-petit);
  font-weight: 500;
  letter-spacing: var(--interlettrage-mono);
  text-transform: uppercase;
  color: var(--texte-2);
}
.ecran--ctrl .ecran__barre { color: var(--texte); }
.ecran__barre .marque { width: 14px; height: 14px; }
/* Le compteur de documents lus, à droite de chaque barre */
.ecran__compte { display: inline-flex; align-items: center; margin-left: auto; white-space: nowrap; color: var(--texte-2); }
.ecran--ctrl .ecran__compte { color: var(--texte); }
.ecran__voyant { flex: none; width: 6px; height: 6px; margin-right: 8px; background-color: var(--tampon); }
.ecran__compte--vide::before { content: ""; flex: none; width: 6px; height: 6px; margin-right: 8px; box-shadow: inset 0 0 0 1px currentColor; }
.accord__un { display: none; }
.accord.est-un .accord__un { display: inline; }
.accord.est-un .accord__plus {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ecran__fil {
  display: grid;
  align-content: start;
  gap: clamp(12px, 1.3vw, 16px);
  padding: clamp(16px, 1.8vw, 22px) clamp(14px, 1.8vw, 24px) clamp(18px, 2vw, 24px);
}
.ecran__fil p { max-width: none; }
/* À gauche, la place qui reste sert à la zone « Joindre un fichier » */
.ecran--seule .ecran__fil { flex: 1; grid-template-rows: auto auto auto minmax(64px, 1fr); align-content: stretch; }

/* La question (la même des deux côtés) */
.ecran__message {
  justify-self: end;
  max-width: min(88%, 30rem);
  padding: 10px 14px 11px;
  background-color: var(--fond-3);
  border-radius: var(--rayon);
  font-size: var(--t-petit);
  font-weight: 500;
  line-height: 1.4;
}
.ecran--seule .ecran__message { background-color: var(--fond); box-shadow: inset 0 0 0 1px var(--filet); }
.frappe .mot, .frappe-mots .mot { display: inline-block; }

/* Qui répond : « IA » ou « Ctrl-Data » (+ les trois points, + le lecteur de fichiers) */
.ecran__qui {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 18px;
  font-family: var(--police-mono);
  font-size: var(--t-mono-petit);
  font-weight: 500;
  letter-spacing: var(--interlettrage-mono);
  text-transform: uppercase;
  color: var(--texte-2);
}
.ecran--ctrl .ecran__qui { color: var(--accent-texte); }
.ecran__qui .marque { width: 12px; height: 12px; }
.points { display: none; gap: 5px; align-items: center; color: var(--texte-2); }
.points i { width: 5px; height: 5px; background-color: currentColor; }
.points i:nth-child(2) { --k: 1; }
.points i:nth-child(3) { --k: 2; }
.lecteur {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--texte-2);
}
.lecteur__fichier {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-transform: none;
  letter-spacing: .02em;
  color: var(--texte);
}
.lecteur::after { /* le curseur du lecteur */
  content: "";
  flex: none;
  width: 7px; height: 11px;
  background-color: var(--tampon);
}

/* La réponse de l'IA seule, puis la zone « Joindre un fichier » (elle prend la place qui reste) */
.ecran__reponse { font-size: var(--t-petit); line-height: 1.5; color: var(--texte); }
.ecran__joindre {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
  padding: 16px 14px;
  font-size: .8125rem;
  color: var(--texte-2);
  border: 1px dashed var(--filet-fort);
  border-radius: var(--rayon);
}
.ecran__joindre-texte { display: inline-flex; align-items: center; gap: 8px; }
.ecran__joindre svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.ecran__attente {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--police-mono);
  font-size: var(--t-mono-petit);
  font-weight: 500;
  letter-spacing: var(--interlettrage-mono);
  text-transform: uppercase;
}
.attente-points { display: inline-flex; gap: 4px; }
.attente-points i { width: 4px; height: 4px; background-color: currentColor; opacity: .35; }
.attente-points i:nth-child(2) { --k: 1; }
.attente-points i:nth-child(3) { --k: 2; }

/* À droite, sur la ligne « Ctrl-Data » : le lecteur de fichiers, puis le statut */
.ecran__suivi { display: grid; flex: 1; min-width: 0; }
.ecran__suivi > * { grid-area: 1 / 1; }
.ecran__statut { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--texte); }
.coche { flex: none; width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; }
.ecran__statut .coche { color: var(--accent-texte); }

/* Le document livré : papier clair dans les deux modes (comme les documents du reste du site) */
.lettre {
  --l-fond: var(--papier);
  --l-texte: var(--graphite);
  --l-texte-2: var(--gris-papier);
  --l-filet: var(--filet-papier-fort);
  --l-filet-doux: var(--filet-papier);
  --l-accent: var(--tampon-texte);
  --couleur-tampon: var(--tampon);
  position: relative;
  padding: clamp(12px, 1.3vw, 16px) clamp(12px, 1.6vw, 18px) clamp(12px, 1.2vw, 14px);
  color: var(--l-texte);
  background-color: var(--l-fond);
  border-radius: 2px;
  box-shadow: 0 18px 36px -20px var(--ombre-feuille), 0 1px 3px var(--ombre-feuille);
  font-size: .8125rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
html[data-mode="clair"] .lettre {
  --l-fond: var(--encre);
  --l-texte: var(--craie);
  --l-texte-2: var(--gris);
  --l-filet: var(--filet-encre-fort);
  --l-filet-doux: var(--filet-encre);
  --l-accent: var(--tampon-clair);
}
/* En mode clair, la carte de droite est crème : la feuille s'éclaircit pour s'en détacher */
html[data-mode="clair"] .ecran--ctrl .lettre { --l-fond: color-mix(in srgb, var(--encre) 40%, var(--sur-tampon)); }
.lettre__tete,
.contrats__tete,
.lettre__note,
.doc-table thead :is(th, td),
.doc-table tbody th {
  font-family: var(--police-mono);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: var(--interlettrage-mono);
  text-transform: uppercase;
  color: var(--l-texte-2);
}
.lettre__tete {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--l-filet);
}
.lettre__objet { font-weight: 600; color: var(--l-texte); }
.lettre__pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--l-filet);
}
.lettre__note { display: inline-flex; align-items: center; gap: 7px; color: var(--l-accent); }
.lettre__pied .tampon-seul { --tampon-taille: .78rem; --tampon-rotation: -6deg; margin: 2px 6px 2px auto; }
.ecrit { display: inline-block; }
.nw { white-space: nowrap; }

/* Les tableaux du document */
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table :is(th, td) {
  padding: 6px 8px;
  text-align: left;
  vertical-align: baseline;
  font-weight: 400;
  border-bottom: 1px solid var(--l-filet-doux);
}
.doc-table :is(th, td):first-child { padding-left: 0; }
.doc-table :is(th, td):last-child { padding-right: 0; }
.doc-table thead :is(th, td) { padding-top: 8px; border-bottom-color: var(--l-filet); }
.doc-table .nb { text-align: right; white-space: nowrap; }

/* 01 · Le devis */
.devis__table tbody td:first-child { padding-right: 12px; }
.devis__table tfoot :is(th, td) { padding-block: 3px; border-bottom: 0; }
.devis__table tfoot tr:first-child > * { padding-top: 9px; }
.devis__table tfoot th { text-align: right; color: var(--l-texte-2); }
.devis__ttc > * { font-weight: 700 !important; color: var(--l-texte) !important; }
.sources { display: grid; gap: 7px; }
.sources__titre {
  font-family: var(--police-mono);
  font-size: var(--t-mono-petit);
  font-weight: 500;
  letter-spacing: var(--interlettrage-mono);
  text-transform: uppercase;
  color: var(--texte-2);
}
.sources__liste { display: grid; gap: 5px; }
.sources__liste li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: .8125rem; line-height: 1.35; }
.sources__liste .coche { color: var(--accent-texte); }
.sources__nom { font-weight: 500; }
.sources__ref { font-family: var(--police-mono); font-size: var(--t-mono-petit); letter-spacing: .02em; color: var(--texte-2); }

/* 02 · Les échéances : des lignes de même hauteur (le tri les échange) */
.contrats__tete,
.contrat__corps {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr);
  column-gap: 10px;
}
.contrats__tete { padding: 8px 8px 6px; border-bottom: 1px solid var(--l-filet); }
.contrats { display: grid; grid-auto-rows: 1fr; }
.contrat { border-bottom: 1px solid var(--l-filet-doux); }
.contrat__corps {
  position: relative;
  isolation: isolate;
  height: 100%;
  align-items: baseline;
  align-content: center;
  row-gap: 5px;
  padding: 7px 8px 8px;
  background-color: var(--l-fond);
}
.contrat__corps::before { /* le surlignage du plus urgent */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: color-mix(in srgb, var(--tampon) 15%, var(--l-fond));
  box-shadow: inset 3px 0 0 var(--tampon);
  opacity: 0;
}
.contrat--urgent .contrat__corps::before { opacity: 1; }
.contrat__nom b { font-weight: 600; }
.contrat__type { color: var(--l-texte-2); }
.contrat__suite {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}
.contrat__ref { font-family: var(--police-mono); font-size: .625rem; letter-spacing: .02em; color: var(--l-texte-2); }
.contrat__relance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid var(--l-accent);
  border-radius: var(--rayon);
  font-family: var(--police-mono);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: var(--interlettrage-mono);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--l-accent);
}
.contrat--urgent .contrat__relance { color: var(--sur-tampon); background-color: var(--tampon-fort); border-color: var(--tampon-fort); }

/* 03 · Le comparatif */
.compare__table { table-layout: fixed; }
.compare__table td { hyphens: manual; -webkit-hyphens: manual; }   /* jamais « L'installa-tion » au téléphone */
.compare__table tbody :is(th, td) { padding-block: 9px; }
.compare__table thead td,
.compare__table tbody th { width: 24%; }
.compare__table thead th { vertical-align: bottom; }
.compare__f {
  display: block;
  font-family: var(--police-texte);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--l-texte);
}
.compare__fichier { display: block; margin-top: 2px; letter-spacing: .02em; text-transform: none; }
.compare__table :is(th, td).compare__choix { background-color: color-mix(in srgb, var(--tampon) 13%, transparent); }
.compare__table thead .compare__choix { box-shadow: inset 0 3px 0 var(--tampon); }
.compare__piege { position: relative; z-index: 0; font-weight: 600; }
.compare__piege::before {
  content: "";
  position: absolute;
  inset: .1em -.12em 0;
  z-index: -1;
  background-color: color-mix(in srgb, var(--tampon) 28%, transparent);
  transform-origin: left center;
}
.compare__alerte {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  max-width: none;
  margin-top: 10px;
  padding: 7px 10px 8px 12px;
  background-color: color-mix(in srgb, var(--tampon) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--tampon);
}
.compare__alerte-titre,
.compare__src { font-family: var(--police-mono); font-size: .625rem; letter-spacing: var(--interlettrage-mono); text-transform: uppercase; }
.compare__alerte-titre { font-weight: 600; color: var(--l-accent); }
.compare__src { letter-spacing: .02em; text-transform: none; color: var(--l-texte-2); }
.compare__raison { flex: 1 1 15rem; max-width: none; }
.compare__raison b { font-weight: 700; }

/* L'aspiration : les pages filent vers le lecteur (canvas décoratif, au-dessus des écrans) */
.duel__toile {
  position: absolute;
  left: calc(-1 * var(--gouttiere));
  top: -48px;
  z-index: 3;
  width: calc(100% + 2 * var(--gouttiere));
  height: calc(100% + 96px);
  pointer-events: none;
}

/* ---------- 2. Le scénario (seulement quand le script a pris la main : .duel--pret) ----------
   Phases posées sur le panneau, dans l'ordre : ph-q, ph-reflexion, ph-a-repond, ph-b-trouve,
   ph-b-remplit, ph-b-tri, ph-b-source, ph-b-tampon, ph-fin. Les transitions ne sont écrites
   que sur l'état « allumé » : la remise à zéro est immédiate. */
.duel--pret .ecran__message { opacity: 0; transform: translateY(8px); }
.duel--pret .ph-q .ecran__message {
  opacity: 1; transform: none;
  transition: opacity .3s var(--sortie-douce), transform .5s var(--sortie);
}
.duel--pret .frappe .car { opacity: 0; }
.duel--pret .ph-q .frappe .car { opacity: 1; transition: opacity 40ms linear calc(160ms + var(--i) * var(--pas, 20ms)); }

.duel--pret .ecran__qui { opacity: 0; }
.duel--pret .ph-reflexion .ecran__qui { opacity: 1; transition: opacity .3s var(--sortie-douce); }
.duel--pret .points { display: inline-flex; opacity: 0; }
.duel--pret .ph-reflexion:not(.ph-a-repond) .points { opacity: 1; }
.duel--pret.duel--visible .ph-reflexion:not(.ph-a-repond) .points i { animation: duel-points .9s ease-in-out calc(var(--k, 0) * .15s) infinite; }
@keyframes duel-points {
  0%, 60%, 100% { transform: none; opacity: .35; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes duel-clignote { from { opacity: 1; } to { opacity: .15; } }

/* À gauche : la réponse, la zone « Joindre » qui fait coucou, puis l'attente sans fin */
.duel--pret .frappe-mots .mot { opacity: 0; transform: translateY(.4em); }
.duel--pret .ph-a-repond .mot {
  opacity: 1; transform: none;
  transition: opacity .35s var(--sortie-douce) calc(var(--i) * 45ms), transform .55s var(--sortie) calc(var(--i) * 45ms);
}
.duel--pret .ecran__joindre { opacity: 0; transform: translateY(6px); }
.duel--pret .ph-a-repond .ecran__joindre {
  opacity: 1; transform: none;
  transition: opacity .4s var(--sortie-douce) .6s, transform .6s var(--sortie) .6s;
}
.duel--pret .ph-a-repond .ecran__joindre-texte { animation: duel-coucou .5s ease-in-out 1.4s 2; }
@keyframes duel-coucou {
  0%, 100% { transform: none; }
  25% { transform: translateX(-4px) rotate(-2deg); }
  75% { transform: translateX(4px) rotate(2deg); }
}
.duel--pret.duel--visible .est-actif.ph-a-repond .attente-points i { animation: duel-points 1.3s ease-in-out calc(1.6s + var(--k, 0) * .2s) infinite; }

/* À droite : le compteur, le lecteur de fichiers, puis le statut */
.duel--pret .ecran--ctrl .ecran__compte { opacity: 0; }
.duel--pret .ph-reflexion .ecran--ctrl .ecran__compte { opacity: 1; transition: opacity .3s var(--sortie-douce); }
.duel--pret.duel--visible .ph-reflexion:not(.ph-b-remplit) .ecran__voyant { animation: duel-clignote .34s steps(2, jump-none) infinite; }
.duel--pret .lecteur { opacity: 0; }
.duel--pret .ph-reflexion:not(.ph-b-remplit) .lecteur { opacity: 1; }
.duel--pret .ph-b-remplit .lecteur { opacity: 0; transition: opacity .25s var(--sortie-douce); }
.duel--pret .ph-b-trouve .lecteur__fichier { color: var(--accent-texte); }
.duel--pret.duel--visible .ph-reflexion:not(.ph-b-trouve) .lecteur::after { animation: duel-clignote .5s steps(2, jump-none) infinite; }
.duel--pret .ecran__statut { opacity: 0; transform: translateY(5px); }
.duel--pret .ph-b-remplit .ecran__statut {
  opacity: 1; transform: none;
  transition: opacity .3s var(--sortie-douce) .15s, transform .5s var(--sortie) .15s;
}

/* Le document : il arrive vide pendant la lecture, puis s'écrit ligne par ligne */
.duel--pret .lettre { opacity: 0; transform: translateY(14px); }
.duel--pret .ph-reflexion .lettre {
  opacity: 1; transform: none;
  transition: opacity .45s var(--sortie-douce) .15s, transform .8s var(--sortie) .15s;
}
.duel--pret .ecrit { opacity: 0; clip-path: inset(0 100% 0 0); }
.duel--pret .ph-b-remplit .ecrit {
  --retard: calc(var(--i, 0) * 280ms + var(--c, 0) * 70ms);
  opacity: 1; clip-path: inset(-8px -40px);
  transition: opacity .15s linear var(--retard), clip-path .45s var(--sortie) var(--retard);
}
.duel--pret .sources__titre,
.duel--pret .sources__liste li { opacity: 0; transform: translateX(-8px); }
.duel--pret .ph-reflexion .sources__titre,
.duel--pret .ph-reflexion .sources__liste li {
  opacity: 1; transform: none;
  transition: opacity .3s var(--sortie-douce) calc(var(--i, 0) * 420ms), transform .5s var(--sortie) calc(var(--i, 0) * 420ms);
}
.duel--pret .compare__fichier { opacity: 0; }
.duel--pret .ph-reflexion .compare__fichier { opacity: 1; transition: opacity .3s var(--sortie-douce) calc(var(--c, 0) * 420ms); }

/* 02 · les contrats arrivent dans l'ordre où ils sont trouvés (--o), puis se trient (--d) */
.duel--pret .contrat { transform: translateY(calc(var(--d, 0) * 100%)); }
.duel--pret .ph-b-tri .contrat { transform: none; transition: transform .75s var(--sortie) calc(var(--o, 0) * 45ms); }
.duel--pret .contrat__corps { opacity: 0; transform: translateX(-12px); }
.duel--pret .ph-b-remplit .contrat__corps {
  opacity: 1; transform: none;
  transition: opacity .35s var(--sortie-douce) calc(var(--o, 0) * 280ms), transform .55s var(--sortie) calc(var(--o, 0) * 280ms);
}
.duel--pret .contrat__relance { opacity: 0; transform: translateY(4px); }
.duel--pret .ph-b-source .contrat__relance {
  opacity: 1; transform: none;
  transition: opacity .35s var(--sortie-douce) calc(var(--n, 0) * 120ms), transform .5s var(--sortie) calc(var(--n, 0) * 120ms);
}
.duel--pret .contrat--urgent .contrat__corps::before { opacity: 0; }
.duel--pret .ph-b-source .contrat--urgent .contrat__corps::before { opacity: 1; transition: opacity .5s var(--sortie-douce); }

/* 03 · le piège repéré, puis le meilleur choix */
.duel--pret .compare__piege::before { transform: scaleX(0); }
.duel--pret .ph-b-tri .compare__piege::before { transform: none; transition: transform .6s var(--sortie); }
.duel--pret .compare__alerte { opacity: 0; transform: translateY(6px); }
.duel--pret .ph-b-tri .compare__alerte {
  opacity: 1; transform: none;
  transition: opacity .35s var(--sortie-douce) .2s, transform .5s var(--sortie) .2s;
}
.duel--pret .duel__panneau:not(.ph-b-source) .compare__choix { background-color: transparent; box-shadow: none; }
.duel--pret .ph-b-source .compare__choix { transition: background-color .6s var(--sortie-douce), box-shadow .6s var(--sortie-douce); }

/* « Rangé dans vos… », puis le coup de tampon, qui fait trembler l'écran */
.duel--pret .lettre__pied > :not(.tampon-seul) { opacity: 0; transform: translateY(5px); }
.duel--pret .ph-b-source .lettre__pied > :not(.tampon-seul) {
  opacity: 1; transform: none;
  transition: opacity .35s var(--sortie-douce) .25s, transform .5s var(--sortie) .25s;
}
.duel--pret .ph-b-tampon .ecran--ctrl { animation: duel-secousse .36s cubic-bezier(.3, .7, .2, 1) .2s; }
@keyframes duel-secousse {
  0%, 100% { transform: none; }
  30% { transform: translate(1.5px, 2.5px); }
  65% { transform: translate(-1px, -1px); }
}

/* ---------- 3. La comparaison en 4 lignes ([data-duel-comparatif]) ---------- */
.comparatif { margin-top: clamp(64px, 8vw, 120px); }
.comparatif__tete,
.comparatif__ligne {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 4fr) minmax(0, 5fr);
}
.comparatif__tete > * {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px clamp(14px, 1.8vw, 26px) 14px;
  font-family: var(--police-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: var(--interlettrage-mono);
  text-transform: uppercase;
  color: var(--texte-2);
  border-top: 1px solid var(--filet-fort);
}
.comparatif__tete > :first-child { padding-left: 0; }
.comparatif__col--ctrl { position: relative; color: var(--texte); background-color: var(--fond); border-top-color: var(--tampon); }
.comparatif__col--ctrl::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 3px;
  background-color: var(--tampon);
}
.comparatif__col--ctrl .marque { width: 14px; height: 14px; }
.comparatif__ligne > * {
  padding: clamp(16px, 2vw, 26px) clamp(14px, 1.8vw, 26px);
  border-top: 1px solid var(--filet);
}
.comparatif__ligne:last-child > * { border-bottom: 1px solid var(--filet); }
.comparatif__sujet {
  padding-left: 0 !important;
  font-family: var(--police-titre);
  font-size: var(--t-4);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.015em;
}
.comparatif__seule { color: var(--texte-2); }
.comparatif__ctrl {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-weight: 500;
  color: var(--texte);
  background-color: var(--fond);
}
.comparatif__ctrl::before { /* le trait tampon, côté gauche */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background-color: var(--tampon);
  transform-origin: top center;
}
.comparatif__chevron { flex: none; width: 15px; height: 15px; overflow: visible; transform: translateY(2px); }
.comparatif__chevron path { fill: none; stroke-width: 2.2; stroke-linecap: square; }
.comparatif__chevron .avant { stroke: var(--tampon); }
.comparatif__chevron .arriere { stroke: currentColor; opacity: .45; }
.comparatif__mini { display: none; }
.comparatif__pied {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: var(--espace-6);
}
.comparatif__pied p { font-size: var(--t-petit); color: var(--texte-2); max-width: 52ch; }
.comparatif__pied b { font-weight: 600; color: var(--texte); }

/* Téléphone : une fiche par ligne, la colonne Ctrl-Data en bloc, sans tableau écrasé */
@media (max-width: 759px) {
  .comparatif__tete {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .comparatif__ligne {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px 0 24px;
    border-top: 1px solid var(--filet-fort);
  }
  .comparatif__ligne:last-child { border-bottom: 1px solid var(--filet-fort); }
  .comparatif__ligne > *,
  .comparatif__ligne:last-child > * { padding: 0; border: 0; }
  .comparatif__sujet { margin-bottom: 12px; }
  .comparatif__seule { padding-bottom: 12px !important; }
  .comparatif__ctrl { display: block; padding: 13px 14px 15px 18px !important; border-radius: var(--rayon); }
  .comparatif__ctrl .comparatif__chevron { display: none; }
  .comparatif__mini {
    display: block;
    margin-bottom: 4px;
    font-family: var(--police-mono);
    font-size: var(--t-mono-petit);
    font-weight: 500;
    letter-spacing: var(--interlettrage-mono);
    text-transform: uppercase;
    color: var(--texte-2);
  }
  .comparatif__ctrl .comparatif__mini { color: var(--accent-texte); }
}

/* Allumage ligne par ligne (seulement quand le script a pris la main : .comparatif--pret) */
.comparatif--pret .comparatif__sujet,
.comparatif--pret .comparatif__seule,
.comparatif--pret .comparatif__ctrl > *,
.comparatif--pret .comparatif__ctrl::before {
  transition: opacity .6s var(--sortie-douce), transform .8s var(--sortie);
  transition-delay: calc(var(--i, 0) * 280ms);
}
.comparatif--pret:not(.est-allume) .comparatif__sujet,
.comparatif--pret:not(.est-allume) .comparatif__seule { opacity: .22; }
.comparatif--pret:not(.est-allume) .comparatif__ctrl > * { opacity: 0; transform: translateX(-12px); }
.comparatif--pret:not(.est-allume) .comparatif__ctrl::before { transform: scaleY(0); }

/* Écran (petit) : les deux écrans l'un sous l'autre ; la demande n'est écrite qu'une fois */
@media (max-width: 859px) {
  .duel__scene { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 12px; }
  .ecran--seule { height: auto; }
  .ecran--ctrl .ecran__message { display: none; }
  .duel__versus { flex-direction: row; padding-block: 2px; }
  .duel__versus span { writing-mode: horizontal-tb; transform: none; }
  .duel__versus::before,
  .duel__versus::after { width: auto; height: 1px; }
}
/* Téléphone : le nom court dans la barre, le document plus serré */
@media (max-width: 479px) {
  .ecran__nom-long,
  .compare__long {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .lettre { font-size: .75rem; }
  .doc-table :is(th, td) { padding: 5px 5px; }
  .devis__table tbody td:first-child { padding-right: 6px; }
  .contrats__tete,
  .contrat__corps { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr); column-gap: 6px; }
  .contrat__type { display: block; }
  .contrat__ref { display: none; }
  .compare__table thead td,
  .compare__table tbody th { width: 26%; }
  .compare__f { font-size: .75rem; }
  .compare__fichier { font-size: .5625rem; letter-spacing: 0; white-space: nowrap; }
  .sources__ref { flex-basis: 100%; padding-left: 21px; }
}

/* ---------- 3 bis. Téléphone (17/11/2026) : la scène tient en moins d'écrans ----------
   Demande de Maxime : « on scrolle énormément ». Au téléphone seulement (rien ne change au-dessus
   de 600 px) : en-tête resserré ; onglets d'une ligne (chacun la largeur de son mot) ; l'écran de
   l'IA seule ramassé (la zone « Joindre un fichier » sur une ligne) ; le document plus serré. */
@media (max-width: 600px) {
  .duel-tete { gap: var(--espace-4); }
  /* « Chapitre 01 —— Intelligence artificielle » : le filet plus court, l'étiquette tient sur une ligne */
  .duel-tete .etiquette--filet::after { min-width: 1.25rem; }
  .duel-tete__textes { gap: var(--espace-3); }
  .duel-tete__titre { font-size: var(--t-2); }   /* l'échelle des titres du téléphone (base.css) */
  .duel { margin-top: var(--espace-5); }
  .duel__commandes { margin-bottom: 10px; }
  .duel__onglets { display: flex; }
  .duel__onglet { flex: 1 1 auto; min-width: 0; gap: 1px; padding: 7px 7px 9px; }
  .duel__rejouer { width: 44px; }

  .duel__scene { gap: 8px; }
  .ecran__barre { padding: 9px 12px; }
  .ecran__fil { gap: 10px; padding: 12px 12px 14px; }

  /* L'IA seule : sa demande, sa réponse, puis « Joindre un fichier · En attente » sur une ligne */
  .ecran--seule .ecran__fil { grid-template-rows: none; align-content: start; }
  .ecran__message { padding: 8px 12px 9px; }
  .ecran__joindre { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-top: 0; padding: 9px 12px; }
  .ecran__joindre > * { white-space: nowrap; }

  /* Le document de droite, plus serré (même texte, mêmes animations) */
  .lettre { padding: 10px 10px 9px; }
  .lettre__tete { padding-bottom: 6px; }
  .doc-table :is(th, td) { padding-block: 4px; }
  .doc-table thead :is(th, td) { padding-top: 6px; }
  .devis__table tfoot tr:first-child > * { padding-top: 6px; }
  .devis__table tfoot :is(th, td) { padding-block: 2px; }
  .lettre__pied { flex-wrap: nowrap; margin-top: 8px; padding-top: 8px; }
  .lettre__pied > :not(.tampon-seul) { flex: 1 1 auto; min-width: 0; }   /* le tampon reste sur la même ligne */
  .contrats__tete { padding: 6px 6px 5px; }
  .contrat__corps { row-gap: 3px; padding: 6px 6px 7px; }
  .compare__table tbody :is(th, td) { padding-block: 6px; }
  .compare__alerte { margin-top: 8px; }
  .sources { gap: 5px; }
  .sources__liste { gap: 5px; }
  .sources__liste li { row-gap: 0; line-height: 1.3; }

  .comparatif__pied { gap: 8px 24px; margin-top: var(--espace-5); }
}
/* Très petit téléphone : le devis tient dans son écran (il en débordait déjà avant le 17/11) */
@media (max-width: 359px) {
  .doc-table :is(th, td) { padding-inline: 3px; }
  .devis__table thead .nb { white-space: normal; }
}

/* ---------- 4. Mouvement réduit : l'état final, sans mouvement ---------- */
.mouvement-reduit .duel *,
.mouvement-reduit .duel *::before,
.mouvement-reduit .duel *::after,
.mouvement-reduit .comparatif *,
.mouvement-reduit .comparatif *::before { transition: none !important; animation: none !important; }
.mouvement-reduit .duel__rejouer,
.mouvement-reduit .duel__toile { display: none; }
.mouvement-reduit .ecran-aimant { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .duel__rejouer, .duel__toile { display: none; }
  .ecran-aimant { transform: none; }
}
