/* ── Custom colour picker (replaces the browser's) ── */
#color-pop {
  position: fixed; z-index: 2000;
  width: 260px; padding: 10px; /* width is recalculated in JS to fit the grid exactly */
  background: #161616; border: 1px solid #2e2e2e; border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  font-size: 0.75rem; color: #e0e0e0;
}
.cp-top { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cp-current { width: 28px; height: 28px; border-radius: 4px; border: 1px solid #3a3a3a; flex-shrink: 0; }
#cp-hex {
  flex: 1; min-width: 0; height: 28px; padding: 0 8px;
  background: #1e1e1e; border: 1px solid #3a3a3a; border-radius: 4px;
  color: #e0e0e0; font: inherit; font-family: ui-monospace, Consolas, monospace; outline: none;
}
#cp-hex:focus { border-color: #4a7fcb; }
#cp-hex.invalid { border-color: #e5484d; }
.cp-transparent { width: 28px; height: 28px; border-radius: 4px; border: 1px solid #3a3a3a; cursor: pointer; flex-shrink: 0; padding: 0; }
.cp-transparent:hover { border-color: #fff; }
/* eyedropper toggle (colour picker and Palette window) */
.cp-eyedrop {
  width: 28px; height: 28px; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1e1e1e; border: 1px solid #3a3a3a; border-radius: 4px; color: #ccc; cursor: pointer;
}
.cp-eyedrop:hover { border-color: #fff; color: #fff; }
.cp-eyedrop.active { background: #4a7fcb; border-color: #4a7fcb; color: #fff; }
/* while sampling: pipette cursor (tip = hotspot) over the canvas area */
#grid-container.eyedropping, #grid-container.eyedropping * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23000' stroke-width='4'%3E%3Cpath d='m2 22 1-1h3l9-9'/%3E%3Cpath d='M3 21v-3l9-9'/%3E%3Cpath d='m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z'/%3E%3C/g%3E%3Cg stroke='%23fff' stroke-width='2'%3E%3Cpath d='m2 22 1-1h3l9-9'/%3E%3Cpath d='M3 21v-3l9-9'/%3E%3Cpath d='m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z'/%3E%3C/g%3E%3C/svg%3E") 2 22, crosshair !important;
}
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1600;
  padding: 7px 14px; border-radius: 6px; background: #000c; border: 1px solid #3a3a3a;
  color: #e0e0e0; font-size: 0.78rem; pointer-events: none; transition: opacity 0.3s;
}
#toast.fade { opacity: 0; }
#eyedrop-chip {
  position: fixed; z-index: 1500; width: 22px; height: 22px; pointer-events: none;
  border: 2px solid #fff; border-radius: 4px; box-shadow: 0 0 0 1px #000, 0 2px 8px #0008;
}
#eyedrop-chip.is-transparent { background: repeating-conic-gradient(#bbb 0% 25%, #fff 0% 50%) 0 0 / 8px 8px; }
.cp-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; opacity: 0.5; margin: 0 0 5px; }
.cp-canvas { display: block; cursor: pointer; image-rendering: pixelated; }
#cp-grid { margin-bottom: 10px; }

.palette {
  display: flex;
  gap: 4px;
}

.swatch {
  width: 22px; height: 22px;
  border-radius: 3px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.1s, transform 0.1s;
}

.swatch:hover { transform: scale(1.15); }
.swatch.selected { border-color: #fff; }
