.cp-root {
  position: relative;
  display: inline-block;
}

.cp-trigger {
  width: 35px;
  height: 35px;
  border-radius: 4px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
  display: block;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s, box-shadow 0.1s;
}

.cp-trigger:active {
  transform: scale(0.93);
}

.cp-popover {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
  width: 240px;
}

.cp-picker-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

/* Saturation / brightness square */
.cp-saturation {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 8px;
  cursor: crosshair;
  overflow: hidden;
  flex-shrink: 0;
  user-select: none;
}

/* Hue rainbow track */
.cp-hue-track {
  position: relative;
  width: 100%;
  height: 14px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  background: linear-gradient(
    to right,
    #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000
  );
}

/* Shared pointer (handle) */
.cp-pointer {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 20%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 1), 0 2px 6px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-sizing: border-box;
}

.cp-pointer--hue {
  top: 50%;
}

/* Hex input row */
.cp-hex-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cp-hex-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.cp-hex-field {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  padding: 6px 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  outline: none;
  text-transform: uppercase;
}

.cp-hex-field:focus {
  border-color: rgba(0, 0, 0, 0.35);
}
