#tool-body {
  --primary:      #16baaa;
  --primary-dim:  rgba(22,186,170,0.12);
  --card-bg:      #fff;
  --card-border:  #e8eaed;
  --surface:      #f7f8fa;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;
  --input-bg:     #f7f8fa;
  --input-border: #e2e5e9;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --radius-sm:    6px;
  --radius-lg:    14px;
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.theme-dark-mode #tool-body {
  --card-bg:      #1e1e1e;
  --card-border:  #2e2e2e;
  --surface:      #252525;
  --text:         #d2d2d2;
  --text-muted:   #9ca3af;
  --text-light:   #6b7280;
  --input-bg:     #2a2a2a;
  --input-border: #3a3a3a;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.3);
}

/* ── Layout ── */
#tool-body .cp-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
#tool-body .cp-col-left {
  width: 38%;
  max-width: 38%;
  flex-shrink: 0;
}
#tool-body .cp-col-right { flex: 1; min-width: 0; }
@media (max-width: 900px) {
  #tool-body .cp-wrap { flex-direction: column; }
  #tool-body .cp-col-left,
  #tool-body .cp-col-right { width: 100%; max-width: 100%; }
}

/* ── Card ── */
#tool-body .cp-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ── Preview ── */
#tool-body .cp-preview-panel {
  position: relative;
  height: 120px;
  background-image:
    linear-gradient(45deg,#ccc 25%,transparent 25%),
    linear-gradient(-45deg,#ccc 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#ccc 75%),
    linear-gradient(-45deg,transparent 75%,#ccc 75%);
  background-size: 12px 12px;
  background-position: 0 0,0 6px,6px -6px,-6px 0;
  background-color: #fff;
}
#tool-body .cp-preview-fill {
  position: absolute; inset: 0;
  transition: background 0.2s ease;
}
#tool-body .cp-preview-badge {
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-weight: 600;
  letter-spacing: 1.5px;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  pointer-events: none;
  font-family: 'SFMono-Regular','Consolas','Menlo',monospace;
  font-size: 13px;
}
#tool-body .cp-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 13px;
  pointer-events: none;
  background: var(--surface);
}

/* ── Left body ── */
#tool-body .cp-left-body {
  padding: 16px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ── Pick button ── */
#tool-body .cp-pick-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.5px;
}
#tool-body .cp-pick-btn:hover { opacity: 0.88; }
#tool-body .cp-pick-btn:active { transform: scale(0.98); }
#tool-body .cp-pick-btn:disabled {
  background: var(--input-border);
  color: var(--text-light);
  cursor: not-allowed;
  transform: none; opacity: 1;
}

/* ── Not supported tip ── */
#tool-body .cp-unsupported {
  background: rgba(245,108,108,0.1);
  border: 1px solid rgba(245,108,108,0.3);
  border-radius: var(--radius-sm);
  color: #c0392b;
  font-size: 12px;
  padding: 8px 12px;
  line-height: 1.6;
  display: none;
}
.theme-dark-mode #tool-body .cp-unsupported {
  color: #f1948a;
}

/* ── Section label ── */
#tool-body .cp-sec-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}

/* ── History swatches ── */
#tool-body .cp-history-wrap { display: flex; flex-direction: column; }
#tool-body .cp-swatches {
  display: flex; flex-wrap: wrap; gap: 7px;
  min-height: 26px;
}
#tool-body .cp-sw {
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid var(--card-border);
  transition: transform 0.12s;
  flex-shrink: 0;
  position: relative;
}
#tool-body .cp-sw:hover { transform: scale(1.18); }
#tool-body .cp-sw.active {
  outline: 2px solid var(--primary);
}
#tool-body .cp-history-empty {
  font-size: 12px;
  color: var(--text-light);
  line-height: 28px;
}

/* ── Right body ── */
#tool-body .cp-right-body {
  padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
#tool-body .cp-group-hd {
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 6px 6px 2px;
}

/* ── Format row ── */
#tool-body .cp-fmt-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
#tool-body .cp-fmt-row:hover { background: var(--surface); }
#tool-body .cp-fmt-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-light);
  text-transform: uppercase;
  min-width: 52px;
  flex-shrink: 0;
}
#tool-body .cp-fmt-input {
  flex: 1; min-width: 0;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'SFMono-Regular','Consolas','Menlo',monospace;
  font-size: 13px;
  padding: 6px 9px;
  outline: none;
  background: transparent;
  box-sizing: border-box;
  cursor: default;
  user-select: all;
}
#tool-body .cp-fmt-input::placeholder { color: var(--text-light); font-style: italic; }

/* ── Action buttons ── */
#tool-body .cp-act-grp { display: flex; gap: 3px; flex-shrink: 0; }
#tool-body .cp-act-btn {
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1;
}
#tool-body .cp-act-btn:hover {
  background: var(--primary-dim);
  color: var(--primary);
  border-color: var(--primary);
}
#tool-body .cp-copy-btn.cp-copied {
  color: var(--primary);
  background: var(--primary-dim);
  border-color: var(--primary);
}

/* ── Divider ── */
#tool-body .cp-divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 4px 0;
}

/* ── Picking animation ── */
#tool-body .cp-pick-btn.picking {
  background: #f39c12;
  animation: cp-pulse 1s infinite;
}
@keyframes cp-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.72; }
}