/* ============================================================
   color-palette extractor - layers on /assets/site.css tokens
   ============================================================ */

.cp-panel { margin-bottom: 24px; }

/* ---------- drop zone ---------- */
.cp-drop {
  border: 2px dashed var(--ink);
  border-radius: var(--r-lg);
  background: var(--bg-soft);
  padding: 40px 20px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.cp-drop:hover, .cp-drop:focus-visible { background: var(--yellow-wash); outline: none; }
.cp-drop.dragover { background: var(--yellow-soft); border-style: solid; }
.cp-drop-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cp-hint { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); }

/* ---------- result layout ---------- */
.cp-result { margin: 8px 0 40px; }
.cp-layout { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 24px; align-items: start; }
.cp-preview {
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--bg-soft);
}
.cp-preview img { width: 100%; height: auto; display: block; max-height: 420px; object-fit: contain; }

/* ---------- controls ---------- */
.cp-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cp-controls label { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-mute); }
.cp-controls select {
  font-family: inherit; font-size: 15px; padding: 7px 10px;
  border: 2px solid var(--ink); border-radius: var(--r-sm); background: var(--bg); color: var(--ink);
}
.cp-controls select:focus { outline: none; box-shadow: 3px 3px 0 var(--yellow-deep); }
.cp-copyhint { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); margin-left: auto; }

/* ---------- palette ---------- */
.cp-palette { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.cp-swatch {
  display: flex; align-items: center; gap: 14px;
  border: 2px solid var(--ink); border-radius: var(--r-md);
  padding: 10px 12px; background: var(--bg);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
  text-align: left; width: 100%; font-family: inherit;
}
.cp-swatch:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.cp-swatch:active { transform: translate(0,0); box-shadow: 2px 2px 0 var(--ink); }
.cp-chip {
  width: 52px; height: 52px; flex: 0 0 auto;
  border: 2px solid var(--ink); border-radius: var(--r-sm);
}
.cp-vals { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cp-hex { font-family: var(--font-mono); font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.cp-rgb { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-mute); }
.cp-share { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.cp-pct { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); }
.cp-copy-tag { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); }

.cp-export { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 720px) {
  .cp-layout { grid-template-columns: 1fr; }
  .cp-preview { max-width: 100%; }
  .cp-copyhint { margin-left: 0; width: 100%; }
}
