/* 抽出した色を、コントラスト判定つきのカードで並べる。 */
#palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.swatch {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card, var(--bg));
}

.swatch-chip {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.swatch-chip .on-w { color: #fff; font-weight: 700; }
.swatch-chip .on-b { color: #000; font-weight: 700; }

.swatch-meta { padding: 8px 10px 10px; }

.hexbtn {
  background: none;
  border: 0;
  padding: 2px 0;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  letter-spacing: .03em;
}
.hexbtn:hover { text-decoration: underline; }

.swatch-rgb { font-size: 12px; color: var(--muted); margin: 1px 0 6px; }

.swatch-contrast { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.swatch-contrast .c-ok { color: #1a8a3a; }
.swatch-contrast .c-warn { color: #b0670f; }
.swatch-contrast .c-ng { color: #b03030; }

@media (prefers-color-scheme: dark) {
  .swatch-contrast .c-ok { color: #6fd089; }
  .swatch-contrast .c-warn { color: #e0a35a; }
  .swatch-contrast .c-ng { color: #ee8a8a; }
}
