/* ==========================================================================
   The Batch — batch resize/convert (/darkroom/batch-resize/)

   Scoped inside the light .pt-scope bench; tokens from pt-instrument.css.
   Flat design only — the progress bar is two nested solid divs, never a
   gradient fill.
   ========================================================================== */

.dk-batch-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- Queue --------------------------------------------------------------- */
.dk-batch-queue-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.dk-batch-queue {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 22rem;
    overflow-y: auto;
    border: 1px solid var(--pt-border);
    border-radius: 0.5rem;
    background: var(--pt-surface);
}

.dk-queue__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--pt-border);
}

.dk-queue__row:last-child { border-bottom: none; }

.dk-queue__thumb {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 0.25rem;
    background: var(--pt-surface-raised);
    border: 1px solid var(--pt-border);
}

.dk-queue__meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.dk-queue__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--pt-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dk-queue__sub {
    font-family: var(--pt-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--pt-text-faint);
}

.dk-queue__status {
    flex: 0 0 auto;
    max-width: 45%;
    text-align: right;
    font-family: var(--pt-font-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pt-text-muted);
}

.dk-queue__status.is-processing { color: var(--pt-accent); }

.dk-queue__status.is-done {
    color: var(--pt-ok);
    text-transform: none;
    letter-spacing: normal;
    font-family: var(--pt-font-mono);
    font-variant-numeric: tabular-nums;
}

.dk-queue__status.is-failed {
    color: var(--pt-bad);
    text-transform: none;
    letter-spacing: normal;
}

.dk-queue__status.is-skipped { color: var(--pt-text-muted); }

/* --- Settings ------------------------------------------------------------ */
.dk-chips--wrap { flex-wrap: wrap; }

.dk-batch-size {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.dk-batch-custom {
    width: 8rem;
    padding: 0.375rem 0.5rem;
    font-family: var(--pt-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    color: var(--pt-text);
    background: var(--pt-chrome-bg);
    border: 1px solid var(--pt-border-strong);
    border-radius: 0.375rem;
}

.dk-batch-custom:focus {
    outline: none;
    border-color: var(--pt-accent);
}

/* --- Progress (flat: nested solid divs) ---------------------------------- */
.dk-batch-progress-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dk-batch-progress {
    flex: 1 1 auto;
    height: 8px;
    border-radius: 4px;
    background: var(--pt-border-strong);
    overflow: hidden;
}

.dk-batch-progress__fill {
    height: 100%;
    width: 0%;
    background: var(--pt-accent);
    transition: width var(--pt-dur, 240ms) var(--pt-ease, ease);
}

.dk-batch-progress__count {
    flex: 0 0 auto;
    font-family: var(--pt-font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--pt-text);
}

/* --- Actions ------------------------------------------------------------- */
.dk-batch-actions { margin-left: 0; }

@media (prefers-reduced-motion: reduce) {
    .dk-batch-progress__fill { transition: none; }
}

@media (max-width: 640px) {
    /* Queue rows: let the status drop to its own full-width line under the
       filename rather than fighting for space and overflowing. The filename
       already truncates with an ellipsis. */
    .dk-queue__row { flex-wrap: wrap; }

    .dk-queue__status {
        max-width: none;
        flex-basis: 100%;
        margin-left: 3.75rem;   /* align under the meta column, past the 48px thumb + gap */
        text-align: left;
    }

    /* Three actions won't fit one row on a phone — let the primary convert
       button take its own full-width line below Add/Clear. */
    .dk-batch-actions { flex-wrap: wrap; }

    #dk-batch-convert { flex-basis: 100%; }
}
