#inventoryBatchRepriceModal {
    z-index: 2000;
}

#inventoryBatchRepriceModal .inventory-batch-reprice-dialog {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 36px);
    overflow: hidden;
}

#inventoryBatchRepriceBody {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

/* Keep the options in the dialog's scroll flow instead of clipping a popover. */
#inventoryBatchRepriceBody .smooth-select-panel {
    position: static;
    max-height: min(240px, 35dvh);
    margin-top: 6px;
    transform: none;
}

#inventoryBatchRepriceBody .inventory-modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex-wrap: wrap;
    padding: 12px 0 2px;
    background: var(--throne-surface, #fff);
}

#inventoryBatchRepriceBody .inventory-batch-reprice-table-wrap {
    max-height: none;
}

#inventoryBatchRepriceBody .inventory-reprice-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-reprice-template {
    display: grid;
    gap: 3px;
    margin-bottom: 14px;
}

.inventory-reprice-template > span,
.inventory-reprice-preview caption {
    color: var(--inv-muted);
    font-size: 12px;
    text-align: left;
}

.inventory-reprice-preview caption {
    padding: 8px 12px;
}

.inventory-reprice-error {
    display: grid;
    gap: 5px;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid var(--inv-border);
    border-radius: 8px;
}

.inventory-reprice-note {
    margin: 12px 0 0;
}

.inventory-reprice-error li,
.inventory-reprice-excluded li {
    margin: 8px 0;
}

.inventory-reprice-error li span,
.inventory-reprice-excluded li span {
    display: block;
}

.inventory-batch-progress {
    margin-top: 6px;
    white-space: normal;
}

.inventory-batch-progress[aria-busy="true"]::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -1px;
    animation: inventory-reprice-spin 0.9s linear infinite;
}

.inventory-batch-progress-warning {
    font-weight: 700;
}

@keyframes inventory-reprice-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .inventory-batch-progress[aria-busy="true"]::before {
        animation: none;
    }
}

@media (max-width: 600px) {
    #inventoryBatchRepriceBody .inventory-reprice-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #inventoryBatchRepriceBody .inventory-reprice-preview {
        min-width: 0;
    }

    .inventory-reprice-preview thead {
        display: none;
    }

    .inventory-reprice-preview tr,
    .inventory-reprice-preview td {
        display: block;
        width: auto;
        white-space: normal;
    }

    .inventory-reprice-preview tr + tr {
        border-top: 1px solid var(--inv-border);
    }

    .inventory-reprice-preview td[data-label] {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .inventory-reprice-preview td[data-label]::before {
        content: attr(data-label);
        color: var(--inv-muted);
    }
}
