/* ── Custom color picker popup ── */
.cp {
  position: fixed;
  z-index: 2000;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  padding: 12px;
  width: 244px;
  box-shadow: 0 16px 48px rgba(0,0,0,.8), 0 2px 8px rgba(0,0,0,.4);
  display: none;
  user-select: none;
}
.cp.open { display: block; }
.cp-sv {
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: 6px;
  overflow: hidden;
  cursor: crosshair;
  margin-bottom: 10px;
}
.cp-sv-white, .cp-sv-black {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cp-sv-white { background: linear-gradient(to right, #fff, transparent); }
.cp-sv-black { background: linear-gradient(to bottom, transparent, #000); }
.cp-sv-thumb {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.cp-sliders-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cp-eyedropper-btn {
  width: 28px; height: 28px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #666;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.cp-eyedropper-btn:hover { background: #2a2a2a; color: #ccc; border-color: #3a3a3a; }
.cp-eyedropper-btn.no-support { opacity: .3; cursor: default; pointer-events: none; }
.cp-tracks { flex: 1; display: flex; flex-direction: column; gap: 2px; }
/* Расширяет зону клика на 8px по бокам (чтобы кружок не обрезался) */
.cp-slider-wrap {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0 8px;
  margin: 0 -8px;
}
.cp-hue-track {
  width: 100%; height: 12px; border-radius: 6px; pointer-events: none;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.cp-alpha-bg {
  position: absolute; left: 8px; right: 8px; top: 50%; transform: translateY(-50%);
  height: 12px; border-radius: 6px; pointer-events: none;
  background: repeating-conic-gradient(#555 0% 25%, #333 0% 50%) 0 0 / 8px 8px;
}
.cp-alpha-track {
  position: absolute; left: 8px; right: 8px; top: 50%; transform: translateY(-50%);
  height: 12px; border-radius: 6px; pointer-events: none;
}
.cp-hue-thumb, .cp-alpha-thumb {
  position: absolute;
  top: 50%;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cp-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}
.cp-format-label {
  font-size: 11px; color: #888;
  background: #2a2a2a; border: 1px solid #333;
  border-radius: 5px; padding: 5px 7px;
  white-space: nowrap; flex-shrink: 0;
}
.cp-hex-val {
  flex: 1; min-width: 0;
  background: #2a2a2a; border: 1px solid #333;
  border-radius: 5px; padding: 5px 6px;
  font-family: 'SF Mono','Fira Code',monospace;
  font-size: 12px; color: #ccc; outline: none;
}
.cp-hex-val:focus { border-color: #555; color: #fff; }
.cp-opacity-val {
  width: 38px; flex-shrink: 0;
  background: #2a2a2a; border: 1px solid #333;
  border-radius: 5px; padding: 5px 4px;
  font-size: 12px; color: #ccc; outline: none; text-align: center;
}
.cp-opacity-val:focus { border-color: #555; color: #fff; }
.cp-pct-label { font-size: 11px; color: #555; flex-shrink: 0; }
