/* Mobile-friendly overrides for web terminal */

/* Global */
html {
  overscroll-behavior-x: none;
}

body {
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
}

/* Prevent zoom on input focus (iOS) */
input, textarea, select {
  font-size: 16px !important;
}

/* PWA standalone mode */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
  }
}

@media (max-width: 768px) {
  /* Home page — must scroll vertically */
  .min-h-screen {
    min-height: 100dvh !important;
    overflow-y: auto !important;
  }

  /* Terminal page — fill screen exactly, no scroll */
  .h-screen.w-screen {
    width: 100% !important;
    height: 100dvh !important;
  }

  /* Terminal container */
  .xterm {
    width: 100% !important;
    max-width: 100% !important;
    touch-action: pan-y;
  }

  .xterm-viewport {
    -webkit-overflow-scrolling: touch;
  }

  /* Hide split panel resize handle */
  .cursor-ew-resize {
    display: none !important;
  }

  /* Scale up Lucide icons — mobile only (touch devices) */

  /* Reduce desktop padding */
  .p-8 {
    padding: 1rem !important;
  }

  .p-6 {
    padding: 0.75rem !important;
  }

  /* Smaller headings */
  .text-4xl {
    font-size: 1.5rem !important;
  }

  .text-3xl {
    font-size: 1.25rem !important;
  }

  /* Grid to single column */
  .md\:grid-cols-2,
  .lg\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* Touch-friendly buttons — PWA standalone only */

  /* Modal dialogs fit mobile */
  .max-w-md {
    max-width: calc(100vw - 2rem) !important;
  }
}

/* Virtual keyboard open */
@media (max-width: 768px) and (max-height: 500px) {
  .mb-6, .mb-8 {
    margin-bottom: 0.25rem !important;
  }
}
