/* Thermomètre des émotions LeoBelo, version 1.0.0. Classes préfixées te-. Couleurs : jetons du socle (palette fluo).
   Niveaux : 1 et 2 en bleu, 3 en vert, 4 et 5 en orange ; jamais de rouge ; le niveau se lit aussi par le chiffre, le mot et la hauteur. */
.te-ecran[hidden] { display: none !important; }
.te-marque { font-weight: 700; }
html {
  --te-n1-vif: #A6EAF8; --te-n1-fonce: var(--lb-bleu-fonce); --te-n1-clair: var(--lb-bleu-clair);
  --te-n2-vif: var(--lb-bleu-vif); --te-n2-fonce: var(--lb-bleu-fonce); --te-n2-clair: var(--lb-bleu-clair);
  --te-n3-vif: var(--lb-vert-vif); --te-n3-fonce: var(--lb-vert-fonce); --te-n3-clair: var(--lb-vert-clair);
  --te-n4-vif: #FFAE66; --te-n4-fonce: var(--lb-orange-fonce); --te-n4-clair: var(--lb-orange-clair);
  --te-n5-vif: var(--lb-orange-vif); --te-n5-fonce: var(--lb-orange-fonce); --te-n5-clair: var(--lb-orange-clair);
}
.te-n-1 { --te-vif: var(--te-n1-vif); --te-fonce: var(--te-n1-fonce); --te-clair: var(--te-n1-clair); }
.te-n-2 { --te-vif: var(--te-n2-vif); --te-fonce: var(--te-n2-fonce); --te-clair: var(--te-n2-clair); }
.te-n-3 { --te-vif: var(--te-n3-vif); --te-fonce: var(--te-n3-fonce); --te-clair: var(--te-n3-clair); }
.te-n-4 { --te-vif: var(--te-n4-vif); --te-fonce: var(--te-n4-fonce); --te-clair: var(--te-n4-clair); }
.te-n-5 { --te-vif: var(--te-n5-vif); --te-fonce: var(--te-n5-fonce); --te-clair: var(--te-n5-clair); }

/* ---------- Espace adulte ---------- */
.te-commencer-ligne { margin: calc(var(--lb-pas) * 2) 0 0; }
.te-gros { width: 100%; min-height: 3.5rem; font-size: 1.2rem; background: var(--lb-bleu-vif); border-color: var(--lb-bleu-fonce); box-shadow: 0 0.3125rem 0 var(--lb-bleu-fonce); margin-bottom: 0.3125rem; }
.te-gros:active { box-shadow: 0 0.3125rem 0 var(--lb-bleu-fonce), inset 0 0 0 0.1875rem var(--lb-bleu-fonce); }
.te-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--lb-pas); }
.te-mode { padding: 0.5rem 0.75rem; }
.te-mode[aria-pressed="true"], .te-voix[aria-pressed="true"] { color: var(--lb-encre); background: var(--lb-bleu-vif); border-color: var(--lb-bleu-fonce); box-shadow: inset 0 0 0 0.125rem var(--lb-bleu-fonce); }
.te-voix-ligne { margin: 0 0 0.25rem; }
.te-etat { font-weight: 400; padding-left: 0.5rem; border-left: 0.0625rem solid currentColor; }
.te-voix::before { content: ""; width: 1.25rem; height: 1.25rem; flex: none; border: 0.125rem solid currentColor; border-radius: 50%; }
.te-voix[aria-pressed="true"]::before { background: var(--lb-encre); box-shadow: inset 0 0 0 0.1875rem var(--lb-bleu-vif); }
.te-plan-niveau { padding: var(--lb-pas) calc(var(--lb-pas) * 1.5); border-left: 0.375rem solid var(--te-vif); background: var(--te-clair); border-radius: 0 var(--lb-rayon) var(--lb-rayon) 0; }
.te-plan-niveau > legend { display: flex; align-items: center; gap: var(--lb-pas); float: left; width: 100%; margin-bottom: 0.25rem; }
.te-plan-niveau > legend + * { clear: both; }
.te-plan-niveau .lb-info { margin-bottom: 0.25rem; }
.te-champ-perso { margin: 0 0 var(--lb-pas) 2.25rem; }
.te-chiffre { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2rem; height: 2rem; border-radius: 0.5rem;
  background: var(--te-vif); border: 0.125rem solid var(--te-fonce); color: var(--lb-encre); font-weight: 700; line-height: 1; }
