:root[data-client-theme][data-theme] {
  color-scheme: light;
  --bg: var(--client-bg);
  --chrome: var(--client-chrome);
  --surface: var(--client-surface);
  --surface-2: var(--client-surface-2);
  --surface-3: var(--client-surface-3);
  --text: var(--client-text);
  --muted-text: var(--client-muted);
  --subtle-text: var(--client-subtle);
  --line: var(--client-line);
  --control-line: var(--client-field-line);
  --brand: var(--client-brand);
  --brand-on: var(--client-brand-on);
  --brand-deep: var(--client-ink);
  --brand-soft: var(--client-soft);
  --brand-faint: var(--client-pale);
  --selection: var(--client-selected);
  --chart-variable: var(--client-chart-variable);
  --wf-bg: var(--surface);
  --wf-text: var(--text);
  --wf-muted: var(--muted-text);
  --wf-border: var(--line);
  --wf-accent: var(--brand);
  background: var(--bg);
  color: var(--text);
}

:root[data-client-theme][data-theme=dark] { color-scheme: dark; }

:root[data-client-theme] .app-shell :is(.sidebar, .topbar, .mobile-nav) {
  background: var(--chrome) !important;
  color: var(--text);
  border-color: var(--line);
}

:root[data-client-theme][data-theme] :is(.app-shell, .app-shell .workspace, .app-shell .content) {
  background: var(--bg);
}

:root[data-client-theme] .app-shell :is(.main-nav, .mobile-nav) button:is(.active, [aria-current=page]) {
  background: var(--selection);
  color: var(--brand-deep);
}

:root[data-client-theme] .app-shell :is(.main-nav, .mobile-nav) button:hover:not(.active) {
  background: var(--brand-faint);
  color: var(--brand-deep);
}

:root[data-client-theme] :where(.app-shell, .access-layout) :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: 2px;
}

:root[data-client-theme] .app-shell .main-nav button:focus-visible { outline-offset: -3px; }

:root[data-client-theme] :is(.app-shell, .access-layout) :where(input:not([type=checkbox],[type=radio],[type=range]), select, textarea) {
  border-color: var(--control-line);
}

:root[data-client-theme] :is(input, textarea)::placeholder { color: var(--subtle-text); }

:root[data-client-theme][data-theme] .app-shell thead th {
  background: var(--surface-2);
  color: var(--muted-text);
}

:root[data-client-theme] .app-shell :is(.scroll-top-button, .wf-investment-tabs .active) { color: var(--brand-on); }

:root[data-client-theme] .access-layout .access-brand {
  background: linear-gradient(145deg, var(--client-hero), var(--client-hero-end));
  color: #fff;
}

:root[data-client-theme] .access-brand :is(.access-identity, .access-headline) { color: inherit; }
:root[data-client-theme] .access-brand .access-identity:focus-visible { outline-color: #fff; }

:root[data-client-theme] .portal-tenant-access {
  --bg: var(--client-bg);
  --surface: var(--client-surface);
  --surface-2: var(--client-surface-2);
  --ink: var(--client-text);
  --muted: var(--client-muted);
  --line: var(--client-line);
  --brand-deep: var(--client-ink);
  --brand-faint: var(--client-pale);
  background: var(--bg);
  color: var(--ink);
  color-scheme: inherit;
}
