/* Color palette generator */
.pg-controls { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; gap: 14px; align-items: end; }
@media (max-width: 860px) { .pg-controls { grid-template-columns: minmax(0, 1fr) auto; } .pg-controls .pg-mode-field { grid-column: 1 / -1; grid-row: 2; } }
@media (max-width: 480px) { .pg-controls { grid-template-columns: 1fr; } .pg-controls #pg-random { width: 100%; } }
.pg-base-row { display: flex; gap: 8px; }
.pg-base-row input[type='color'] { flex-shrink: 0; }
.pg-swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; min-height: 300px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.pg-swatch { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; padding: 14px 6px; min-width: 0; text-align: center; }
.pg-tools { position: absolute; top: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.pg-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; font: inherit; font-size: 1rem;
  color: inherit; background: rgba(255, 255, 255, 0.18); opacity: 0.7; transition: opacity 0.15s, background 0.15s;
}
.pg-swatch:hover .pg-btn, .pg-btn:focus-visible, .pg-lock[aria-pressed='true'] { opacity: 1; }
.pg-btn:hover { background: rgba(255, 255, 255, 0.32); }
.pg-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.pg-lock[aria-pressed='true'] { background: rgba(255, 255, 255, 0.4); }
.pg-hex { border: 0; background: none; color: inherit; font: inherit; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.pg-hex:hover, .pg-hex:focus-visible { background: rgba(255, 255, 255, 0.2); outline: none; }
.pg-meta { font-size: 0.72rem; line-height: 1.4; opacity: 0.85; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .pg-swatches { grid-template-columns: 1fr; min-height: 0; }
  .pg-swatch { flex-direction: row; justify-content: space-between; padding: 14px 12px; min-height: 76px; text-align: left; }
  .pg-tools { position: static; order: 3; }
  .pg-meta { flex: 1; }
}
#pg-err:empty { display: none; }
@media (hover: none) { #pg-random .kbd { display: none; } }
