.theme-choice {
  position: relative;
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.theme-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-choice i {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: var(--surface-interactive);
  transition: border-color 160ms ease, background 160ms ease;
}

.theme-choice i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--action-primary);
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}

.theme-choice input:checked + i::after {
  transform: translateX(18px);
}

.theme-choice input:focus-visible + i {
  outline: 3px solid color-mix(in srgb, var(--action-primary) 24%, transparent);
  outline-offset: 2px;
}

.sidebar-theme-choice {
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  padding: 8px 2px;
}

.brand-mark span {
  display: none;
}

.brand-mark img {
  display: block;
  width: 34px;
  height: 34px;
}

html[data-theme="knovis"] {
  color-scheme: dark;

  --surface-base: #020814;
  --surface-raised: #0d1b2d;
  --surface-interactive: #10243a;
  --surface-interactive-hover: rgba(143, 168, 255, 0.12);
  --surface-selected: rgba(143, 168, 255, 0.16);
  --surface-overlay: rgba(1, 5, 12, 0.72);

  --border-default: #3b5573;
  --border-strong: #496788;
  --border-focus: #8fa8ff;

  --text-primary: #f7f5ef;
  --text-secondary: #bdc9da;
  --text-muted: #93a4b8;
  --text-on-accent: #020814;

  --action-primary: #8fa8ff;
  --action-primary-hover: #fffdf5;
  --focus-ring: rgba(143, 168, 255, 0.16);

  --status-success: #9ee6cf;
  --status-warning: #ffd58a;
  --status-danger: #ff8f9c;

  --domain-role: #a998ff;
  --domain-task: #54a6ff;
  --domain-knowledge: #65c18c;
  --domain-requirement: #d6a45f;
  --domain-risk: #ff6b78;
  --graph-edge: #93a4b8;
  --graph-edge-soft: rgba(147, 164, 184, 0.66);
  --graph-label-bg: rgba(9, 24, 42, 0.9);
  --graph-label-border: rgba(143, 168, 255, 0.28);
  --graph-edge-gradient-start: #a998ff;
  --graph-edge-gradient-mid: #8fa8ff;
  --graph-edge-gradient-end: #7fc4dc;
}

html[data-theme="knovis"] body {
  background:
    radial-gradient(
      circle at 48% 36%,
      color-mix(in srgb, var(--surface-interactive) 48%, transparent),
      transparent 36%
    ),
    linear-gradient(
      145deg,
      var(--surface-base),
      color-mix(in srgb, var(--surface-raised) 50%, var(--surface-base)) 52%,
      var(--surface-base)
    );
  color: var(--text-primary);
}

html[data-theme="knovis"] .login-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 28% 52%,
      color-mix(in srgb, var(--domain-role) 13%, transparent),
      transparent 27%
    ),
    radial-gradient(
      circle at 72% 46%,
      color-mix(in srgb, var(--graph-edge-gradient-end) 12%, transparent),
      transparent 25%
    );
}

html[data-theme="knovis"] .login-screen::before {
  position: absolute;
  z-index: -1;
  width: min(760px, 82vw);
  aspect-ratio: 1;
  background: url("assets/knovis-mark.svg") center / contain no-repeat;
  content: "";
  opacity: 0.08;
  transform: translateX(-28%);
}

html[data-theme="knovis"] .login-panel {
  border-color: var(--border-strong);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow:
    0 24px 70px color-mix(in srgb, var(--surface-base) 46%, transparent),
    0 0 42px color-mix(in srgb, var(--action-primary) 10%, transparent);
}

html[data-theme="knovis"] .login-field input,
html[data-theme="knovis"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="knovis"] textarea,
html[data-theme="knovis"] select {
  border-color: var(--border-default);
  background: var(--surface-base);
  color: var(--text-primary);
}

html[data-theme="knovis"] input::placeholder,
html[data-theme="knovis"] textarea::placeholder {
  color: var(--text-muted);
}

html[data-theme="knovis"] input:focus,
html[data-theme="knovis"] textarea:focus,
html[data-theme="knovis"] select:focus {
  border-color: var(--border-focus);
  outline: 3px solid var(--focus-ring);
}

