/* Sora Inventory v7.3 — continuous sidebar rail + restored sticky desktop sidebar.
   Visual/navigation-only fix. Uses existing sidebar markup and versioned assets.
   Loaded after v7.2 and the v5.8 manager-nav rule that set the sidebar position:relative.
*/
@media (min-width: 901px) {
  /* The actual rail belongs to the page frame, not the viewport-height sidebar.
     Its height therefore follows the full content, even on very long history pages. */
  html[data-theme] body .shell:has(> aside.side) {
    --sora-v73-rail-width: 230px;
    position: relative;
    background-image: linear-gradient(to right,
      var(--panel) 0,
      var(--panel) var(--sora-v73-rail-width),
      transparent var(--sora-v73-rail-width),
      transparent 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }
  html.sora-sidebar-collapsed[data-theme] body .shell:has(> aside.side) {
    --sora-v73-rail-width: 74px;
  }

  /* A continuous edge overlays the rail for the shell's entire height.
     This replaces the v5.8 glow, which stopped where the short aside ended. */
  html[data-theme] body .shell:has(> aside.side)::after {
    content: "";
    display: block;
    position: absolute;
    left: calc(var(--sora-v73-rail-width) - 2px);
    top: 0;
    bottom: 0;
    width: 2px;
    z-index: 30;
    pointer-events: none;
  }
  html[data-theme="dark"] body .shell:has(> aside.side)::after {
    background: linear-gradient(to bottom,
      rgba(255,179,217,.55), #ff86bf 25%, #ff62b2 68%, rgba(255,151,205,.62));
    box-shadow: 0 0 6px #ff8cc5,
                0 0 14px rgba(252,86,166,.7),
                0 0 24px rgba(255,98,181,.3);
  }
  html[data-theme="light"] body .shell:has(> aside.side)::after {
    background: var(--line, #e8e9ef);
    box-shadow: 0 0 8px rgba(236,129,175,.13);
  }

  /* Do not draw a second, shorter glow over the page-long divider. */
  html[data-theme] body .shell > aside.side {
    border-right: 2px solid transparent !important;
    box-shadow: none !important;

    /* v5.8 was overriding the original sticky positioning with 'relative',
       making the menu scroll out of sight. Keep navigation usable on long pages. */
    position: sticky !important;
    top: 0 !important;
    align-self: flex-start !important;
    height: calc(100vh - 69px) !important;
    height: calc(100dvh - 69px) !important;
    max-height: calc(100dvh - 69px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    overscroll-behavior: contain;
  }

  /* Do not let the rail cover the menu buttons. The divider itself is noninteractive. */
  html[data-theme] body .shell > aside.side nav,
  html[data-theme] body .shell > aside.side .sora-sidebar-account {position: relative;}
}
