/* Image MicroTools 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,
#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;
}

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

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

#workspace {
    margin-top: 20px;
}

.work {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.side {
    display: grid;
    gap: 16px;
}

.stage {
    position: sticky;
    top: 16px;
}

.canvas-wrap {
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 16px 16px;
    border: 1px solid var(--border);
}

#preview {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
}

.result-line {
    margin: 12px 0 0;
    font-variant-numeric: tabular-nums;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool {
    margin-top: 8px;
}

.size-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

input[type="number"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
}

select {
    width: 100%;
}

.lock {
    margin-top: 12px;
}

.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.presets .chip {
    padding: 4px 12px;
}

.output .actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.output h2 {
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .work {
        grid-template-columns: 1fr;
    }

    .stage {
        position: static;
    }

    #preview {
        max-height: 50vh;
    }
}
