.cvd {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cvd-loader {
    margin-block: 0.5rem;
}

/* Drop zone doubles as the file picker label. */
.cvd-drop {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 7rem;
    padding: 1.5rem;
    border: 2px dashed var(--border);
    border-radius: 0.75rem;
    background: var(--surface);
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.cvd-drop:hover,
.cvd-drop:focus-within {
    border-color: var(--accent);
    color: var(--text);
}

.cvd-drop.is-over {
    border-color: var(--accent);
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

/* Visually hide the native file input but keep it accessible. */
.cvd-file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.cvd-drop-text {
    font-size: 0.95rem;
}

.cvd-empty {
    color: var(--muted);
    font-size: 0.95rem;
}

/* Responsive grid of result panels. */
.cvd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.cvd-cell {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface);
}

.cvd-caption {
    font-weight: 600;
    color: var(--text);
}

.cvd-canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--text) 6%, transparent);
}

.cvd-download {
    align-self: flex-start;
}
