/* Company settings own navigation, action colors and logo backing in both
   personal modes. The existing personal palette still owns reading surfaces,
   fixed status meanings, control boundaries and keyboard focus. */
@media screen {
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] :is(.button.primary, .icon-button.primary),
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] :is(.button.primary, .icon-button.primary):hover:not(:disabled) {
    background: var(--company-accent);
    color: var(--company-on-accent);
    border-color: var(--company-accent);
    filter: none;
  }

  /* An unsaved preview uses only its own local values. */
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .appearance-preview :is(.button.primary, .icon-button.primary),
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .appearance-preview :is(.button.primary, .icon-button.primary):hover:not(:disabled) {
    background: var(--blue);
    color: var(--accent-ink);
    border-color: var(--blue);
  }

  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] :is(input[type="checkbox"], input[type="radio"], input[type="range"]) {
    accent-color: var(--company-accent);
  }

  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar .company-logo.logo-bg-transparent {
    color: var(--company-on-primary);
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .appearance-preview .company-logo.logo-bg-transparent {
    color: var(--sidebar-ink);
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar .user-profile > .icon-button:hover {
    background: transparent;
    color: var(--company-on-primary);
    box-shadow: inset 0 0 0 1px var(--company-on-primary);
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar :is(button, a):focus-visible {
    outline-color: var(--company-on-primary);
    box-shadow: none;
  }

  html[data-rh-theme="dark"] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar {
    --sidebar-ink: var(--company-on-primary);
    --blue: var(--company-accent);
    background: var(--company-primary);
    color: var(--company-on-primary);
    border-color: color-mix(in srgb, var(--company-on-primary) 20%, transparent);
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar :is(.workspace-label, .user-profile div > span, .user-profile strong, .user-profile .icon-button, .company-brand-caption, nav > button, .sidebar-bottom > button) {
    color: var(--company-on-primary);
    opacity: 1;
  }
  /* Tinting midtone nav colors can invalidate their derived text contrast.
     Use non-fill cues so every label keeps its validated background pair. */
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar :is(nav > button:hover, .sidebar-bottom > button:hover, nav > button.active, .sidebar-bottom > button.active) {
    background: transparent;
    color: var(--company-on-primary);
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar :is(nav > button:hover, .sidebar-bottom > button:hover) .sidebar-nav-label {
    text-decoration: underline;
    text-underline-offset: .2em;
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar :is(nav > button.active, .sidebar-bottom > button.active) {
    box-shadow: inset 3px 0 var(--company-on-primary);
    font-weight: 700;
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar nav > button.active svg {
    color: var(--company-on-primary);
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar nav > button small {
    background: transparent;
    color: var(--company-on-primary);
    box-shadow: inset 0 0 0 1px var(--company-on-primary);
  }
  html[data-rh-theme="dark"] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar .user-profile {
    border-color: color-mix(in srgb, var(--company-on-primary) 20%, transparent);
  }
  html[data-rh-theme="dark"] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar .sidebar-nav-item:focus-visible {
    outline-color: var(--company-on-primary);
  }
  html[data-rh-theme="dark"] .rh-company-scope[data-rockhuddle-surface="company"] .sidebar .company-logo.logo-bg-transparent:has(> img) {
    background: transparent;
    padding: 0;
  }

  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .mobile-bottom {
    background: var(--company-primary);
    color: var(--company-on-primary);
    border-color: color-mix(in srgb, var(--company-on-primary) 20%, transparent);
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .mobile-bottom button,
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .mobile-bottom button.active {
    color: var(--company-on-primary);
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .mobile-bottom button.active svg {
    background: color-mix(in srgb, var(--company-on-primary) 12%, transparent);
    box-shadow: inset 0 -2px var(--company-accent);
  }
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .mobile-bottom button:focus-visible {
    outline-color: var(--company-on-primary);
  }
}

/* Keep the selected sample on its validated draft navigation background. */
@media screen {
  html[data-rh-theme] .rh-company-scope[data-rockhuddle-surface="company"] .appearance-preview .preview-nav-item {
    background: transparent;
    color: var(--sidebar-ink);
    border-left-color: var(--sidebar-ink);
    font-weight: 700;
  }
}
