/* AutoGestão Pro: correções isoladas de modais e formulários em dispositivos móveis. */
/* Somente sobreposições que contenham formulários; não alterar layout de páginas comuns. */
.fixed.inset-0:has(form) { max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.fixed.inset-0:has(form) > div:first-child { max-height: min(94dvh, 980px); overflow-x: hidden; overflow-y: auto; min-width: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 767px) {
  .fixed.inset-0:has(form) { max-height: 100dvh; padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .fixed.inset-0:has(form) > div:first-child { width: 100%; min-width: 0; max-width: min(100%, 100vw - 12px); max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px); overflow-x: hidden; overflow-y: auto; box-sizing: border-box; margin: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .fixed.inset-0:has(form) form { min-width: 0; max-width: 100%; }
  .fixed.inset-0:has(form) form :is(input, select, textarea) { min-width: 0; max-width: 100%; box-sizing: border-box; }
  .fixed.inset-0:has(form) form .grid { min-width: 0; }
  .fixed.inset-0:has(form) form .grid.grid-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .fixed.inset-0:has(form) :is(button, a[role="button"]) { touch-action: manipulation; }
  .fixed.inset-0:has(form) :is(.sticky.bottom-0, .agp-payment-actions) { padding-bottom: max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
}
@media (max-width: 375px) {
  .fixed.inset-0:has(form) form .grid.grid-cols-2 { grid-template-columns: minmax(0, 1fr); }
}
.agp-docs-overlay { padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); }
.agp-docs-dialog { max-width: 100%; max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); overflow-x: hidden; overflow-y: auto; }