html[data-theme="knovis"] .login-button,
html[data-theme="knovis"] .primary-action-button,
html[data-theme="knovis"] .admin-console-button {
  border-color: transparent;
  background: var(--action-primary);
  box-shadow: 0 0 24px color-mix(in srgb, var(--action-primary-hover) 12%, transparent);
  color: var(--text-on-accent);
}

html[data-theme="knovis"] .login-button:hover,
html[data-theme="knovis"] .primary-action-button:hover,
html[data-theme="knovis"] .admin-console-button:hover {
  background: var(--action-primary-hover);
  filter: none;
}

html[data-theme="knovis"] .admin-console :is(.primary-action-button, .admin-console-button) {
  box-shadow: none;
}

html[data-theme="knovis"] .create-role-button {
  border-color: var(--border-default);
  background: var(--surface-interactive);
  color: var(--text-primary);
}

html[data-theme="knovis"] .create-role-button:hover {
  border-color: var(--border-focus);
  background: var(--surface-interactive-hover);
}

html[data-theme="knovis"] .brand-mark {
  background: var(--surface-base);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--action-primary) 22%, transparent),
    0 0 24px color-mix(in srgb, var(--action-primary) 12%, transparent);
}

html[data-theme="knovis"] .app-shell {
  background: transparent;
}

html[data-theme="knovis"] .sidebar {
  border-left-color: var(--border-default);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 98%, transparent), color-mix(in srgb, var(--surface-base) 88%, var(--surface-raised)));
  box-shadow: -18px 0 48px color-mix(in srgb, var(--surface-base) 18%, transparent);
}

html[data-theme="knovis"] .current-user,
html[data-theme="knovis"] .menu-group,
html[data-theme="knovis"] .role-button,
html[data-theme="knovis"] .person-button,
html[data-theme="knovis"] .role-description-trigger,
html[data-theme="knovis"] .assign-role-button,
html[data-theme="knovis"] .self-assessment-role {
  border-color: var(--border-default);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .role-button:hover,
html[data-theme="knovis"] .role-button.active,
html[data-theme="knovis"] .person-button:hover,
html[data-theme="knovis"] .person-button.active,
html[data-theme="knovis"] .role-description-trigger:hover,
html[data-theme="knovis"] .role-description-trigger:focus-visible,
html[data-theme="knovis"] .role-description-popover.is-open .role-description-trigger,
html[data-theme="knovis"] .assign-role-button:hover,
html[data-theme="knovis"] .self-assessment-action:hover {
  border-color: var(--border-focus);
  background: var(--surface-selected);
  color: var(--text-primary);
}

html[data-theme="knovis"] .menu-toggle b,
html[data-theme="knovis"] .admin-section-header span {
  border: 1px solid var(--border-default);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .self-assessment-action {
  border-color: var(--border-default);
  background: var(--surface-interactive);
  color: var(--text-primary);
}

html[data-theme="knovis"] .logout-icon-button,
html[data-theme="knovis"] .icon-button,
html[data-theme="knovis"] .graph-tool-button {
  border-color: var(--border-default);
  background: var(--surface-interactive);
  color: var(--text-primary);
}

html[data-theme="knovis"] .logout-icon-button:hover,
html[data-theme="knovis"] .icon-button:hover,
html[data-theme="knovis"] .graph-tool-button:hover {
  border-color: var(--border-focus);
  background: var(--surface-interactive-hover);
  color: var(--text-primary);
}

html[data-theme="knovis"] .workspace {
  background: color-mix(in srgb, var(--surface-base) 22%, transparent);
}

html[data-theme="knovis"] .topbar {
  border-bottom-color: var(--border-default);
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
  backdrop-filter: blur(16px);
}

html[data-theme="knovis"] .topbar h2 {
  color: var(--text-primary);
}

html[data-theme="knovis"] .readiness strong {
  color: var(--text-primary);
  text-shadow: none;
}

html[data-theme="knovis"] .graph-area {
  border-color: var(--border-default);
  background: var(--surface-base);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--graph-edge-gradient-end) 5%, transparent),
    0 0 0 1px color-mix(in srgb, var(--surface-base) 28%, transparent);
}

html[data-theme="knovis"] .graph-area::after {
  border-color: var(--border-default);
}

