.fex-design-grid {
    width:
        min(
            calc(100% - 32px),
            1000px
        );

    margin:
        0 auto;

    box-sizing:
        border-box;

    display:
        grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(220px, 1fr)
        );

    gap:
        var(--fex-space-md, 16px);
}

.fex-design-card {
    position: relative;

    display: flex;

    flex-direction:
        column;

    gap:
        var(--fex-space-sm, 12px);

    padding:
        var(--fex-space-lg, 18px);

    border:
        1px solid
        var(
            --fex-color-border,
            #e5e7eb
        );

    border-radius:
        var(
            --fex-radius-lg,
            16px
        );

    background:
        var(
            --fex-color-surface,
            #ffffff
        );

    color:
        var(
            --fex-color-text,
            #111827
        );

    transition:
        transform
        var(
            --fex-transition-fast,
            200ms ease
        ),
        box-shadow
        var(
            --fex-transition-fast,
            200ms ease
        ),
        border-color
        var(
            --fex-transition-fast,
            200ms ease
        );
}

.fex-design-card:hover {
    transform:
        translateY(-3px);

    border-color:
        var(
            --fex-color-border-hover,
            #d1d5db
        );

    box-shadow:
        var(
            --fex-shadow-md,
            0 10px 30px rgba(0, 0, 0, 0.08)
        );
}

.fex-design-preview {
    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    min-height:
        110px;

    padding:
        var(
            --fex-space-sm,
            12px
        );

    color:
        var(
            --fex-color-text,
            #111827
        );

    font-size:
        42px;

    line-height:
        1.4;

    text-align:
        center;

    word-break:
        break-word;

    overflow-wrap:
        anywhere;

    cursor:
        pointer;

    user-select:
        text;

    border-radius:
        var(
            --fex-radius-md,
            10px
        );

    transition:
        background-color
        var(
            --fex-transition-fast,
            160ms ease
        );
}

.fex-design-preview:hover {
    background:
        var(
            --fex-color-surface-hover,
            #f8fafc
        );
}

.fex-design-info {
    display:
        flex;

    flex-direction:
        column;

    gap:
        var(
            --fex-space-xs,
            4px
        );
}

.fex-design-name {
    color:
        var(
            --fex-color-heading,
            #111827
        );

    font-size:
        15px;

    font-weight:
        700;

    line-height:
        1.4;
}

.fex-design-category {
    color:
        var(
            --fex-color-text-muted,
            #6b7280
        );

    font-size:
        12px;

    line-height:
        1.4;

    text-transform:
        capitalize;
}

.fex-design-actions {
    display:
        flex;

    gap:
        7px;

    flex-wrap:
        wrap;
}

.fex-action {
    flex:
        1;

    min-width:
        70px;

    padding:
        8px 10px;

    border:
        1px solid
        var(
            --fex-color-border,
            #e5e7eb
        );

    border-radius:
        var(
            --fex-radius-sm,
            9px
        );

    background:
        var(
            --fex-color-surface,
            #ffffff
        );

    color:
        var(
            --fex-color-text,
            #111827
        );

    cursor:
        pointer;

    font-family:
        inherit;

    font-size:
        12px;

    font-weight:
        600;

    line-height:
        1.3;

    transition:
        background-color
        var(
            --fex-transition-fast,
            200ms ease
        ),
        border-color
        var(
            --fex-transition-fast,
            200ms ease
        ),
        color
        var(
            --fex-transition-fast,
            200ms ease
        ),
        transform
        var(
            --fex-transition-fast,
            150ms ease
        ),
        box-shadow
        var(
            --fex-transition-fast,
            150ms ease
        );
}

.fex-action:hover {
    transform:
        translateY(-1px);

    background:
        var(
            --fex-color-surface-hover,
            #f3f4f6
        );

    border-color:
        var(
            --fex-color-border-hover,
            #d1d5db
        );
}

.fex-action:active {
    transform:
        translateY(0);
}

.fex-action:focus-visible {
    outline:
        var(
            --fex-border-width-strong,
            2px
        )
        solid
        var(
            --fex-focus-border,
            #2563eb
        );

    outline-offset:
        2px;
}

.fex-action-copy.is-copied {
    color:
        var(
            --fex-color-success,
            #16a34a
        );

    font-weight:
        700;
}

.fex-action-favorite.is-favorite {
    color:
        var(
            --fex-color-primary,
            #2563eb
        );

    font-weight:
        700;
}

.fex-action-add.is-added {
    color:
        var(
            --fex-color-success,
            #16a34a
        );

    font-weight:
        700;
}

.fex-design-empty {
    width:
        100%;

    padding:
        40px 20px;

    color:
        var(
            --fex-color-text-muted,
            #6b7280
        );

    text-align:
        center;
}

@media (max-width: 600px) {

    .fex-design-grid {
        width:
            calc(100% - 24px);

        margin:
            0 auto;

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap:
            var(
                --fex-space-sm,
                10px
            );
    }

    .fex-design-card {
        padding:
            var(
                --fex-space-sm,
                12px
            );

        border-radius:
            var(
                --fex-radius-md,
                12px
            );
    }

    .fex-design-preview {
        min-height:
            90px;

        font-size:
            30px;
    }

    .fex-design-actions {
        display:
            grid;

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap:
            6px;
    }

    .fex-action {
        min-width:
            0;

        width:
            100%;
    }
}

@media (max-width: 380px) {

    .fex-design-grid {
        width:
            calc(100% - 20px);

        margin:
            0 auto;

        grid-template-columns:
            1fr;
    }

    .fex-design-preview {
        min-height:
            100px;

        font-size:
            32px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .fex-design-card,
    .fex-design-preview,
    .fex-action {
        transition:
            none;
    }
}