.dpd-grid {
    display: grid;
    gap: 24px;
    margin: 24px 0;
}

.dpd-columns-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.dpd-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dpd-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dpd-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dpd-columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.dpd-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.10);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
    transition: transform .18s ease, box-shadow .18s ease;
}

.dpd-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(0,0,0,.10);
}

.dpd-thumb-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: inherit;
}

.dpd-thumb-wrap {
    display: block;
    aspect-ratio: 4 / 5.35;
    background: #f3f4f6;
    overflow: hidden;
}

.dpd-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dpd-card-body {
    padding: 16px;
}

.dpd-title {
    margin: 0 0 14px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
}

.dpd-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dpd-preview-btn,
.dpd-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    border: 1px solid #1f2937;
    line-height: 1.2;
}

.dpd-preview-btn {
    background: #1f2937;
    color: #fff;
}

.dpd-open-btn {
    background: #fff;
    color: #1f2937;
}

.dpd-preview-btn:hover,
.dpd-open-btn:hover {
    opacity: .88;
}

.dpd-empty {
    padding: 18px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.dpd-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.dpd-modal.is-open {
    display: block;
}

.dpd-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.72);
}

.dpd-modal-dialog {
    position: absolute;
    inset: 4vh 4vw;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 18px 60px rgba(0,0,0,.30);
}

.dpd-modal-header {
    min-height: 54px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dpd-modal-title {
    font-size: 16px;
    line-height: 1.3;
}

.dpd-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: #f3f4f6;
    color: #111827;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.dpd-modal-frame {
    width: 100%;
    height: 100%;
    border: 0;
    flex: 1;
}

body.dpd-modal-open {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .dpd-columns-4,
    .dpd-columns-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dpd-grid,
    .dpd-columns-2,
    .dpd-columns-3,
    .dpd-columns-4,
    .dpd-columns-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .dpd-card-body {
        padding: 13px;
    }

    .dpd-title {
        font-size: 16px;
    }

    .dpd-modal-dialog {
        inset: 2vh 2vw;
        border-radius: 10px;
    }
}

@media (max-width: 520px) {
    .dpd-grid,
    .dpd-columns-1,
    .dpd-columns-2,
    .dpd-columns-3,
    .dpd-columns-4,
    .dpd-columns-5 {
        grid-template-columns: 1fr;
    }

    .dpd-actions {
        flex-direction: column;
    }

    .dpd-preview-btn,
    .dpd-open-btn {
        width: 100%;
    }
}
