/* =============================================================================
   Réarranger une série (UQTR) — feuille de style
   Couleurs institutionnelles : vert 0E8954, or DBA326, noir.
   Même charte que les autres applications du site (apps/tours-hanoi).
   Graphe : les couleurs de la diapositive 10 de la section 3.2 (MPU1054).
   ============================================================================= */

:root {
  --vert: #0E8954;
  --vert-fonce: #0B6E43;
  --vert-moyen: #87C4AA;
  --vert-clair: #B7DCCC;
  --or: #DBA326;
  --or-fonce: #9C7414;
  --or-moyen: #E9C87D;
  --or-clair: #F2DFB3;
  --rouge: #C0392B;
  --rouge-clair: #F6D5D1;
  --gris: #4D4D4D;
  --gris-moyen: #9E9E9E;
  --gris-clair: #D4D4D4;
  --fond: #F5F4EE;
  --carte: #FFFFFF;
  --bord: #E3E1D8;
  --texte: #1C1C1A;
  --texte-2: #63625B;
  --ombre: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 18px rgba(20, 40, 30, .06);
  --rayon: 10px;
  --police: "Carlito", "Calibri", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --police-math: "KaTeX_Main", "Latin Modern Roman", "STIX Two Text", "Cambria", "Georgia", "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.4 var(--police);
  color: var(--texte);
  background: var(--fond);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
i, .math i { font-family: var(--police-math); font-style: italic; }
.math-libelle { font-family: var(--police-math); font-size: 16px; white-space: nowrap; }
.math-libelle i { font-family: "KaTeX_Math", var(--police-math); }
sub, sup { font-size: .72em; line-height: 0; }
button, input { font-family: inherit; }
.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.katex { font-size: 1.08em; }

/* ---------------------------------------------------------------- En-tête */
.entete {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 20px 11px;
  background: #fff;
  border-bottom: 4px solid var(--or);
  z-index: 2;
}
.entete::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--vert);
}
.logo { height: 38px; width: auto; }
.titre { min-width: 0; }
.titre h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--vert);
  letter-spacing: .01em;
}
.sous-titre { margin: 3px 0 0; font-size: 12.5px; color: var(--texte-2); }
.actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------------------------------------------------------- Disposition */
.principal {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 12px;
  padding: 16px 12px 12px;
}
body.sans-panneau .principal { grid-template-columns: minmax(0, 1fr); }
body.sans-panneau .panneau { display: none; }

.zone-graphe {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  overflow: hidden;
}
.graphe-conteneur { position: relative; flex: 1; min-height: 240px; }
#graphe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}
#graphe.sur-cible { cursor: ns-resize; }
#graphe.glisse-cible { cursor: grabbing; }
.etiquettes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.etiq {
  position: absolute;
  transform: translate(0, -50%);
  padding: 0 2px;
  font-size: 12.5px;
  line-height: 1;
  background: rgba(255, 255, 255, .85);
  border-radius: 3px;
  white-space: nowrap;
}
.etiq.pos { color: var(--vert); }
.etiq.neg { color: var(--rouge); }
.etiq.ligne { transform: translate(0, -50%); font-size: 13px; background: rgba(255, 255, 255, .9); }
.etiq.ligne.s { color: var(--gris); }
.etiq.ligne.c { color: var(--or-fonce); font-weight: 700; }
.etiq.ecart-texte { color: var(--rouge); font-size: 12px; font-family: var(--police); background: rgba(255, 255, 255, .8); }
.etiq.axe { color: var(--gris); font-family: var(--police); font-size: 12.5px; background: none; }
.etiq.apercu { opacity: .8; }

.panneau {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #CFCDC4 transparent;
}

