/* --- Color swatch (replaces native input[type=color]) --- */

.wptp-color-swatch {
    width: 100% !important;
    height: 38px !important;
    border: 1px solid var(--wptp-border) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

/* --- Custom color picker --- */

.wptp-picker {
    display: none;
    position: fixed;
    z-index: 10000000001 !important;
    width: 220px;
    background: var(--wptp-surface, #fff);
    border: 1px solid var(--wptp-border, #d0d7de);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    padding: 10px;
    font-family: var(--wptp-font);
    touch-action: none;
}

.wptp-picker-open { display: block; }

.wptp-picker-sv {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 4px;
    overflow: hidden;
    cursor: crosshair;
    touch-action: none;
}

.wptp-picker-sv-white,
.wptp-picker-sv-black {
    position: absolute;
    inset: 0;
    border-radius: 4px;
}

.wptp-picker-sv-white {
    background: linear-gradient(to right, #fff, transparent);
}

.wptp-picker-sv-black {
    background: linear-gradient(to top, #000, transparent);
}

.wptp-picker-sv-cursor {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(0,0,0,.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.wptp-picker-hue {
    position: relative;
    width: 200px;
    height: 14px;
    margin-top: 10px;
    border-radius: 7px;
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    cursor: pointer;
    touch-action: none;
}

.wptp-picker-hue-cursor {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(0,0,0,.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.wptp-picker-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.wptp-picker-preview {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid var(--wptp-border, #d0d7de);
    flex-shrink: 0;
}

.wptp-picker-hex {
    flex: 1;
    padding: 6px 8px !important;
    border: 1px solid var(--wptp-border, #d0d7de) !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-family: monospace !important;
    color: var(--wptp-text, #24292f) !important;
    background: #fff !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.wptp-picker-hex:focus {
    border-color: var(--wptp-accent, #2563eb) !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .2) !important;
}
