:root {
  color-scheme: light;
  --fade-rgb: 255 255 255;
  --node-explanation: #246b94;
  --node-source: #a55235;
  --node-collection: #397e70;
  --node-instrument: #7354a1;
  --node-workflow: #a12d70;
  --graph-edge: #9badb8;
  --chart-grid: #bdced9;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #10171d;
  --ink: #edf3f6;
  --muted: #afc0cb;
  --line: #354752;
  --accent: #82c0e1;
  --accent-dark: #b0dcf4;
  --warm: #e7a18b;
  --light: #1c2b35;
  --gray: #a5b5bf;
  --darkgray: #bed0db;
  --highlight: #2b4758;
  --fade-rgb: 16 23 29;
  --node-explanation: #82c0e1;
  --node-source: #ee9877;
  --node-collection: #81bea9;
  --node-instrument: #b7a0e9;
  --node-workflow: #f084b7;
  --graph-edge: #718995;
  --chart-grid: #405661;
  --raised: #18232b;
}
.graph-node text { stroke: var(--paper); }
html[data-theme="dark"] .global-graph-outer { background: var(--paper); }
html[data-theme="dark"] :is(.help,.graph-card,.glossary-dialog,.diagram-method) { background: var(--raised); box-shadow: 0 14px 60px #0006; }
html[data-theme="dark"] :is(.searchbox,.level-control,.reader-figure,.reader-table,.compare-control,.help-feedback input,.help-feedback textarea) { background: var(--paper); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] body.graph-active.search-open .searchbox { background: var(--raised); }
html[data-theme="dark"] :is(#source-submit,#feedback-submit) { background: var(--accent); color: var(--paper); }
html[data-theme="dark"] :is(#source-submit,#feedback-submit):hover { background: var(--accent-dark); }
html[data-theme="dark"] .graph-card-actions { background: linear-gradient(var(--raised) 72%,transparent); }
html[data-theme="dark"] #search-backdrop { background: #10171d80; }
html[data-theme="dark"] :is(.action-icon,.site-home-link,.graph-controls button,.graph-card-actions button):is(:hover,:focus-visible) { background: var(--raised); color: var(--accent-dark); box-shadow: 0 5px 18px #0007,0 0 17px #82c0e120; }
html[data-theme="dark"] .rating-reader { border-color: var(--line); }
html[data-theme="dark"] .reader-result { background: #223b4a; }
html[data-theme="dark"] .selected-row { background: var(--highlight); }
html[data-theme="dark"] .plot-grid { stroke: var(--line); }
html[data-theme="dark"] .plot-axis { stroke: var(--muted); }
html[data-theme="dark"] :is(.selected-marker-a,.selected-marker-b) { stroke: var(--paper); }
html[data-theme="dark"] #search-error { background: #422d27; color: #ffd5c7; }
html[data-theme="dark"] .site-hero p { color: #d4dfe6; }
html[data-theme="dark"] ::selection { background: #385c72; color: #fff; }
