/* XConnect cabinet theme, loaded after the existing cabinet stylesheet. */
:root {
  --xc-action: #7549d8;
  --xc-action-hover: #6336c9;
  --xc-action-pressed: #5027b0;
  --xc-action-text: #fff;
  --xc-action-focus: #b69af8;
  --xc-panel-edge: #aeb7e526;
  --xc-panel-edge-hover: #ae8fff64;
  --xc-secondary-edge: #aeb7e538;
}

html.light {
  --xc-action: #6435c6;
  --xc-action-hover: #5729ba;
  --xc-action-pressed: #472298;
  --xc-action-focus: #6435c6;
  --xc-panel-edge: #24165324;
  --xc-panel-edge-hover: #6435c66b;
  --xc-secondary-edge: #2416533c;
}

#root :is(.btn-primary, button.bg-accent-500:not(.btn-icon), a.bg-accent-500:not(.btn-icon)) {
  background: var(--xc-action);
  color: var(--xc-action-text);
  box-shadow: none;
  font-weight: 650;
}

#root :is(.btn-primary, .btn-secondary) {
  border-radius: 12px;
}

#root .btn-secondary {
  border: 1px solid var(--xc-secondary-edge);
  box-shadow: none;
}

@media (hover: hover) {
  #root :is(.btn-primary, button.bg-accent-500:not(.btn-icon), a.bg-accent-500:not(.btn-icon)):hover:not(:disabled):not([aria-disabled='true']) {
    background: var(--xc-action-hover);
  }
}

#root :is(.btn-primary, button.bg-accent-500:not(.btn-icon), a.bg-accent-500:not(.btn-icon)):active:not(:disabled):not([aria-disabled='true']) {
  background: var(--xc-action-pressed);
}

#root :is(.btn-primary, .btn-secondary, button.bg-accent-500, a.bg-accent-500):focus-visible {
  outline: 2px solid var(--xc-action-focus);
  outline-offset: 3px;
}

#root :is(.card, .card-hover, .bento-card, .bento-card-hover, .card-glow, .bento-card-glow, .xc-card, .xc-tile) {
  border: 1px solid var(--xc-panel-edge) !important;
}

@media (hover: hover) {
  #root :is(.card-hover, .bento-card-hover, .xc-card):hover {
    border-color: var(--xc-panel-edge-hover) !important;
  }
}

#root :is(.xc-section-head, .xc-card-footer, .xc-setting) {
  border-block-color: var(--xc-panel-edge);
  border-block-style: solid;
}

#root .xc-grain-layer {
  opacity: calc(var(--xc-grain-opacity, .7) * .5);
}

/* Borrow the banner's twilight colours at lower intensity on working surfaces. */
html:not(.light) {
  --xc-action: #8047b7;
  --xc-action-hover: #7037a9;
  --xc-action-pressed: #5c2993;
  --xc-action-focus: #e0a5dc;
  --xc-panel-edge-hover: #d08db96b;
}

html:not(.light) #root {
  background-image:
    radial-gradient(ellipse at 8% 0%, #68254e20 0%, transparent 43%),
    radial-gradient(ellipse at 92% 4%, #58439324 0%, transparent 37%);
}
