#dribbblish-config {
    display: none;
    z-index: 99999;
    position: absolute;
    inset: 0px;
    align-items: center;
    justify-content: center;
    color: spiceColor("text");

    &[active] {
        display: flex;

        & ~ #main::after {
            z-index: 4;
            position: absolute;
            content: "";
            inset: 0px;
            backdrop-filter: blur(3px) brightness(60%);
        }
    }

    .dribbblish-config-container {
        z-index: 1;
        position: relative;
        width: clamp(500px, 50%, 650px);
        background-color: spiceColor("main", 0.95);
        backdrop-filter: blur(3px);
        padding: 20px 15px;
        border-radius: var(--main-corner-radius);
        display: flex;
        gap: 5px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        @include spiceShadow();

        .dribbblish-config-close {
            position: absolute;
            top: 15px;
            right: 15px;
        }

        .dribbblish-config-areas {
            display: flex;
            width: 100%;
            flex-direction: column;
            gap: 8px;
            max-height: 60vh;
            overflow-y: auto;
            padding: 0px 25px;

            .dribbblish-config-area {
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 8px;

                &[collapsed] {
                    overflow: hidden;
                    min-height: 38px; //for some reason height alone isn't enough
                    height: 38px;

                    .dribbblish-config-area-header svg {
                        transform: rotate(270deg);
                    }
                }

                &:empty {
                    display: none;
                }

                .dribbblish-config-area-header {
                    position: relative;
                    text-align: center;
                    width: fit-content;
                    height: 38px;
                    display: flex;
                    gap: 10px;
                    align-items: center;
                    justify-content: center;

                    svg {
                        color: spiceColor("text");
                        padding: 0px;
                        height: 100%;
                        stroke-width: 2px;
                        transform: rotate(90deg);
                    }
                }

                .dribbblish-config-area-items {
                    display: flex;
                    flex-direction: column;
                    gap: 8px;
                    width: 100%;

                    .dribbblish-config-item {
                        position: relative;
                        width: 100%;
                        height: min-content;
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        gap: 10px;
                        padding: 8px 16px;
                        user-select: text;

                        &[hidden] {
                            display: none;
                        }

                        &::before {
                            z-index: -1;
                            content: "";
                            position: absolute;
                            inset: 0px;
                            border-radius: var(--main-corner-radius);
                            background-color: spiceColor("subtext", 0.03, 0.04);
                        }

                        &[parent]::before {
                            top: -8px;
                            border-top-left-radius: 0px;
                            border-top-right-radius: 0px;
                        }

                        &[connect-bottom]::before {
                            border-bottom-left-radius: 0px;
                            border-bottom-right-radius: 0px;
                        }

                        &[invalid] {
                            &::before {
                                border: 2px solid rgba(red, 0.8);
                            }

                            .dribbblish-config-item-input::before {
                                content: var(--validation-error);
                                margin-right: 8px;
                                color: rgba(red, 0.8);
                            }
                        }

                        &[changed] {
                            &::after {
                                content: "";
                                position: absolute;
                                left: 0px;
                                top: 0px;
                                bottom: 0px;
                                width: 5px;
                                background-color: spiceColor("text");
                                border-top-left-radius: var(--main-corner-radius);
                                border-bottom-left-radius: var(--main-corner-radius);
                            }

                            &[parent]::after {
                                top: -4px;
                                border-top-left-radius: 0px;
                            }

                            &[connect-bottom]::after {
                                bottom: -4px;
                                border-bottom-left-radius: 0px;
                            }
                        }

                        .dribbblish-config-item-header {
                            display: flex;
                            flex-direction: column;
                            align-items: flex-start;
                            gap: 5px;

                            > {
                                & [empty="true"] {
                                    display: none;
                                }

                                .x-settings-title {
                                    display: flex;
                                    gap: 10px;
                                    align-items: center;
                                    grid-area: header;
                                    margin: 0px;
                                    height: min-content;
                                    position: relative;
                                    bottom: 0px;

                                    .dribbblish-config-item-reset {
                                        padding: 0px;
                                        color: spiceColor("text");
                                        width: 1em;
                                        height: 1em;
                                    }
                                }

                                .main-type-mesto {
                                    grid-area: description;
                                    height: min-content;
                                    color: spiceColor("subtext");
                                    line-height: calc(1em + 6px); // To have line gaps
                                }

                                .x-settings-secondColumn {
                                    grid-area: input;
                                }
                            }
                        }

                        .dribbblish-config-item-input {
                            display: flex;
                            min-width: fit-content;
                        }
                    }
                }
            }
        }
    }

    .dribbblish-config-backdrop {
        position: absolute;
        content: "";
        inset: 0px;
    }
}
