:root {
  --blue-950: #103451;
  --blue-900: #174968;
  --blue-700: #3f779e;
  --blue-500: #6d9aba;
  --blue-100: #eaf2f7;
  --cyan: #17a7ac;
  --ink: #173144;
  --muted: #667986;
  --line: #d9e3e9;
  --paper: #ffffff;
  --wash: #f3f7f9;
  --warning: #9b5b00;
  --warning-bg: #fff6e5;
  --danger-bg: #fff0ed;
  --radius: 16px;
  --shadow: 0 16px 42px rgba(25, 64, 88, .08);
}

/* Paint the browser canvas and body with the active palette, including tab resume. */
html, body { background: var(--wash); color: var(--ink); }

html[data-theme="dark"] {
  color-scheme: dark;
  accent-color: var(--cyan);
  --blue-950: #123c63;
  --blue-900: #23638b;
  --blue-700: #70b9de;
  --blue-500: #7fc6e8;
  --blue-100: #213b4d;
  --cyan: #5ed5d3;
  --ink: #eaf2f7;
  --muted: #b3c8d5;
  --line: #345064;
  --paper: #1a2c3b;
  --wash: #101d2b;
  --warning: #ffd08b;
  --warning-bg: #40301f;
  --danger-bg: #402b30;
  --surface: #1a2c3b;
  --surface-muted: #203747;
  --surface-elevated: #1a2c3b;
  --surface-hover: #294657;
  --surface-selected: #193e48;
  --border-selected: #4baaad;
  --input-bg: #132331;
  --input-border: #5f8096;
  --placeholder: #94adbd;
  --disabled-bg: #263847;
  --disabled-text: #a9bdca;
  --disabled-border: #3c5262;
  --switch-off: #657a88;
  --label-text: #c8dce8;
  --muted-text: #b3c8d5;
  --subtle-text: #a9bdca;
  --action-bg: #2c6e94;
  --action-hover: #327a9f;
  --action-text: #ffffff;
  --secondary-bg: #244458;
  --secondary-hover: #31566d;
  --secondary-text: #c9ecff;
  --secondary-border: #3d667d;
  --success-text: #a6eeea;
  --success-bg: #173a40;
  --success-border: #34747a;
  --warning-text: #ffd08b;
  --warning-border: #806044;
  --error-text: #ffb9af;
  --error-border: #825055;
  --positive-bg: #204539;
  --positive-text: #b1efd4;
  --neutral-bg: #30404c;
  --neutral-text: #d0dde5;
  --selected-bg: #234e56;
  --selected-text: #b4f0ed;
  --nav-text: #c1d4e0;
  --nav-selected-bg: #70b9de;
  --nav-selected-text: #071927;
  --brand-strong: #23638b;
  --inverse-accent: #a6eeea;
  --inverse-muted: #d4e5ef;
  --row-border: #345064;
  --backdrop: #030a11c9;
  --focus-ring: #5ed5d34d;
  --auth-page: #101d2b;
  --auth-text: #eaf2f7;
  --auth-muted: #b3c8d5;
  --auth-border: #345064;
  --auth-input-border: #5f8096;
  --auth-action: #286180;
  --shadow: 0 16px 42px rgba(2, 9, 16, .25);
}

.theme-toggle { min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--secondary-text, var(--blue-700)); background: transparent; font-size: 11px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.theme-toggle:hover { background: var(--secondary-hover, var(--blue-100)); }
.theme-toggle:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
html[data-theme="dark"] :where(button, a, summary, input, select, textarea):focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
html[data-theme="dark"] :where(input, textarea)::placeholder { color: var(--placeholder); opacity: 1; }
@media print { html, body { background: #fff; } .theme-toggle { display: none !important; } html[data-theme="dark"] { color-scheme: light; } }
