/* Prevent horizontal scrolling while maintaining accessibility */
html, body {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100%;
}

#app {
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  min-height: 100vh;
  height: auto;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    height: auto;
    min-height: 100%;
  }

  #app {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    position: relative;
    height: auto;
    min-height: 100vh;
  }

  /* Override min-h-screen on mobile */
  .min-h-screen {
    min-height: auto !important;
    height: auto !important;
  }

  /* Allow scrolling on chat container */
  .prompting, main, .space-y-4, .max-w-4xl {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    height: auto;
  }

  /* Prevent pull-to-refresh but allow scrolling */
  body {
    overscroll-behavior-y: contain;
  }
}

/* Allow text selection for accessibility */
input, textarea, [contenteditable] {
  user-select: text;
  touch-action: auto;
}
