/* Theme: colors for the light and dark themes (CSS variables), the page and
   scrollbars. */

:root,
:root[data-chosen-theme=light] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #eef2ff;
  --text: #0b1020;
  --mutedText: #4a5578;
  --line: #c9d3f5;
  --accent: #1240e0;
  --dot: #c3cbe6;
  --selected: #1240e0;
  --danger: #b3261e;
  --overlap: #8b0000; /* dark red: lines on top of each other */
  --runarrow: #a32a1a;
  --runFill: #e2553f; /* shading of a running pump or actuated valve */
  --runOpacity: .28;
  --ballred: #e2553f; /* flow balls: pressure side, suction side */
  --ballblue: #3d8fd8;
  --ballring: 0; /* width of a ring in the sheet color round each ball */
  --pop: #ffffff; /* windows that float over the sheet: settings, menus, bars */
  --popline: #c9d3f5;
  --popshadow: 0 8px 24px rgba(5, 10, 30, .18);
  --info: #eef2ff; /* component details under the components panel */
  --infoline: #c9d3f5;
  --divider: #c9d3f5; /* lines between the toolbar, components panel and sheet */
  --startGreen: #178a3e;
  --stop: #d0342c
}

:root[data-chosen-theme=dark],
:root:not([data-chosen-theme])[data-theme=dark] {
  color-scheme: dark;
  --bg: #0a0d18;
  --panel: #11162b;
  --text: #e6eaff;
  --mutedText: #9aa6d6;
  --line: #26305a;
  --accent: #7b95ff;
  --dot: #2a3256;
  --selected: #8aa2ff;
  --danger: #ff8a80;
  --overlap: #e04a4a; /* a dark red would vanish on the dark sheet */
  --runarrow: #e0705e;
  --runFill: #ff5a40; /* stronger on the dark sheet, or it barely shows */
  --runOpacity: .5;
  --ballred: #ff7a5c; /* brighter balls for the dark sheet */
  --ballblue: #5cb4ff;
  --ballring: 2.4px; /* sets the balls apart from the light lines */
  --pop: #1a2142; /* floating windows lighter than the sheet, so they stand out */
  --popline: #4a5aa0;
  --popshadow: 0 10px 30px rgba(0, 0, 0, .65);
  --info: #1a2142; /* raised like the floating windows, apart from the list */
  --infoline: #4a5aa0;
  --divider: #4a5aa0; /* brighter, or they vanish on the dark theme */
  --startGreen: #23a455;
  --stop: #e5483f
}

@media(prefers-color-scheme:dark) {
  :root:not([data-chosen-theme]):not([data-theme=light]) {
    color-scheme: dark;
    --bg: #0a0d18;
    --panel: #11162b;
    --text: #e6eaff;
    --mutedText: #9aa6d6;
    --line: #26305a;
    --accent: #7b95ff;
    --dot: #2a3256;
    --selected: #8aa2ff;
    --danger: #ff8a80;
    --overlap: #e04a4a; /* a dark red would vanish on the dark sheet */
    --runarrow: #e0705e;
    --runFill: #ff5a40;
    --runOpacity: .5;
    --ballred: #ff7a5c;
    --ballblue: #5cb4ff;
    --ballring: 2.4px;
    --pop: #1a2142;
    --popline: #4a5aa0;
    --popshadow: 0 10px 30px rgba(0, 0, 0, .65);
    --info: #1a2142;
    --infoline: #4a5aa0;
    --divider: #4a5aa0;
    --startGreen: #23a455;
    --stop: #e5483f
  }
}

html,
body {
  background: var(--bg)
}

* {
  box-sizing: border-box;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px
}

::-webkit-scrollbar-thumb:hover {
  background: var(--mutedText)
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden
}
