/* Palette extractor page styles. Theme tokens only; the only literal colors are the
   extracted swatch colors, applied inline by the controller (derived from the user's
   own image, fine to render). */

.palette-extractor .tool-title {
    margin-bottom: 0.25rem;
}

.palette-extractor .tool-intro {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

/* --- Controls: drop zone + count --------------------------------------- */

.pe-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: stretch;
}

@media (max-width: 560px) {
    .pe-controls {
        grid-template-columns: 1fr;
    }
}

.pe-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 7rem;
    padding: 1.25rem;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pe-drop:hover,
.pe-drop:focus-within,
.pe-drop.is-dragging {
    border-color: var(--accent);
    background: var(--accent-weak);
}

.pe-file {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.pe-drop-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    pointer-events: none;
}

.pe-drop-text strong {
    color: var(--text);
    font-size: 1.05rem;
}

.pe-count {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    justify-content: center;
}

.pe-count__label {
    font-size: 0.85rem;
    color: var(--muted);
}

.pe-count__input {
    width: 5.5rem;
}

.pe-reset {
    margin-top: 0.25rem;
}

/* --- Preview ----------------------------------------------------------- */

.pe-preview-wrap {
    margin-top: 1.5rem;
}

.pe-preview {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: block;
}

/* --- Palette swatches -------------------------------------------------- */

.pe-palette {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: 0.75rem;
}

.pe-palette:empty {
    margin-top: 0;
}

.pe-swatch {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.15rem;
    min-height: 6rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.pe-swatch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.pe-swatch:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.pe-swatch__hex {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.pe-swatch__hsl {
    font-size: 0.8rem;
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
}
