:root {
  color-scheme: dark;
  --canvas: #000000;
  --surface: #101419;
  --panel-rgb: 16, 20, 25;
  --floating-rgb: 12, 18, 26;
  --panel-background: #0c1118;
  --surface-raised: #18202a;
  --ink: #e8eef5;
  --muted: #a5b0bd;
  --faint: #7f8b99;
  --accent: #7eb5f5;
  --accent-rgb: 126, 181, 245;
  --accent-hover: #a3ccfa;
  --on-accent: #0b1726;
  --accent-soft: #b2d1f7;
  --accent-border: #526f91;
  --accent-surface: #18283b;
  --accent-surface-hover: #20344a;
  --line: rgba(220, 232, 247, 0.15);
  --line-rgb: 220, 232, 247;
  --control-border: #425366;
  --feedback-error: #efb49a;
  --focus-offset: 3px;
  --scene-focus-contrast: #080c10;
  --tool-page-background: #090c10;
  --tool-ink: var(--ink);
  --tool-surface: var(--surface);
  --tool-raised: var(--surface-raised);
  --tool-border: #344252;
  --tool-muted: var(--muted);
  --tool-gold: var(--accent);
}

:root[data-theme="gold"] {
  --surface: #111315;
  --panel-rgb: 15, 17, 19;
  --floating-rgb: 12, 14, 16;
  --panel-background: initial;
  --surface-raised: #1a1c1e;
  --ink: #efeee9;
  --muted: #a8a9a5;
  --faint: #818581;
  --accent: #d9b47a;
  --accent-rgb: 217, 180, 122;
  /* Invalid custom-property values select each component's original gold shade. */
  --accent-hover: initial;
  --on-accent: initial;
  --accent-soft: initial;
  --accent-border: initial;
  --accent-surface: initial;
  --accent-surface-hover: initial;
  --line: rgba(227, 228, 221, 0.15);
  --line-rgb: 227, 228, 221;
  --control-border: #485154;
  --tool-page-background: #090c0e;
  --tool-ink: #e6e8e3;
  --tool-surface: #101416;
  --tool-raised: #171c1e;
  --tool-border: #343b3d;
  --tool-muted: #adb7b8;
  --tool-gold: #dfbd86;
}

:root[data-theme="teal"] {
  --surface: #0e1717;
  --panel-rgb: 14, 23, 23;
  --floating-rgb: 10, 19, 19;
  --panel-background: #0a1213;
  --surface-raised: #172526;
  --ink: #e5f1ee;
  --muted: #a2b7b1;
  --faint: #7b948d;
  --accent: #75d2be;
  --accent-rgb: 117, 210, 190;
  --accent-hover: #9be4d4;
  --on-accent: #091d19;
  --accent-soft: #a9e3d6;
  --accent-border: #477d72;
  --accent-surface: #132f29;
  --accent-surface-hover: #1b3e36;
  --line: rgba(216, 242, 233, 0.15);
  --line-rgb: 216, 242, 233;
  --control-border: #3f6059;
  --tool-page-background: #080e0e;
  --tool-border: #304b45;
}

:root[data-theme="violet"] {
  --surface: #15121d;
  --panel-rgb: 21, 18, 29;
  --floating-rgb: 16, 13, 23;
  --panel-background: #100d17;
  --surface-raised: #211c2e;
  --ink: #ede9f6;
  --muted: #b3a9c4;
  --faint: #8e819f;
  --accent: #b7a2ea;
  --accent-rgb: 183, 162, 234;
  --accent-hover: #cbbaf4;
  --on-accent: #1a102b;
  --accent-soft: #d1c1f3;
  --accent-border: #73628e;
  --accent-surface: #2a203d;
  --accent-surface-hover: #36294c;
  --line: rgba(236, 226, 250, 0.15);
  --line-rgb: 236, 226, 250;
  --control-border: #58486d;
  --tool-page-background: #0c0a10;
  --tool-border: #443651;
}

@media (max-width: 767px) {
  :root[data-theme="outdoor-red"] {
    --surface: #0e0303;
    --panel-rgb: 14, 3, 3;
    --floating-rgb: 14, 3, 3;
    --panel-background: #0e0303;
    --surface-raised: #1c0707;
    --ink: #cb6d69;
    --muted: #cb6d69;
    --faint: #b65b54;
    --accent: #df817a;
    --accent-rgb: 223, 129, 122;
    --accent-hover: #df817a;
    --on-accent: #1c0707;
    --accent-soft: #df817a;
    --accent-border: #68322f;
    --accent-surface: #1c0707;
    --accent-surface-hover: #280a0a;
    --line: rgba(203, 109, 105, 0.3);
    --line-rgb: 203, 109, 105;
    --control-border: #68322f;
    --feedback-error: #ed9389;
    --scene-focus-contrast: #0e0303;
    --tool-page-background: #0e0303;
    --tool-border: #68322f;
  }
}

.theme-control { display: flex; flex: none; align-items: center; min-width: 0; max-width: 100%; pointer-events: auto; }
.theme-control select, .theme-select { width: auto; min-width: 160px; max-width: 100%; min-height: 38px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; font-size: 11px; cursor: pointer; color-scheme: dark; }
.theme-control select:focus-visible, .theme-select:focus-visible { outline: 2px solid var(--accent); outline-offset: var(--focus-offset); }
.theme-control select option, .theme-select option { color: var(--ink); background: var(--surface); }
.theme-control > span { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#theme-control-host .theme-control { width: 100%; }
#theme-control-host select { width: 100%; min-height: 44px; }
