/* Feuille mobile (voir js/feuille_mobile.js) : sur mobile, une fenêtre marquée data-feuille-mobile devient une feuille
   plein écran opaque. Le FOND couvre tout l'écran (et 160 px au-delà en bas : le clavier iOS translucide passe par-dessus
   du blanc). Seule la CARTE suit la zone visible (--cmp-h / --cmp-t posées par le script avec visualViewport).
   Ordinateur et tablette large : rien ne change. */
html.feuille-ouverte { overflow: hidden; }
@media (max-width: 767.98px) {
  html body [data-feuille-mobile].feuille-mobile--ouverte {
    position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: -160px !important;
    height: auto !important; width: auto !important; margin: 0 !important; padding: 0 !important; transform: none !important;
    z-index: 10000 !important; background: #fff !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    opacity: 1 !important; overflow: hidden !important; visibility: visible !important;
  }
  html body [data-feuille-mobile].feuille-mobile--ouverte .feuille-mobile__fond { display: none !important; }
  html body [data-feuille-mobile].feuille-mobile--ouverte .feuille-mobile__passage { display: contents !important; }
  html body .feuille-mobile__panel.feuille-mobile__panel {
    position: absolute !important; left: 0 !important; right: 0 !important; top: var(--cmp-t, 0px) !important; bottom: auto !important;
    height: var(--cmp-h, 100dvh) !important; width: auto !important; max-width: none !important; max-height: none !important; min-height: 0 !important;
    margin: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; transform: none !important;
    background: #fff; padding-top: var(--pwa-offset, 0px) !important; box-sizing: border-box !important;
    overflow-y: auto !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  /* Barre d'actions collée en bas de la feuille (au-dessus du clavier). */
  html body .feuille-mobile__panel [data-feuille-pied] {
    position: sticky !important; bottom: 0 !important; background: #fff; z-index: 2;
    padding-bottom: calc(10px + var(--sab, 0px)) !important; border-top: 1px solid #f1f5f9;
  }
  /* Champs à 16 px : iOS ne zoome pas dessus. */
  html body .feuille-mobile__panel input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  html body .feuille-mobile__panel textarea,
  html body .feuille-mobile__panel select { font-size: 16px !important; }
  /* La page derrière est invisible (rien ne peut transparaître sous le flou iOS) ; la feuille reste visible. */
  html.feuille-ouverte body > * { visibility: hidden !important; }
  html.feuille-ouverte body .feuille-mobile--ouverte { visibility: visible !important; }
  html.feuille-ouverte .app-mobile-nav { visibility: hidden !important; }
}
