.cp-upload-error {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.cp-workspace { margin-top: 4px; display: flex; flex-direction: column; gap: 18px; }

.cp-stage-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.cp-canvas-outer {
  position: relative;
  max-width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background:
    repeating-conic-gradient(var(--bg-alt) 0% 25%, var(--surface) 0% 50%) 0 0 / 22px 22px;
}
#cpCanvas { display: block; max-width: 100%; touch-action: none; cursor: crosshair; }

.cp-loupe {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transform: translate(-50%, -100%);
  pointer-events: none;
  background: var(--surface);
}
.cp-loupe canvas { width: 100%; height: 100%; }

.cp-summary { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.cp-panel { flex-direction: column; align-items: stretch; gap: 16px; }
.cp-current-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.cp-swatch-lg {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);

  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, var(--bg-alt) 25%, transparent 25%, transparent 75%, var(--bg-alt) 75%),
    linear-gradient(45deg, var(--bg-alt) 25%, transparent 25%, transparent 75%, var(--bg-alt) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: default;
}

.cp-values { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
#cpValueRows { display: flex; flex-direction: column; gap: 8px; }
.cp-value-row { display: flex; align-items: center; gap: 10px; }
.cp-value-row[hidden] { display: none; }
.cp-value-label { width: 38px; flex-shrink: 0; font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.cp-value-code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
}
.cp-copy-btn { flex-shrink: 0; }
.cp-empty-hint { font-size: 13px; color: var(--text-muted); }

.cp-history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cp-history-head h3 { font-size: 13.5px; font-weight: 700; color: var(--text-secondary); margin: 0; }

.cp-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cp-history-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cp-history-swatch {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  padding: 0;
}
.cp-history-swatch:hover { border-color: var(--accent); }
.cp-history-hex { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); font-weight: 600; }

.cp-actions-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .cp-current-row { justify-content: center; }
  .cp-loupe { width: 84px; height: 84px; }
}
