/*
 * Cashier / POS short-screen safeguard.
 *
 * This is deliberately scoped to the full-screen POS overlay by the unique
 * /cashier/workspace link that exists inside PosPage. It does not change the
 * normal WIZECFO app shell or other dialogs.
 */
@media (min-width: 900px) and (max-height: 900px) {
  [class~="fixed"][class~="inset-0"][class~="z-50"]:has(a[href="/cashier/workspace"]) > div {
    max-height: calc(100dvh - 1rem);
    overflow-y: scroll !important;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    padding-bottom: 5.5rem !important;
  }

  [class~="fixed"][class~="inset-0"][class~="z-50"]:has(a[href="/cashier/workspace"]) aside {
    max-height: calc(100dvh - 20rem);
    min-height: 19rem;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    padding-bottom: 5.5rem !important;
  }

  /*
   * The Charge button is the cashier's final action. Keep it visible even on
   * 1366x768-class laptops and when Windows/browser scaling reduces the usable
   * vertical viewport. Its existing disabled/busy logic is unchanged.
   */
  [class~="fixed"][class~="inset-0"][class~="z-50"]:has(a[href="/cashier/workspace"]) aside > button:last-child {
    position: fixed;
    right: max(1.5rem, calc((100vw - 1700px) / 2 + 2rem));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 80;
    width: clamp(18rem, 27vw, 26rem);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
  }
}
