.grid-preview {
    --grid-columns: 3;
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fc;
    min-height: 320px;
    border: 1px dashed rgba(88, 100, 255, 0.25);
    border-radius: 0.75rem;
    position: relative;
    overflow-y: auto;
}

.grid-preview .placeholder-text {
    margin: auto;
    max-width: 240px;
    line-height: 1.6;
}

.grid-preview .slice-card {
    border: 1px solid rgba(88, 100, 255, 0.25);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grid-preview .slice-card figure {
    margin: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #eef1ff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.grid-preview .slice-card img {
    width: 100%;
    height: auto;
    display: block;
}

.grid-preview .slice-meta {
    font-size: 0.8125rem;
    color: #475569;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.list-check li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
}

.list-check li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    top: 0;
    color: #5864ff;
    font-weight: 700;
}

.grid-preset-group {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.grid-preset-group::-webkit-scrollbar {
    height: 6px;
}

.grid-preset-group::-webkit-scrollbar-thumb {
    background-color: rgba(88, 100, 255, 0.35);
    border-radius: 9999px;
}

.grid-preset-option {
    border-radius: 0.75rem;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    min-width: 0;
    white-space: normal;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    color: #1f2937;
}

.grid-preset-option .text-muted {
    color: #6b7280 !important;
}

.grid-preset-group .btn-check:checked + .grid-preset-option {
    border-color: #4f46e5;
    background-color: #eef2ff;
    box-shadow: 0 0 0 0.3rem rgba(79, 70, 229, 0.2);
    color: #111827;
}

/* Ensure the selected state keeps text legible on the highlighted background */
.grid-preset-group .btn-check:checked + .grid-preset-option .fw-semibold {
    color: #1f2937;
}

.grid-preset-group .btn-check:checked + .grid-preset-option .text-muted {
    color: #4338ca !important;
}

.btn-check:focus-visible + .grid-preset-option {
    box-shadow: 0 0 0 0.25rem rgba(88, 100, 255, 0.25);
}

.grid-preset-option:hover {
    border-color: rgba(88, 100, 255, 0.6);
}

@media (max-width: 991.98px) {
    .grid-preview {
        min-height: 260px;
    }
}
