/* All overrides are limited to the Apps embed, preserving the public website. */
html[data-catalog-embed='apps'] body {
  overscroll-behavior: contain;
}

html[data-catalog-embed='apps']
  :is(
    footer,
    [data-cookie-consent],
    #cookie-consent,
    .swage-discovery,
    #proto-system-popup,
    .proto-popup-launcher,
    .proto-film-popup,
    .erpnav-brand-wrap,
    .preview-site > header a[aria-label='ERP•AI home'],
    .erpnav-right,
    .swage-system-menu__actions,
    .swage-system-menu__mobile-signin,
    .swage-product-mega__rail,
    .app-site .application-bar,
    .app-site .nav .brand,
    .app-site .nav-end
  ) {
  display: none !important;
}

html[data-catalog-embed='apps'] .page-shell {
  min-height: 100vh;
  padding-bottom: 0 !important;
}

/* The Apps dialog owns the outer corners; its hidden footer needs no end-cap. */
html[data-catalog-embed='apps'] .page-shell > #main-content {
  border-radius: 0;
  box-shadow: none;
}

html[data-catalog-embed='apps'] .page-shell > #main-content::after {
  display: none;
}

html[data-catalog-embed='apps'] :is(.erpnav-inner, .erpnav-left, .erpnav-center) {
  justify-content: center;
}

html[data-catalog-embed='apps'] .erpnav-left {
  width: 100%;
}

html[data-catalog-embed='apps'] .swage-product-mega__body {
  grid-template-columns: minmax(0, 1fr);
}

html[data-catalog-embed='apps'] .erpnav-mobile-menu {
  margin-left: auto;
}

/* App-site pages (layouts/app-site.njk): the dialog header names the app and offers Activate, so
   the All applications bar, brand and Sign in / Start now go and the app's own menus centre. */
html[data-catalog-embed='apps'] .app-site .nav {
  top: env(safe-area-inset-top, 0px);
}

html[data-catalog-embed='apps']:has(> body.app-site.has-application-switcher) {
  scroll-padding-top: 88px;
}

html[data-catalog-embed='apps'] .app-site .nav .wrap {
  justify-content: center;
}

html[data-catalog-embed='apps'] .app-site .menus {
  margin-left: 0;
}
