/* ==================================================================
   pwa/css/pwa.css — Styles PWA : bandeaux, mode installé, mode web view natif.
   ================================================================== */

/* Bandeau hors ligne */
.pwa-offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1060;
  padding: calc(.45rem + env(safe-area-inset-top)) 1rem .45rem; text-align: center;
  background: #111827; color: #fff; font-size: .85rem; font-weight: 600;
}
.pwa-offline i { color: #FFB4B9; margin-right: .4rem; }

/* Carte d'installation et de mise à jour (au-dessus de la navigation basse) */
.pwa-card {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 1055; width: min(94%, 420px);
  bottom: calc(var(--nav-h, 76px) + 22px + env(safe-area-inset-bottom));
  background: #fff; border-radius: 22px; padding: 1rem; display: flex; gap: .85rem; align-items: center;
  box-shadow: 0 16px 40px rgba(17, 24, 39, .18); border: 1px solid #F1F2F5; animation: pwaUp .35s cubic-bezier(.2, .8, .2, 1) both;
}
.pwa-card[hidden] { display: none; }
.pwa-card img { width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; }
.pwa-card .txt { flex: 1; min-width: 0; line-height: 1.3; }
.pwa-card .txt b { display: block; color: #0B1640; font-weight: 800; }
.pwa-card .txt span { color: #64748B; font-size: .82rem; }
.pwa-card .txt i.fa-arrow-up-from-bracket { color: #1E7BE0; }
.pwa-card .btn-pwa {
  border: none; border-radius: 14px; padding: .65rem 1rem; font-weight: 700; background: #E50914; color: #fff;
  box-shadow: 0 8px 18px rgba(229, 9, 20, .25); white-space: nowrap;
}
.pwa-card .btn-x { border: none; background: transparent; color: #94A3B8; padding: .25rem .4rem; font-size: 1.05rem; }
@keyframes pwaUp { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 992px) { .pwa-card { bottom: 28px; left: auto; right: 110px; transform: none; animation: none; } }

/* Application installée (écran d'accueil) */
.pwa-standalone body { overscroll-behavior-y: none; }

/* Web view natif (Android / iOS) */
.in-app body {
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;          /* ressenti « application native » */
  -webkit-touch-callout: none;
}
.in-app input, .in-app textarea, .in-app [contenteditable], .in-app .selectable,
.in-app .detail-row b, .in-app #refCode { -webkit-user-select: text; user-select: text; }
.in-app .app-main { padding-top: calc(1rem + env(safe-area-inset-top)); }
.in-app .pwa-card#pwa-install { display: none !important; }  /* jamais d'invite d'installation dans l'appli native */

/* Hors ligne : on signale les actions qui nécessitent le réseau */
.is-offline form button[type="submit"], .is-offline form button:not([type]) { opacity: .55; }
