.vk-phone-wallpaper {
  display: none;
}

@media (max-width: 760px) {
  html:root:is([data-bk-parity="home"][data-bk-world="volt"], [data-vk-sample-edge], [data-vk-cart-wallpaper]):has(#volt-workspace-wallpaper) {
    --vk-safari-edge: #2b1e2b;
    --vk-safari-matte: linear-gradient(90deg, #2b1e2b 0%, #302330 48%, #2b1e2b 100%);
    min-height: 100%;
    overflow-x: clip;
    overflow-y: visible;
    scrollbar-gutter: auto;
    color-scheme: dark;
    background: var(--vk-safari-edge) var(--vk-safari-matte) !important;
  }

  html:is([data-bk-parity="home"][data-bk-world="volt"], [data-vk-sample-edge], [data-vk-cart-wallpaper]) body {
    position: relative;
    isolation: isolate;
    min-height: 100svh;
    overflow-x: clip;
    overflow-y: visible;
    touch-action: pan-y pinch-zoom;
  }

  html:is([data-vk-sample-edge], [data-vk-cart-wallpaper]) body {
    --vk-wallpaper-stack: 0;
  }

  /* The shared phone wallpaper replaces both legacy app background layers. */
  html:root:is([data-vk-sample-edge], [data-vk-cart-wallpaper])::before,
  html:root:is([data-vk-sample-edge], [data-vk-cart-wallpaper]) body::before,
  html:root[data-vk-cart-wallpaper] body::after {
    display: none !important;
  }

  html[data-vk-sample-edge] #volt-learner-sample {
    position: relative;
    z-index: 1;
  }

  html[data-vk-sample-edge] body.kk-app-viewport .trainer-home.learning-home {
    min-height: 100svh;
  }

  /* Paint past the toolbar while keeping the artwork at the viewport origin. */
  html:is([data-bk-parity="home"][data-bk-world="volt"], [data-vk-cart-wallpaper]) body > .vk-phone-wallpaper,
  html[data-vk-role-appearance]:has(body :is(.trainer-home.learning-home, .learning-exam, .refrigeration-simulation, [data-company-forum], [data-role-preview-workspace], main.auth-loading[data-loading-role="learner"], main.auth-loading[data-loading-role="instructor"])) body > .vk-phone-wallpaper {
    display: block;
    position: fixed;
    inset: 0 0 auto;
    height: calc(100vh + 140px);
    height: calc(100lvh + max(140px, env(safe-area-inset-bottom, 0px)));
    z-index: var(--vk-wallpaper-stack, 0);
    pointer-events: none;
    background: var(--vk-safari-edge) var(--vk-safari-matte);
  }

  .vk-phone-wallpaper > img {
    display: block;
    width: 100%;
    height: 100vh;
    height: 100lvh;
    object-fit: fill;
    --vk-art-end: calc(100svh - max(24px, env(safe-area-inset-bottom, 0px)));
    --vk-art-fade: linear-gradient(to bottom, transparent 8px, #000 140px,
      #000 max(140px, calc(var(--vk-art-end) - 180px)), transparent max(141px, var(--vk-art-end)));
    -webkit-mask-image: var(--vk-art-fade);
    mask-image: var(--vk-art-fade);
  }
}
