.vlp-post-select-modal {
    width: 100%;
    max-width: 820px;

    .components-modal__content {
        display: flex;
        flex-direction: column;
        padding-bottom: 24px;
    }

    .vlp-post-select {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
    }

    .vlp-post-select-input {
        display: flex;
        align-items: stretch;
        flex: 0 0 auto;
        gap: 8px;
        flex-wrap: wrap;

        select,
        .vlp-post-select-search {
            height: 36px;
            line-height: 1.4;
            margin: 0;
        }

        .vlp-post-select-search-wrap {
            position: relative;
            flex: 1 1 280px;
            display: flex;
        }

        .vlp-post-select-search {
            flex: 1 1 auto;
            width: 100%;
            max-width: none;
            padding-right: 36px;
        }

        .vlp-post-select-search-spinner {
            position: absolute;
            top: 50%;
            right: 8px;
            transform: translateY(-50%);
            display: inline-flex;
            pointer-events: none;

            .components-spinner {
                margin: 0;
            }
        }
    }

    .vlp-post-select-results {
        flex: 0 0 auto;
        height: 320px;
        margin-top: 10px;
        overflow: auto;
        border: 1px solid #ddd;
        border-radius: 4px;
        background: #fff;
        transition: opacity 0.15s ease;

        &.is-loading {
            opacity: 0.5;
        }
    }

    .vlp-post-select-posts {
        width: 100%;
        margin-top: 0;
        border-collapse: collapse;
        table-layout: auto;

        th {
            text-align: left;
            position: sticky;
            top: 0;
            z-index: 1;
            background: #fff;
            border-bottom: 1px solid #e5e5e5;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #50575e;
            white-space: nowrap;
        }

        th,
        td {
            padding: 8px 12px;
            vertical-align: middle;
        }

        td {
            border-bottom: 1px solid #f0f0f0;
        }

        .vlp-post-select-col-thumbnail {
            width: 1%;
            padding-right: 0;

            img,
            .vlp-post-select-thumbnail-placeholder {
                display: block;
                width: 40px;
                height: 40px;
                border-radius: 4px;
                object-fit: cover;
                background: #f0f0f1;
            }

            .vlp-post-select-thumbnail-placeholder {
                border: 1px dashed #dcdcde;
                box-sizing: border-box;
            }
        }

        .vlp-post-select-col-type {
            white-space: nowrap;
            width: 1%;
            min-width: 80px;
            color: #50575e;
        }

        .vlp-post-select-col-date {
            white-space: nowrap;
            width: 1%;
            min-width: 110px;
            color: #50575e;
        }

        .vlp-post-select-col-title {
            width: auto;

            a {
                display: inline-block;
                max-width: 100%;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                vertical-align: middle;
            }
        }

        .vlp-post-select-col-action {
            width: 1%;
            min-width: 120px;
            white-space: nowrap;
            text-align: right;
        }

        .vlp-post-select-row {
            &:hover {
                background-color: #f6f7f7;
            }

            &:last-child td {
                border-bottom: none;
            }
        }

        .vlp-post-select-feedback td {
            padding: 32px 12px;
            text-align: center;
            color: #50575e;
        }
    }

    .vlp-post-select-use {
        &.components-button.is-primary {
            padding: 4px 10px;
            height: auto;
            font-size: 12px;
        }
    }

    .vlp-post-select-loading {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }
}

@media screen and (max-width: 782px) {
    .vlp-post-select-modal {
        .vlp-post-select {
            min-height: 0;
        }

        .vlp-post-select-results {
            height: auto;
            min-height: 240px;
            max-height: calc(100vh - 280px);
        }
    }
}
