.#{$eccgui}-autosuggestion {
    position: relative;
    width: 100%;

    &__dropdown {
        position: absolute;
        top: 0;
        z-index: 2;
        display: flex;
        flex-flow: column wrap;
        max-width: 25rem;
        max-height: 30rem;
        margin-top: 0;
        overflow: hidden auto;
        background-color: $pt-popover-background-color;

        // TODO: was: 1px solid $list-container-item-border-color
        border: 1px solid;
        border-radius: 0.3rem;
        transition: all 300ms;

        .#{$ns}-menu,
        .#{$eccgui}-overviewitem__item {
            box-sizing: border-box;
            max-width: 24rem;
        }
    }
}

.#{$eccgui}-autosuggestion__inputfield {
    background-color: $eccgui-color-textfield-background;
}

.#{$eccgui}-codeeditor.#{$eccgui}-singlelinecodeeditor {
    height: auto;
    padding: 2px;

    [class^="cm-theme"] {
        width: 100%;
    }

    &:has(.cm-editor.cm-focused) {
        --#{$eccgui}-a11y-outline-color: #{$eccgui-color-accent};

        @extend .#{$eccgui}-a11y-focus-by-keyboard-static;
    }

    .cm-editor {
        height: auto;
        padding: 0;
        margin: 0;
        overflow: hidden;
        background-color: transparent;
        border-radius: 0;
        box-shadow: none;

        &.cm-focused {
            outline: none;
            box-shadow: none;
        }

        .cm-scroller {
            height: 100%;
            min-height: calc(#{$eccgui-size-textfield-height-regular} - 2px);
            padding: 0;
            margin: 0;
            overflow: auto hidden !important;
        }

        .cm-content {
            display: flex;
            flex-direction: column;
            justify-content: center;
            height: 100%;
            min-height: 100%;
            padding: 0;
            border: none;
        }

        pre.cm-line,
        pre.cm-placeholder,
        pre.CodeMirror-line-like {
            box-sizing: content-box;
            height: calc(#{$eccgui-size-textfield-height-regular} - 4px - 6px);
            padding: 3px 0;
            font-family: $eccgui-font-family-default;
            font-size: $eccgui-size-typo-base;
            line-height: calc(#{$eccgui-size-textfield-height-regular} - 4px - 6px);
            color: $input-color;
        }

        pre.cm-placeholder {
            top: 3px;
            padding: 0;
            color: $input-placeholder-color;
        }

        .cm-cursor {
            width: 1px;
            margin: 0;
            background-color: transparent;
            border: none;

            &::after {
                position: absolute;
                top: 50%;
                right: 0;
                width: 1px;
                height: 1rem;
                margin-top: -0.5rem;
                overflow: hidden;
                content: " ";
                background-color: black;
            }
        }
    }
}

.#{$eccgui}-autosuggestion__text--highlighted {
    display: inline-block;
    color: $eccgui-color-warning-text;
    background-color: $eccgui-color-warning-background;
}

.#{$eccgui}-autosuggestion__text--highlighted-error {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
    background-repeat: repeat-x;
    background-position: left bottom;
}
