/* Mobile sizing and scrolling only. Desktop and existing UI styles are preserved. */
@media (max-width: 767px) {
  .admin-enterprise-shell {
    min-height: 0;
    height: 100vh;
    height: 100dvh;
  }

  .admin-enterprise-main,
  .admin-enterprise-sider {
    min-height: 0;
    height: calc(100vh - 52px);
    height: calc(100dvh - 52px);
  }

  .admin-enterprise-content {
    min-height: 0;
    max-width: 100%;
    overflow: auto;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }

  .admin-enterprise-header {
    gap: 8px;
    padding-inline: 12px !important;
  }

  .admin-top-brand {
    flex-shrink: 0;
    width: auto;
    margin-left: 0;
    padding-inline: 0;
    gap: 8px;
  }

  .admin-header-page-title {
    position: static;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .admin-enterprise-header > .ant-space {
    flex-shrink: 0;
  }

  .admin-enterprise-sider {
    position: fixed;
    top: 52px;
    left: 0;
    z-index: 20;
    overflow: visible;
  }

  .admin-enterprise-sider .ant-layout-sider-zero-width-trigger {
    top: 8px;
    color: #334155;
  }

  .admin-enterprise-menu,
  .admin-enterprise-content .ant-table-content,
  .admin-enterprise-content .ant-table-body {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }

  .admin-enterprise-content .ant-table-content {
    max-width: 100%;
    overflow-x: auto !important;
  }

  /* Let every column slide into view instead of covering the narrow viewport. */
  .admin-enterprise-content .ant-table-cell-fix-left,
  .admin-enterprise-content .ant-table-cell-fix-right {
    position: static !important;
  }

  .admin-notification-wrap > div[style] {
    position: fixed !important;
    top: 52px !important;
    right: 12px !important;
    width: min(360px, calc(100vw - 24px)) !important;
    max-height: calc(100vh - 64px) !important;
    max-height: calc(100dvh - 64px) !important;
    overflow: auto !important;
  }

  .ant-drawer-content-wrapper {
    max-width: 100vw;
  }


  /* The public landing page scrolls as a document, including its login slot. */
  html {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.official-landing-active {
    height: auto;
    min-height: 100%;
    overflow: visible;
  }

  body.official-landing-active #root {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  body.official-landing-active #official-website {
    height: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }

  /* Portal content needs the same scrolling as pages inside the admin shell. */
  .ant-drawer-body,
  .ant-modal-body {
    min-width: 0;
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }

  .ant-modal {
    max-width: calc(100vw - 24px);
  }

  .ant-drawer-body .ant-table-content,
  .ant-drawer-body .ant-table-body,
  .ant-modal-body .ant-table-content,
  .ant-modal-body .ant-table-body {
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }

  .ant-drawer-body .ant-table-cell-fix-left,
  .ant-drawer-body .ant-table-cell-fix-right,
  .ant-modal-body .ant-table-cell-fix-left,
  .ant-modal-body .ant-table-cell-fix-right {
    position: static !important;
  }

  .organization-command-table-wrap,
  .operations-risk-table-wrap,
  .favorites-ledger-table-wrap,
  .mc-list-pane,
  .mc-table-body,
  .mc-detail-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }

  .knowledge-workspace {
    min-width: 0;
    max-width: 100%;
  }

  .knowledge-heading > .ant-space {
    max-width: 100%;
    overflow-x: auto;
  }

  .knowledge-body,
  .knowledge-log-body {
    max-width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }
}
