.color-panel {
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem;
  user-select: none;
}

/* 3×3 grid of swatches */
.cp-swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}

/* Wrapper provides a positioning context for the hidden color input */
.cp-swatch-wrapper {
  position: relative;
}

.cp-swatch {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition:
    transform 0.1s,
    border-color 0.1s;
  overflow: hidden;
}

.cp-swatch:hover {
  transform: scale(1.12);
}

.cp-swatch.selected {
  border-color: #ffffff;
}

/* Small key-number hint in the bottom-right of each swatch */
.cp-key-hint {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
}

/* Hidden native color input – triggered programmatically on double-click */
.cp-color-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