/* ---------------------------------------------------------------- Surimpressions du graphe */
.hud {
  position: absolute;
  top: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  font-size: 13.5px;
  color: var(--texte-2);
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--bord);
  border-radius: 999px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  z-index: 1;
}
.hud b { color: var(--texte); font-size: 15px; }
.hud-gauche { left: 12px; }
.hud-sep { color: #B5B3AA; }
.hud .katex { font-size: 1em; }
.legende {
  position: absolute;
  top: 12px; right: 14px;
  display: flex; gap: 14px;
  font-size: 12.5px;
  color: var(--texte-2);
  pointer-events: none;
  z-index: 1;
}
.leg { display: flex; align-items: center; gap: 6px; }
.leg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.leg-depart i { background: var(--gris-clair); }
.leg-rearr i { background: var(--or); box-shadow: 0 0 0 1.5px var(--or-fonce); }

.bulle {
  position: absolute;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--texte);
  background: #fff;
  border: 1px solid var(--bord);
  border-left: 4px solid var(--or);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
  z-index: 3;
  pointer-events: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.bulle.pos { border-left-color: var(--vert); }
.bulle.neg { border-left-color: var(--rouge); }
.bulle .katex { font-size: 1.05em; }
.bulle .petit { color: var(--texte-2); font-size: 12px; }

.invite {
  position: absolute;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 24px));
  padding: 7px 14px;
  font-size: 13.5px;
  line-height: 1.35;
  text-align: center;
  color: var(--texte);
  background: #FFFCF3;
  border: 1px solid var(--or-clair);
  border-left: 4px solid var(--or);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
  pointer-events: none;
  z-index: 2;
  animation: apparition .3s ease-out;
}
@keyframes apparition { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Animation du dernier pas ajouté */
.pas-neuf .tige { stroke-dasharray: var(--long) var(--long); stroke-dashoffset: var(--long); animation: tracer .28s ease-out forwards; }
.pas-neuf .tete { opacity: 0; animation: surgir .12s ease-out .22s forwards; }
.pas-neuf .point { transform-box: fill-box; transform-origin: center; animation: pop .34s cubic-bezier(.2, 1.6, .4, 1) .2s both; }
@keyframes tracer { to { stroke-dashoffset: 0; } }
@keyframes surgir { to { opacity: 1; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.surbrillance { animation: clignote 1.1s ease-out; }
@keyframes clignote { 0%, 40% { r: 8; stroke-width: 3; } 100% { r: 3.6; stroke-width: 1.2; } }

/* ---------------------------------------------------------------- Barre d'outils */
.barre-outils {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 12px;
  border-top: 1px solid var(--bord);
  background: #FBFAF6;
}
.groupe-btn { display: flex; gap: 5px; }
.groupe-btn.droite { margin-left: auto; }
.btn-plus { color: var(--vert-fonce); }
.btn-moins { color: var(--rouge); }
.btn-plus:hover { border-color: var(--vert); }
.btn-moins:hover { border-color: var(--rouge); background: #FDF6F5; }

/* ---------------------------------------------------------------- Bande du réarrangement */
.bande { flex: none; padding: 6px 12px 8px; border-top: 1px solid var(--bord); }
.bande-titre {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--vert);
}
.bande-titre .note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.note { font-size: 12px; color: var(--texte-2); font-family: var(--police); font-style: normal; }
.jetons-rearr {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-height: 46px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: #CFCDC4 transparent;
}
.jetons-rearr .vide { align-self: center; font-size: 13px; color: var(--texte-2); padding-left: 2px; }
.jetons-rearr .somme-debut { align-self: center; flex: none; padding: 0 4px 0 2px; }
.jetons-rearr .suite { align-self: center; flex: none; padding: 0 6px; color: var(--texte-2); font-size: 13px; white-space: nowrap; }
.bijection {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--texte-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.bijection .katex { font-size: 1em; }

/* ---------------------------------------------------------------- Jetons (termes) */
.jeton {
  position: relative;
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 7px 2px;
  background: #fff;
  border: 1.5px solid var(--bord);
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .12s, box-shadow .12s, opacity .2s, background .12s;
}
.jeton .valeur { min-height: 1.5em; display: flex; align-items: center; }
.jeton .indice-n {
  margin-top: 1px;
  font-family: var(--police-math);
  font-size: 10.5px;
  color: var(--texte-2);
}
.jeton.pos { border-color: var(--vert-moyen); }
.jeton.neg { border-color: #E9A79F; }
.jeton.nul { border-color: var(--gris-clair); }
.jeton.pos .valeur { color: #0A5C39; }
.jeton.neg .valeur { color: #9E2A1E; }
.jeton:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, .1); }
.jeton.pos:hover { background: #F2FAF6; border-color: var(--vert); }
.jeton.neg:hover { background: #FDF5F4; border-color: var(--rouge); }
.jeton:focus-visible { outline: 2px solid var(--or); outline-offset: 1px; }
.jeton.utilise { background: #F6F5F0; border-style: dashed; }
.jeton.utilise .valeur, .jeton.utilise .indice-n { opacity: .32; }
.jeton.utilise:hover { transform: none; }
.jeton.utilise:hover .valeur, .jeton.utilise:hover .indice-n { opacity: .7; }
.jeton .rang {
  position: absolute;
  top: -7px; right: -5px;
  padding: 0 4px;
  font-family: var(--police-math);
  font-size: 10px;
  line-height: 14px;
  color: #000;
  background: var(--or);
  border-radius: 7px;
}
.jeton.prochain::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px dashed var(--or);
  border-radius: 9px;
  pointer-events: none;
}
.jeton.vole { animation: vole .35s ease-out; }
@keyframes vole { 0% { transform: scale(1.15); box-shadow: 0 0 0 4px var(--or-clair); } 100% { transform: scale(1); box-shadow: none; } }

/* Jetons de la bande : déplaçables */
.jetons-rearr .jeton { cursor: grab; padding-right: 15px; }
.jetons-rearr .jeton .retirer {
  position: absolute;
  top: 1px; right: 1px;
  width: 14px; height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-size: 10px;
  line-height: 14px;
  color: var(--texte-2);
  background: transparent;
  cursor: pointer;
  opacity: .55;
}
.jetons-rearr .jeton .retirer:hover { opacity: 1; color: #fff; background: var(--rouge); }
.jetons-rearr .jeton .indice-n { font-size: 10px; }
.jetons-rearr .jeton.fantome-place { opacity: .25; border-style: dashed; }
.jeton.porte {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  cursor: grabbing;
  transform: rotate(-3deg) scale(1.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
  opacity: .96;
}
.jetons-rearr .jeton.repere { box-shadow: 0 0 0 3px var(--or); }
.insertion {
  flex: none;
  width: 3px;
  margin: 0 -1px;
  border-radius: 2px;
  background: var(--or);
  align-self: stretch;
}

/* ---------------------------------------------------------------- Cartes */
.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 12px 14px 13px;
  box-shadow: var(--ombre);
}
.carte h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--vert);
}
.carte h2::after { content: ""; flex: 1; height: 1px; background: var(--bord); }

.rangee { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rangee.droite { justify-content: flex-end; margin-top: 14px; }
.indice { margin: 7px 0 0; font-size: 12.5px; color: var(--texte-2); line-height: 1.4; }
.carte > .indice:first-of-type { margin-top: 0; margin-bottom: 8px; }
.note-alerte {
  padding: 6px 9px;
  color: var(--texte);
  background: #FBF6E8;
  border-left: 3px solid var(--or);
  border-radius: 4px;
}

/* Série de départ */
.champ-terme {
  display: flex;
  align-items: center;
  gap: 8px;
}
.champ-terme input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font: 15px/1.2 "Latin Modern Mono", Consolas, Menlo, monospace;
  color: var(--texte);
  border: 1px solid var(--bord);
  border-radius: 8px;
  background: #FCFCFA;
}
.champ-terme input:focus { border-color: var(--vert); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(14, 137, 84, .12); }
.champ-terme input.invalide { border-color: var(--rouge); box-shadow: 0 0 0 3px rgba(192, 57, 43, .1); }
.apercu-terme {
  min-height: 46px;
  margin: 8px 0 4px;
  padding: 6px 8px;
  text-align: center;
  background: #FBFAF6;
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: hidden;
}
.apercu-terme .katex-display { margin: 0; }
.apercu-terme.perime { opacity: .45; }
.erreur { margin: 4px 0 6px; font-size: 13px; color: var(--rouge); }
.erreur code { font-size: 12.5px; background: var(--rouge-clair); padding: 0 4px; border-radius: 3px; color: #7A1F15; }
.exemples { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.exemple {
  padding: 3px 8px;
  font-size: 12.5px;
  border: 1px solid var(--bord);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.exemple:hover { border-color: var(--vert); background: #F6FBF8; }
.exemple[aria-pressed="true"] { border-color: var(--or); background: var(--or-clair); }
.exemple .katex { font-size: 1.18em; }
.serie-longue {
  margin: 9px 0 0;
  padding: 6px 2px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px dashed var(--bord);
  scrollbar-width: thin;
}
.serie-longue .katex-display { margin: .3em 0; text-align: left; }
.serie-longue .katex { font-size: 1em; }
.serie-longue .katex-display > .katex { text-align: left; }
.diagnostic { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--texte-2); }
.diagnostic b { color: var(--texte); }
.badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: 1px;
  border-radius: 999px;
}
.badge.absolue { color: var(--vert-fonce); background: #E4F2EB; }
.badge.conditionnelle { color: #6E500B; background: var(--or-clair); }
.badge.divergente, .badge.grossiere { color: #8E2A1E; background: var(--rouge-clair); }

/* Banque des termes */
.rangee-banque { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.etiq-banque {
  flex: none;
  width: 58px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.positif { color: var(--vert); }
.negatif { color: var(--rouge); }
.nul { color: var(--gris-moyen); }
.banque {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 8px 3px 6px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #CFCDC4 transparent;
}
.motif {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 6px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px dashed var(--bord);
  font-size: 13.5px;
}
.motif input {
  width: 3.2em;
  padding: 3px 4px;
  font: inherit;
  text-align: center;
  border: 1px solid var(--bord);
  border-radius: 6px;
}
.motif .btn { margin-left: auto; }

/* Procédé de Riemann */
.ligne-cible { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.ligne-cible input[type="text"] {
  width: 5.2em;
  padding: 5px 8px;
  font: 15px var(--police-math);
  text-align: center;
  border: 1px solid var(--or);
  border-radius: 8px;
  background: #FFFCF3;
}
.ligne-cible input[type="range"] { flex: 1; margin: 0; accent-color: var(--or); }
.vitesse {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--texte-2);
}
.vitesse input[type="range"] { flex: 1; margin: 0; accent-color: var(--vert); }
.vitesse output { min-width: 6.6em; text-align: right; color: var(--texte); font-variant-numeric: tabular-nums; }

/* Valeurs */
.valeurs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: baseline;
  margin: 0;
  font-size: 14px;
}
.valeurs dt { white-space: nowrap; color: var(--texte-2); }
.valeurs dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-x: auto;
  overflow-y: hidden;
}
.valeurs dd.accent { color: var(--or-fonce); font-weight: 700; }
.valeurs .katex { font-size: 1.02em; }

/* ---------------------------------------------------------------- Boutons */
.btn {
  border: 1px solid var(--bord);
  background: #fff;
  color: var(--texte);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--vert); background: #F6FBF8; }
.btn.primaire { background: var(--vert); color: #fff; border-color: var(--vert); }
.btn.primaire:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); }
.btn.primaire.en-cours { background: var(--or); border-color: var(--or); color: #000; }
.btn.petit { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover { border-color: var(--bord); background: #fff; }
.btn.confirme { border-color: var(--vert); background: #E4F2EB; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--or); outline-offset: 1px; }
.btn.langue { font-weight: 700; letter-spacing: .04em; border-color: var(--or); min-width: 3em; }
.btn.langue:hover { background: var(--or-clair); }

/* ---------------------------------------------------------------- Aide */
dialog {
  border: 0;
  border-radius: 12px;
  padding: 0;
  max-width: 740px;
  width: calc(100% - 40px);
  max-height: calc(100% - 40px);
  color: var(--texte);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}
dialog::backdrop { background: rgba(20, 30, 25, .45); }
.aide-corps { padding: 18px 24px 20px; border-top: 5px solid var(--or); }
dialog h2 { margin: 0 0 8px; color: var(--vert); font-size: 19px; }
dialog h3 { margin: 14px 0 5px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--texte-2); }
dialog p { margin: 0 0 6px; line-height: 1.45; }
dialog ul { margin: 0; padding-left: 18px; }
dialog li { margin: 3px 0; line-height: 1.4; }
dialog code { font: 13px "Latin Modern Mono", Consolas, Menlo, monospace; background: #F1F0EA; padding: 0 4px; border-radius: 3px; }
kbd {
  font: 12px var(--police);
  background: #F1F0EA;
  border: 1px solid var(--bord);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
}
.pied { margin: 2px 0 4px; font-size: 12px; color: var(--texte-2); text-align: center; }

/* Résultats des tests (index.html?test=1) */
#tests {
  position: fixed; left: 12px; bottom: 12px; z-index: 60;
  max-height: 60vh; overflow: auto;
  margin: 0; padding: 10px 14px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--bord); border-radius: 8px;
  font: 12.5px/1.45 "Latin Modern Mono", Consolas, Menlo, monospace;
  box-shadow: var(--ombre);
  white-space: pre-wrap;
  max-width: 46vw;
}

/* ---------------------------------------------------------------- Écrans étroits */
@media (max-width: 960px) {
  body { overflow: auto; height: auto; min-height: 100%; }
  .principal { display: flex; flex-direction: column; padding: 10px 8px 12px; }
  .zone-graphe { flex: none; height: max(520px, min(80vh, 700px)); }
  .panneau { overflow: visible; padding-right: 0; }
  .sous-titre { display: none; }
  .masque-etroit { display: none; }
  .entete { gap: 10px; padding: 8px 10px 10px; }
  .logo { height: 30px; }
  .titre h1 { font-size: 18px; }
  .actions { gap: 5px; }
  .actions .btn { padding: 5px 8px; font-size: 13px; }
}
@media (max-width: 560px) {
  .libelle { display: none; }
  .hud { font-size: 12.5px; padding: 3px 8px; }
  .legende { display: none; }
  .barre-outils { gap: 6px 8px; padding: 7px 8px; }
  .barre-outils .btn { padding: 5px 8px; font-size: 13.5px; }
  .groupe-btn.droite { margin-left: 0; }
  .invite { top: 46px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .invite, .jeton.vole { animation: none; }
  .pas-neuf .tige, .pas-neuf .tete, .pas-neuf .point { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; opacity: 1; }
  .jeton { transition: none; }
}

/* =============================================================================
   Intégrée dans une page de mathopo.ca (index.html?embed=1 ; la classe « integre »
   est posée par index.html). Sans l’en-tête UQTR (la page du site donne le titre),
   sur fond blanc, avec la police et les gris du site. Le vert, l’or et les
   couleurs du graphe ne changent pas.
   ============================================================================= */
.integre {
  --vert: #0b7a57;
  --vert-fonce: #085e42;
  --fond: #ffffff;
  --bord: #dde4e0;
  --texte: #1d2b3a;
  --texte-2: #47576a;
  --ombre: none;
  --rayon: 8px;
  --police: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.integre .entete, .integre .pied { display: none; }
.integre .principal { padding: 0; gap: 16px; }
.integre .carte h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--texte);
}
.integre .bande-titre { font-size: 13.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--texte); }
.integre .etiq-banque { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.integre .badge { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.integre .badge::first-letter, .integre .etiq-banque::first-letter { text-transform: uppercase; }
