.kpxcAutocomplete-container {
    background-color: var(--kpxc-background-color);
    border: var(--kpxc-autocomplete-menu-border);
    border-radius: 8px;
    box-shadow: var(--kpxc-box-shadow);
    box-sizing: border-box;
    display: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1em;
    min-width: 16em;
    overflow: hidden; /* Prevent the content from bleeding over the border radius. */
    padding: 6px;
    position: absolute !important;
    scrollbar-color: --var(--kpxc-scrollbar-thumb) --var(--kpxc-scrollbar-background);
    z-index: 2147483646;
}

.kpxcAutocomplete-container--visible {
    display: block;
}

.kpxcAutocomplete-items {
    max-height: 250px;
    overflow-y: auto;
}

.kpxcAutocomplete-item {
    background-color: var(--kpxc-background-color);
    border-radius: 4px;
    color: var(--kpxc-text-color);
    cursor: pointer;
    letter-spacing: normal !important;
    line-height: 1.25em;
    padding: 12px;
    text-align: start !important;
    text-rendering: auto !important;
    width: auto;
    word-spacing: normal !important;
}

.kpxcAutocomplete-container--compact .kpxcAutocomplete-items {
    cursor: pointer;
    display: grid;
    grid-template-columns: repeat(3, auto);
    max-height: 250px;
    max-width: 600px;
    overflow-y: auto;
    overflow-x: hidden;
}

.kpxcAutocomplete-container--compact .kpxcAutocomplete-item {
    display: contents;
}

.kpxcAutocomplete-container--compact .kpxcAutocomplete-item__header {
    align-self: flex-start;
    border-radius: 4px 0 0 4px;
    display: grid;
    height: 14px;
    padding: 6px 24px 6px 6px;
    pointer-events: auto;
}

.kpxcAutocomplete-container--compact .kpxcAutocomplete-item__group {
    align-self: center;
    border-radius: 0 4px 4px 0;
    display: flex;
    height: 14px;
    justify-content: flex-end;
    padding: 6px 6px 6px 24px;
    pointer-events: auto;
}

.kpxcAutocomplete-container--compact .kpxcAutocomplete-item__value {
    align-self: flex-end;
    height: 14px;
    justify-self: start;
    margin: 0;
    padding: 6px 0 6px 0;
    pointer-events: auto;
    width: 100%;
}

/* Separate class for value if group is not shown */
.kpxcAutocomplete-container--compact .kpxcAutocomplete-item__value--last {
    align-self: center;
    border-radius: 0 4px 4px 0;
    color: var(--kpxc-lighter-text-color);
    display: flex;
    font-size: .85em;
    height: 14px;
    justify-content: flex-end;
    overflow: hidden;
    padding: 6px 6px 6px 24px;
    pointer-events: auto;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kpxcAutocomplete-item:last-child {
    border-bottom: none;
}

.kpxcAutocomplete-item__header {
    align-items: center;
    display: flex;
    flex-direction: row-reverse;
    gap: 6px;
    justify-content: space-between;
}

.kpxcAutocomplete-item__group {
    color: var(--kpxc-light-text-color);
    font-size: .7em;
    font-weight: bold;
    letter-spacing: 0.05em;
    overflow: hidden;
    pointer-events: none;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.kpxcAutocomplete-item__label {
    font-size: .9em;
    font-weight: bold;
    overflow: hidden;
    pointer-events: none;
    text-overflow: ellipsis;
    white-space: nowrap
}

.kpxcAutocomplete-item__value {
    color: var(--kpxc-lighter-text-color);
    font-size: .85em;
    margin-top: 4px;
    overflow: hidden;
    pointer-events: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kpxcAutocomplete-item--active {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.kpxcAutocomplete-item--active * {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

.kpxcAutocomplete-container footer {
    background-color: var(--kpxc-autocomplete-footer-color);
    border-radius: 0 0 4px 4px;
    color: var(--kpxc-lighter-text-color);
    font-size: max(9px, .8em) !important;
    padding: 5px;
    width: auto;
}

@media (prefers-color-scheme: dark) {
    .kpxcAutocomplete-container {
        border: var(--kpxc-autocomplete-menu-border);
    }

    .kpxcAutocomplete-items {
        background: var(--kpxc-background-color);
        color: var(--kpxc-text-color);
    }
}
