/**
 * Image Compress.
 */

.em-ic__drop { margin-bottom: 1.2em; }
.em-ic__drop strong { color: var(--em-ink, inherit); }

/* ── Controls ──────────────────────────────────────────────────────────── */

.em-ic__controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: .9em 1.2em;
    padding: .9em 1em;
    border: 1px solid var(--em-line, #e5e7eb);
    border-radius: 10px;
    background: var(--em-surface, #fff);
}

.em-ic__label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5em;
    margin-bottom: .5em;
    font-weight: 600;
    color: var(--em-ink, inherit);
}

.em-ic__value {
    font-variant-numeric: tabular-nums;
    color: var(--em-brand, #2563eb);
}

.em-ic__control input[type="range"] {
    width: 100%;
    accent-color: var(--em-brand, #2563eb);
}

.em-ic__select {
    width: 100%;
    padding: .6em .7em;
    border: 1px solid var(--em-line, #e5e7eb);
    border-radius: 8px;
    background: var(--em-surface, #fff);
    color: var(--em-ink, inherit);
    font: inherit;
}

.em-ic__control .em-tool__hint { margin: .35em 0 0; font-size: .84rem; line-height: 1.45; }

/* ── The bar between the controls and the results ──────────────────────── */

.em-ic__bar {
    display: flex;
    flex-wrap: wrap;
    gap: .7em 1em;
    align-items: center;
    justify-content: space-between;
    margin-top: 1em;
    padding: .8em 1em;
    border-radius: 10px;
    background: var(--em-tint, #f0f6ff);
    color: var(--em-ink, inherit);
}

.em-ic__totals {
    flex: 1 1 14em;
    font-variant-numeric: tabular-nums;
}

.em-ic__progress {
    display: flex;
    align-items: center;
    gap: .55em;
    flex: 1 1 14em;
    margin: 0;
    font-size: .94rem;
    color: var(--em-soft, #6b7280);
}

.em-ic__spinner {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    border: 2px solid var(--em-brand, #2563eb);
    border-right-color: transparent;
    border-radius: 50%;
    animation: em-ic-spin .7s linear infinite;
}

@keyframes em-ic-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .em-ic__spinner { animation: none; opacity: .5; }
}

.em-ic__bar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5em;
}

.em-ic__all,
.em-ic__save,
.em-ic__add,
.em-ic__clear {
    padding: .55em 1em;
    border: 1px solid var(--em-brand, #2563eb);
    border-radius: 8px;
    background: var(--em-brand, #2563eb);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.em-ic__save,
.em-ic__add {
    background: transparent;
    color: var(--em-brand, #2563eb);
}

/* Starting again throws work away, so it does not look like the main action. */
.em-ic__clear {
    border-color: var(--em-line, #e5e7eb);
    background: transparent;
    color: var(--em-soft, #6b7280);
    font-weight: 400;
}

.em-ic__save { flex: 0 0 auto; }

/* ── One picture per row ───────────────────────────────────────────────── */

.em-ic__list {
    list-style: none;
    margin: 1em 0 0;
    padding: 0;
}

.em-ic__row {
    display: flex;
    gap: 1em;
    align-items: center;
    padding: .8em 0;
    border-bottom: 1px solid var(--em-line, #e5e7eb);
}

.em-ic__row:last-child { border-bottom: 0; }

.em-ic__thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--em-tint, #f0f6ff);
}

.em-ic__meta {
    flex: 1 1 8em;
    min-width: 0;
}

/* A camera's filename is long and has nowhere to break. */
.em-ic__name {
    display: block;
    overflow-wrap: anywhere;
    color: var(--em-ink, inherit);
}

.em-ic__sizes {
    display: block;
    margin-top: .2em;
    font-size: .9rem;
    color: var(--em-soft, #6b7280);
    font-variant-numeric: tabular-nums;
}

.em-ic__sizes.is-bad { color: #dc2626; }

.em-ic__saved {
    font-weight: 600;
    color: #16a34a;
}

/* When the file grew, the figure should not be dressed as good news. */
.em-ic__saved.is-worse {
    font-weight: 400;
    color: var(--em-soft, #6b7280);
}

@media (max-width: 420px) {
    .em-ic__row { flex-wrap: wrap; }
    .em-ic__save { width: 100%; }
}
