/* ===== COLOR PICKER COMPONENT ===== */

.color-picker-wrap {
  position: relative;
}

.color-picker-wrap .custom-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  background: transparent;
  transition: border-color 0.2s;
  cursor: pointer;
  position: relative;
  z-index: 0;
  contain: layout style paint;
}

.color-picker-wrap .custom-color-swatch::before {
  content: '';
  position: absolute;
  inset: -3px;
  z-index: -2;
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
  border-radius: 8px;
  background: radial-gradient(250px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--glow-rgb), .25), transparent 40%);
}

.color-picker-wrap .custom-color-swatch::after {
  content: '';
  position: absolute;
  inset: 2px;
  z-index: -1;
  pointer-events: none;
  border-radius: 4px;
  background: transparent;
}

.color-picker-wrap .custom-color-swatch:hover::before,
.color-picker-wrap:focus-within .custom-color-swatch::before {
  opacity: 1;
}

[data-theme="light"] .color-picker-wrap .custom-color-swatch::before,
[data-theme="light"] .color-picker-wrap .custom-color-swatch::after {
  display: none;
}

[data-theme="light"] .color-picker-wrap .custom-color-swatch {
  contain: unset;
}

.color-picker-wrap input {
  font-family: 'SF Mono', 'Fira Code', monospace;
  letter-spacing: 0.02em;
}

.color-picker-wrap:focus-within .custom-color-swatch {
  border-color: rgba(var(--glow-rgb), 0.4);
}