/* Palette extractor specifics. Shared primitives live in tools-ui.css. */
.drop {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: 24px;
    text-align: center;
    background: var(--surface);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
}

.drop:hover,
.drop.over,
.visually-hidden:focus-visible + .drop,
#fileInput:focus-visible ~ .drop {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.drop-title {
    font-weight: 600;
}

.drop-hint {
    color: var(--text-muted);
    font-size: 0.875rem;
}

#sampleBtn {
    margin-top: 12px;
}

.message {
    margin: 10px 0 0;
    min-height: 1.5em;
    color: var(--text-muted);
}

.message.error {
    color: var(--danger);
}

#workspace {
    margin-top: 20px;
    display: grid;
    gap: 16px;
}

.top {
    align-items: start;
}

.preview img {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 16px 16px;
}

.strip {
    display: flex;
    height: 28px;
    margin: 16px 0 12px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.strip span {
    min-width: 3px;
}

.swatches,
.pairs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.swatch {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 8px 12px 8px 8px;
    text-align: left;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.swatch:hover {
    border-color: var(--accent);
}

.swatch[aria-current="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.chip-color {
    display: grid;
    place-items: center;
    width: 56px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
    font-size: 0.8125rem;
    font-weight: 700;
}

.swatch-main {
    min-width: 0;
}

.swatch-code {
    display: block;
    font-family: var(--mono);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.swatch-meta {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.swatch-share {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.pairs {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    margin-top: 12px;
}

.pairs .swatch {
    grid-template-columns: 40px 1fr;
}

.pairs .chip-color {
    width: 40px;
    height: 36px;
}

.code {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: 0.875rem;
    line-height: 1.55;
    white-space: pre;
}

@media (max-width: 760px) {
    .drop {
        min-height: 110px;
    }
}
