/* Native scrollbars, matched to Heavenly Dao's parchment and lacquer surfaces.
   Keep native wheel, keyboard and touch scrolling; never hide the scroll affordance. */
html{
  --hd-scroll-track:#e7d8b7;
  --hd-scroll-thumb:#997951;
  --hd-scroll-hover:#72512e;
  scrollbar-color:var(--hd-scroll-thumb) var(--hd-scroll-track);
  scrollbar-width:thin;
}
html[data-theme='night']{
  --hd-scroll-track:#1b120c;
  --hd-scroll-thumb:#8d7048;
  --hd-scroll-hover:#c09b60;
}
html[data-theme-variant='midnight']{
  --hd-scroll-track:#080808;
  --hd-scroll-thumb:#937646;
  --hd-scroll-hover:#c2a06a;
}

/* Scrollable ledgers, panes and drawers share the active theme's ink/wood finish.
   This does not override existing scrollbar-width:none on horizontal mobile rails. */
html :is(
  .side-body,.satchel-grid,.tech-library-list,.mk-rows,.mk-slip,
  .discord-chat-messages,.discord-chat-drawer,.discord-chat-channel-menu,
  .discord-mention-menu,.rc-controls,.rc-rail,.game-world-col,.fight-panel,
  .hd-contracts,.hd-player-profile-sheet,.hd-trade-panel
){
  scrollbar-color:var(--hd-scroll-thumb) var(--hd-scroll-track);
  scrollbar-width:thin;
}

/* Combat and crafting stay lacquer-black even when the rest of the site is Light. */
html :is(.bt-panel,.bt-items,.craft-panel){
  --hd-scroll-track:#140d07;
  --hd-scroll-thumb:#8d6d3e;
  --hd-scroll-hover:#c39c5b;
  color-scheme:dark;
  scrollbar-color:var(--hd-scroll-thumb) var(--hd-scroll-track);
  scrollbar-width:thin;
}
html[data-theme-variant='midnight'] :is(.bt-panel,.bt-items,.craft-panel){
  --hd-scroll-track:#050505;
  --hd-scroll-thumb:#92784d;
  --hd-scroll-hover:#d0b17b;
}

/* Older WebKit/Safari fallback; newer browsers use standard scrollbar properties.
   Keep the thumb clearly visible without glossy effects, arrows or fake controls. */
@supports not (scrollbar-color: #777 #111) {
  html ::-webkit-scrollbar{width:10px;height:10px}
  html ::-webkit-scrollbar-track{background:var(--hd-scroll-track)}
  html ::-webkit-scrollbar-thumb{
    background:var(--hd-scroll-thumb);
    border:2px solid var(--hd-scroll-track);
    border-radius:5px;
  }
  html ::-webkit-scrollbar-thumb:hover{background:var(--hd-scroll-hover)}
}
