html[data-crm-theme] body {
  --bg: var(--si-bg);
  --panel: var(--si-surface);
  --ink: var(--si-ink);
  --muted: var(--si-ink-muted);
  --line: var(--si-line);
  --brand: var(--si-accent);
  --danger: var(--si-danger);
  --success: var(--si-ok);
  --shadow: var(--si-shadow-pop);
  background: var(--si-bg);
  color: var(--si-ink);
  font-family: var(--si-font-sans);
}

html[data-crm-theme] body :is(.si-num, time, input[type="number"], .metrics b, .weekly-metrics b) {
  font-family: var(--si-font-sans);
  font-variant-numeric: tabular-nums;
}

html[data-crm-theme] :is(.rail, body > .app-header, .drawer, dialog, .card, .focus-card, .queue-section,
  .analytics-grid > article, .integration-grid > article, .manager-group, .control-table,
  .weekly-manager, .weekly-report-state, .regulation-head, .regulation-rule, .regulation-preview,
  .regulation-audit, .regulation-calendar, .regulation-first-price) {
  background: var(--si-surface);
  color: var(--si-ink);
  border-color: var(--si-line);
}

html[data-crm-theme] :is(.column, .card:hover, .control-row:hover, .focus-detail-list article,
  .client-passport > div, .regulation-rule.unsupported, .regulation-impact-metrics article) {
  background: var(--si-surface-2);
}

html[data-crm-theme] :where(button, input, select, textarea, .toolbar-check, .focus-detail-tabs button,
  .icon-action, .terminal-card, .control-row, .drawer-tabs) {
  color: var(--si-ink);
  border-color: var(--si-line-strong);
}

html[data-crm-theme] :where(input, select, textarea, .ghost, .toolbar-check, .focus-detail-tabs button,
  .icon-action, .terminal-card, .control-row, .drawer-tabs) {
  background: var(--si-surface);
}

html[data-crm-theme] .client-next-popover footer button[type="submit"] {
  color: var(--si-surface);
}

html[data-crm-theme] .client-next-accept {
  color: var(--client-v6-proposed-icon);
}

html[data-crm-theme] button.client-next-accept {
  color: var(--client-v6-proposed-icon) !important;
}

html[data-crm-theme] :is(.primary, .board-add) {
  background: var(--si-accent);
  border-color: var(--si-accent);
  color: var(--si-on-accent);
}

html[data-crm-theme] :is(.primary, .board-add):hover { background: var(--si-accent-hover); border-color: var(--si-accent-hover); }
html[data-crm-theme] :is(button, input, select, textarea):focus-visible { outline: 2px solid var(--si-accent); outline-offset: 2px; }
html[data-crm-theme] .rail nav button.active { background: var(--si-accent-soft); color: var(--si-accent-text); box-shadow: inset 2px 0 var(--si-accent); }
html[data-crm-theme] .rail nav button:hover { background: var(--si-surface-2); color: var(--si-ink); }
html[data-crm-theme] :is(.brand span, .rail-foot, .hint, #notice, .section-note, .heading p,
  .focus-card small, .focus-summary p, .card footer, .timeline p) { color: var(--si-ink-muted); }
html[data-crm-theme] dialog::backdrop { background: var(--si-overlay); }
html[data-crm-theme] .theme-toggle { width: 36px; min-width: 36px; height: 36px; padding: 0; border-radius: var(--si-radius-pill); }

@media (max-width: 900px) {
  html[data-crm-theme] .mobile-stage-nav { background: color-mix(in srgb, var(--si-surface) 94%, transparent); border-color: var(--si-line); }
  html[data-crm-theme] .mobile-stage-nav button.active { background: var(--si-accent-soft); color: var(--si-accent-text); }
}
