/* =====================================================================================================================
   Composants du socle (anatomie du relevé 01 § 4). Valeurs en points iOS = px CSS.
   ===================================================================================================================== */

/* ---------- icônes ---------- */
.ak-icone { display: inline-block; flex: none; vertical-align: middle; overflow: visible; }

/* ---------- filets (relevé 01 § 1.7) ---------- */
.ak-filet { height: var(--trait-fin); background: var(--couleur-filet); flex: none; }
.ak-filet--moitie { background: var(--couleur-filet-moitie); }
.ak-filet--systeme { background: var(--couleur-filet-systeme); height: 1px; transform: scaleY(0.34); transform-origin: top; } /* 1 px physique */
.ak-filet--vertical { width: var(--trait-fin); height: auto; align-self: stretch; }

/* ---------- texte qui se réduit ---------- */
.ak-ajuste { display: block; white-space: nowrap; overflow: hidden; min-width: 0; }

/* ---------- chevron qui tourne de −90° une fois replié ---------- */
.ak-chevron { display: inline-flex; color: var(--couleur-texte-3); transition: transform var(--duree-doux) var(--ressort); }
.ak-chevron[data-replie] { transform: rotate(-90deg); }

/* ---------- repli animé : hauteur (grille 1fr → 0fr) + fondu + glissement vers le haut ---------- */
.ak-repli {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--duree-doux) var(--ressort);
}
.ak-repli[data-replie] { grid-template-rows: 0fr; }
.ak-repli__interieur {
  min-height: 0;
  overflow: hidden;
  transition: opacity var(--duree-doux) var(--ressort), transform var(--duree-doux) var(--ressort),
    visibility 0s linear 0s;
}
.ak-repli[data-replie] > .ak-repli__interieur {
  opacity: 0;
  transform: translateY(-12px);
  visibility: hidden;
  transition: opacity var(--duree-doux) var(--ressort), transform var(--duree-doux) var(--ressort),
    visibility 0s linear var(--duree-doux);
}

