/* Cashback Pro V36.7.166 — center non-home pages in the available desktop workspace
   and shorten the desktop navigation drawer without changing mobile layouts. */
@media (min-width: 1100px) {
  :root {
    --v166-sidebar-width: clamp(232px, 19vw, 286px);
    --v166-sidebar-left: 18px;
    --v166-sidebar-gap: 24px;
    --v166-content-right-gap: 24px;
    --v166-content-max: 1480px;
    --v166-header-height: var(--v36-header-height, 104px);
  }

  /* Keep the drawer below the fixed category button, but limit its height to
     roughly four-fifths of the viewport. The tab list remains independently scrollable. */
  html body #app-sidebar.app-sidebar {
    top: calc(var(--v166-header-height) + 56px) !important;
    bottom: auto !important;
    height: min(78vh, calc(100dvh - var(--v166-header-height) - 84px)) !important;
    min-height: 0 !important;
    max-height: min(78vh, calc(100dvh - var(--v166-header-height) - 84px)) !important;
    overflow: hidden !important;
    border-radius: 20px !important;
  }
  html body #app-sidebar > #main-tabs-nav {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Other destinations: center the actual content column in the remaining
     workspace, not against the full viewport and not against the sidebar edge. */
  html body.dashboard-tab-mode main.main-container,
  html body:not(.dashboard-home) main.main-container {
    width: min(var(--v166-content-max), calc(100vw - var(--v166-sidebar-width) - 90px)) !important;
    max-width: var(--v166-content-max) !important;
    min-width: 0 !important;
    margin-left: calc(
      var(--v166-sidebar-left) + var(--v166-sidebar-width) + var(--v166-sidebar-gap) +
      max(0px, (100vw - var(--v166-sidebar-left) - var(--v166-sidebar-width) - var(--v166-sidebar-gap) - var(--v166-content-right-gap) - var(--v166-content-max)) / 2)
    ) !important;
    margin-right: auto !important;
    padding: 20px clamp(16px, 1.8vw, 30px) 34px !important;
    box-sizing: border-box !important;
  }

  /* When the drawer is hidden, reclaim the full canvas and center the same
     max-width content column on the viewport. */
  html body.sidebar-collapsed.dashboard-tab-mode main.main-container,
  html body.sidebar-collapsed:not(.dashboard-home) main.main-container {
    width: min(var(--v166-content-max), calc(100vw - 64px)) !important;
    max-width: var(--v166-content-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: clamp(16px, 1.8vw, 30px) !important;
    padding-right: clamp(16px, 1.8vw, 30px) !important;
  }
}
