/* theme-fix — alias legacy vars + force shell to follow data-theme */
:root {
  --fd-bg-950: var(--fd-bg);
  --fd-bg-900: var(--fd-rail);
  --fd-bg-850: var(--fd-surface);
  --fd-bg-800: var(--fd-bg-subtle);
  --fd-bg-750: var(--fd-bg-hover);
  --fd-bg-700: var(--fd-bg-hover);
  --fd-text-primary: var(--fd-text);
  --fd-text-secondary: var(--fd-text-soft);
  --fd-text-muted: var(--fd-text-dim);
  --fd-surface-base: var(--fd-surface);
  --fd-surface-elevated: var(--fd-surface);
  --fd-surface-hover: var(--fd-bg-hover);
  --fd-primary: var(--fd-accent);
  --fd-primary-bright: var(--fd-accent-bright);
  --fd-primary-dim: var(--fd-accent-dim);
  --bg: var(--fd-bg);
  --bg-soft: var(--fd-bg-soft);
  --bg-elev: var(--fd-surface);
  --text: var(--fd-text);
  --text-dim: var(--fd-text-dim);
  --accent: var(--fd-accent);
  --accent-bright: var(--fd-accent-bright);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { color-scheme: light; }
}
html, body {
  background: var(--fd-bg) !important;
  color: var(--fd-text) !important;
}
.fd-sidebar, .fd-rail, aside.fd-sidebar, .fd-topbar, .fd-globalbar,
.fd-workspace, .workspace-shell {
  background: var(--fd-rail) !important;
  color: var(--fd-text);
  border-color: var(--fd-border);
}
.fd-main, main, .fd-content, .workspace-main {
  background: var(--fd-bg);
  color: var(--fd-text);
}
input, select, textarea { color-scheme: inherit; }
:root[data-theme="light"] .fd-sidebar a:hover,
:root[data-theme="light"] .fd-globalnav-link:hover {
  background: var(--fd-bg-hover);
}
