/* iPhone 17 Pro Max（约 430 CSS px）专用兼容层。
   这里仅保证原业务页的触控、刘海安全区与
   专业宽表入口仍可可靠操作，不改动桌面布局和业务计算。 */
@media (min-width: 400px) and (max-width: 460px) and (orientation: portrait) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background: #eef3f4;
  }

  body {
    max-width: 100%;
    overflow-x: clip !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
  }

  .suite-sidebar__mobile-trigger {
    top: max(10px, env(safe-area-inset-top, 0px)) !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .suite-sidebar__item,
  .suite-sidebar__brand {
    min-height: 44px !important;
  }

  :where(button, .button, .btn, [role="button"], summary, select,
    input[type="text"], input[type="search"], input[type="date"],
    input[type="number"], input[type="email"], input[type="time"],
    input[type="range"]) {
    min-height: 44px !important;
  }

  :where(button, .button, .btn, [role="button"], summary) {
    min-width: 44px !important;
  }

  :where(a.rail-btn, a.text-link, a.alert-action, a.button, a.btn,
    a[class*="-button"], a[class*="-action"]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  :where(select, input, textarea) {
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 16px; /* 避免 iOS 聚焦表单时自动放大页面。 */
  }

  :where(.table-wrap, .table-scroll, .records-view, .recordsView,
    .data-table-wrap, .het-table-wrap) {
    max-width: 100%;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .home-payment-theme .overview-shell,
  .customs-page .customs-module,
  html[data-module-base="/margin"] #main,
  .payment-suite-page .wrap {
    padding-top: max(64px, calc(env(safe-area-inset-top, 0px) + 54px)) !important;
  }

  .customs-page .tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible !important;
  }

  .customs-page .tab {
    justify-content: center;
    min-width: 0 !important;
    padding-inline: 8px !important;
  }

  .customs-page .filters,
  .customs-page .filter-grid,
  .home-payment-theme .overview-grid {
    min-width: 0;
  }

  html[data-module-base="/margin"] .inline-detail {
    min-width: 0 !important;
  }

  html[data-module-base="/margin"] .bar,
  html[data-module-base="/margin"] .system-title-row,
  .payment-suite-page .top,
  .payment-suite-page .toolbar {
    max-width: 100%;
  }

  .payment-suite-page .viewtabs,
  .payment-suite-page .account-tabs {
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .payment-suite-page .viewtab,
  .payment-suite-page .account-tab {
    min-height: 44px !important;
    scroll-snap-align: start;
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}
