/* iPhone / PWA safe-area and touch responsiveness fixes */
html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .header,
  .dashboard-header {
    padding-top: env(safe-area-inset-top);
  }

  .nav.mobile-active,
  .mobile-nav,
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-menu-toggle {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: calc(20px + env(safe-area-inset-right));
  }
}

/* Fix iOS input zoom */
@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Fix iOS 100vh issue */
@supports (-webkit-touch-callout: none) {
  body {
    min-height: -webkit-fill-available;
  }

  .full-height {
    min-height: -webkit-fill-available;
  }
}

@media (hover: none) and (pointer: coarse) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .nav,
  .nav-btn,
  .theme-toggle,
  .action-btn,
  .submit-btn,
  .cancel-btn,
  .va-card,
  .stat-card,
  .form-container {
    transition-duration: 120ms !important;
  }

  .mobile-nav-overlay {
    touch-action: none;
  }
}
