:root[data-color-theme="dark"] {
  color-scheme: dark;
  --page: #111519;
  --surface: #1c2025;
  --surface-2: #272d33;
  --hover: #30373f;
  --line: #454d56;
  --line-soft: #343b42;
  --text: #e8ebef;
  --muted: #a8b0b8;
  --accent: #e8ebef;
  --link: #7db7f0;
  --focus: #ffd166;
  --ok: #56c881;
  --ok-soft: #56c8811a;
  --danger: #ff6478;
  --danger-soft: #ff647814;
  --warning: #ffd166;
  --warning-soft: #ffcc0022;
  --warning-line: #c49c2a;
  --changed: #ffb86b;
  --info: #7db7f0;
  --info-soft: #7db7f014;
  --card-shadow: 0 1px 2px #0005, 0 4px 16px #0003;
  --shadow: #0009;
}

/* A header action; native popovers handle outside clicks, Escape and focus order. */
.admin-theme-control { display: flex; flex: none; }
.admin-theme-trigger { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.admin-theme-trigger:hover { background: var(--hover); }
.admin-theme-trigger .icon, .admin-theme-menu .icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-light-icon { display: inline-flex; }
.theme-dark-icon { display: none; }
:root[data-color-theme="dark"] .theme-light-icon { display: none; }
:root[data-color-theme="dark"] .theme-dark-icon { display: inline-flex; }
.admin-guest-tools { position: absolute; top: 16px; right: 24px; }
.admin-guest-tools .icon-button.light { color: var(--text); }
.admin-theme-menu { position: fixed; inset: 58px 24px auto auto; margin: 0; width: 184px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 8px 28px var(--shadow); }
.admin-theme-menu p { margin: 4px 10px 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.admin-theme-menu button { display: flex; align-items: center; width: 100%; gap: 10px; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.admin-theme-menu button:hover { background: var(--hover); }
.admin-theme-menu button[aria-pressed="true"] { background: var(--surface-2); font-weight: 600; }
.theme-check { margin-left: auto; visibility: hidden; }
[aria-pressed="true"] > .theme-check { visibility: visible; }
.topbar nav { min-width: 0; }
.topbar .me { flex: none; }
:root[data-color-theme="dark"] .topbar nav a.active { color: var(--text); background: var(--surface-2); }
:root[data-color-theme="dark"] .toast,
:root[data-color-theme="dark"] .toast.ok { background: var(--surface-2); color: var(--text); border-color: var(--line); }
:root[data-color-theme="dark"] button.danger-solid,
:root[data-color-theme="dark"] .toast.error { color: #111519; }

