/* Base commune des outils LeoBelo, version 1.
   Classes préfixées lb- ; un outil ajoute les siennes avec son propre préfixe. */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: var(--lb-texte)/var(--lb-interligne) var(--lb-police); color: var(--lb-encre); background: var(--lb-fond); }
main { max-width: 40rem; margin: 0 auto; padding: calc(var(--lb-pas) * 2); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 calc(var(--lb-pas) * 2); }
h2 { font-size: 1.25rem; line-height: 1.25; margin: calc(var(--lb-pas) * 3) 0 var(--lb-pas); }
p { margin: 0 0 var(--lb-pas); }
[hidden] { display: none !important; }
.lb-info { font-size: 0.9375rem; color: var(--lb-gris-texte); }
.lb-visuellement-cache { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* En-tête : trois petits cubes et nom de l'outil */
.lb-entete { display: flex; align-items: center; gap: var(--lb-pas); min-height: var(--lb-cible); }
.lb-marque-cubes { height: 1.5rem; width: auto; flex: none; }
.lb-cubes { display: inline-flex; gap: 0.1875rem; flex: none; }
.lb-cubes span { width: 0.75rem; height: 0.75rem; border-radius: 0.1875rem; }
.lb-cubes span:nth-child(1) { background: var(--lb-orange-vif); }
.lb-cubes span:nth-child(2) { background: var(--lb-bleu-vif); }
.lb-cubes span:nth-child(3) { background: var(--lb-vert-vif); }
.lb-cubes span { box-shadow: inset 0 0 0 0.0625rem rgba(0, 0, 0, 0.25); }

/* Boutons */
.lb-bouton { display: inline-flex; align-items: center; justify-content: center; gap: var(--lb-pas);
  min-height: var(--lb-cible); min-width: var(--lb-cible); padding: 0.5rem 1.25rem; font: inherit; font-weight: 700; line-height: 1.2;
  color: var(--lb-encre); background: var(--lb-bleu-vif); border: var(--lb-trait) solid var(--lb-bleu-fonce); border-radius: var(--lb-rayon);
  cursor: pointer; text-align: center; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.lb-bouton.lb-enfant { min-height: var(--lb-cible-enfant); min-width: var(--lb-cible-enfant); font-size: 1.25rem; }
.lb-bouton.lb-secondaire { color: var(--lb-bleu-fonce); background: var(--lb-fond); }
.lb-bouton.lb-discret { color: var(--lb-encre); background: var(--lb-fond); border-color: var(--lb-gris-trait); font-weight: 400; }
.lb-bouton[aria-pressed="true"] { color: var(--lb-encre); background: var(--lb-bleu-vif); border-color: var(--lb-bleu-fonce); }
.lb-bouton:disabled { opacity: 0.5; cursor: not-allowed; }
:focus-visible { outline: 0.1875rem solid var(--lb-encre); outline-offset: 0.1875rem; }

/* Champs */
.lb-champ { display: block; margin: var(--lb-pas) 0; }
.lb-champ > span { display: block; font-weight: 700; margin-bottom: 0.25rem; }
.lb-champ input[type="text"], .lb-champ input[type="number"] { width: 100%; min-height: var(--lb-cible); padding: 0.5rem 0.75rem;
  font: inherit; color: var(--lb-encre); background: var(--lb-blanc); border: var(--lb-trait) solid var(--lb-gris-trait); border-radius: var(--lb-rayon); }

/* Panneau de réglages commun */
.lb-reglages { margin-top: calc(var(--lb-pas) * 3); border: 0.0625rem solid var(--lb-gris-trait); border-radius: var(--lb-rayon); padding: 0 calc(var(--lb-pas) * 2); background: var(--lb-fond); }
.lb-reglages > summary { min-height: var(--lb-cible); display: flex; align-items: center; gap: var(--lb-pas); font-weight: 700; cursor: pointer; list-style: none; }
.lb-reglages > summary::-webkit-details-marker { display: none; }
.lb-reglages > summary::before { content: "+"; display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border: var(--lb-trait) solid currentColor; border-radius: 0.375rem; font-weight: 700; }
.lb-reglages[open] > summary::before { content: "\2212"; }
.lb-reglages[open] { padding-bottom: calc(var(--lb-pas) * 2); }
.lb-groupe { border: 0; margin: calc(var(--lb-pas) * 2) 0 0; padding: 0; min-width: 0; }
.lb-groupe > legend { font-weight: 700; padding: 0; margin-bottom: 0.25rem; }
.lb-groupe + .lb-groupe { margin-top: calc(var(--lb-pas) * 3); box-shadow: 0 -0.75rem 0 -0.6875rem var(--lb-gris-filet); }
.lb-case { display: flex; align-items: center; gap: 0.75rem; min-height: var(--lb-cible); cursor: pointer; }
.lb-case input[type="checkbox"], .lb-case input[type="radio"] { width: 1.5rem; height: 1.5rem; margin: 0; flex: none; accent-color: var(--lb-bleu-fonce); }
.lb-choix { display: flex; flex-wrap: wrap; gap: 0 calc(var(--lb-pas) * 2); }
.lb-curseur { display: flex; align-items: center; gap: 0.75rem; min-height: var(--lb-cible); }
.lb-curseur input[type="range"] { flex: 1; min-height: var(--lb-cible); accent-color: var(--lb-bleu-fonce); }
.lb-rangee { display: flex; flex-wrap: wrap; gap: var(--lb-pas); margin-top: var(--lb-pas); }
.lb-fichier { position: relative; }
.lb-fichier input[type="file"] { position: absolute; top: 0; right: 0; bottom: 0; left: 0; opacity: 0; width: 100%; cursor: pointer; }
.lb-fichier:focus-within { outline: 0.1875rem solid var(--lb-encre); outline-offset: 0.1875rem; }
.lb-fichier input[type="file"]:focus-visible { outline: none; }
.lb-message { min-height: 1.5em; margin-top: var(--lb-pas); font-weight: 700; }

/* Bandeaux du socle : nouvelle version, rappel d'installation */
.lb-bandeau { display: flex; flex-wrap: wrap; align-items: center; gap: var(--lb-pas); margin: var(--lb-pas) 0; padding: var(--lb-pas) calc(var(--lb-pas) * 2);
  background: var(--lb-bleu-clair); border: 0.0625rem solid var(--lb-bleu-moyen); border-radius: var(--lb-rayon); }
.lb-bandeau p { flex: 1 1 14rem; margin: 0; }

/* Bloc de soutien : prévu, masqué tant que la page « soutenir » n'existe pas */
.lb-soutien { margin-top: calc(var(--lb-pas) * 3); padding: calc(var(--lb-pas) * 2); border: 0.0625rem solid var(--lb-gris-trait); border-radius: var(--lb-rayon); }

/* Mode calme et animations réduites : rien ne bouge sans nécessité */
html[data-animations="reduites"] *, html[data-animations="reduites"] *::before, html[data-animations="reduites"] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* Impression : noir sur blanc, sans boutons ni réglages */
.lb-impression-seule { display: none; }
@media print {
  @page { margin: 12mm; }
  html, body { background: #FFFFFF !important; color: #000000 !important; }
  .lb-bouton, .lb-reglages, .lb-info, .lb-ecran-seul, .lb-bandeau, .lb-soutien { display: none !important; }
  .lb-impression-seule { display: block !important; }
}
