/* SwitchHouse appearance (kit piece `appearance`): HQ's Night and Day, for every product.

   Shane, 8 Oct 2026: HQ's palette is THE palette, and the rail stays dark in both. These values are HQ's
   (HQ/resources/css/app.css, --bts-*), kept the same on purpose; if HQ's change, this file changes with them.

   Which one shows is the attribute on <html>:
     data-surface="night"    Night (also what you get with no attribute)
     data-surface="day"      Day
     data-surface="system"   whichever the device is set to

   A club's own colours (set in HQ, never by a product) arrive as a second stylesheet after this one, in the same
   variable names, so they win by order.

   Load this AFTER a product's own stylesheet; the bridge near the bottom points the older names (--bg, --panel…) at
   these. */

:root {
  --bts-bg: #0B0D11;
  --bts-surface: #11151C;
  --bts-panel: #11151C;
  --bts-surface-raised: #161B22;
  --bts-border: #252C36;
  --bts-border-subtle: #1a2028;
  --bts-text: #F2F5F8;
  --bts-text-muted: #B5BDC8;
  --bts-text-dim: #76808C;
  --bts-accent: #D71920;
  --bts-accent-hover: #ef2a32;
  --bts-accent-muted: rgba(215, 25, 32, 0.16);
  --bts-accent-ink: #FFFFFF;
  --bts-accent-text: #e05f65;
  --bts-focus-ring: var(--bts-accent-text);
  --bts-input-bg: rgba(11, 13, 17, 0.85);
  --bts-success: #2ECC71;
  --bts-success-muted: rgba(46, 204, 113, 0.12);
  --bts-success-ink: #0B0D11;
  --bts-warning: #E0B100;
  --bts-warning-muted: rgba(224, 177, 0, 0.12);
  --bts-warning-ink: #0B0D11;
  --bts-danger: #EF6B6B;
  --bts-danger-muted: rgba(239, 107, 107, 0.12);
  --bts-danger-ink: #0B0D11;
  --bts-info: #00A3E0;
  --bts-info-muted: rgba(0, 163, 224, 0.12);
  --bts-info-ink: #0B0D11;
  --bts-row-on: #1C2129;
  --bts-scheme: dark;

  /* Words and lines that carry a state. Night keeps the pale tints every product has always used. */
  --sh-ok-text: #9fddb4;   --sh-ok-line: #2c4a2c;
  --sh-warn-text: #FFE07A; --sh-warn-line: #5a4a10;
  --sh-bad-text: #FF9AA6;  --sh-bad-line: #5c1620;
  --sh-info-text: #9ec5ff; --sh-info-line: #2b3f5e;
  /* Solid fills behind those words (a key held down, a latched button). */
  --sh-ok-fill: #14351f;
  --sh-warn-fill: #2e2604;
  --sh-bad-fill: #3a0a0c;
  /* The green button and toggle, the level-meter well, an "off" toggle, a chip that is on, scrollbars. */
  --sh-go: #1f6f3f;
  --sh-go-ink: #F2F5F8;
  --sh-well: #0e1116;
  --sh-off: #3a4452;
  --sh-raise: #2a323e;
  --sh-scroll: #3a424e;
  --sh-scroll-hover: #4d5663;
  /* A row the pointer is over, and the dark canvas a page builder previews on. */
  --sh-hover: #141a22;
  --sh-canvas: #07090c;
  color-scheme: dark;
}

/* Day: HQ's, with its measured contrast (see HQ app.css for the working). */
:root[data-surface='day'] {
  --bts-bg: #F4F5F7;
  --bts-row-on: #EEF1F4;
  --bts-surface: #FFFFFF;
  --bts-panel: #FFFFFF;
  --bts-surface-raised: #FFFFFF;
  --bts-border: #DCE0E6;
  --bts-border-subtle: #EDEFF2;
  --bts-text: #14171C;
  --bts-text-muted: #5A626C;
  --bts-text-dim: #666D77;
  --bts-accent-text: #b8191f;
  --bts-input-bg: #FFFFFF;
  --bts-success: #146837;
  --bts-success-muted: rgba(20, 104, 55, 0.12);
  --bts-success-ink: #FFFFFF;
  --bts-warning: #725800;
  --bts-warning-muted: rgba(114, 88, 0, 0.14);
  --bts-warning-ink: #FFFFFF;
  --bts-danger: #B3151B;
  --bts-danger-muted: rgba(179, 21, 27, 0.1);
  --bts-danger-ink: #FFFFFF;
  --bts-info: #0A6285;
  --bts-info-muted: rgba(10, 98, 133, 0.12);
  --bts-info-ink: #FFFFFF;
  --bts-scheme: light;

  --sh-ok-text: #146837;   --sh-ok-line: #b7dcc5;
  --sh-warn-text: #725800; --sh-warn-line: #e6d28a;
  --sh-bad-text: #B3151B;  --sh-bad-line: #efb9bd;
  --sh-info-text: #0A6285; --sh-info-line: #b8cbe8;
  --sh-ok-fill: rgba(20, 104, 55, 0.12);
  --sh-warn-fill: rgba(114, 88, 0, 0.14);
  --sh-bad-fill: rgba(179, 21, 27, 0.1);
  --sh-go: #146837;
  --sh-go-ink: #FFFFFF;
  --sh-well: #E3E7EC;
  --sh-off: #9aa3ae;
  --sh-raise: #D3D8DF;
  --sh-scroll: #c3c9d1;
  --sh-scroll-hover: #aab2bc;
  --sh-hover: #F2F4F7;
  --sh-canvas: #DDE1E7;
  color-scheme: light;
}

