.editor-color-picker {
  position: relative;
}

.editor-color-picker__popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 12px;
  border: 1px solid #d7dbe3;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  z-index: 80;
  box-sizing: border-box;
}

.editor-color-picker__popover--inline {
  position: static;
  top: auto;
  left: auto;
  transform: none;
}

.editor-color-picker__spectrum {
  position: relative;
  width: 100%;
  height: 116px;
  border-radius: 10px;
  overflow: hidden;
  cursor: crosshair;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, #f00);
}

.editor-color-picker__controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.editor-color-picker__hue {
  position: relative;
  flex: 1 1 auto;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #ff0000 0%,
    #ffff00 17%,
    #00ff00 33%,
    #00ffff 50%,
    #0000ff 67%,
    #ff00ff 83%,
    #ff0000 100%
  );
  cursor: ew-resize;
}

.editor-color-picker__spectrum-cursor,
.editor-color-picker__hue-cursor {
  position: absolute;
  pointer-events: none;
}

.editor-color-picker__spectrum-cursor {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
}

.editor-color-picker__hue-cursor {
  top: 50%;
  width: 6px;
  height: calc(100% + 6px);
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
}

.editor-color-picker__preview {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
  flex: 0 0 auto;
  background-color: #fff;
}

.editor-color-picker__swatch.is-transparent,
.editor-color-picker__preview.is-transparent {
  background-image:
    linear-gradient(45deg, #d5d9e0 25%, transparent 25%),
    linear-gradient(-45deg, #d5d9e0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d5d9e0 75%),
    linear-gradient(-45deg, transparent 75%, #d5d9e0 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  background-color: #fff;
}

.editor-color-picker__clear {
  margin-top: 10px;
  width: 100%;
  height: 32px;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.editor-color-picker__clear:hover {
  background: #f1f5f9;
}

.editor-color-picker__eyedropper {
  width: 32px;
  height: 32px;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
}

.editor-color-picker__eyedropper > img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.editor-color-picker__eyedropper:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.editor-color-picker__meta {
  margin-top: 10px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 6px;
  align-items: center;
}

.editor-color-picker__meta-row {
  display: contents;
}

.editor-color-picker__meta-label {
  color: #666;
  font-weight: 600;
  font-size: 12px;
}

.editor-color-picker__code-input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #f5f7fb;
  color: #334155;
  font-size: 11px;
  box-sizing: border-box;
  text-align: right;
}

.editor-color-picker__apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #d7dbe3;
  border-radius: 8px;
  background: #007bff;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.editor-color-picker__apply:hover {
  background: #0069d9;
}

.editor-color-picker__apply-slot {
  visibility: hidden;
  pointer-events: none;
  height: 30px;
}
