/* Color swatches (fill set inline from the palette) */
.swatch { display: block; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--border-strong); cursor: pointer; transition: box-shadow 120ms; }
.swatch-none { background: var(--surface); }
.swatch:hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

.swatch-custom { background: var(--rainbow); }
.swatch-custom.is-custom { background: var(--swatch-color); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.swatch-custom[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

/* Custom color popover: sits above the color pill */
.color-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
}
.color-popover[hidden] { display: none; }
.color-popover input[type="color"] { width: 36px; height: 32px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.color-popover input[type="text"] {
  width: 92px;
  height: 32px;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: var(--fs-small);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}
.color-popover input[type="text"][aria-invalid="true"] { border-color: var(--danger); }
.color-popover button { height: 32px; padding: 0 12px; font-size: var(--fs-small); font-weight: 500; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); cursor: pointer; }
.color-popover button:hover { background: var(--accent-hover); }
