.color-palette {
  min-inline-size: 0;
}

.color-palette legend {
  font-weight: 600;
}

.color-palette-plane {
  position: relative;
  block-size: clamp(10rem, 28vw, 16rem);
  border-radius: var(--radius);
  background-image:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, transparent);
  box-shadow: inset 0 0 0 1px var(--field-border);
  cursor: crosshair;
  touch-action: none;
}

.color-palette-marker {
  position: absolute;
  inline-size: 1rem;
  block-size: 1rem;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #000;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.color-palette-range {
  display: grid;
  gap: .25rem;
}

.color-palette-range input {
  inline-size: 100%;
  margin: 0;
}

#palette-hue {
  appearance: none;
  block-size: 1.5rem;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  cursor: pointer;
}

#palette-hue::-webkit-slider-thumb {
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1f2937;
  box-shadow: 0 0 0 1px #000;
}

#palette-hue::-moz-range-thumb {
  width: .875rem;
  height: .875rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1f2937;
  box-shadow: 0 0 0 1px #000;
}