html[data-theme="knovis"] .graph-toolbar,
html[data-theme="knovis"] .graph-layer-controls,
html[data-theme="knovis"] .graph-tooltip,
html[data-theme="knovis"] .graph-context-menu,
html[data-theme="knovis"] .graph-create-intent-menu {
  border-color: var(--border-default);
  background: var(--surface-raised);
  box-shadow: 0 16px 36px color-mix(in srgb, var(--surface-base) 34%, transparent);
  color: var(--text-primary);
  backdrop-filter: blur(14px);
}

html[data-theme="knovis"] .graph-context-menu button:hover:not(:disabled),
html[data-theme="knovis"] .graph-create-intent-menu button:hover,
html[data-theme="knovis"] .graph-create-intent-menu button:focus-visible {
  background: var(--surface-interactive-hover);
  color: var(--text-primary);
}

html[data-theme="knovis"] .edge {
  stroke: url("#knovisEdgeGradient");
  opacity: 0.94;
  filter: none;
}

html[data-theme="knovis"] .node circle {
  stroke: color-mix(in srgb, var(--text-primary) 78%, transparent);
  filter: none;
}

html[data-theme="knovis"] .node[data-node-type="role"] circle {
  fill: var(--domain-role);
}

html[data-theme="knovis"] .node[data-node-type="task"] circle {
  fill: var(--domain-task);
}

html[data-theme="knovis"] .node[data-node-type="knowledge"] circle {
  fill: var(--domain-knowledge);
}

html[data-theme="knovis"] .node[data-node-type="requirement"] circle {
  fill: var(--domain-requirement);
}

html[data-theme="knovis"] .node[data-node-type="risk"] circle {
  fill: var(--domain-risk);
}

html[data-theme="knovis"] .edge-requirements {
  stroke: var(--domain-requirement);
  opacity: 0.88;
}

html[data-theme="knovis"] .edge-risks {
  stroke: var(--domain-risk);
  opacity: 0.9;
}

html[data-theme="knovis"] .node-requirement .node-label-box {
  fill: color-mix(in srgb, var(--domain-requirement) 16%, var(--surface-base));
  stroke: color-mix(in srgb, var(--domain-requirement) 44%, transparent);
}

html[data-theme="knovis"] .node-risk .node-label-box {
  fill: color-mix(in srgb, var(--domain-risk) 16%, var(--surface-base));
  stroke: color-mix(in srgb, var(--domain-risk) 46%, transparent);
}

html[data-theme="knovis"] .node.clickable:hover circle,
html[data-theme="knovis"] .node:focus-visible circle {
  stroke: var(--action-primary-hover);
  filter: none;
}

html[data-theme="knovis"] .node text {
  fill: var(--text-primary);
}

html[data-theme="knovis"] .node-label-box {
  fill: var(--graph-label-bg);
  stroke: var(--graph-label-border);
}

html[data-theme="knovis"] .details-grid,
html[data-theme="knovis"] .readiness-view {
  background: var(--surface-base);
}

html[data-theme="knovis"] .person-navigation-shell,
html[data-theme="knovis"] .person-section-tabs,
html[data-theme="knovis"] .person-readiness-overview,
html[data-theme="knovis"] .person-readiness-role,
html[data-theme="knovis"] .role-passport,
html[data-theme="knovis"] .assessment-panel,
html[data-theme="knovis"] .gap-panel,
html[data-theme="knovis"] .readiness-summary-panel,
html[data-theme="knovis"] .readiness-deficits-panel,
html[data-theme="knovis"] .readiness-confirmations-panel,
html[data-theme="knovis"] .readiness-employee-risk-panel,
html[data-theme="knovis"] .readiness-interventions-panel,
html[data-theme="knovis"] .readiness-development-panel,
html[data-theme="knovis"] .readiness-decisions-panel,
html[data-theme="knovis"] .readiness-audit-panel {
  background: var(--surface-raised);
}

