/* Theme palettes. The palette colours come from the upstream editor themes
   Tomorrow, Gruvbox, Solarized, Dracula/Alucard, Atom One, Ayu, Catppuccin,
   Everforest, GitHub, Hopscotch, Horizon, Kanagawa, Kimbie, Material, Monokai,
   Night Owl, Nord, Oceanic Next, PaperColor, Paraiso, Rose Pine, Tokyo Night
   and Zenburn; copied from paste's palette set with the syntax-highlighting
   tokens dropped and the monitor status tokens added. */
/* The default (black & white) palette, light and dark in one place: each
   light-dark() pair resolves against the root's color-scheme, which follows
   the system until appearance.ts sets data-theme. Other palettes override
   the colors per theme below; the error and warning colors are shared.
   --up, --down and --unknown are literal hex colors with at least 3:1
   contrast against --page in every block (checked by jstest/theme_test.ts).
   Healthy monitors stay quiet in the default palette: --up is a muted grey. */
:root {
  color-scheme: light dark;
  --page: light-dark(#ffffff, #141414);
  --text: light-dark(#202020, #ededed);
  --muted: light-dark(#6b6b6b, #a3a3a3);
  --accent: light-dark(#202020, #ededed);
  --selection: light-dark(#cbd5e1, #3d4654);
  --error: light-dark(#a12d2d, #ffaaa1);
  --error-bg: light-dark(#fbe7e5, #482825);
  --error-border: light-dark(#dc8881, #a45a51);
  --warning: light-dark(#755923, #d7c28f);
  --warning-bg: light-dark(#f5f0e3, #2c291e);
  --warning-border: light-dark(#e6d9b8, #4a412b);
  --up: light-dark(#767676, #8a8a8a);
  --down: light-dark(#c62828, #ff7b72);
  --unknown: light-dark(#9a6700, #d9a441);
  --nodata: color-mix(in srgb, var(--muted) 35%, var(--page));
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Every non-default palette derives its muted text the same way. */
:root[data-palette]:not([data-palette="default"]) {
  --muted: color-mix(in srgb, var(--text) 72%, var(--page));
}

:root[data-palette="tomorrow"][data-theme="light"] {
  --page: #ffffff;
  --text: #4d4d4c;
  --accent: #4271ae;
  --selection: #d6d6d6;
  --up: #718c00;
  --down: #c82829;
  --unknown: #ab8d1e;
}

:root[data-palette="tomorrow"][data-theme="dark"] {
  --page: #1d1f21;
  --text: #c5c8c6;
  --accent: #81a2be;
  --selection: #373b41;
  --up: #b5bd68;
  --down: #cc6666;
  --unknown: #f0c674;
}

:root[data-palette="tomorrow-blue"][data-theme="dark"] {
  --page: #002451;
  --text: #ffffff;
  --accent: #bbdaff;
  --selection: #003f8e;
  --up: #d1f1a9;
  --down: #ff9da4;
  --unknown: #ffeead;
}

:root[data-palette="gruvbox"][data-theme="light"] {
  --page: #fbf1c7;
  --text: #3c3836;
  --accent: #076678;
  --selection: #d5c4a1;
  --up: #79740e;
  --down: #9d0006;
  --unknown: #b57614;
}

:root[data-palette="gruvbox"][data-theme="dark"] {
  --page: #282828;
  --text: #ebdbb2;
  --accent: #83a598;
  --selection: #504945;
  --up: #b8bb26;
  --down: #fb4934;
  --unknown: #fabd2f;
}

:root[data-palette="solarized"][data-theme="light"] {
  --page: #fdf6e3;
  --text: #657b83;
  --accent: #268bd2;
  --selection: #eee8d5;
  --up: #819510;
  --down: #dc322f;
  --unknown: #ab8710;
}

:root[data-palette="solarized"][data-theme="dark"] {
  --page: #002b36;
  --text: #839496;
  --accent: #268bd2;
  --selection: #073642;
  --up: #859900;
  --down: #dc322f;
  --unknown: #b58900;
}

:root[data-palette="dracula"][data-theme="light"] {
  --page: #fffbeb;
  --text: #1f1f1f;
  --accent: #644ac9;
  --selection: #cfcfde;
  --up: #14710a;
  --down: #cb3a2a;
  --unknown: #846e15;
}

:root[data-palette="dracula"][data-theme="dark"] {
  --page: #282a36;
  --text: #f8f8f2;
  --accent: #bd93f9;
  --selection: #44475a;
  --up: #50fa7b;
  --down: #ff5555;
  --unknown: #f1fa8c;
}

:root[data-palette="atom-one"][data-theme="light"] {
  --page: #fafafa;
  --text: #383a42;
  --accent: #3f6ed6;
  --selection: #e5e5e6;
  --up: #4f9d4e;
  --down: #e45649;
  --unknown: #bc8104;
}

:root[data-palette="atom-one"][data-theme="dark"] {
  --page: #282c34;
  --text: #abb2bf;
  --accent: #61aeee;
  --selection: #3e4451;
  --up: #98c379;
  --down: #e06c75;
  --unknown: #e5c07b;
}

:root[data-palette="ayu"][data-theme="light"] {
  --page: #fcfcfc;
  --text: #5c6166;
  --accent: #86715c;
  --selection: #d7e4f6;
  --up: #7a9c1d;
  --down: #d86e6f;
  --unknown: #aa8957;
}

:root[data-palette="ayu"][data-theme="dark"] {
  --page: #10141c;
  --text: #bfbdb6;
  --accent: #ffb454;
  --selection: #1c3555;
  --up: #aad94c;
  --down: #f07178;
  --unknown: #ffb454;
}

:root[data-palette="ayu-mirage"][data-theme="dark"] {
  --page: #242936;
  --text: #cccac2;
  --accent: #ffcc66;
  --selection: #304763;
  --up: #d5ff80;
  --down: #f28779;
  --unknown: #ffcc66;
}

:root[data-palette="catppuccin"][data-theme="light"] {
  --page: #eff1f5;
  --text: #4c4f69;
  --accent: #2164eb;
  --selection: #ccd0da;
  --up: #419a30;
  --down: #d20f39;
  --unknown: #b67c32;
}

:root[data-palette="catppuccin"][data-theme="dark"] {
  --page: #1e1e2e;
  --text: #cdd6f4;
  --accent: #89b4fa;
  --selection: #45475a;
  --up: #a6e3a1;
  --down: #f38ba8;
  --unknown: #f9e2af;
}

:root[data-palette="catppuccin-frappe"][data-theme="dark"] {
  --page: #303446;
  --text: #c6d0f5;
  --accent: #8caaee;
  --selection: #51576d;
  --up: #a6d189;
  --down: #e78284;
  --unknown: #e5c890;
}

:root[data-palette="catppuccin-macchiato"][data-theme="dark"] {
  --page: #24273a;
  --text: #cad3f5;
  --accent: #8aadf4;
  --selection: #494d64;
  --up: #a6da95;
  --down: #ed8796;
  --unknown: #eed49f;
}

:root[data-palette="everforest"][data-theme="light"] {
  --page: #fdf6e3;
  --text: #5c6a72;
  --accent: #52768a;
  --selection: #e3e0d1;
  --up: #81941c;
  --down: #f25653;
  --unknown: #a58832;
}

:root[data-palette="everforest"][data-theme="dark"] {
  --page: #2d353b;
  --text: #d3c6aa;
  --accent: #a7c080;
  --selection: #475258;
  --up: #a7c080;
  --down: #e67e80;
  --unknown: #dbbc7f;
}

:root[data-palette="github"][data-theme="light"] {
  --page: #ffffff;
  --text: #24292e;
  --accent: #005cc5;
  --selection: #dbe9f9;
  --up: #1a7f37;
  --down: #cf222e;
  --unknown: #9a6700;
}

:root[data-palette="github"][data-theme="dark"] {
  --page: #0d1117;
  --text: #c9d1d9;
  --accent: #58a6ff;
  --selection: #264f78;
  --up: #3fb950;
  --down: #f85149;
  --unknown: #d29922;
}

:root[data-palette="hopscotch"][data-theme="dark"] {
  --page: #322931;
  --text: #b9b5b8;
  --accent: #479cbd;
  --selection: #483f47;
  --up: #8fc13e;
  --down: #dd464c;
  --unknown: #fdcc59;
}

:root[data-palette="horizon"][data-theme="light"] {
  --page: #fdf0ed;
  --text: #403c3d;
  --accent: #347886;
  --selection: #f9cbbe;
  --up: #1a8a5a;
  --down: #df5273;
  --unknown: #b37d2b;
}

:root[data-palette="horizon"][data-theme="dark"] {
  --page: #1c1e26;
  --text: #cbced0;
  --accent: #de5676;
  --selection: #2e303e;
  --up: #09f7a0;
  --down: #e95678;
  --unknown: #fab795;
}

:root[data-palette="kanagawa"][data-theme="light"] {
  --page: #f2ecbc;
  --text: #545464;
  --accent: #4d699b;
  --selection: #c9cbd1;
  --up: #6f894e;
  --down: #c84053;
  --unknown: #b37724;
}

:root[data-palette="kanagawa"][data-theme="dark"] {
  --page: #1f1f28;
  --text: #dcd7ba;
  --accent: #7e9cd8;
  --selection: #223249;
  --up: #98bb6c;
  --down: #e46876;
  --unknown: #e6c384;
}

:root[data-palette="kanagawa-dragon"][data-theme="dark"] {
  --page: #181616;
  --text: #c5c9c5;
  --accent: #8ba4b0;
  --selection: #393836;
  --up: #87a987;
  --down: #c4746e;
  --unknown: #c4b28a;
}

:root[data-palette="kimbie"][data-theme="light"] {
  --page: #fbebd4;
  --text: #84613d;
  --accent: #7e602c;
  --selection: #e8d5bc;
  --up: #878846;
  --down: #dc3958;
  --unknown: #b27839;
}

:root[data-palette="kimbie"][data-theme="dark"] {
  --page: #221a0f;
  --text: #d3af86;
  --accent: #8ab1b0;
  --selection: #3e3222;
  --up: #889b4a;
  --down: #dc3958;
  --unknown: #f79a32;
}

:root[data-palette="material"][data-theme="light"] {
  --page: #fafafa;
  --text: #546e7a;
  --accent: #7c4dff;
  --selection: #dfe4e6;
  --up: #769768;
  --down: #e53935;
  --unknown: #a88a56;
}

:root[data-palette="material"][data-theme="dark"] {
  --page: #263238;
  --text: #eeffff;
  --accent: #82aaff;
  --selection: #314549;
  --up: #c3e88d;
  --down: #f07178;
  --unknown: #ffcb6b;
}

:root[data-palette="material-palenight"][data-theme="dark"] {
  --page: #292d3e;
  --text: #959dcb;
  --accent: #82aaff;
  --selection: #3a3f55;
  --up: #c3e88d;
  --down: #f07178;
  --unknown: #ffcb6b;
}

:root[data-palette="monokai"][data-theme="dark"] {
  --page: #272822;
  --text: #f8f8f2;
  --accent: #66d9ef;
  --selection: #49483e;
  --up: #a6e22e;
  --down: #f92672;
  --unknown: #e6db74;
}

:root[data-palette="night-owl"][data-theme="light"] {
  --page: #fbfbfb;
  --text: #403f53;
  --accent: #994cc3;
  --selection: #e0e0e0;
  --up: #08916a;
  --down: #de3d3b;
  --unknown: #a9881b;
}

:root[data-palette="night-owl"][data-theme="dark"] {
  --page: #011627;
  --text: #d6deeb;
  --accent: #82aaff;
  --selection: #1d3b53;
  --up: #addb67;
  --down: #ef5350;
  --unknown: #ecc48d;
}

:root[data-palette="nord"][data-theme="dark"] {
  --page: #2e3440;
  --text: #e5e9f0;
  --accent: #81a1c1;
  --selection: #434c5e;
  --up: #a3be8c;
  --down: #c1666f;
  --unknown: #ebcb8b;
}

:root[data-palette="oceanic-next"][data-theme="dark"] {
  --page: #1b2b34;
  --text: #c0c5ce;
  --accent: #6699cc;
  --selection: #35444d;
  --up: #99c794;
  --down: #ec5f67;
  --unknown: #fac863;
}

:root[data-palette="papercolor"][data-theme="light"] {
  --page: #eeeeee;
  --text: #444444;
  --accent: #a85616;
  --selection: #d3d3d3;
  --up: #5f8700;
  --down: #af0000;
  --unknown: #9c841b;
}

:root[data-palette="papercolor"][data-theme="dark"] {
  --page: #1c1c1c;
  --text: #d0d0d0;
  --accent: #ff5faf;
  --selection: #393939;
  --up: #5faf5f;
  --down: #d75f5f;
  --unknown: #ffaf00;
}

:root[data-palette="paraiso"][data-theme="light"] {
  --page: #e7e9db;
  --text: #4f424c;
  --accent: #336f8c;
  --selection: #c3c4b8;
  --up: #4b8c70;
  --down: #d55c54;
  --unknown: #9c7b35;
}

:root[data-palette="paraiso"][data-theme="dark"] {
  --page: #2f1e2e;
  --text: #a39e9b;
  --accent: #06b6ef;
  --selection: #42323f;
  --up: #48b685;
  --down: #ef6155;
  --unknown: #fec418;
}

:root[data-palette="rose-pine"][data-theme="light"] {
  --page: #faf4ed;
  --text: #575279;
  --accent: #286983;
  --selection: #f2e9de;
  --up: #286983;
  --down: #b4637a;
  --unknown: #af7f50;
}

:root[data-palette="rose-pine"][data-theme="dark"] {
  --page: #191724;
  --text: #e0def4;
  --accent: #c4a7e7;
  --selection: #26233a;
  --up: #3e8fb0;
  --down: #eb6f92;
  --unknown: #f6c177;
}

:root[data-palette="rose-pine-moon"][data-theme="dark"] {
  --page: #232136;
  --text: #e0def4;
  --accent: #c4a7e7;
  --selection: #44415a;
  --up: #3e8fb0;
  --down: #eb6f92;
  --unknown: #f6c177;
}

:root[data-palette="tokyo-night"][data-theme="light"] {
  --page: #d5d6db;
  --text: #565a6e;
  --accent: #34548a;
  --selection: #d5d6db;
  --up: #485e30;
  --down: #8c4351;
  --unknown: #8f5e15;
}

:root[data-palette="tokyo-night"][data-theme="dark"] {
  --page: #1a1b26;
  --text: #9aa5ce;
  --accent: #7aa2f7;
  --selection: #292e42;
  --up: #9ece6a;
  --down: #f7768e;
  --unknown: #e0af68;
}

:root[data-palette="zenburn"][data-theme="dark"] {
  --page: #383838;
  --text: #dcdccc;
  --accent: #7cb8bb;
  --selection: #606060;
  --up: #9fc59f;
  --down: #cc9393;
  --unknown: #f0dfaf;
}
