:root,
:root[data-theme="imperial-gold"],
.theme-preview[data-theme="imperial-gold"] {
  color-scheme: dark;

  --theme-background: #05080f;
  --theme-background-secondary: #07111f;
  --theme-background-elevated: #0b1220;
  --theme-surface: #060a0f;
  --theme-surface-elevated: #0b1017;
  --theme-surface-high: #111723;

  --theme-text-primary: #f8fafc;
  --theme-text-secondary: #d7dde4;
  --theme-text-muted: #98a2ad;

  --theme-accent: #f2a900;
  --theme-accent-strong: #f59e0b;
  --theme-accent-deep: #c77c12;
  --theme-accent-soft: rgba(242, 169, 0, 0.11);
  --theme-activity: #14b8a6;
  --theme-activity-bright: #2dd4bf;

  --theme-line: rgba(242, 240, 232, 0.12);
  --theme-line-strong: rgba(242, 240, 232, 0.2);
  --theme-line-accent: rgba(242, 169, 0, 0.42);

  --theme-grid: rgba(190, 184, 169, 0.16);
  --theme-grid-inactive: rgba(190, 184, 169, 0.16);
  --theme-grid-active: #2bb5a5;
  --theme-grid-strong: rgba(224, 193, 132, 0.17);
  --theme-grid-cell: rgba(255, 250, 238, 0.012);
  --theme-grid-cell-alternate: rgba(216, 160, 55, 0.026);

  --theme-occupant: color-mix(in srgb, var(--theme-text-primary) 94%, var(--theme-selection) 6%);
  --theme-occupant-fill: rgba(11, 15, 20, 0.97);
  --theme-occupant-stroke: color-mix(in srgb, var(--theme-text-secondary) 62%, var(--theme-selection) 38%);
  --theme-occupant-root-fill: rgba(22, 24, 27, 0.99);
  --theme-connector: color-mix(in srgb, var(--theme-text-secondary) 64%, var(--theme-activity) 36%);
  --theme-focus: #ffd98a;
  --theme-selection: #e7ad45;
  --theme-hover: #e7ad45;
  --theme-related: #67b4b0;
  --theme-ancestor: #ffde99;
  --theme-descendant: #37d3c0;
  --theme-focus-text: color-mix(in srgb, var(--theme-focus) 42%, white 58%);
  --theme-hover-text: color-mix(in srgb, var(--theme-hover) 38%, white 62%);
  --theme-root-stroke: color-mix(in srgb, var(--theme-focus) 52%, white 48%);
  --theme-state-selected-fill: color-mix(in srgb, var(--theme-selection) 24%, var(--theme-occupant-fill) 76%);
  --theme-state-related-text: color-mix(in srgb, var(--theme-related) 76%, white 24%);
  --theme-state-related-fill: color-mix(in srgb, var(--theme-related) 18%, var(--theme-occupant-fill) 82%);
  --theme-state-related-stroke: color-mix(in srgb, var(--theme-related) 72%, transparent);
  --theme-state-ancestor-text: color-mix(in srgb, var(--theme-ancestor) 82%, white 18%);
  --theme-state-ancestor-fill: color-mix(in srgb, var(--theme-ancestor) 20%, var(--theme-occupant-fill) 80%);
  --theme-state-ancestor-stroke: color-mix(in srgb, var(--theme-ancestor) 86%, transparent);
  --theme-state-descendant-text: color-mix(in srgb, var(--theme-descendant) 78%, white 22%);
  --theme-state-descendant-fill: color-mix(in srgb, var(--theme-descendant) 19%, var(--theme-occupant-fill) 81%);
  --theme-state-descendant-stroke: color-mix(in srgb, var(--theme-descendant) 84%, transparent);
  --theme-state-glow: color-mix(in srgb, currentColor 24%, transparent);

  --theme-inspector-background: rgba(6, 10, 15, 0.78);
  --theme-inspector-border: rgba(255, 255, 255, 0.08);
  --theme-minimap-background: rgba(3, 6, 10, 0.72);
  --theme-minimap-badge-background: rgba(8, 10, 14, 0.55);
  --theme-minimap-control-background: rgba(8, 10, 14, 0.5);
  --theme-minimap-text: rgba(242, 240, 232, 0.84);
  --theme-minimap-control-text: rgba(242, 240, 232, 0.9);
  --theme-minimap-icon: rgba(242, 240, 232, 0.95);
  --theme-minimap-grid: rgba(255, 255, 255, 0.08);
  --theme-minimap-viewport: #ffde99;
  --theme-minimap-occupant: #e7ad45;
  --theme-minimap-focused: #ffd98a;
  --theme-minimap-related: #67b4b0;
  --theme-minimap-path: #2bb5a5;

  --theme-signal-ambient: #2bb5a5;
  --theme-signal-origin: #f59e0b;
  --theme-signal-path: #14b8a6;
  --theme-signal-receiving: #2bb5a5;
  --theme-signal-broadcast: #e7ad45;
  --theme-signal-resolved: #94a3b8;

  --theme-status-info: #2f79ad;
  --theme-status-success: #44c06a;
  --theme-status-danger: #e15b64;

  --theme-scene-canvas: #030609;
  --theme-scene-surface: #080d12;
  --theme-scene-depth: #010305;
  --theme-atmosphere-selection: rgba(231, 173, 69, 0.085);
  --theme-atmosphere-activity: rgba(43, 181, 165, 0.045);
  --theme-pointer-glow: rgba(43, 181, 165, 0.14);
  --theme-vignette: rgba(0, 0, 0, 0.54);
  --theme-glass-border: rgba(255, 255, 255, 0.08);
  --theme-glass-border-strong: rgba(255, 255, 255, 0.1);
  --theme-glass-highlight: rgba(255, 255, 255, 0.05);
  --theme-minimap-cell: rgba(255, 255, 255, 0.02);
  --theme-minimap-occupant-fill: rgba(242, 169, 0, 0.54);
  --theme-minimap-occupant-stroke: rgba(255, 234, 184, 0.84);
  --theme-minimap-focused-fill: rgba(255, 226, 140, 1);
  --theme-minimap-focused-stroke: rgba(255, 248, 220, 1);
  --theme-minimap-viewport-stroke: rgba(255, 222, 153, 0.9);
}

