.lcp {
  --lcp-h: 239;
  position: fixed;
  z-index: 5000;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 256px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: #151938;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
}

.lcp[hidden] { display: none; }

.lcp *,
.lcp *::before,
.lcp *::after {
  box-sizing: border-box;
}

.lcp-sv {
  position: relative;
  height: 150px;
  border-radius: 10px;
  background:
    linear-gradient(to top, #000000, transparent),
    linear-gradient(to right, #ffffff, hsl(var(--lcp-h) 100% 50%));
  cursor: crosshair;
  touch-action: none;
}

.lcp-sv-thumb,
.lcp-hue-thumb {
  position: absolute;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.lcp-sv-thumb {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
}

.lcp-hue {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  cursor: pointer;
  touch-action: none;
}

.lcp-hue-thumb {
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  background: hsl(var(--lcp-h) 100% 50%);
}

.lcp-sv:focus-visible,
.lcp-hue:focus-visible,
.lcp-hex:focus-visible,
.lcp-done:focus-visible,
.lcp-swatch:focus-visible {
  outline: 2px solid #c7d2fe;
  outline-offset: 2px;
}

.lcp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lcp-preview {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.lcp-hex {
  flex: 1;
  width: 0;
  min-width: 0;
  height: 32px;
  margin: 0;
  padding: 0 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: lowercase;
}

.lcp-hex:focus { border-color: rgba(129, 140, 248, 0.8); outline: none; }

.lcp-done {
  flex: none;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lcp-swatches {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.lcp-swatch {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.lcp-swatch[aria-pressed="true"] {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

.lcp-recent-wrap[hidden] { display: none; }

.lcp-caption {
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
}

.lcp.lcp-sheet {
  left: 8px;
  right: 8px;
  top: auto;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  width: auto;
  padding: 14px;
}

.lcp.lcp-sheet .lcp-sv { height: 170px; }
.lcp.lcp-sheet .lcp-hue { height: 20px; }
.lcp.lcp-sheet .lcp-hue-thumb { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