/* ---------- en-tête de carte (CarteVerre, Carte) ---------- */
.ak-entete {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  text-align: left;
}
.ak-entete__icone { width: 24px; flex: none; display: inline-flex; justify-content: center; color: var(--couleur-texte-2); }
.ak-entete__textes { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* ---------- CarteVerre (rayon 20) ---------- */
.ak-carte-verre { display: flex; flex-direction: column; min-width: 0; }

/* ---------- Carte (rayon 16, clipped) ---------- */
.ak-carte { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.ak-carte__bouton { display: block; width: 100%; border-radius: var(--rayon-lg) var(--rayon-lg) 0 0; }
/* Carte non repliable : en Swift l'en-tête est un bouton .plain désactivé (Grille.swift:163) qu'iOS estompe ; opacité mesurée
   sur reference/moniteur/02 (titre, sous-titre et icône de la carte produit) : 0,50. Posée sur .ak-entete lui-même (une règle
   d'écran sur le même élément la remplace au lieu de s'y multiplier). */
.ak-entete.ak-entete--inactif { opacity: 0.5; }

/* ---------- Groupe ---------- */
.ak-groupe { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ak-groupe__titre {
  display: flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 8px 0 16px;
  width: 100%;
}
.ak-groupe__titre--fixe { min-height: 0; }
.ak-groupe__panneau { display: flex; flex-direction: column; }
.ak-groupe__panneau > .ak-filet:first-child { display: none; }

/* ---------- GrilleChiffres, Cellule, JaugeSeuils ---------- */
.ak-grille { display: flex; flex-direction: column; min-width: 0; }
.ak-grille__heros--filet { border-bottom: var(--trait-fin) solid var(--couleur-filet); }
.ak-grille__rangee {
  display: grid;
  grid-template-columns: repeat(var(--colonnes, 2), minmax(0, 1fr));
  align-items: stretch;
}
.ak-grille__rangee + .ak-grille__rangee { border-top: var(--trait-fin) solid var(--couleur-filet); }
.ak-grille__rangee > .ak-cellule + .ak-cellule { border-left: var(--trait-fin) solid var(--couleur-filet); }
.ak-cellule {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  padding: 16px;
  min-width: 0;
}
.ak-cellule--heros { gap: 8px; }
.ak-cellule__valeur { line-height: var(--interligne); }
.ak-cellule__bas { display: flex; align-items: center; gap: 8px; min-height: 16px; min-width: 0; }
.ak-cellule__bas:empty { min-height: 16px; }

.ak-jauge { position: relative; height: 12px; width: 100%; }
.ak-jauge__rail {
  position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px;
  border-radius: var(--rayon-capsule); background: var(--couleur-surface-3);
}
.ak-jauge__trait { position: absolute; top: 1px; width: 1.5px; height: 10px; }
.ak-jauge__trait--be { background: var(--couleur-texte-3); }
.ak-jauge__trait--cible { background: var(--couleur-texte-2); }
.ak-jauge__point { position: absolute; top: 2px; width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Globe / Pastille (avatar) ---------- */
.ak-globe { position: relative; display: inline-flex; flex: none; }
.ak-globe__disque {
  position: relative; width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--couleur-surface-2);
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: var(--couleur-texte);
}
.ak-globe__disque::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: var(--anneau-l, 1px) solid var(--anneau, var(--couleur-filet));
  pointer-events: none;
}
.ak-globe__initiale { font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.ak-globe__image {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; transition: opacity 200ms ease-out;
}
.ak-globe__etat {
  position: absolute; right: -2px; bottom: -2px;
  width: 11px; height: 11px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--couleur-surface);
}

/* ---------- Ligne (min 52) ---------- */
.ak-ligne {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 16px; min-height: 52px;
}
.ak-ligne__gauche { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ak-ligne__valeur { flex: none; text-align: right; }

/* ---------- RangeeBouton + RangeeStyle (min 56, pressé = surface3 à 60 % dès le toucher, sans animation) ---------- */
.ak-rangee-bouton {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 0 16px;
  text-align: left; color: var(--couleur-texte);
  transition: none;
}
.ak-rangee-bouton:active, .ak-rangee-bouton.ak-presse { background: var(--couleur-pressee); }
@media (hover: hover) and (pointer: fine) {
  .ak-rangee-bouton:hover { background: rgba(243, 239, 232, 0.035); }
  .ak-rangee-bouton:active { background: var(--couleur-pressee); }
}
.ak-rangee-bouton__contenu { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.ak-rangee-bouton__chevron { flex: none; display: inline-flex; color: var(--couleur-texte-3); }

/* « ⋯ » 44 × 44 */
.ak-bouton-plus {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--couleur-texte-3);
}
.ak-bouton-plus:active { opacity: 0.6; }

/* Boutons « plain » : léger affaiblissement à l'appui (comportement iOS) */
.ak-carte__bouton:active, .ak-groupe__titre:active, .ak-en-savoir-plus:active, .ak-ligne-alerte:active { opacity: 0.7; }
.ak-carte__bouton:active { opacity: 1; }
.ak-carte__bouton:active .ak-entete { opacity: 0.7; }

/* ---------- Bandeau (rayon 10, 16 × 12) ---------- */
.ak-bandeau {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--rayon-md);
  color: var(--couleur-texte-2); background: var(--couleur-surface-2);
}
.ak-bandeau--alerte { color: var(--couleur-alerte); background: var(--couleur-alerte-doux); }
.ak-bandeau--erreur { color: var(--couleur-perte); background: var(--couleur-perte-doux); }

/* ---------- Vide ---------- */
.ak-vide {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 32px; width: 100%; text-align: center;
}

/* ---------- BoutonRond, PastillePeriode ---------- */
.ak-bouton-rond {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.ak-pastille-periode {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px; flex: none;
  white-space: nowrap; color: var(--couleur-texte);
}
/* Barre de commandes : [actualiser] [période] … « maj HH:MM » (GlassEffectContainer spacing 10) */
.ak-barre-commandes { display: flex; align-items: center; gap: 10px; }
.ak-barre-commandes > .ak-meta { margin-left: auto; padding-left: 4px; white-space: nowrap; }

/* ---------- EnSavoirPlus ---------- */
.ak-en-savoir-plus { display: block; margin: 16px auto 0; text-align: center; padding: 4px 8px; }

/* ---------- TubeVerre, BarreParts (matière « tube de verre ») ---------- */
.ak-tube { position: relative; width: 100%; border-radius: var(--rayon-capsule); background: var(--voile-texte-10); }
.ak-tube__plein {
  position: relative; display: block; height: 100%;
  border-radius: var(--rayon-capsule);
  box-shadow: inset 0 0 0 var(--trait-fin) rgba(255, 255, 255, 0.18);
}
.ak-tube > .ak-tube__plein { position: absolute; left: 0; top: 0; }
.ak-tube__reflet {
  position: absolute; left: 2px; right: 2px; top: 1px;
  border-radius: var(--rayon-capsule);
  background: linear-gradient(rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.ak-barre-parts { display: flex; gap: 2px; width: 100%; }
.ak-barre-parts__part { flex-basis: 0; flex-shrink: 1; min-width: 6px; transition: flex-grow var(--duree-liste) var(--ressort); }

/* ---------- anneaux ---------- */
.ak-anneau { position: relative; display: inline-flex; flex: none; }
.ak-anneau svg { display: block; }
.ak-anneau__arc--progression { transition: stroke-dasharray var(--duree-anneau) ease-out; }
.ak-anneau__arc--pourcent { transition: stroke-dasharray var(--duree-anneau-pourcent) ease-out; }
.ak-anneau__centre {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ak-anneau--tourne { animation: ak-tourne var(--duree-roue) linear infinite; }
@keyframes ak-tourne { to { transform: rotate(360deg); } }

/* ---------- BarreSegments, BarrePostes ---------- */
.ak-barre-segments { display: flex; gap: 2px; width: 100%; }
.ak-barre-segments__seg { flex-basis: 0; min-width: var(--h, 10px); border-radius: calc(var(--h, 10px) / 2); }
.ak-barre-postes { display: flex; gap: 2px; width: 100%; }
.ak-barre-postes > span { flex-basis: 0; min-width: 2px; border-radius: var(--rayon-xs); }

/* ---------- PuceEtat (hauteur 30, capsule) ---------- */
.ak-puce-etat {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 30px; padding: 0 10px;
  border-radius: var(--rayon-capsule);
  background: var(--voile-texte-06);
  border: var(--trait-fin) solid var(--voile-texte-08);
  white-space: nowrap;
}
/* Rangée de puces qui défile avec un fondu du bord droit (fonduDroit(36)) */
.ak-rangee-puces {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding-right: 36px;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
}
.ak-rangee-puces::-webkit-scrollbar { display: none; }

/* ---------- LigneAlerte (min 44, fond couleur 12 %) ---------- */
.ak-ligne-alerte {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 44px; padding: 0 16px;
  text-align: left; color: var(--couleur-texte);
}
.ak-ligne-alerte__icone { width: 22px; flex: none; display: inline-flex; justify-content: center; }
.ak-ligne-alerte__texte { flex: 1; min-width: 0; }

/* ---------- Colonnes (grand écran) : cartes à tour de rôle dans N colonnes flex ---------- */
/* Sous 1100 px le composant ne rend aucun conteneur. Écart vertical et horizontal = --espace-bloc (pile des écrans). */
.ak-colonnes {
  display: flex;
  align-items: flex-start;
  gap: var(--ecart-colonnes, var(--espace-bloc, 24px));
  width: 100%;
  min-width: 0;
  grid-column: 1 / -1;          /* posé dans une grille (.ak-grille-cartes) : toute la ligne */
}
.ak-colonnes__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ecart-colonnes, var(--espace-bloc, 24px));
}
.ak-colonnes__col > * { min-width: 0; }
/* option `equilibre` (Moniteur) : une grille à lignes de 1 px, chaque carte posée par Colonnes (colonne la plus courte) ; la case
   garde la hauteur de son contenu (align-self: start), mesurée par un ResizeObserver. */
.ak-colonnes--equilibre {
  display: grid;
  grid-auto-rows: 1px;
  row-gap: 0;
  column-gap: var(--ecart-colonnes, var(--espace-bloc, 24px));
  align-items: start;
}
.ak-colonnes__case { min-width: 0; align-self: start; display: flex; flex-direction: column; }
.ak-colonnes__case > * { min-width: 0; }
