/* The browser's own scrollbar — full height at the window edge, with its
   arrow buttons — painted in the Nebula palette.

   Chromium and Safari draw it from the ::-webkit-scrollbar rules, which are
   the only ones that allow hover and drag states. Firefox understands only
   scrollbar-color, so it gets that alone: Chromium 121+ ignores every
   ::-webkit-scrollbar rule on an element that has scrollbar-color set, so
   the two must never apply together. */

:root{ color-scheme:dark; }

::-webkit-scrollbar{ width:14px; height:14px; }
::-webkit-scrollbar-track{ background:#0e1330; }
::-webkit-scrollbar-corner{ background:#0e1330; }
::-webkit-scrollbar-thumb{
  background:#2c3770;
  border:3px solid #0e1330;
  border-radius:8px;
  min-height:40px;
}
::-webkit-scrollbar-thumb:hover{ background:#7fb3dd; }
::-webkit-scrollbar-thumb:active{ background:#2e7cc0; }

/* One arrow at each end, as the native bar has. */
::-webkit-scrollbar-button{ display:none; }
::-webkit-scrollbar-button:single-button{
  display:block;
  width:14px; height:14px;
  background-color:#0e1330;
  background-repeat:no-repeat;
  background-position:center;
  background-size:8px 8px;
}
::-webkit-scrollbar-button:single-button:hover{ background-color:#1b2350; }
::-webkit-scrollbar-button:single-button:active{ background-color:#2e7cc0; }

::-webkit-scrollbar-button:single-button:vertical:decrement{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 1.5 7.5 6h-7z' fill='%238d96c2'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:vertical:increment{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 6.5 .5 2h7z' fill='%238d96c2'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:horizontal:decrement{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 4 6 .5v7z' fill='%238d96c2'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:horizontal:increment{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M6.5 4 2 7.5v-7z' fill='%238d96c2'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:hover:vertical:decrement,
::-webkit-scrollbar-button:single-button:active:vertical:decrement{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 1.5 7.5 6h-7z' fill='%23eef1fb'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:hover:vertical:increment,
::-webkit-scrollbar-button:single-button:active:vertical:increment{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 6.5 .5 2h7z' fill='%23eef1fb'/%3E%3C/svg%3E");
}

@supports not selector(::-webkit-scrollbar){
  html, *{ scrollbar-color:#2c3770 #0e1330; }
}

@media print{
  :root{ color-scheme:light; }
}

/* Light theme (shared/prefs.js sets data-theme on <html>). */
:root[data-theme="light"]{ color-scheme:light; }
:root[data-theme="light"] ::-webkit-scrollbar-track,
:root[data-theme="light"]::-webkit-scrollbar-track,
:root[data-theme="light"] ::-webkit-scrollbar-corner,
:root[data-theme="light"]::-webkit-scrollbar-corner,
:root[data-theme="light"] ::-webkit-scrollbar-button:single-button,
:root[data-theme="light"]::-webkit-scrollbar-button:single-button{ background-color:#f4f6fa; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb,
:root[data-theme="light"]::-webkit-scrollbar-thumb{ background:#c5cedd; border-color:#f4f6fa; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover,
:root[data-theme="light"]::-webkit-scrollbar-thumb:hover{ background:#1b4db1; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:active,
:root[data-theme="light"]::-webkit-scrollbar-thumb:active{ background:#153e8f; }
:root[data-theme="light"] ::-webkit-scrollbar-button:single-button:hover,
:root[data-theme="light"]::-webkit-scrollbar-button:single-button:hover{ background-color:#e3e8f0; }
:root[data-theme="light"] ::-webkit-scrollbar-button:single-button:vertical:decrement,
:root[data-theme="light"]::-webkit-scrollbar-button:single-button:vertical:decrement{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 1.5 7.5 6h-7z' fill='%235b6385'/%3E%3C/svg%3E");
}
:root[data-theme="light"] ::-webkit-scrollbar-button:single-button:vertical:increment,
:root[data-theme="light"]::-webkit-scrollbar-button:single-button:vertical:increment{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 6.5 .5 2h7z' fill='%235b6385'/%3E%3C/svg%3E");
}
@supports not selector(::-webkit-scrollbar){
  :root[data-theme="light"], :root[data-theme="light"] *{ scrollbar-color:#c5cedd #f4f6fa; }
}
