/*
 * Mobile account sheet: overlay mechanics.
 *
 * js/mobile-account-modal-fix.js portals #mobile-account-dialog to <body> and
 * toggles body.mobile-account-open. The dialog is the scrim; its panel is a
 * bottom sheet. The !important flags answer older override layers that still
 * position .mobile-login-div-content; the panel's content styling lives in
 * css/site-chrome.css with the rest of the refreshed chrome.
 */
@keyframes xc-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes xc-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media screen and (max-width: 640px) {
  body.mobile-account-open #mobile-account-dialog.mobile-login-div-content {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(0, 0, 0, 0.62) !important;
    box-shadow: none !important;
    color: #ececec !important;
    overflow: hidden !important;
    transform: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    z-index: 2147483000 !important;
    isolation: isolate !important;
    animation: xc-scrim-in 0.24s ease both;
  }

  body.mobile-account-open #mobile-account-dialog.mobile-login-div-content .mobile-account-panel {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: absolute !important;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1 !important;
    max-height: 92dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 0 calc(16px + env(safe-area-inset-bottom));
    background: #141414 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.5);
    color: #ececec !important;
    filter: none !important;
    -webkit-filter: none !important;
    animation: xc-sheet-up 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  body.mobile-account-open .modern-mobile-discovery-strip {
    display: none !important;
  }

  body.mobile-account-open header.modern-header,
  body.mobile-account-open .modern-header .header-top-bar,
  body.mobile-account-open .modern-header .header_top_left,
  body.mobile-account-open .modern-header .modern-header-left {
    overflow: visible !important;
  }
}

@media screen and (max-width: 640px) and (prefers-reduced-motion: reduce) {
  body.mobile-account-open #mobile-account-dialog.mobile-login-div-content,
  body.mobile-account-open #mobile-account-dialog.mobile-login-div-content .mobile-account-panel {
    animation: none;
  }
}
