html:root, html:root * {
  scrollbar-width: thin !important;
  scrollbar-color: #d4d8dd #fff !important;
}

@supports selector(::-webkit-scrollbar) {
  html:root, html:root * {
    scrollbar-width: auto !important;
    scrollbar-color: auto !important;
  }
  html:root::-webkit-scrollbar, html:root *::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
    background: #fff !important;
  }
  html:root::-webkit-scrollbar-track, html:root *::-webkit-scrollbar-track,
  html:root::-webkit-scrollbar-corner, html:root *::-webkit-scrollbar-corner {
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  html:root::-webkit-scrollbar-thumb, html:root *::-webkit-scrollbar-thumb {
    background: #d4d8dd !important;
    border: 0 !important;
    border-radius: 999px !important;
    box-shadow: none !important;
  }
  html:root::-webkit-scrollbar-thumb:hover, html:root *::-webkit-scrollbar-thumb:hover {
    background: #b8bec6 !important;
  }
}
@media (forced-colors: active) {
  html:root, html:root * {
    scrollbar-width: auto !important;
    scrollbar-color: auto !important;
  }
  html:root::-webkit-scrollbar, html:root *::-webkit-scrollbar {
    width: auto !important;
    height: auto !important;
  }
  html:root::-webkit-scrollbar, html:root *::-webkit-scrollbar,
  html:root::-webkit-scrollbar-track, html:root *::-webkit-scrollbar-track,
  html:root::-webkit-scrollbar-corner, html:root *::-webkit-scrollbar-corner {
    background: Canvas !important;
  }
  html:root::-webkit-scrollbar-thumb, html:root *::-webkit-scrollbar-thumb,
  html:root::-webkit-scrollbar-thumb:hover, html:root *::-webkit-scrollbar-thumb:hover {
    background: ButtonText !important;
  }
}

/* A short visual thumb drives the existing native owner, never a content wrapper. */
@media (forced-colors: none) {
 /* The native gutter must not repaint a square white strip under the overlay. */
 html:root .ep-vscroll-native::-webkit-scrollbar,
 html:root .ep-vscroll-native::-webkit-scrollbar-track,
 html:root .ep-vscroll-native::-webkit-scrollbar-corner { background:transparent!important; }
 html:root .ep-vscroll-native::-webkit-scrollbar-thumb:vertical,
 html:root.ep-vscroll-native::-webkit-scrollbar-thumb:vertical { background:transparent!important; }
 .ep-vscroll-track[popover] {
  position:fixed!important; inset:auto; margin:0!important; padding:0!important; border:0!important;
  width:8px!important; max-width:none!important; max-height:none!important; overflow:visible!important;
  background:transparent!important; box-shadow:none!important; border-radius:0!important; z-index:2147483646;
  touch-action:none; user-select:none; cursor:default; contain:layout style;
 }
 .ep-vscroll-track::backdrop { background:transparent; pointer-events:none; }
 .ep-vscroll-thumb {
  position:absolute; left:0; width:8px; min-height:0; margin:0; padding:0; border:0;
  border-radius:999px; background:#d4d8dd; transform:scaleX(.5); transform-origin:center;
  transition:transform 120ms ease-out,background-color 120ms ease; cursor:grab; touch-action:none;
 }
 .ep-vscroll-track:hover > .ep-vscroll-thumb,
 .ep-vscroll-dragging > .ep-vscroll-thumb { transform:scaleX(1); background:#b8bec6; }
 .ep-vscroll-dragging > .ep-vscroll-thumb { cursor:grabbing; }
}
@media (prefers-reduced-motion: reduce) { .ep-vscroll-thumb { transition:none; } }
@media print { .ep-vscroll-track { display:none!important; } }

/* Put sidebar rails at the outside viewport edge, restoring the content direction
   on the immediate child rather than mirroring the menu itself. */
@media screen and (min-width:992px) {
 html[dir="rtl"] body.ep-panel-workspace :is(.ep-settings-sidebar > nav,#menu-bar .epoll-main-navigation:not(.ep-home-sidebar),.ep-home-nav-scroll) { direction:ltr!important; }
 html[dir="rtl"] body.ep-panel-workspace :is(.ep-settings-sidebar > nav,#menu-bar .epoll-main-navigation:not(.ep-home-sidebar),.ep-home-nav-scroll) > * { direction:rtl!important; }
 html[dir="ltr"] body.ep-panel-workspace :is(.ep-settings-sidebar > nav,#menu-bar .epoll-main-navigation:not(.ep-home-sidebar),.ep-home-nav-scroll) { direction:rtl!important; }
 html[dir="ltr"] body.ep-panel-workspace :is(.ep-settings-sidebar > nav,#menu-bar .epoll-main-navigation:not(.ep-home-sidebar),.ep-home-nav-scroll) > * { direction:ltr!important; }
}