:root[data-theme="midnight-electric"],
.theme-preview[data-theme="midnight-electric"] {
  --theme-background: #02050b;
  --theme-background-secondary: #06101d;
  --theme-background-elevated: #0a1727;
  --theme-surface: #050a12;
  --theme-surface-elevated: #09121e;
  --theme-surface-high: #101c2b;
  --theme-text-primary: #f5f9ff;
  --theme-text-secondary: #c8d5e5;
  --theme-text-muted: #8293a8;
  --theme-accent: #3b82f6;
  --theme-accent-strong: #60a5fa;
  --theme-accent-deep: #2563eb;
  --theme-accent-soft: rgba(59, 130, 246, 0.12);
  --theme-activity: #22d3ee;
  --theme-activity-bright: #67e8f9;
  --theme-line-accent: rgba(59, 130, 246, 0.44);
  --theme-grid: rgba(99, 145, 194, 0.17);
  --theme-grid-inactive: rgba(99, 145, 194, 0.17);
  --theme-grid-active: #22d3ee;
  --theme-grid-strong: rgba(96, 165, 250, 0.22);
  --theme-grid-cell-alternate: rgba(59, 130, 246, 0.03);
  --theme-occupant-fill: rgba(7, 21, 39, 0.97);
  --theme-occupant-root-fill: rgba(11, 32, 56, 0.99);
  --theme-connector: rgba(115, 177, 225, 0.5);
  --theme-focus: #93c5fd;
  --theme-selection: #60a5fa;
  --theme-hover: #60a5fa;
  --theme-related: #67e8f9;
  --theme-ancestor: #bfdbfe;
  --theme-descendant: #22d3ee;
  --theme-minimap-occupant-fill: rgba(59, 130, 246, 0.58);
  --theme-minimap-occupant-stroke: rgba(191, 219, 254, 0.88);
  --theme-minimap-focused-fill: #93c5fd;
  --theme-minimap-focused-stroke: #eff6ff;
  --theme-minimap-viewport-stroke: rgba(147, 197, 253, 0.92);
  --theme-signal-ambient: #22d3ee;
  --theme-signal-origin: #60a5fa;
  --theme-signal-path: #22d3ee;
  --theme-signal-receiving: #67e8f9;
  --theme-signal-broadcast: #93c5fd;
  --theme-scene-canvas: #01040a;
  --theme-scene-surface: #06101b;
  --theme-scene-depth: #010207;
  --theme-atmosphere-selection: rgba(59, 130, 246, 0.09);
  --theme-atmosphere-activity: rgba(34, 211, 238, 0.05);
  --theme-pointer-glow: rgba(34, 211, 238, 0.14);
}

