/* ============================================
   NIVEAU 4 — Les Unités
   Styles spécifiques à ce chapitre
   ============================================ */

/* --- Démos visuelles d'unités --- */
.demo-unite {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.demo-unite .boite {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 6px;
  text-align: center;
  line-height: 1.3;
  min-height: 40px;
}

/* Boîtes pour les unités absolues */
.boite-px  { width: 96px; height: 96px; background: #2563eb; }
.boite-cm  { width: 3cm;  height: 3cm;  background: #7c3aed; }
.boite-mm  { width: 15mm; height: 15mm; background: #0891b2; }
.boite-in  { width: 1in;  height: 1in;  background: #059669; }
.boite-pt  { width: 72pt; height: 72pt; background: #d97706; }
.boite-pc  { width: 1pc;  height: 1pc;  background: #dc2626; }

/* Boîtes em vs rem */
.box-em-parent {
  font-size: 20px;
  background: #f1f5f9;
  border: 2px dashed #94a3b8;
  padding: 1rem;
  border-radius: 8px;
}

.box-em-enfant {
  font-size: 1.2em;
  background: #2563eb;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.box-rem {
  font-size: 1.2rem;
  background: #7c3aed;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-top: 0.5rem;
}

/* Démos viewport */
.demo-vh {
  width: 50vw;
  height: 20vh;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* Démo % vs fr */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.demo-grid .cell {
  background: #2563eb;
  color: #fff;
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Arbre de décision */
.decision-tree {
  background-color: var(--couleur-blanc);
  border: 1px solid var(--couleur-bordure);
  border-radius: var(--rayon);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--ombre);
  overflow-x: auto;
}

.decision-tree pre {
  background: transparent;
  color: inherit;
  box-shadow: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  text-align: left;
  display: inline-block;
}

/* Tableau comparatif stylisé */
.tableau-unites td:first-child {
  font-family: var(--police-code);
  font-weight: 600;
  color: var(--couleur-secondaire);
  white-space: nowrap;
}

.tableau-unites .relatif {
  color: var(--couleur-primaire);
}

.tableau-unites .absolu {
  color: var(--couleur-erreur);
}
