/* MVP OS 5.0.16 — restore native scrolling without changing desktop design */
html, body { min-height: 100%; }
body { overflow: auto !important; }
main { min-height: 0; overflow-y: auto !important; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.page { min-height: 0; }
.modal { overflow-y: auto !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-card {
  max-height: min(92vh, 980px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#page-chat { overflow: hidden !important; }
#page-chat .chat-shell,
#page-chat .messenger,
#page-chat .chat-layout { min-height: 0; }
#page-chat .chat-main,
#page-chat .chat-thread,
#page-chat .messages,
#page-chat .message-list { min-height: 0; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
@media (max-width: 820px) {
  body { overflow: auto !important; position: static !important; }
  .app { min-height: 100dvh; height: auto !important; }
  main { height: auto !important; min-height: 100dvh; overflow-y: auto !important; }
  .page { overflow: visible; }
  .modal { align-items: flex-start !important; padding: max(12px, env(safe-area-inset-top)) 10px max(16px, env(safe-area-inset-bottom)) !important; }
  .modal-card { width: 100% !important; max-height: calc(100dvh - 24px) !important; }
  #page-chat.active { height: calc(100dvh - env(safe-area-inset-bottom)); overflow: hidden !important; }
}
