/* ───────────────────────────────────────────────────────────────────────────
   ios-polish.css — Trezo PWA (2026-05-21)
   Patchs ciblés pour Safari iOS : safe-areas, scroll, zoom inputs, tap-highlight.
   À charger après Trezo.css.
─────────────────────────────────────────────────────────────────────────── */

/* ── Safe areas (notch, Dynamic Island, home indicator) ────────────────── */
html, body {
  overscroll-behavior-y: contain;            /* coupe le bounce qui révèle un fond blanc */
  -webkit-text-size-adjust: 100%;            /* empêche iOS d'agrandir le texte en paysage */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  /* padding-bottom géré au cas par cas (nav-bar mobile) */
}

/* ── Tap highlight propre ──────────────────────────────────────────────── */
a, button, input, select, textarea, [role="button"] {
  -webkit-tap-highlight-color: rgba(37, 99, 235, .18);  /* bleu Trezo translucide */
  -webkit-touch-callout: none;
}

/* ── Anti-zoom inputs Safari iOS (force ≥16px) ─────────────────────────── */
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: max(16px, 1rem);
  }
}

/* ── Momentum scroll sur listes scrollables ────────────────────────────── */
.scrollable,
.list-card,
.list-rows,
[data-scroll],
main,
.content {
  -webkit-overflow-scrolling: touch;
}

/* ── Empêche le double-tap zoom sur boutons (iOS 10+) ──────────────────── */
button, .btn, [role="button"] {
  touch-action: manipulation;
}

/* ── Désactive la sélection texte sur les UI controls ──────────────────── */
.nav-bar, .nav-item, .head, .topbar {
  -webkit-user-select: none;
  user-select: none;
}

/* ── Status bar style cohérent (texte clair sur fond sombre) ───────────── */
@media (display-mode: standalone) {
  body {
    /* L'app est en mode standalone : on tire parti de toute la hauteur */
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
}

/* ── Bouton flottant Q&A (déjà géré par ai-chat.js) — safe-area-aware ──── */
#trezo-qa-launcher {
  bottom: calc(20px + env(safe-area-inset-bottom)) !important;
}