html[data-theme="knovis"] :is(.assessment-requirement-row, .assessment-gap-row) {
  border-color: var(--border-default);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .assessment-requirement-row {
  border-left-color: var(--border-strong);
}

html[data-theme="knovis"] .assessment-gap-row {
  border-left-color: var(--border-strong);
}

html[data-theme="knovis"] .assessment-gap-row.medium {
  border-left-color: var(--border-strong);
}

html[data-theme="knovis"] .assessment-requirement-meta :is(.has-risk, .has-evidence) {
  color: var(--text-primary);
}

html[data-theme="knovis"] .assessment-source-meta,
html[data-theme="knovis"] .assessment-detail-source {
  border-color: var(--border-default);
}

html[data-theme="knovis"] .assessment-evidence-preview p {
  color: var(--text-primary);
}

html[data-theme="knovis"] :is(.assessment-panel, .assessment-requirement-modal) .segmented button {
  border-color: var(--border-default);
  background: var(--surface-interactive);
  color: var(--text-muted);
}

html[data-theme="knovis"] :is(.assessment-panel, .assessment-requirement-modal) .segmented button:hover {
  border-color: var(--border-focus);
  background: var(--surface-interactive-hover);
  color: var(--text-primary);
}

html[data-theme="knovis"] :is(.assessment-panel, .assessment-requirement-modal) .segmented button.active {
  border-color: var(--border-focus);
  background: var(--surface-selected);
  color: var(--text-primary);
}

html[data-theme="knovis"] .person-section-tabs button,
html[data-theme="knovis"] .secondary-button,
html[data-theme="knovis"] .gap-action-button {
  border-color: var(--border-default);
  background: var(--surface-raised);
  color: var(--text-muted);
}

html[data-theme="knovis"] .person-primary-navigation button {
  border-color: var(--border-default);
  background: var(--surface-interactive);
  color: var(--text-muted);
}

html[data-theme="knovis"] .person-primary-navigation button:hover,
html[data-theme="knovis"] .person-section-tabs button:hover,
html[data-theme="knovis"] .person-section-tabs button.active,
html[data-theme="knovis"] .secondary-button:hover,
html[data-theme="knovis"] .gap-action-button:hover {
  border-color: var(--border-focus);
  background: var(--surface-interactive-hover);
  color: var(--text-primary);
}

html[data-theme="knovis"] .person-primary-navigation button.active,
html[data-theme="knovis"] .person-section-tabs button.active {
  border-color: var(--border-focus);
  background: var(--surface-selected);
  color: var(--text-primary);
}

html[data-theme="knovis"] .fact,
html[data-theme="knovis"] .readiness-facts div,
html[data-theme="knovis"] .development-path-item,
html[data-theme="knovis"] .audit-event,
html[data-theme="knovis"] .requirement-card,
html[data-theme="knovis"] .gap-card,
html[data-theme="knovis"] .person-intervention,
html[data-theme="knovis"] .person-decision,
html[data-theme="knovis"] .confirmation,
html[data-theme="knovis"] .readiness-gap,
html[data-theme="knovis"] .employee-risk-summary > div,
html[data-theme="knovis"] .employee-risk-item,
html[data-theme="knovis"] .role-checkbox,
html[data-theme="knovis"] .modal-fact,
html[data-theme="knovis"] .admin-action-group,
html[data-theme="knovis"] .admin-empty-workspace,
html[data-theme="knovis"] .admin-graph-workspace,
html[data-theme="knovis"] .admin-role-profile-summary,
html[data-theme="knovis"] .admin-role-task,
html[data-theme="knovis"] .admin-role-requirement,
html[data-theme="knovis"] .admin-role-risk {
  border-color: var(--border-default);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .employee-risk-knowledge {
  border-left-color: var(--border-strong);
}

html[data-theme="knovis"] .employee-risk-item-heading button {
  color: var(--text-primary);
}

html[data-theme="knovis"] .role-passport p,
html[data-theme="knovis"] .readiness-score-card p,
html[data-theme="knovis"] .readiness-chain dd,
html[data-theme="knovis"] .confirmation p,
html[data-theme="knovis"] .person-intervention p,
html[data-theme="knovis"] .person-decision p,
html[data-theme="knovis"] .role-description-tooltip,
html[data-theme="knovis"] .graph-tooltip {
  color: var(--text-muted);
}

html[data-theme="knovis"] .readiness-score-card {
  border-color: var(--border-default);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .readiness-score-card strong {
  color: var(--text-primary);
}

html[data-theme="knovis"] .readiness-gap {
  border-left-color: var(--border-strong);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .readiness-gap.medium,
html[data-theme="knovis"] .role-assignment-account.unlinked {
  border-color: var(--border-strong);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .confirmation {
  border-left-color: var(--border-strong);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .person-intervention {
  border-left-color: var(--border-strong);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .readiness-gap-title span,
html[data-theme="knovis"] .person-intervention-title span,
html[data-theme="knovis"] .status-badge,
html[data-theme="knovis"] .admin-summary span {
  border: 1px solid var(--border-default);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .development-path-item > span {
  background: var(--surface-selected);
  box-shadow: 0 0 18px color-mix(in srgb, var(--action-primary-hover) 18%, transparent);
  color: var(--text-primary);
}

html[data-theme="knovis"] .role-assignment-context > div,
html[data-theme="knovis"] .role-assignment-account.unlinked {
  border-color: var(--border-strong);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .role-assignment-replacement-note,
html[data-theme="knovis"] .graph-import-conflict,
html[data-theme="knovis"] .admin-warning {
  border-color: var(--border-strong);
  background: var(--surface-interactive);
  color: var(--status-warning);
}

html[data-theme="knovis"] .modal-backdrop {
  background: var(--surface-overlay);
  backdrop-filter: blur(8px);
}

html[data-theme="knovis"] .modal-backdrop :is(h2, h3, h4, strong, label) {
  color: var(--text-primary);
}

html[data-theme="knovis"] .modal-backdrop :is(p, span, small, dt) {
  border-color: var(--border-default);
}

html[data-theme="knovis"] .role-picker,
html[data-theme="knovis"] .requirement-modal,
html[data-theme="knovis"] .role-create-modal,
html[data-theme="knovis"] .knowledge-modal,
html[data-theme="knovis"] .requirement-editor-modal,
html[data-theme="knovis"] .risk-entity-modal,
html[data-theme="knovis"] .assessment-requirement-modal,
html[data-theme="knovis"] .new-role-modal,
html[data-theme="knovis"] .self-assessment-modal,
html[data-theme="knovis"] .intervention-modal,
html[data-theme="knovis"] .decision-modal,
html[data-theme="knovis"] .graph-edit-modal {
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  box-shadow:
    0 24px 70px color-mix(in srgb, var(--surface-base) 50%, transparent),
    0 0 42px color-mix(in srgb, var(--action-primary) 8%, transparent);
}

html[data-theme="knovis"] .knowledge-modal {
  border-top-color: var(--border-strong);
}

html[data-theme="knovis"] :is(.requirement-modal, .requirement-editor-modal) {
  border-top-color: var(--border-strong);
}

html[data-theme="knovis"] .assessment-requirement-modal {
  border-top-color: var(--border-strong);
}

html[data-theme="knovis"] .new-role-modal {
  border-top-color: var(--border-strong);
}

html[data-theme="knovis"] :is(.risk-entity-modal, .requirement-editor-modal.risk-editor-modal) {
  border-top-color: var(--border-strong);
}

html[data-theme="knovis"] .modal-window-resizable {
  border-top: 5px solid var(--border-strong);
  box-shadow:
    0 26px 76px color-mix(in srgb, var(--surface-base) 58%, transparent),
    0 0 0 1px color-mix(in srgb, var(--modal-accent, var(--action-primary)) 72%, transparent),
    0 0 34px color-mix(in srgb, var(--modal-accent, var(--action-primary)) 24%, transparent);
}

html[data-theme="knovis"] .role-picker > .section-title,
html[data-theme="knovis"] .requirement-modal > .section-title,
html[data-theme="knovis"] .role-create-modal > .section-title,
html[data-theme="knovis"] .assessment-requirement-modal > .section-title,
html[data-theme="knovis"] .new-role-modal > .section-title,
html[data-theme="knovis"] .intervention-modal > .section-title,
html[data-theme="knovis"] .decision-modal > .section-title,
html[data-theme="knovis"] .self-assessment-modal > .section-title {
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-interactive);
  box-shadow: 0 14px 24px color-mix(in srgb, var(--surface-base) 22%, transparent);
}

html[data-theme="knovis"] .modal-actions {
  position: static;
  bottom: auto;
  border-top-color: var(--border-strong);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-base) 88%, transparent), var(--surface-base) 34%);
}

html[data-theme="knovis"] .admin-console .modal-actions {
  position: sticky;
  bottom: -1px;
}

html[data-theme="knovis"] .admin-console-body,
html[data-theme="knovis"] .self-assessment-body,
html[data-theme="knovis"] .requirement-modal-body,
html[data-theme="knovis"] .role-create-modal-body,
html[data-theme="knovis"] .intervention-modal-body,
html[data-theme="knovis"] .decision-modal-body,
html[data-theme="knovis"] .role-picker {
  color: var(--text-primary);
}

html[data-theme="knovis"] .admin-action-group,
html[data-theme="knovis"] .admin-user-form,
html[data-theme="knovis"] .admin-person-form,
html[data-theme="knovis"] .admin-role-form,
html[data-theme="knovis"] .admin-role-task-form,
html[data-theme="knovis"] .admin-role-requirement-form,
html[data-theme="knovis"] .admin-role-risk-form,
html[data-theme="knovis"] .admin-link-form,
html[data-theme="knovis"] .admin-organization-form,
html[data-theme="knovis"] .organization-unit-card,
html[data-theme="knovis"] .organization-person-context,
html[data-theme="knovis"] .organization-structure-form,
html[data-theme="knovis"] .self-assessment-risk,
html[data-theme="knovis"] .self-assessment-gap,
html[data-theme="knovis"] .decision-context div,
html[data-theme="knovis"] .intervention-gap-context,
html[data-theme="knovis"] .edit-form-summary,
html[data-theme="knovis"] .graph-import-summary,
html[data-theme="knovis"] .graph-import-success {
  border-color: var(--border-default);
  background: var(--surface-interactive);
  color: var(--text-primary);
}

html[data-theme="knovis"] .new-role-target-option {
  border-color: var(--border-default);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .new-role-target-option:has(input:checked) {
  border-color: var(--border-focus);
  background: var(--surface-selected);
}

html[data-theme="knovis"] .new-role-fields :is(input, select, textarea) {
  border-color: var(--border-strong);
  background: var(--surface-base);
  color: var(--text-primary);
}

html[data-theme="knovis"] .admin-creation-context {
  border-left-color: var(--border-focus);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .admin-list-search,
html[data-theme="knovis"] .admin-user-form label,
html[data-theme="knovis"] .admin-person-form label,
html[data-theme="knovis"] .admin-role-form label,
html[data-theme="knovis"] .admin-role-task-form label,
html[data-theme="knovis"] .admin-role-requirement-form label,
html[data-theme="knovis"] .admin-role-risk-form label,
html[data-theme="knovis"] .admin-link-form label,
html[data-theme="knovis"] .admin-organization-form label,
html[data-theme="knovis"] .organization-structure-toolbar label,
html[data-theme="knovis"] .organization-structure-form label,
html[data-theme="knovis"] .admin-position-toolbar label,
html[data-theme="knovis"] .admin-position-form label,
html[data-theme="knovis"] .modal-fact span {
  color: var(--text-secondary);
}

html[data-theme="knovis"] .modal-fact,
html[data-theme="knovis"] .role-assignment-context > div,
html[data-theme="knovis"] .role-checkbox,
html[data-theme="knovis"] .admin-summary span,
html[data-theme="knovis"] .admin-empty-state,
html[data-theme="knovis"] .admin-position-card,
html[data-theme="knovis"] .admin-position-form,
html[data-theme="knovis"] .organization-archive-list article {
  border-color: var(--border-strong);
}

html[data-theme="knovis"] .modal-entity-link {
  border-color: var(--border-default);
  background: var(--surface-interactive);
  color: var(--text-primary);
}

html[data-theme="knovis"] .modal-entity-link:hover,
html[data-theme="knovis"] .modal-entity-link:focus-visible {
  border-color: var(--border-focus);
  background: var(--surface-selected);
}

html[data-theme="knovis"] .modal-entity-tooltip,
html[data-theme="knovis"] .modal-fact .modal-entity-tooltip,
html[data-theme="knovis"] .role-description-tooltip {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  color: var(--text-primary);
}

html[data-theme="knovis"] .danger-button,
html[data-theme="knovis"] .delete-warning {
  border-color: var(--border-strong);
  background: var(--surface-interactive);
  color: var(--status-danger);
}

html[data-theme="knovis"] .form-success {
  border-color: var(--border-default);
  background: var(--surface-interactive);
  color: var(--status-success);
}

html[data-theme="knovis"] .self-assessment-trust-note,
html[data-theme="knovis"] .self-assessment-progress-hint {
  border-color: var(--border-strong);
  background: var(--surface-interactive);
  color: var(--text-secondary);
}

html[data-theme="knovis"] .admin-console-side,
html[data-theme="knovis"] .admin-console-main,
html[data-theme="knovis"] .admin-console-toolbar,
html[data-theme="knovis"] .admin-section {
  color: var(--text-primary);
}

html[data-theme="knovis"] .admin-workspace-content > :is(
  .admin-user-form,
  .admin-person-form,
  .admin-role-form,
  .admin-link-form,
  .admin-organization-form,
  .admin-graph-workspace
) {
  border: 0;
  background: transparent;
}

html[data-theme="knovis"] :is(.organization-unit-panel, .admin-position-detail-panel) {
  border-left-color: var(--border-default);
}

html[data-theme="knovis"] .admin-action-group {
  border: 0;
  background: transparent;
}

html[data-theme="knovis"] .admin-action-group summary:hover,
html[data-theme="knovis"] .admin-action-group summary:focus-visible {
  background: var(--surface-interactive-hover);
  color: var(--text-primary);
}

html[data-theme="knovis"] .admin-navigation-compact select {
  border-color: var(--border-strong);
  background: var(--surface-interactive);
  color: var(--text-primary);
}

html[data-theme="knovis"] .admin-position-toolbar select,
html[data-theme="knovis"] .admin-position-form :is(input, select, textarea),
html[data-theme="knovis"] .admin-position-status-filter button {
  border-color: var(--border-strong);
  background: var(--surface-interactive);
  color: var(--text-primary);
}

html[data-theme="knovis"] .admin-position-card,
html[data-theme="knovis"] .admin-position-form {
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .admin-position-context {
  background: var(--surface-selected);
}

html[data-theme="knovis"] .admin-role-create-actions .secondary-button.active {
  border-color: var(--border-focus);
  background: var(--surface-selected);
  color: var(--text-primary);
}

html[data-theme="knovis"] .admin-list-search,
html[data-theme="knovis"] .admin-form-fields,
html[data-theme="knovis"] .admin-role-catalog,
html[data-theme="knovis"] .admin-role-assignment-list,
html[data-theme="knovis"] .admin-user-list,
html[data-theme="knovis"] .admin-person-list,
html[data-theme="knovis"] .admin-organization-list {
  color: var(--text-primary);
}

html[data-theme="knovis"] .empty-state,
html[data-theme="knovis"] .muted {
  color: var(--text-muted);
}

html[data-theme="knovis"] .empty-state {
  border-color: var(--border-default);
  background: var(--surface-interactive);
}

html[data-theme="knovis"] .form-success {
  color: var(--status-success);
}

html[data-theme="knovis"] .edit-error,
html[data-theme="knovis"] .field-error,
html[data-theme="knovis"] .login-error {
  color: var(--status-danger);
}

html[data-theme="knovis"] ::-webkit-scrollbar-track {
  background: var(--surface-base);
}

html[data-theme="knovis"] ::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--surface-interactive);
  background-clip: padding-box;
}

@media (max-width: 1100px) {
  html[data-theme="knovis"] .role-assignment-context {
    grid-template-columns: 1fr 1fr;
  }

  html[data-theme="knovis"] .role-assignment-account {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  html[data-theme="knovis"] .sidebar {
    box-shadow: 0 -18px 48px color-mix(in srgb, var(--surface-base) 18%, transparent);
  }

  html[data-theme="knovis"] .role-assignment-context,
  html[data-theme="knovis"] .readiness-view {
    grid-template-columns: 1fr;
  }

  html[data-theme="knovis"] .role-assignment-account {
    grid-column: auto;
  }
}

html[data-theme="knovis"] button:disabled,
html[data-theme="knovis"] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea
):disabled {
  border-color: var(--border-default);
  background: var(--surface-interactive);
  color: var(--text-muted);
}
