/* Color Palette Extractor — a hero uploader (after="hide") over a split: the
   image card on the left, the inspector (colour count + palette rows) on the
   right. The layout is styles/components/form.css and the image stage is
   styles/components/preview.css; only the swatch rows' chip, text and states
   are the page's own. */

.cp-file {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

/* Hairlines between swatch rows start under the text, past the 44px chip. */
.cp-palette { --sep-inset: calc(var(--inset) + 44px + var(--space-3)); }

/* ── Swatch rows: chip · HEX over rgb() · share. The whole row is a button. */
.cp-swatch {
  width: 100%;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background var(--duration-snap) var(--ease-standard);
}
.cp-swatch:hover { background: var(--bg-hover); }
.cp-swatch:first-child { border-start-start-radius: inherit; border-start-end-radius: inherit; }
.cp-swatch:last-child { border-end-start-radius: inherit; border-end-end-radius: inherit; }

.cp-swatch__chip {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    var(--shadow-1);
}

.cp-swatch__text {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.cp-swatch__hex {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.cp-swatch__rgb {
  margin-block-start: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}

.cp-swatch.is-copied .cp-swatch__pct {
  font-family: var(--sans);
  color: var(--success);
}
