/* Composant commun PWA de l'usine (v1.0.0). Chaque produit garde sa charte : surcharger les variables
   --pwa-usine-fond, --pwa-usine-texte, --pwa-usine-accent (ou passer options.couleurs à creerProposition). */
.pwa-usine,
.pwa-usine-maj {
  --pwa-usine-fond: #ffffff;
  --pwa-usine-texte: #1f2937;
  --pwa-usine-accent: #1e3a8a;
  --pwa-usine-sur-accent: #ffffff;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 2147483000;
  max-width: 420px;
  max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto; /* petit écran, zoom ou grand texte : tout reste atteignable */
  overscroll-behavior: contain;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--pwa-usine-fond);
  color: var(--pwa-usine-texte);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.pwa-usine__entete { display: flex; align-items: center; gap: 10px; }
.pwa-usine__icone { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.pwa-usine__titre { flex: 1; font-size: 16px; }
.pwa-usine__fermer {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer;
}
.pwa-usine__interet, .pwa-usine__note { margin: 8px 0 0; }
.pwa-usine__note { font-size: 13px; opacity: 0.85; }
.pwa-usine__etapes { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: etape; }
.pwa-usine__etape {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; counter-increment: etape;
}
.pwa-usine__etape::before {
  content: counter(etape); flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--pwa-usine-accent); color: var(--pwa-usine-sur-accent); font-size: 13px; text-align: center; line-height: 22px;
}
.pwa-usine__pictogramme { flex: none; width: 22px; height: 22px; color: var(--pwa-usine-accent); }
.pwa-usine__pictogramme svg { width: 100%; height: 100%; }
.pwa-usine__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.pwa-usine__installer, .pwa-usine__secondaire {
  min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer;
}
.pwa-usine__installer { border: 0; background: var(--pwa-usine-accent); color: var(--pwa-usine-sur-accent); }
.pwa-usine__secondaire { border: 1px solid currentColor; background: transparent; color: inherit; }
.pwa-usine-maj { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.pwa-usine-synchro[data-etat="erreur"] { color: #b91c1c; }
.pwa-usine-synchro[data-etat="synchronise"] { color: #0c4a6e; }
@media (prefers-color-scheme: dark) {
  .pwa-usine, .pwa-usine-maj { --pwa-usine-fond: #111827; --pwa-usine-texte: #f3f4f6; --pwa-usine-accent: #93c5fd; --pwa-usine-sur-accent: #0b1220; }
}
@media (prefers-reduced-motion: no-preference) {
  .pwa-usine, .pwa-usine-maj { animation: pwa-usine-entree 0.2s ease-out; }
}
@keyframes pwa-usine-entree { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.pwa-usine button:focus-visible { outline: 3px solid var(--pwa-usine-accent); outline-offset: 2px; }
