:root {
  color-scheme: light;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --surface: #111827;
  --ink: #e6edf7;
  --muted: #a6b4ca;
  --line: #303c51;
  --primary: #aaa2ff;
  --primary-dark: #c1baff;
  --primary-600: #aaa2ff;
  --primary-50: #302c50;
  --panel-bg: #1a2435;
  --panel-soft: #222f44;
  --copy-secondary: #afbdd2;
  --copy-primary: #e6edf7;
  --edge: #34425a;
  --accent-edge: #6c609b;
  --tone-purple-bg: #302c50;
  --tone-purple-fg: #c0b6ff;
  --tone-teal-bg: #183e38;
  --tone-teal-fg: #7bddb9;
  --tone-blue-bg: #233751;
  --tone-blue-fg: #a6ceff;
  --tone-orange-bg: #403421;
  --tone-orange-fg: #f1c77c;
  --tone-red-bg: #482e39;
  --tone-red-fg: #ffb2b3;
  --tone-pink-bg: #402c48;
  --tone-pink-fg: #efb1db;
  --chart-grid: #303c51;
  --chart-expected: #6f819f;
  --chart-muted: #34425a;
  --chart-line: #a196ff;
  --bs-body-color: #e6edf7;
  --bs-body-bg: #111827;
  --bs-border-color: #303c51;
  --text-primary-light: #e6edf7;
  --text-secondary-light: #afbdd2;
  --input-bg: #1a2435;
  --input-stroke: #34425a;
}
[data-theme='dark'] .btn-primary,
[data-theme='dark'] .auth-submit {
  background: #695ae0;
  border-color: #695ae0;
  color: #fff;
}
[data-theme='dark'] .btn-primary:hover,
[data-theme='dark'] .btn-primary:active {
  background: #7565ed !important;
  border-color: #7565ed !important;
}
[data-theme='dark'] .btn:disabled {
  background: var(--panel-soft);
  color: var(--copy-secondary);
  border-color: var(--line);
}
[data-theme='dark'] .institution-brand-copy > strong {
  color: var(--ink);
}
[data-theme='dark'] .institution-brand-copy > span {
  color: var(--muted);
}
[data-theme='dark'] .institution-logo {
  color: var(--muted);
}
/* Keep supplied institutional artwork intact on a neutral white backing. */
[data-theme='dark'] .institution-logo:has(img) {
  background: #fff;
  border-radius: 8px;
}
[data-theme='dark'] .institution-logo > img {
  border-radius: 8px;
}
[data-theme='dark'] .brand-logo {
  background: #fff;
  mix-blend-mode: normal;
  border-radius: 6px;
}
[data-theme='dark'] .settings-logo-preview {
  background: #fff;
}
[data-theme='dark'] .sidebar-scrim,
[data-theme='dark'] .modal-backdrop-pdks {
  background: #040914bb;
}
[data-theme='dark'] .login-screen {
  background: radial-gradient(ellipse at 30% 20%, #2c2649, transparent 65%), var(--surface);
}
[data-theme='dark'] .pdks-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--copy-secondary);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: var(--panel-soft);
  --bs-table-hover-color: var(--ink);
}
[data-theme='dark'] .btn-outline-secondary {
  color: var(--copy-secondary);
  border-color: var(--edge);
}
[data-theme='dark'] input[type='checkbox'] {
  accent-color: #8b7bed;
}
.theme-settings {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 25px;
  margin-bottom: 28px;
}
.theme-settings h2 {
  font-size: 15px !important;
  font-weight: 650;
  margin: 0 0 7px;
}
.theme-settings p {
  font-size: 12px;
  color: var(--muted, #717b8e);
  margin: 0;
}
.theme-choices {
  display: flex;
  flex-shrink: 0;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line, #e9edf3);
  border-radius: 10px;
  background: var(--surface, #f6f8fc);
}
.theme-choices > button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  font-size: 12px;
  background: transparent;
  color: var(--muted, #717b8e);
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}
.theme-choices > button[aria-pressed='true'] {
  background: var(--panel-bg, #fff);
  color: var(--primary, #6961e8);
  border-color: var(--line, #e9edf3);
  box-shadow: 0 2px 4px #0000000a;
}
.theme-choices > button:focus-visible {
  outline: 3px solid #ada6fa;
  outline-offset: 2px;
}
.login-theme-control {
  position: absolute;
  top: 24px;
  right: 24px;
}
.login-theme-control .theme-toggle {
  background: var(--panel-bg, #fff);
  border: 1px solid var(--line, #e9edf3);
}
.auth-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 13px;
  background: var(--panel-bg, white);
  color: var(--copy-primary, #25304a);
  border: 1px solid var(--line, #e6eaf0);
}
.auth-theme-toggle:focus-visible {
  outline: 3px solid #ada6fa;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .theme-settings {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
    gap: 16px;
  }
  .theme-choices {
    width: 100%;
  }
  .theme-choices > button {
    flex: 1;
    justify-content: center;
    padding: 9px 6px;
  }
}