.te-jour { font-size: 1.0625rem; margin: calc(var(--lb-pas) * 2) 0 0.25rem; }
.te-jour::first-letter { text-transform: uppercase; }
.te-mesures { list-style: none; margin: 0; padding: 0; }
.te-mesures li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.625rem; padding: 0.375rem 0; border-bottom: 0.0625rem solid var(--lb-gris-filet); }
.te-mesures .te-chiffre { width: 1.75rem; height: 1.75rem; font-size: 0.95rem; }
.te-mesure-idee { flex-basis: 100%; padding-left: 2.375rem; font-size: 0.9375rem; color: var(--lb-gris-texte); }
.te-imprimer { margin-top: calc(var(--lb-pas) * 3); }
.te-aide ol { padding-left: 1.25rem; }
.te-aide li { margin-bottom: var(--lb-pas); }
.te-aide a { color: var(--lb-bleu-fonce); font-weight: 700; }

/* ---------- Espace de l'enfant : une question, une action ---------- */
.te-enfant { max-width: 42rem; margin: 0 auto; padding: calc(var(--lb-pas) * 2) calc(var(--lb-pas) * 2) calc(var(--lb-pas) * 3); }
.te-question { font-size: 1.6rem; line-height: 1.2; margin: 0 0 calc(var(--lb-pas) * 2); }
.te-question:focus { outline: none; }
.te-question:focus-visible { outline: 0.1875rem solid var(--lb-encre); outline-offset: 0.1875rem; }
.te-adulte { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--lb-pas); margin-top: calc(var(--lb-pas) * 3); min-height: var(--lb-cible); }
.te-suite-ligne { margin: calc(var(--lb-pas) * 2) 0 0; min-height: var(--lb-cible-enfant); }
.te-suite-ligne .te-gros { min-height: var(--lb-cible-enfant); }
.te-pour-adulte { margin-top: calc(var(--lb-pas) * 2); }

/* Émotions : visages sur un cube du logo, en grille de 2 */
.te-emotions { list-style: none; margin: 0; padding: 0.75rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem;
  background: var(--lb-fond-doux); border-radius: calc(var(--lb-rayon) * 1.5); }