/* System: Day while the device is on light, Night otherwise. The same Day values again, because a media query
   can't share a block with a selector. A test keeps the two the same. */
@media (prefers-color-scheme: light) {
  :root[data-surface='system'] {
    --bts-bg: #F4F5F7;
    --bts-row-on: #EEF1F4;
    --bts-surface: #FFFFFF;
    --bts-panel: #FFFFFF;
    --bts-surface-raised: #FFFFFF;
    --bts-border: #DCE0E6;
    --bts-border-subtle: #EDEFF2;
    --bts-text: #14171C;
    --bts-text-muted: #5A626C;
    --bts-text-dim: #666D77;
    --bts-accent-text: #b8191f;
    --bts-input-bg: #FFFFFF;
    --bts-success: #146837;
    --bts-success-muted: rgba(20, 104, 55, 0.12);
    --bts-success-ink: #FFFFFF;
    --bts-warning: #725800;
    --bts-warning-muted: rgba(114, 88, 0, 0.14);
    --bts-warning-ink: #FFFFFF;
    --bts-danger: #B3151B;
    --bts-danger-muted: rgba(179, 21, 27, 0.1);
    --bts-danger-ink: #FFFFFF;
    --bts-info: #0A6285;
    --bts-info-muted: rgba(10, 98, 133, 0.12);
    --bts-info-ink: #FFFFFF;
    --bts-scheme: light;

    --sh-ok-text: #146837;   --sh-ok-line: #b7dcc5;
    --sh-warn-text: #725800; --sh-warn-line: #e6d28a;
    --sh-bad-text: #B3151B;  --sh-bad-line: #efb9bd;
    --sh-info-text: #0A6285; --sh-info-line: #b8cbe8;
    --sh-ok-fill: rgba(20, 104, 55, 0.12);
    --sh-warn-fill: rgba(114, 88, 0, 0.14);
    --sh-bad-fill: rgba(179, 21, 27, 0.1);
    --sh-go: #146837;
    --sh-go-ink: #FFFFFF;
    --sh-well: #E3E7EC;
    --sh-off: #9aa3ae;
    --sh-raise: #D3D8DF;
    --sh-scroll: #c3c9d1;
    --sh-scroll-hover: #aab2bc;
    --sh-hover: #F2F4F7;
    --sh-canvas: #DDE1E7;
    color-scheme: light;
  }
}

/* The rail is chrome you glance at, so it is dark in Day and Night alike (Shane, 8 Oct 2026). Not touched by
   any club's colours except the accent that lights up the line you are on. */
:root {
  --bts-rail-bg: #0E1218;
  --bts-rail-border: #252C36;
  --bts-rail-panel: #161B22;
  --bts-rail-field: #0B0D11;
  --bts-rail-text: #B5BDC8;
  --bts-rail-text-strong: #F2F5F8;
  --bts-rail-text-dim: #76808C;
  --bts-rail-warning: #E0B100;
  --bts-rail-success: #2ECC71;
  --bts-rail-danger: #C62828;
  --bts-rail-hover: rgba(255, 255, 255, 0.05);
}

/* The bridge: the names the older stylesheets use, pointed at HQ's. At Night every value is the one they had,
   except --danger, which is HQ's lifted red so the word reads on its own wash. */
:root {
  --bg: var(--bts-bg);
  --bg2: var(--bts-surface);
  --panel: var(--bts-surface-raised);
  --line: var(--bts-border);
  --text: var(--bts-text);
  --text2: var(--bts-text-muted);
  --muted: var(--bts-text-dim);
  --red: var(--bts-accent);
  --green: var(--bts-success);
  --amber: var(--bts-warning);
  --danger: var(--bts-danger);
}

/* A product's own rail (`.rail`, from the mockup stylesheets) is dark in Day too: the older names are pointed at the
   rail colours inside it, so its rules keep working. The kit's own rail (`.sh-rail`) does the same in calm.css. */
.rail {
  --bg: var(--bts-rail-field); --bg2: var(--bts-rail-bg); --panel: var(--bts-rail-panel); --line: var(--bts-rail-border);
  --text: var(--bts-rail-text-strong); --text2: var(--bts-rail-text); --muted: var(--bts-rail-text-dim);
  --amber: var(--bts-rail-warning); --green: var(--bts-rail-success); --danger: var(--bts-rail-danger);
  color-scheme: dark;
}

/* The words on the solid green and red buttons: the page's dark text on Day's deeper fills read badly, so they take the ink
   made for those fills. Loaded after the product's own stylesheet, so one rule here is every product's. */
button.go { color: var(--sh-go-ink); }
button.hot { color: var(--bts-accent-ink); }

/* Dropdowns, date pickers and scrollbars the browser draws itself. */
*::-webkit-scrollbar-thumb { background: var(--sh-scroll); }
*::-webkit-scrollbar-thumb:hover { background: var(--sh-scroll-hover); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-color: var(--sh-scroll) transparent; } }
