@media (max-width: 767px) {
  /* The theme sets the side panel width. Leave the website visible on its left. */
  html.mvn-phone-menu-open {
    background-color: var(--mvn-mobile-panel-color, #821127);
    overscroll-behavior: none;
  }
  html.mvn-phone-menu-open #wrapper { position: relative; }
  .mvn-drawer-page-edge {
    position: absolute;
    inset: clamp(0px, var(--mvn-page-edge-start, 100%), 100%) 0 0 auto;
    background-color: var(--mvn-mobile-panel-color, #821127);
    pointer-events: none;
    z-index: 101;
  }
  #mobile-drawer.show-drawer {
    height: calc(100vh - var(--mvn-drawer-inset, 0px)) !important;
    height: calc(max(100lvh - var(--mvn-drawer-inset, 0px), var(--mvn-drawer-height, 100dvh)) + env(safe-area-inset-bottom, 0px)) !important;
  }
  #mobile-drawer.show-drawer .drawer-content {
    box-sizing: border-box;
    flex: 0 1 auto;
    max-height: calc(var(--mvn-drawer-height, 100dvh) - var(--mvn-phone-menu-head, 0px));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
  /* Kadence centres the navigation vertically in a height-limited item.
     On short screens that puts the first link above the scrollable area. */
  #mobile-drawer .drawer-content .site-header-item-mobile-navigation {
    display: block;
    height: auto !important;
    max-height: none !important;
  }
  #mobile-drawer .drawer-inner .drawer-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    justify-content: stretch;
    padding-inline: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
  }
  #mobile-drawer .drawer-header .mvn-drawer-logo {
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    place-items: center;
    justify-self: stretch;
    margin: 0;
  }
  #mobile-drawer .drawer-header .mvn-drawer-logo img {
    display: block;
    width: min(100%, 230px) !important;
    height: auto !important;
    margin: 0 auto !important;
  }
}