.te-emotion { width: 100%; flex-direction: column; gap: 0.25rem; padding: 0.5rem 0.375rem; font-size: 1.1rem; line-height: 1.15; background: #FFFFFF; border-color: var(--lb-gris-trait); box-shadow: 0 0.1875rem 0 var(--lb-gris-filet); }
.te-emotion .te-visage { width: 3.25rem; height: 3.25rem; flex: none; }
.te-emotion[aria-pressed="true"] { border-color: var(--lb-encre); box-shadow: inset 0 0 0 0.125rem var(--lb-encre); }
.te-emotions li:last-child { grid-column: 1 / -1; }
.te-emotions li:last-child .te-emotion { flex-direction: row; gap: 0.75rem; }
.te-visage { display: block; overflow: visible; }
.te-c-trait { stroke-width: 4; stroke-linejoin: round; }
.te-t-orange .te-c-face { fill: var(--lb-orange-vif); } .te-t-orange .te-c-dessus { fill: #FFAE66; } .te-t-orange .te-c-cote { fill: var(--lb-orange-moyen); } .te-t-orange .te-c-trait { stroke: var(--lb-orange-fonce); }
.te-t-bleu .te-c-face { fill: var(--lb-bleu-vif); } .te-t-bleu .te-c-dessus { fill: #66DDF5; } .te-t-bleu .te-c-cote { fill: var(--lb-bleu-moyen); } .te-t-bleu .te-c-trait { stroke: var(--lb-bleu-fonce); }
.te-t-vert .te-c-face { fill: var(--lb-vert-vif); } .te-t-vert .te-c-dessus { fill: #B0F05A; } .te-t-vert .te-c-cote { fill: var(--lb-vert-moyen); } .te-t-vert .te-c-trait { stroke: var(--lb-vert-fonce); }
.te-t-gris .te-c-face { fill: #E6E6E6; } .te-t-gris .te-c-dessus { fill: #F2F2F2; } .te-t-gris .te-c-cote { fill: #CCCCCC; } .te-t-gris .te-c-trait { stroke: #5F5B54; }
.te-c-oeil { fill: var(--lb-encre); }
.te-c-ligne { fill: none; stroke: var(--lb-encre); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.te-pastille-emotion { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 var(--lb-pas); padding: 0.25rem 0.875rem 0.25rem 0.375rem;
  border: 0.125rem solid var(--lb-gris-trait); border-radius: 999px; font-weight: 700; }
.te-pastille-emotion .te-visage { width: 2rem; height: 2rem; }

/* L'échelle : le tube en face des boutons, sur un plateau pastel */
.te-echelle { display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 0.75rem; padding: 0.75rem 0.75rem 4.25rem;
  background: var(--lb-fond-doux); border-radius: calc(var(--lb-rayon) * 1.5); }
.te-tube { position: relative; }
.te-tube svg { position: absolute; top: 0; left: 0; overflow: visible; }
.te-niveaux { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.te-niveau { width: 100%; min-height: var(--lb-cible-enfant); flex-wrap: wrap; justify-content: flex-start; gap: 0.375rem 0.75rem; padding: 0.375rem 0.75rem; text-align: left;
  background: #FFFFFF; border: 0.1875rem solid var(--te-fonce); box-shadow: inset 0 0 0 0.25rem var(--te-vif), 0 0.1875rem 0 var(--te-clair); font-weight: 400; }
.te-niveau .te-chiffre { width: 2.75rem; height: 2.75rem; font-size: 1.5rem; border-radius: 0.625rem; }
.te-mots { display: flex; flex-direction: column; min-width: 0; flex: 1 1 4.5em; }
.te-mot { font-size: 1.2rem; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; }
.te-desc { font-size: 0.95rem; line-height: 1.3; color: var(--lb-gris-texte); overflow-wrap: break-word; }
.te-niveau[aria-pressed="true"] { background: var(--te-clair); border-color: var(--te-fonce); box-shadow: inset 0 0 0 0.125rem var(--te-fonce), 0 0.25rem 0 var(--te-fonce); }
.te-niveau[aria-pressed="true"] .te-desc { color: var(--lb-encre); }

/* Le dessin du thermomètre */
.te-verre { fill: #FFFFFF; stroke: var(--lb-encre); stroke-width: 3.5; stroke-linejoin: round; }
.te-liquide { stroke-width: 2.5; stroke-linejoin: round; }
.te-liq-0 { fill: #E9EEF3; stroke: #B8C2CC; }
.te-liq-1 { fill: var(--te-n1-vif); stroke: var(--te-n1-fonce); }
.te-liq-2 { fill: var(--te-n2-vif); stroke: var(--te-n2-fonce); }
.te-liq-3 { fill: var(--te-n3-vif); stroke: var(--te-n3-fonce); }
.te-liq-4 { fill: var(--te-n4-vif); stroke: var(--te-n4-fonce); }
.te-liq-5 { fill: var(--te-n5-vif); stroke: var(--te-n5-fonce); }
.te-grad { stroke: var(--lb-encre); stroke-opacity: 0.35; stroke-width: 2; }
.te-repere { stroke: var(--lb-encre); stroke-width: 3; stroke-linecap: round; }
.te-reflet { fill: #FFFFFF; fill-opacity: 0.75; }
.te-mini { display: block; flex: none; }

/* Idées */
.te-rappel { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 var(--lb-pas); }
.te-rappel .te-mini { width: 3rem; height: auto; }
.te-rappel-texte { margin: 0; padding: 0.375rem 0.875rem; border-radius: 999px; background: var(--te-clair); border: 0.125rem solid var(--te-fonce); font-weight: 700; font-size: 1.1rem; }
.te-idees { list-style: none; margin: 0; padding: 0.75rem; display: grid; gap: 0.75rem; background: var(--lb-fond-doux); border-radius: calc(var(--lb-rayon) * 1.5); }
.te-idee { width: 100%; min-height: 6rem; flex-wrap: wrap; justify-content: flex-start; gap: 0.5rem 1rem; padding: 0.75rem 1rem; text-align: left; font-size: 1.25rem; line-height: 1.3;
  background: #FFFFFF; border: 0.1875rem solid var(--te-fonce); box-shadow: inset 0 0 0 0.25rem var(--te-vif), 0 0.25rem 0 var(--te-clair); }
.te-idee[aria-pressed="true"] { background: var(--te-clair); border-color: var(--te-fonce); box-shadow: inset 0 0 0 0.125rem var(--te-fonce), 0 0.25rem 0 var(--te-fonce); }
.te-idee-texte { min-width: 0; flex: 1 1 6em; overflow-wrap: break-word; }
.te-icone-fond { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 4rem; height: 4rem; border-radius: 50%; background: var(--te-clair); border: 0.125rem solid var(--te-vif); }
.te-icone { width: 2.75rem; height: 2.75rem; fill: none; stroke: var(--lb-encre); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* Fin : calme, sans étoile ni bravo */
.te-fin { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: calc(var(--lb-rayon) * 1.5); background: var(--lb-fond-doux); }
.te-fin .te-question { margin-bottom: 0.25rem; }
.te-fin-tube .te-mini { width: 4.5rem; height: auto; }
.te-fin-texte { font-size: 1.25rem; font-weight: 700; margin: 0; }
.te-fin-actions { display: flex; flex-wrap: wrap; gap: var(--lb-pas); margin-top: calc(var(--lb-pas) * 2); }
.te-fin-actions .lb-bouton { flex: 1 1 12rem; }


/* Contraste renforcé : pas d'ombre décorative, traits pleins */
html[data-contraste="fort"] .te-niveau, html[data-contraste="fort"] .te-idee, html[data-contraste="fort"] .te-emotion, html[data-contraste="fort"] .te-gros { box-shadow: none; }
html[data-contraste="fort"] .te-niveau, html[data-contraste="fort"] .te-idee { border-color: var(--te-fonce); }
html[data-contraste="fort"] .te-echelle, html[data-contraste="fort"] .te-idees, html[data-contraste="fort"] .te-emotions { background: transparent; box-shadow: inset 0 0 0 0.125rem var(--lb-gris-trait); }

/* Petits écrans en hauteur : l'échelle tient sans défiler */
@media (max-height: 50em) {
  .te-question { font-size: 1.35rem; margin-bottom: var(--lb-pas); }
  .te-niveau { min-height: 4.25rem; padding-top: 0.25rem; padding-bottom: 0.25rem; row-gap: 0; }
  .te-desc { font-size: 0.85rem; line-height: 1.15; }
  .te-niveaux { gap: 0.25rem; }
  .te-echelle { padding-top: 0.5rem; padding-bottom: 3rem; }
  .te-suite-ligne { margin-top: var(--lb-pas); }
  .te-pastille-emotion { margin-bottom: 0.25rem; }
  .te-enfant { padding-top: var(--lb-pas); }
}
@media (max-height: 38em) {
  .te-desc { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
@media (min-width: 40em) {
  .te-emotions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .te-emotion { padding: 0.75rem 0.5rem; }
  .te-emotion .te-visage { width: 4rem; height: 4rem; }
  .te-emotions li:last-child { grid-column: 2; }
  .te-emotions li:last-child .te-emotion { flex-direction: column; gap: 0.25rem; }
}

/* Téléphone en paysage : le tube et les boutons à gauche, la question et la suite à droite */
@media (orientation: landscape) and (max-height: 32em) {
  #ecran-niveau { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 1.25rem; max-width: 60rem; }
  #ecran-niveau .te-echelle { grid-column: 1; grid-row: 1 / span 4; padding-bottom: 2.75rem; }
  #ecran-niveau .te-niveaux { gap: 0.25rem; }
  #ecran-niveau .te-pastille-emotion, #ecran-niveau .te-question, #ecran-niveau .te-suite-ligne, #ecran-niveau .te-adulte { grid-column: 2; }
  #ecran-niveau .te-adulte { margin-top: var(--lb-pas); }
  .te-niveau { min-height: 3.75rem; padding: 0.25rem 0.625rem; }
  .te-desc { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .te-niveau .te-chiffre { width: 2.25rem; height: 2.25rem; font-size: 1.2rem; }
  .te-niveaux { gap: 0.375rem; }
  .te-emotions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .te-emotion { font-size: 1rem; padding: 0.375rem; }
  .te-emotion .te-visage { width: 2.5rem; height: 2.5rem; }
  .te-question { font-size: 1.25rem; margin-bottom: var(--lb-pas); }
  #ecran-niveau .te-pastille-emotion { justify-self: start; }
  .te-emotions li:last-child { grid-column: auto; }
  .te-emotions li:last-child .te-emotion { flex-direction: column; gap: 0.25rem; }
  .te-idees { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .te-idee { min-height: 4.5rem; padding: 0.5rem 0.75rem; font-size: 1.1rem; }
  .te-icone-fond { width: 3rem; height: 3rem; }
  .te-icone { width: 2rem; height: 2rem; }
  .te-rappel { margin-bottom: 0.25rem; }
  .te-rappel .te-mini { width: 2rem; }
  #ecran-niveau .te-pastille-emotion { align-self: start; }
}

/* ---------- Impression : A4, noir sur blanc ---------- */
.te-impression { color: #000000; }
@media print {
  @page { size: A4; margin: 12mm; }
  .te-ecran { display: none !important; }
  .te-impression { display: block !important; }
  .te-i-page { page-break-after: always; break-after: page; }
  .te-i-page2 { page-break-after: auto; break-after: auto; }
  .te-impression h1 { font-size: 22pt; margin: 0 0 4mm; }
  .te-i-ligne { font-size: 13pt; margin: 0 0 5mm; border-bottom: 0.3mm solid #808080; padding-bottom: 2mm; min-height: 9mm; }
  .te-i-ligne-simple { font-size: 12pt; margin: 0 0 5mm; }
  .te-i-corps { display: grid; grid-template-columns: 30mm 1fr; column-gap: 5mm; }
  .te-i-tube { position: relative; }
  .te-i-svg { width: 30mm; height: auto; }
  .te-i-svg .te-verre { stroke: #000000; stroke-width: 1; fill: #FFFFFF; }
  .te-i-svg .te-liquide { fill: #FFFFFF; stroke: #808080; stroke-width: 0.6; }
  .te-i-svg .te-grad { stroke: #000000; stroke-opacity: 1; stroke-width: 0.6; }
  .te-i-svg .te-repere { stroke: #000000; stroke-width: 1; }
  .te-i-svg .te-reflet { display: none; }
  .te-i-niveaux { list-style: none; margin: 8mm 0 0; padding: 0; display: grid; grid-auto-rows: 33mm; row-gap: 3mm; }
  .te-i-niveau { border: 0.4mm solid #000000; border-radius: 3mm; padding: 2mm 3mm; overflow: hidden; }
  .te-i-nom { display: flex; align-items: center; gap: 3mm; margin: 0; font-size: 15pt; font-weight: 700; }
  .te-i-chiffre { display: inline-flex; align-items: center; justify-content: center; width: 9mm; height: 9mm; border: 0.5mm solid #000000; border-radius: 2mm; }
  .te-i-desc { margin: 0.5mm 0 1mm 12mm; font-size: 10pt; color: #333333; }
  .te-i-idees { list-style: none; margin: 0 0 0 12mm; padding: 0; }
  .te-i-idees li { display: flex; align-items: center; gap: 2mm; min-height: 7mm; font-size: 11.5pt; border-bottom: 0.2mm dotted #808080; }
  .te-i-idees .te-icone { width: 6mm; height: 6mm; stroke: #000000; stroke-width: 2.6; fill: none; flex: none; }
  .te-i-consigne { margin: 5mm 0 0; font-size: 13pt; font-weight: 700; }
  .te-i-pied { margin-top: 4mm; font-size: 9pt; color: #5F5B54; }
  .te-i-semaine { width: 100%; border-collapse: collapse; font-size: 12pt; }
  .te-i-semaine th, .te-i-semaine td { border: 0.4mm solid #000000; padding: 2mm; text-align: left; vertical-align: middle; }
  .te-i-semaine tbody tr { height: 26mm; }
  .te-i-semaine td { color: #5F5B54; letter-spacing: 1.5mm; }
}
