/* Light colors remain at their component declarations as fallbacks. */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-surface: #17191d;
  --theme-surface-muted: #21252b;
  --theme-hover: #2c323b;
  --theme-solid: #38404b;
  --theme-text: #e8ebef;
  --theme-muted: #b0b8c4;
  --theme-border: #373e48;
  --theme-border-strong: #7f8a99;
  --theme-accent: #176aaf;
  --theme-info: #83c3ff;
  --theme-info-bg: #1c3145;
  --theme-info-border: #375b7c;
  --theme-success: #84d5ac;
  --theme-success-bg: #1d332b;
  --theme-success-border: #38654f;
  --theme-warning: #e7c27f;
  --theme-warning-bg: #382e1f;
  --theme-warning-border: #715b36;
  --theme-danger: #ffa6ad;
  --theme-danger-bg: #3a252c;
  --theme-danger-border: #79424b;
  --theme-danger-solid: #963e49;
  --theme-purple: #c5adf2;
  --theme-purple-bg: #30283e;
  --theme-purple-border: #63517e;
  background: var(--theme-surface);
}
:root[data-theme="dark"] dialog { background: var(--theme-surface); color: var(--theme-text); }
:root[data-theme="dark"] .btn-primary { background: var(--theme-accent); border-color: var(--theme-accent); }
:root[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #225f91; }
:root[data-theme="dark"] ::selection { background: #315b82; color: #fff; }
:root[data-theme="dark"] .overview-room h2,
:root[data-theme="dark"] .overview-desk:hover { background: #ffffff0a; }
:root[data-theme="dark"] .overview-desk { background: #ffffff04; }
.research-theme-toggle {
  display: flex; align-items: center; gap: 9px; flex: none;
  width: 100%; min-height: 44px; margin: 0 0 14px; padding: 8px 10px;
  border: 1px solid var(--theme-border, #e4e7ec); border-radius: 8px;
  background: var(--theme-surface, #fff); color: var(--theme-muted, #59616c);
  font: inherit; font-size: 12px; cursor: pointer;
}
.research-theme-toggle:hover { background: var(--theme-surface-muted, #f5f6f8); }
.research-theme-toggle:focus-visible { outline: 2px solid var(--theme-info, #176aaf); outline-offset: 2px; }
.research-theme-toggle svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.research-theme-switch { display: inline-flex; align-items: center; width: 28px; height: 16px; padding: 2px; margin-left: auto; border-radius: 10px; background: #8b939f; }
.research-theme-switch::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.research-theme-toggle[aria-pressed="true"] .research-theme-switch { background: #337ebc; }
.research-theme-toggle[aria-pressed="true"] .research-theme-switch::after { transform: translateX(12px); }
.member-auth-wrap > .research-theme-toggle { width: fit-content; margin: 0 0 16px auto; }
@media (max-width: 1119px) and (min-width: 980px) {
  .research-board-mode:not(.research-posting-workspace) .research-theme-toggle { justify-content: center; padding: 8px 0; }
  .research-board-mode:not(.research-posting-workspace) .research-theme-toggle > span { display: none; }
}