:root[data-theme="crimson-ops"],
.theme-preview[data-theme="crimson-ops"] {
  --theme-background: #070305;
  --theme-background-secondary: #120509;
  --theme-background-elevated: #1a080e;
  --theme-surface: #0d0508;
  --theme-surface-elevated: #16090d;
  --theme-surface-high: #211015;
  --theme-text-primary: #fff7f8;
  --theme-text-secondary: #e7cdd2;
  --theme-text-muted: #a18288;
  --theme-accent: #dc143c;
  --theme-accent-strong: #ff334f;
  --theme-accent-deep: #9f1239;
  --theme-accent-soft: rgba(220, 20, 60, 0.12);
  --theme-activity: #fb7185;
  --theme-activity-bright: #fda4af;
  --theme-line-accent: rgba(220, 20, 60, 0.46);
  --theme-grid: rgba(187, 108, 121, 0.17);
  --theme-grid-inactive: rgba(187, 108, 121, 0.17);
  --theme-grid-active: #fb7185;
  --theme-grid-strong: rgba(255, 51, 79, 0.22);
  --theme-grid-cell-alternate: rgba(220, 20, 60, 0.03);
  --theme-occupant-fill: rgba(24, 8, 13, 0.97);
  --theme-occupant-root-fill: rgba(37, 11, 18, 0.99);
  --theme-connector: rgba(211, 139, 151, 0.5);
  --theme-focus: #fecdd3;
  --theme-selection: #fb7185;
  --theme-hover: #fb7185;
  --theme-related: #fda4af;
  --theme-ancestor: #ffe4e6;
  --theme-descendant: #ff4664;
  --theme-minimap-occupant-fill: rgba(220, 20, 60, 0.58);
  --theme-minimap-occupant-stroke: rgba(254, 205, 211, 0.88);
  --theme-minimap-focused-fill: #fda4af;
  --theme-minimap-focused-stroke: #fff1f2;
  --theme-minimap-viewport-stroke: rgba(253, 164, 175, 0.92);
  --theme-signal-ambient: #fb7185;
  --theme-signal-origin: #ff334f;
  --theme-signal-path: #fb7185;
  --theme-signal-receiving: #fda4af;
  --theme-signal-broadcast: #fecdd3;
  --theme-scene-canvas: #050203;
  --theme-scene-surface: #100508;
  --theme-scene-depth: #030102;
  --theme-atmosphere-selection: rgba(220, 20, 60, 0.09);
  --theme-atmosphere-activity: rgba(251, 113, 133, 0.05);
  --theme-pointer-glow: rgba(251, 113, 133, 0.14);
}

:root[data-theme="emerald-matrix"],
.theme-preview[data-theme="emerald-matrix"] {
  --theme-background: #020806;
  --theme-background-secondary: #04130d;
  --theme-background-elevated: #071b13;
  --theme-surface: #040d09;
  --theme-surface-elevated: #081710;
  --theme-surface-high: #0e2118;
  --theme-text-primary: #f3fff9;
  --theme-text-secondary: #c9e4d7;
  --theme-text-muted: #7fa392;
  --theme-accent: #10b981;
  --theme-accent-strong: #34d399;
  --theme-accent-deep: #047857;
  --theme-accent-soft: rgba(16, 185, 129, 0.12);
  --theme-activity: #6ee7b7;
  --theme-activity-bright: #a7f3d0;
  --theme-line-accent: rgba(16, 185, 129, 0.44);
  --theme-grid: rgba(93, 163, 132, 0.17);
  --theme-grid-inactive: rgba(93, 163, 132, 0.17);
  --theme-grid-active: #34d399;
  --theme-grid-strong: rgba(52, 211, 153, 0.22);
  --theme-grid-cell-alternate: rgba(16, 185, 129, 0.03);
  --theme-occupant-fill: rgba(6, 24, 16, 0.97);
  --theme-occupant-root-fill: rgba(9, 37, 26, 0.99);
  --theme-connector: rgba(109, 190, 153, 0.5);
  --theme-focus: #a7f3d0;
  --theme-selection: #34d399;
  --theme-hover: #34d399;
  --theme-related: #6ee7b7;
  --theme-ancestor: #d1fae5;
  --theme-descendant: #10b981;
  --theme-minimap-occupant-fill: rgba(16, 185, 129, 0.58);
  --theme-minimap-occupant-stroke: rgba(167, 243, 208, 0.88);
  --theme-minimap-focused-fill: #6ee7b7;
  --theme-minimap-focused-stroke: #ecfdf5;
  --theme-minimap-viewport-stroke: rgba(110, 231, 183, 0.92);
  --theme-signal-ambient: #34d399;
  --theme-signal-origin: #10b981;
  --theme-signal-path: #6ee7b7;
  --theme-signal-receiving: #a7f3d0;
  --theme-signal-broadcast: #d1fae5;
  --theme-scene-canvas: #010604;
  --theme-scene-surface: #05120d;
  --theme-scene-depth: #010302;
  --theme-atmosphere-selection: rgba(16, 185, 129, 0.09);
  --theme-atmosphere-activity: rgba(110, 231, 183, 0.05);
  --theme-pointer-glow: rgba(52, 211, 153, 0.14);
}

