/* Keep upload progress in the library utility row without changing the grid flow. */
#libraryView .library-content {
    position: relative !important;
}

#libraryView .library-content > #libraryUploadStatus {
    position: absolute !important;
    top: 12px !important;
    left: 50% !important;
    z-index: 6 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    width: min(360px, calc(100% - 208px)) !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border: 1px solid color-mix(in srgb, var(--accent-color) 22%, var(--border-color)) !important;
    border-radius: 10px !important;
    background: color-mix(in srgb, var(--input-bg) 92%, transparent) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
    transform: translateX(-50%) !important;
    pointer-events: none !important;
}

#libraryView .library-content > #libraryUploadStatus[hidden] {
    display: none !important;
}

#libraryView .library-upload-status-row {
    min-width: 0 !important;
    margin-bottom: 5px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

#libraryView .library-upload-status-row > span:first-child {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#libraryView .library-upload-status-row > span:last-child {
    flex: 0 0 auto !important;
    color: var(--text-primary) !important;
    font-variant-numeric: tabular-nums;
}

#libraryView .library-upload-progress-track {
    height: 4px !important;
}

#libraryView #librarySearchBar {
    z-index: 8 !important;
}

#libraryView #librarySelectionToolbar {
    z-index: 9 !important;
}

/* Selection actions can become wider, so leave them a larger clear zone. */
#libraryView.library-selection-mode .library-content > #libraryUploadStatus {
    width: min(300px, calc(100% - 330px)) !important;
}

@media (max-width: 768px) {
    #libraryView .library-content > #libraryUploadStatus {
        top: 12px !important;
        width: min(176px, calc(100% - 128px)) !important;
        min-height: 32px !important;
        padding: 5px 8px !important;
        border-radius: 9px !important;
    }

    #libraryView.library-selection-mode .library-content > #libraryUploadStatus {
        width: min(132px, calc(100% - 170px)) !important;
    }

    #libraryView .library-upload-status-row {
        font-size: 10px !important;
    }

    #libraryView .library-upload-progress-track {
        height: 3px !important;
    }
}
