/* The canvas viewport's own overlay bars (js/ui/canvas/scrollbars.js; desktop parity:
   canvas/overlay/OverlayScrollArea.hpp): native scrollbar-color is one colour for both bars. */
.canvas-viewport::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* A 12px strip with a 6px pill swelling to 9px under its pointer; faded after 900ms idle, and then
   pointer-transparent. */
.canvas-sb {
    position: fixed;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
.canvas-sb.canvas-sb-on { opacity: 1; pointer-events: auto; }
.canvas-sb[hidden] { display: none; }
.canvas-sb-thumb {
    position: absolute;
    background: var(--sb-thumb);
    border-radius: 999px;
    transition: background-color 0.15s, width 0.15s, height 0.15s, right 0.15s, bottom 0.15s;
}
.canvas-sb-y .canvas-sb-thumb { width: 6px; right: 3px; }
.canvas-sb-x .canvas-sb-thumb { height: 6px; bottom: 3px; }
.canvas-sb-y:hover .canvas-sb-thumb, .canvas-sb-y.canvas-sb-drag .canvas-sb-thumb {
    width: 9px; right: 1.5px; background: var(--sb-thumb-hover);
}
.canvas-sb-x:hover .canvas-sb-thumb, .canvas-sb-x.canvas-sb-drag .canvas-sb-thumb {
    height: 9px; bottom: 1.5px; background: var(--sb-thumb-hover);
}
.canvas-sb.canvas-sb-nomotion, .canvas-sb.canvas-sb-nomotion .canvas-sb-thumb { transition: none; }
@media (prefers-reduced-motion: reduce) {
    .canvas-sb, .canvas-sb-thumb { transition: none; }
}

/* Every other scrollable: the thumb takes the accent only on its own strip (`.sb-hover`, utils.js
   wireScrollbarHover) — panel-wide :hover lit it on every scroll (user report). Desktop: PillScrollBars.hpp. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb) transparent;
}
.sb-hover { scrollbar-color: var(--sb-thumb-hover) transparent; }
/* Older Safari: a transparent border shrinks the thumb inside a constant 12px slot, so the swell never
   shifts layout. */
*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-track, *::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-thumb {
    background-color: var(--sb-thumb);
    background-clip: padding-box;
    border: 2px solid transparent;
    border-radius: 12px;
    transition: background-color 0.15s;
}
.sb-hover::-webkit-scrollbar-thumb { border-width: 0; background-color: var(--sb-thumb-hover); }
*::-webkit-scrollbar-thumb:hover { background-color: var(--sb-thumb-active); }
/* padding-right, because macOS overlay bars take no space and scrollbar-gutter has nothing to reserve. */
#coord-body {
    padding-right: 10px;
}
#coord-body,
#fs-points-panel {
    scrollbar-gutter: stable;
}
