/* Keep the artwork's size and crop and anchor it opposite Safari's top bar. */
html[data-ipad-home-background="it"]:has(#it-approved-background-20261105) body::before,
html[data-ipad-home-background="volt"]:has(#volt-workspace-wallpaper) body::before,
html[data-ipad-home-background="handel"]:root:has(.kk-release.kk-home-refined)::before,
html[data-ipad-home-background="shk"] body .shk-preview-phone-scene {
  inset: auto 0 0 !important;
  height: var(--ipad-home-scene-height) !important;
  min-height: 0 !important;
}

html[data-ipad-home-background]:has([data-release-page])[style*="--ipad-home-background-image"] {
  &[data-ipad-home-background="it"]:has(#it-approved-background-20261105) body::before,
  &[data-ipad-home-background="volt"]:has(#volt-workspace-wallpaper) body::before,
  &[data-ipad-home-background="handel"]::before,
  &[data-ipad-home-background="shk"] body .shk-preview-phone-scene {
    background-image: var(--ipad-home-background-image) !important;
  }
}

html[data-ipad-home-background="kfz"][style*="--ipad-home-background-image"] body > #ipad-kfz-home-backdrop {
  position: fixed;
  inset: auto 0 0;
  z-index: -1;
  height: var(--ipad-home-scene-height);
  background: var(--ipad-home-background-image, none) center top / cover no-repeat #1d1916;
  pointer-events: none;
}

html[data-ipad-home-background="kfz"][style*="--ipad-home-background-image"]:has(#MainContent) body[data-kfz-home-copper]:has(#MainContent .kk-storefront)::before {
  content: none !important;
}

html[data-ipad-home-background="kaelte"]:not(.kk-portal-open) body > .kk-master-backdrop,
html[data-ipad-home-background="logistik"] body #logistik-wallpaper-v4 {
  inset: auto 0 0 !important;
  height: var(--ipad-home-scene-height) !important;
  min-height: 0 !important;
}

@media (max-width: 760px) {
  /* Preserve Kälte-Klar's existing faded canvas for narrow iPad windows. */
  html[data-ipad-home-background="kaelte"]:not(.kk-portal-open):has(.kk-home-refined[data-release-page]) body > .kk-master-backdrop {
    bottom: calc(-1 * var(--ipad-home-scene-height)) !important;
    height: calc(3 * var(--ipad-home-scene-height)) !important;

    & :is(picture, .kk-backdrop-svg) {
      top: var(--ipad-home-scene-height);
      height: var(--ipad-home-scene-height);
    }

    & picture::after {
      top: calc(var(--ipad-home-scene-height) - 180px);
      bottom: calc(-1 * var(--ipad-home-scene-height));
    }
  }
}
