/* Dark is the first-paint fallback; the blocking bootstrap restores explicit preferences. */
:root {
  color-scheme:dark;
  --external-brand-panel:rgb(255 255 255);
  --text-rgb:248 243 240;--surface-rgb:41 35 38;--contrast-rgb:41 35 38;
  --ink-rgb:var(--text-rgb);--paper-rgb:var(--surface-rgb);--inverse-rgb:var(--contrast-rgb);--shadow-rgb:0 0 0;
  --text:rgb(var(--text-rgb));--surface:rgb(var(--surface-rgb));--page:#211c1f;--surface-raised:#40373b;--surface-hover:#4b4146;
  --tone-dark:var(--text);--tone-light:var(--surface);
  --signal-red:#f8303a;--signal-green:#67ccb4;--signal-yellow:#ffc76c;--signal-blue:#89a3ff;
  --text-danger:#ff858b;--signal-on-green:#211c1f;--signal-on-red:#120e10;
  --welcome-bg:#393134;--welcome-bg-rgb:57 49 52;--welcome-text:var(--text);--welcome-ink-rgb:var(--text-rgb);--deck-edge:#4d4449;
  --popup-bg:#352e32;--popup-text:var(--text);--table-cell:var(--surface);--table-sorted:#40373b;
  --rink-line:var(--text);--rink-label:var(--text);--rink-halo:var(--surface);--rink-label-surface:var(--surface);
  --video-bg:#090809;--scrim:rgb(0 0 0 / .7);--focus:var(--signal-green);
  --action-bg:var(--text);--action-text:rgb(var(--contrast-rgb));--image-panel:#f8f3f0;
  --hero-dark:var(--welcome-bg);--hero-light:var(--welcome-bg);--hero-card:rgb(var(--welcome-ink-rgb) / .08);
  color:var(--text);background:var(--page);
}
:root[data-theme="light"] {
  color-scheme:light;
  --text-rgb:57 49 52;--surface-rgb:248 243 240;--contrast-rgb:248 243 240;
  --page:#f8f3f0;--surface-raised:#eee7e4;--surface-hover:#e5dcda;
  --signal-blue:#001494;--text-danger:#a51b27;
  --welcome-bg:#eee7e4;--welcome-bg-rgb:238 231 228;--deck-edge:#d6cac7;
  --popup-bg:#f8f3f0;--table-sorted:#eee7e4;--scrim:rgb(0 0 0 / .42);
  --focus:#236b5b;
}
/* Roles stay separate from brand colors, including within the welcome/metric block. */
html,body{background:var(--page);color:var(--text)}
body{accent-color:var(--focus)}
button,input,select,textarea{color:inherit;color-scheme:inherit}
input::placeholder,textarea::placeholder{color:rgb(var(--text-rgb) / .72);opacity:1}
select option,select optgroup{background:var(--popup-bg);color:var(--popup-text)}
input[type=checkbox],input[type=radio],input[type=range],progress{accent-color:var(--focus)}
::selection{background:rgb(103 204 180 / .3);color:var(--text)}
:focus-visible{outline-color:var(--focus)}
*{scrollbar-color:rgb(var(--text-rgb) / .32) var(--surface);scrollbar-width:thin}
.theme-toggle{width:auto;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:8px 12px;border:1px solid rgb(var(--text-rgb) / .18);background:transparent;color:var(--text);font-size:11px;white-space:nowrap;min-height:36px}
.theme-toggle:hover{background:rgb(var(--text-rgb) / .08)}
.theme-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5}
.header-utilities{display:flex;align-items:center;gap:20px;min-width:0}
.header-utilities .header-account{margin-left:0}
@media(width<=480px){.header-utilities{gap:10px}.theme-toggle{padding:8px}.theme-toggle span{display:none}}

input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus{box-shadow:0 0 0 1000px var(--surface) inset;-webkit-text-fill-color:var(--text);caret-color:var(--text)}
.header-utilities .account-toggle{max-width:min(360px,30vw)}
.theme-toggle{flex-shrink:0}