:root[data-theme="arctic"],
.theme-preview[data-theme="arctic"] {
  --theme-background: #06101a;
  --theme-background-secondary: #0a1926;
  --theme-background-elevated: #102536;
  --theme-surface: #09151f;
  --theme-surface-elevated: #0e202f;
  --theme-surface-high: #173044;
  --theme-text-primary: #f8fdff;
  --theme-text-secondary: #d4e8f2;
  --theme-text-muted: #8da9b8;
  --theme-accent: #7dd3fc;
  --theme-accent-strong: #bae6fd;
  --theme-accent-deep: #0284c7;
  --theme-accent-soft: rgba(125, 211, 252, 0.12);
  --theme-activity: #67e8f9;
  --theme-activity-bright: #cffafe;
  --theme-line-accent: rgba(125, 211, 252, 0.42);
  --theme-grid: rgba(145, 190, 211, 0.18);
  --theme-grid-inactive: rgba(145, 190, 211, 0.18);
  --theme-grid-active: #67e8f9;
  --theme-grid-strong: rgba(186, 230, 253, 0.23);
  --theme-grid-cell-alternate: rgba(125, 211, 252, 0.03);
  --theme-occupant-fill: rgba(11, 34, 50, 0.97);
  --theme-occupant-root-fill: rgba(16, 53, 74, 0.99);
  --theme-connector: rgba(145, 202, 225, 0.5);
  --theme-focus: #e0f2fe;
  --theme-selection: #7dd3fc;
  --theme-hover: #7dd3fc;
  --theme-related: #a5f3fc;
  --theme-ancestor: #f0f9ff;
  --theme-descendant: #67e8f9;
  --theme-minimap-occupant-fill: rgba(125, 211, 252, 0.58);
  --theme-minimap-occupant-stroke: rgba(224, 242, 254, 0.9);
  --theme-minimap-focused-fill: #bae6fd;
  --theme-minimap-focused-stroke: #ffffff;
  --theme-minimap-viewport-stroke: rgba(186, 230, 253, 0.94);
  --theme-signal-ambient: #67e8f9;
  --theme-signal-origin: #7dd3fc;
  --theme-signal-path: #67e8f9;
  --theme-signal-receiving: #a5f3fc;
  --theme-signal-broadcast: #e0f2fe;
  --theme-scene-canvas: #040c14;
  --theme-scene-surface: #0a1925;
  --theme-scene-depth: #02070c;
  --theme-atmosphere-selection: rgba(125, 211, 252, 0.09);
  --theme-atmosphere-activity: rgba(103, 232, 249, 0.05);
  --theme-pointer-glow: rgba(125, 211, 252, 0.14);
}

