/* Niveau à bulle : styles propres à l'outil. */
.o-niveau-bulle [hidden] { display: none !important; }
.o-niveau-bulle { --niv-liquide: #c9e86a; --niv-liquide-ok: #7fd36b; --niv-bulle: rgba(255, 255, 255, .92); }
.o-niveau-bulle .o-niveau-bulle-haut { border-top: 0; padding-top: 0; justify-content: center; }
.atelier .o-niveau-bulle .btn[aria-pressed="true"] { background: var(--marque); border-color: var(--marque); color: var(--sur-marque); }
.o-niveau-bulle-info { margin: 0; padding: 8px 12px; border-radius: var(--rayon-petit); background: var(--surface-2); color: var(--texte); font-size: .95rem; max-width: 560px; }
.o-niveau-bulle-boutons-capteur, .o-niveau-bulle-commandes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.o-niveau-bulle-fiole { position: relative; background: var(--niv-liquide); border: 3px solid var(--texte-2); box-shadow: inset 0 0 18px rgba(0, 0, 0, .25); touch-action: none; user-select: none; }
.o-niveau-bulle.niveau .o-niveau-bulle-fiole { background: var(--niv-liquide-ok); border-color: var(--ok-texte); }
.o-niveau-bulle.demo .o-niveau-bulle-fiole { cursor: crosshair; }
.o-niveau-bulle-bulle { position: absolute; display: block; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 25%, var(--niv-bulle) 45%, rgba(255, 255, 255, .55) 100%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); --fx: 0; --fy: 0; }

.o-niveau-bulle-rond { width: min(260px, 72vw); aspect-ratio: 1; border-radius: 50%; }
.o-niveau-bulle-rond .o-niveau-bulle-bulle { left: calc(50% - 22px + var(--fx) * (50% - 25px)); top: calc(50% - 22px + var(--fy) * (50% - 25px)); }
.o-niveau-bulle-croix { position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .3), rgba(0, 0, 0, .3)) center / 1px 100% no-repeat, linear-gradient(rgba(0, 0, 0, .3), rgba(0, 0, 0, .3)) center / 100% 1px no-repeat; border-radius: 50%; }
/* Cercle de la zone ±0,5° : bulle (44 px) + course à 0,5° (tanh(0,125) = 0,12435) + bordure. */
.o-niveau-bulle-cible { position: absolute; left: 50%; top: 50%; box-sizing: border-box; width: calc(48px + 0.12435 * (100% - 50px)); aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid rgba(0, 0, 0, .55); border-radius: 50%; }

.o-niveau-bulle-tube { width: min(520px, 100%); height: 64px; border-radius: 32px; }
.o-niveau-bulle-tube .o-niveau-bulle-bulle { width: 80px; height: 40px; top: 9px; border-radius: 20px; left: calc(50% - 40px + var(--fx) * (50% - 43px)); }
.o-niveau-bulle-repere { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0, 0, 0, .55); }
/* Repères de la zone ±0,5° : demi-bulle (40 px) + course à 0,5°. */
.o-niveau-bulle-repere:first-of-type { left: calc(50% - 42px - 0.12435 * (50% - 43px)); }
.o-niveau-bulle-repere:nth-of-type(2) { left: calc(50% + 40px + 0.12435 * (50% - 43px)); }

.o-niveau-bulle-grand { margin: 4px 0 0; font: 800 3.4rem/1 var(--police); font-variant-numeric: tabular-nums; color: var(--texte); }
.o-niveau-bulle-etat { display: block; min-height: 1.6em; padding: 4px 14px; border-radius: 999px; font-weight: 700; background: var(--erreur-fond); color: var(--erreur-texte); }
.o-niveau-bulle-etat:empty { visibility: hidden; }
.o-niveau-bulle.niveau .o-niveau-bulle-etat { background: var(--ok-fond); color: var(--ok-texte); }
.o-niveau-bulle.fige .o-niveau-bulle-etat { background: var(--surface-2); color: var(--texte); }
.o-niveau-bulle.fige .o-niveau-bulle-grand { color: var(--marque); }
.o-niveau-bulle-axes { display: grid; gap: 6px; margin: 0; width: min(520px, 100%); }
.o-niveau-bulle-axes > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 6px 12px; border-radius: var(--rayon-petit); background: var(--surface-2); text-align: left; }
.o-niveau-bulle-axes dt { color: var(--texte-2); font-size: .92rem; }
.o-niveau-bulle-axes dd { margin: 0; font: 600 1rem var(--mono); }
.o-niveau-bulle-axes small { font: 400 .85rem var(--police); color: var(--texte-2); }
.o-niveau-bulle select { min-height: 42px; }
.o-niveau-bulle .o-niveau-bulle-aide { display: block; margin-top: 10px; }
@media (max-width: 480px) {
  .o-niveau-bulle-grand { font-size: 2.8rem; }
}
