.ipsum-sidebar {
  height: 100vh;
  height: 100dvh;
}

.ipsum-sidebar > :not(nav) {
  flex-shrink: 0;
}

.ipsum-sidebar > nav {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

@media (max-width: 1023px) {
  html:has(.ipsum-header button[aria-expanded="true"]) {
    overflow: hidden;
  }

  .ipsum-sidebar {
    max-width: calc(100vw - 44px);
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Keep the daily SKU search and its heading inside the available width. */
  .ipsum-main .flex:has(> .relative.flex-1 > input[placeholder="Поиск товара..."]) {
    flex-wrap: wrap;
  }

  .ipsum-main .flex:has(> .relative.flex-1 > input[placeholder="Поиск товара..."]) > .whitespace-nowrap {
    white-space: normal;
  }

  .ipsum-main .relative.flex-1:has(> input[placeholder="Поиск товара..."]) {
    min-width: 0;
    flex-basis: 120px;
  }

  /* Allow the budget tabs to wrap while keeping every tab visible. */
  .ipsum-main .flex.border-b:has(> button.border-b-2.px-5) {
    flex-wrap: wrap;
  }

  .ipsum-main .flex.border-b > button.border-b-2.px-5 {
    padding-inline: 0.75rem;
  }
}
