/* ═══════════════════════════════════════════════════════════════
   Sélecteur de couleur personnalisé
   ═══════════════════════════════════════════════════════════════ */

.cpk {
  margin-top: 12px;
}

.cpk-body {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

/* Zone dégradée SV */
.cpk-canvas-wrap {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--bdr);
  flex-shrink: 0;
  cursor: crosshair;
}

.cpk-canvas {
  display: block;
  width: 200px;
  height: 120px;
}

/* Marqueur (cercle) */
.cpk-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(0, 0, 0, .6);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Curseur de teinte vertical */
.cpk-hue-wrap {
  display: flex;
  align-items: stretch;
  width: 20px;
  height: 120px;
  flex-shrink: 0;
}

.cpk-hue {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: linear-gradient(
    to bottom,
    hsl(0, 100%, 50%),
    hsl(60, 100%, 50%),
    hsl(120, 100%, 50%),
    hsl(180, 100%, 50%),
    hsl(240, 100%, 50%),
    hsl(300, 100%, 50%),
    hsl(360, 100%, 50%)
  );
  border-radius: 4px;
  border: 1px solid var(--bdr);
  cursor: pointer;
  outline: none;
}

.cpk-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 8px;
  background: #fff;
  border: 1px solid #888;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

.cpk-hue::-moz-range-thumb {
  width: 22px;
  height: 8px;
  background: #fff;
  border: 1px solid #888;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

.cpk-hue::-moz-range-track {
  background: transparent;
  border: none;
}

/* Champs Hex / R / G / B */
.cpk-fields {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  align-items: flex-end;
}

.cpk-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cpk-field label {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx2);
  text-transform: uppercase;
  text-align: center;
}

.cpk-field input {
  width: 56px;
  padding: 5px 4px;
  font-size: 12px;
  text-align: center;
  background: var(--bg0);
  border: 1px solid var(--bdr);
  border-radius: 4px;
  color: var(--tx);
  outline: none;
  font-family: 'SF Mono', Consolas, monospace;
}

.cpk-field input:focus {
  border-color: var(--acc);
}

.cpk-field input[type=number] {
  width: 42px;
  -moz-appearance: textfield;
}

.cpk-field input[type=number]::-webkit-inner-spin-button,
.cpk-field input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Aperçu */
.cpk-preview-wrap {
  display: flex;
  align-items: flex-end;
  padding-bottom: 1px;
}

.cpk-preview {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bdr);
  box-shadow: 0 0 4px rgba(255, 255, 255, .1);
}