:root[data-theme="amethyst"],
.theme-preview[data-theme="amethyst"] {
  --theme-background: #08050f;
  --theme-background-secondary: #120a20;
  --theme-background-elevated: #1a102c;
  --theme-surface: #0d0816;
  --theme-surface-elevated: #160e24;
  --theme-surface-high: #211634;
  --theme-text-primary: #fcfaff;
  --theme-text-secondary: #ded4eb;
  --theme-text-muted: #9c8aac;
  --theme-accent: #8b5cf6;
  --theme-accent-strong: #a78bfa;
  --theme-accent-deep: #6d28d9;
  --theme-accent-soft: rgba(139, 92, 246, 0.12);
  --theme-activity: #c4b5fd;
  --theme-activity-bright: #ddd6fe;
  --theme-line-accent: rgba(139, 92, 246, 0.44);
  --theme-grid: rgba(153, 127, 190, 0.18);
  --theme-grid-inactive: rgba(153, 127, 190, 0.18);
  --theme-grid-active: #c4b5fd;
  --theme-grid-strong: rgba(167, 139, 250, 0.23);
  --theme-grid-cell-alternate: rgba(139, 92, 246, 0.03);
  --theme-occupant-fill: rgba(23, 13, 37, 0.97);
  --theme-occupant-root-fill: rgba(37, 21, 58, 0.99);
  --theme-connector: rgba(172, 145, 207, 0.5);
  --theme-focus: #ddd6fe;
  --theme-selection: #a78bfa;
  --theme-hover: #a78bfa;
  --theme-related: #c4b5fd;
  --theme-ancestor: #ede9fe;
  --theme-descendant: #8b5cf6;
  --theme-minimap-occupant-fill: rgba(139, 92, 246, 0.58);
  --theme-minimap-occupant-stroke: rgba(221, 214, 254, 0.9);
  --theme-minimap-focused-fill: #c4b5fd;
  --theme-minimap-focused-stroke: #f5f3ff;
  --theme-minimap-viewport-stroke: rgba(196, 181, 253, 0.94);
  --theme-signal-ambient: #c4b5fd;
  --theme-signal-origin: #8b5cf6;
  --theme-signal-path: #a78bfa;
  --theme-signal-receiving: #c4b5fd;
  --theme-signal-broadcast: #ddd6fe;
  --theme-scene-canvas: #050309;
  --theme-scene-surface: #10091b;
  --theme-scene-depth: #030205;
  --theme-atmosphere-selection: rgba(139, 92, 246, 0.09);
  --theme-atmosphere-activity: rgba(196, 181, 253, 0.05);
  --theme-pointer-glow: rgba(167, 139, 250, 0.14);
}

:root[data-theme="copper-industrial"],
.theme-preview[data-theme="copper-industrial"] {
  --theme-background: #080503;
  --theme-background-secondary: #140c07;
  --theme-background-elevated: #1d120b;
  --theme-surface: #0e0905;
  --theme-surface-elevated: #181009;
  --theme-surface-high: #25180f;
  --theme-text-primary: #fffaf2;
  --theme-text-secondary: #ead9c4;
  --theme-text-muted: #a68e74;
  --theme-accent: #c97941;
  --theme-accent-strong: #e39a61;
  --theme-accent-deep: #9a4f24;
  --theme-accent-soft: rgba(201, 121, 65, 0.13);
  --theme-activity: #f59e0b;
  --theme-activity-bright: #fbbf24;
  --theme-line-accent: rgba(201, 121, 65, 0.46);
  --theme-grid: rgba(170, 126, 91, 0.18);
  --theme-grid-inactive: rgba(170, 126, 91, 0.18);
  --theme-grid-active: #f59e0b;
  --theme-grid-strong: rgba(227, 154, 97, 0.23);
  --theme-grid-cell-alternate: rgba(201, 121, 65, 0.035);
  --theme-occupant-fill: rgba(26, 15, 8, 0.97);
  --theme-occupant-root-fill: rgba(42, 23, 12, 0.99);
  --theme-connector: rgba(192, 151, 112, 0.52);
  --theme-focus: #fed7aa;
  --theme-selection: #e39a61;
  --theme-hover: #e39a61;
  --theme-related: #fbbf24;
  --theme-ancestor: #ffedd5;
  --theme-descendant: #f59e0b;
  --theme-minimap-occupant-fill: rgba(201, 121, 65, 0.6);
  --theme-minimap-occupant-stroke: rgba(254, 215, 170, 0.9);
  --theme-minimap-focused-fill: #fbbf24;
  --theme-minimap-focused-stroke: #fff7ed;
  --theme-minimap-viewport-stroke: rgba(251, 191, 36, 0.94);
  --theme-signal-ambient: #f59e0b;
  --theme-signal-origin: #c97941;
  --theme-signal-path: #f59e0b;
  --theme-signal-receiving: #fbbf24;
  --theme-signal-broadcast: #fed7aa;
  --theme-scene-canvas: #050302;
  --theme-scene-surface: #120b06;
  --theme-scene-depth: #030201;
  --theme-atmosphere-selection: rgba(201, 121, 65, 0.1);
  --theme-atmosphere-activity: rgba(245, 158, 11, 0.045);
  --theme-pointer-glow: rgba(227, 154, 97, 0.14);
}

