/* Status native document scrolling — R33
 *
 * Normal pages use the browser's native document scroll root. No full-page
 * wrapper, html/body overflow setting, touch-action rule or momentum scroller
 * is allowed to compete with the first iOS finger movement.
 */

body.status-document-scroll-v33 {
  position: static !important;
  width: 100%;
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow: visible !important;
  scroll-behavior: auto !important;
}

body.status-document-scroll-v33 #container {
  position: relative;
  width: 100%;
  height: auto !important;
  min-height: calc(100svh - var(--status-navbar-actual-height, var(--status-navbar-height, 56px))) !important;
  max-height: none !important;
  overflow: visible !important;
  contain: none !important;
}

@supports not (height: 100svh) {
  body.status-document-scroll-v33 #container {
    min-height: calc(100vh - var(--status-navbar-actual-height, var(--status-navbar-height, 56px))) !important;
  }
}

/* Clip accidental horizontal paint without creating another scroll container. */
@supports (overflow: clip) {
  html:has(body.status-document-scroll-v33),
  body.status-document-scroll-v33 {
    overflow-x: clip !important;
  }
}

/* Legitimate overlay scrollers remain self-contained. */
body.status-document-scroll-v33 .modal-body,
body.status-document-scroll-v33 .status-navbar .dropdown-menu,
body.status-document-scroll-v33 .status-user-dropdown,
body.status-document-scroll-v33 .icon-picker-list,
body.status-document-scroll-v33 .iconpicker-popover,
body.status-document-scroll-v33 .icon-picker-popover {
  -webkit-overflow-scrolling: touch;
}

@supports (-webkit-touch-callout: none) {
  html.status-ios-document-scroll-v33 {
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    scroll-behavior: auto !important;
  }

  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    touch-action: auto !important;
    -webkit-overflow-scrolling: auto !important;
  }

  /* Structural wrappers must remain in normal document flow. */
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 #container,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-page-container,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-public-container,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-admin-container,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-admin-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-public-list-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-admin-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-public-list-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-form-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-task-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-task-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-notices-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-notices-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-alert-admin-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-alert-admin-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-alert-form-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-alert-form-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-stats-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-stats-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .factions-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .user-settings-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .user-settings-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .edit-event-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .edit-event-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-admin-editor,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-admin-tasks,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-admin-items,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .updater-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-system-admin-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-gps-admin-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-info-page,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-info-shell,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-event-tabs,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .tab-content,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .tab-pane {
    position: relative;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    contain: none !important;
    transform: none;
    -webkit-overflow-scrolling: auto !important;
  }

  /* Horizontal tables may pan sideways, but no fixed vertical body is kept. */
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .table-responsive,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .dataTables_scroll,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .dataTables_scrollBody {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    touch-action: auto !important;
    -webkit-overflow-scrolling: auto !important;
  }

  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .factions-page .flag-table-wrapper {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .settings-nav,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-editor-subnav,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .updater-tabs-card .nav-tabs,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .updater-header-status {
    overflow-y: hidden !important;
    touch-action: auto !important;
    -webkit-overflow-scrolling: auto !important;
  }

  html.status-ios-document-scroll-v33 body.status-document-scroll-v33.modal-open {
    overflow: hidden !important;
  }

  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .modal,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .modal-dialog,
  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .modal-content {
    touch-action: auto;
  }

  html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  @media (max-width: 767.98px) {
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-task-toolbar,
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-notices-toolbar,
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-public-list-toolbar,
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-stats-toolbar,
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-admin-tasks .admin-toolbar {
      position: static !important;
      top: auto !important;
    }

    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .settings-nav,
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-editor-subnav,
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .updater-tabs-card .nav-tabs,
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .updater-header-status {
      flex-wrap: wrap !important;
      white-space: normal !important;
      overflow: visible !important;
    }

    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .settings-nav > *,
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .status-editor-subnav > *,
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .updater-tabs-card .nav-tabs > *,
    html.status-ios-document-scroll-v33 body.status-document-scroll-v33 .updater-header-status > * {
      flex: 0 1 auto !important;
      white-space: normal !important;
    }
  }
}