:root[data-theme="polar-mono"],
.theme-preview[data-theme="polar-mono"] {
  --theme-background: #050607;
  --theme-background-secondary: #0c0e10;
  --theme-background-elevated: #14171a;
  --theme-surface: #090b0d;
  --theme-surface-elevated: #111417;
  --theme-surface-high: #1a1e22;
  --theme-text-primary: #f5f7f9;
  --theme-text-secondary: #d2d7dc;
  --theme-text-muted: #8c959e;
  --theme-accent: #d9dde3;
  --theme-accent-strong: #f1f3f5;
  --theme-accent-deep: #9ba3ab;
  --theme-accent-soft: rgba(217, 221, 227, 0.1);
  --theme-activity: #9cc8e7;
  --theme-activity-bright: #c5e2f5;
  --theme-line-accent: rgba(217, 221, 227, 0.35);
  --theme-grid: rgba(174, 184, 194, 0.16);
  --theme-grid-inactive: rgba(174, 184, 194, 0.16);
  --theme-grid-active: #9cc8e7;
  --theme-grid-strong: rgba(217, 221, 227, 0.2);
  --theme-grid-cell-alternate: rgba(217, 221, 227, 0.022);
  --theme-occupant-fill: rgba(21, 25, 29, 0.97);
  --theme-occupant-root-fill: rgba(32, 38, 43, 0.99);
  --theme-connector: rgba(174, 184, 194, 0.48);
  --theme-focus: #ffffff;
  --theme-selection: #d9dde3;
  --theme-hover: #d9dde3;
  --theme-related: #9cc8e7;
  --theme-ancestor: #eef1f4;
  --theme-descendant: #9cc8e7;
  --theme-minimap-occupant-fill: rgba(217, 221, 227, 0.54);
  --theme-minimap-occupant-stroke: rgba(245, 247, 249, 0.88);
  --theme-minimap-focused-fill: #ffffff;
  --theme-minimap-focused-stroke: #ffffff;
  --theme-minimap-viewport-stroke: rgba(197, 226, 245, 0.92);
  --theme-signal-ambient: #9cc8e7;
  --theme-signal-origin: #d9dde3;
  --theme-signal-path: #9cc8e7;
  --theme-signal-receiving: #c5e2f5;
  --theme-signal-broadcast: #ffffff;
  --theme-scene-canvas: #030405;
  --theme-scene-surface: #0b0d0f;
  --theme-scene-depth: #010202;
  --theme-atmosphere-selection: rgba(217, 221, 227, 0.07);
  --theme-atmosphere-activity: rgba(156, 200, 231, 0.045);
  --theme-pointer-glow: rgba(156, 200, 231, 0.12);
}

:root[data-contrast="high"] {
  --theme-background: #000;
  --theme-surface: color-mix(in srgb, var(--theme-selection) 4%, #020304);
  --theme-surface-elevated: color-mix(in srgb, var(--theme-selection) 6%, #05070a);
  --theme-surface-high: color-mix(in srgb, var(--theme-selection) 8%, #090c10);
  --theme-text-primary: #fff;
  --theme-text-secondary: #f0f4f8;
  --theme-text-muted: #c3ccd5;
  --theme-line: rgba(255, 255, 255, 0.28);
  --theme-line-strong: rgba(255, 255, 255, 0.44);
  --theme-grid: color-mix(in srgb, var(--theme-activity) 34%, transparent);
  --theme-grid-inactive: color-mix(in srgb, var(--theme-activity) 34%, transparent);
  --theme-grid-strong: color-mix(in srgb, var(--theme-selection) 42%, transparent);
  --theme-occupant-stroke: color-mix(in srgb, var(--theme-text-primary) 72%, var(--theme-selection) 28%);
  --theme-connector: color-mix(in srgb, var(--theme-text-secondary) 68%, var(--theme-activity) 32%);
  --theme-inspector-border: rgba(255, 255, 255, 0.3);
  --theme-minimap-grid: rgba(255, 255, 255, 0.22);
}

:root[data-color-vision="safe"] {
  /* Okabe-Ito derived roles keep hierarchy distinct under common color-vision deficiencies. */
  --theme-related: #56b4e9;
  --theme-ancestor: #e69f00;
  --theme-descendant: #009e73;
  --theme-signal-ambient: #56b4e9;
  --theme-signal-origin: #e69f00;
  --theme-signal-path: #0072b2;
  --theme-signal-receiving: #009e73;
  --theme-signal-broadcast: #f0e442;
  --theme-signal-resolved: #a7adb5;
}

:root[data-glow="reduced"] {
  --theme-pointer-glow: transparent;
  --theme-atmosphere-selection: color-mix(in srgb, var(--theme-selection) 3%, transparent);
  --theme-atmosphere-activity: color-mix(in srgb, var(--theme-activity) 2%, transparent);
}

:root[data-glow="reduced"] .cursor-glow {
  display: none !important;
}

:root[data-glow="reduced"] .topology-node {
  --node-glow: transparent !important;
}

:root[data-glow="reduced"] :is(
  .grid-hex,
  .grid-node,
  .grid-connector,
  .grid-occupant-fill,
  .grid-hex-signal,
  .grid-node-signal,
  .graph-edge,
  .topology-mini-map__node-shape,
  .topology-mini-map__frame
) {
  filter: none !important;
}

:root[data-color-vision="safe"] .grid-connector.relationship-context-related,
:root[data-color-vision="safe"] .grid-occupant.is-related .grid-occupant-fill {
  stroke-dasharray: 2 2;
}

:root[data-color-vision="safe"] .grid-connector.relationship-context-descendant,
:root[data-color-vision="safe"] .grid-occupant.is-descendant .grid-occupant-fill {
  stroke-dasharray: 5 2;
}

:root[data-color-vision="safe"] [data-cell-signal-type="ambient"] {
  stroke-dasharray: 1 3;
}

:root[data-color-vision="safe"] [data-cell-signal-type="broadcast"] {
  stroke-dasharray: 5 2;
}

:root {
  /* Compatibility aliases remain until all renderers consume theme tokens directly. */
  --bg-primary: var(--theme-background);
  --bg-secondary: var(--theme-background-secondary);
  --bg-elevated: var(--theme-background-elevated);
  --surface: var(--theme-surface);
  --surface-raised: var(--theme-surface-elevated);
  --surface-high: var(--theme-surface-high);
  --text: var(--theme-text-primary);
  --text-primary: var(--theme-text-primary);
  --text-secondary: var(--theme-text-secondary);
  --text-muted: var(--theme-text-muted);
  --accent: var(--theme-accent);
  --accent-gold: var(--theme-accent-strong);
  --accent-deep: var(--theme-accent-deep);
  --accent-soft: var(--theme-accent-soft);
  --accent-teal: var(--theme-activity);
  --accent-cyan: var(--theme-activity-bright);
  --signal-blue: var(--theme-status-info);
  --signal-green: var(--theme-status-success);
  --signal-red: var(--theme-status-danger);
  --line: var(--theme-line);
  --line-strong: var(--theme-line-strong);
  --line-accent: var(--theme-line-accent);
  --scene-canvas: var(--theme-scene-canvas);
  --scene-surface: var(--theme-scene-surface);
  --scene-grid: var(--theme-grid);
  --scene-grid-strong: var(--theme-grid-strong);
  --scene-cell: var(--theme-grid-cell);
  --scene-cell-alt: var(--theme-grid-cell-alternate);
  --scene-connector: var(--theme-connector);
  --scene-occupant-fill: var(--theme-occupant-fill);
  --scene-occupant-stroke: var(--theme-occupant-stroke);
  --scene-root-fill: var(--theme-occupant-root-fill);
  --scene-gold: var(--theme-selection);
  --scene-gold-bright: var(--theme-focus);
  --scene-teal: var(--theme-grid-active);
}
