.cs_root {
    position: relative;
    width: 460px;
    max-width: 90%;
}

/* looks like one input, holds the chosen country and the actual input */
.cs_box {
    display: flex;
    align-items: center;
    border-radius: 4px;
    background-color: white;
}

.cs_input {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 19px;
    border: none;
    border-radius: 4px;
    outline: none;
    background: none;
    font-size: x-large;
}

.cs_chip {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    gap: 8px;
    max-width: 58%;
    margin-left: 8px;
    padding: 4px 4px 4px 10px;
    box-sizing: border-box;
    border-radius: 4px;
    background-color: #fbecee;
    color: #1c1c1c;
}

/* display above would win over the attribute */
.cs_chip[hidden] {
    display: none;
}

.cs_chip:not([hidden]) + .cs_input {
    padding-left: 12px;
}

.cs_chip_flag {
    flex: 0 0 auto;
    display: flex;
}

.cs_chip_flag:empty {
    display: none;
}

.cs_chip_name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs_chip button {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: none;
    color: #6b6b6b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.cs_chip button:hover {
    background-color: rgba(0, 0, 0, 0.08);
    color: #1c1c1c;
}

.cs_dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
    overflow: hidden;
    border-radius: 4px;
    background-color: #fefefe;
    box-shadow: 0 10px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.cs_results {
    max-height: 340px;
    overflow-y: auto;
    margin: 0;
    padding: 4px 0;
    list-style: none;
}

.cs_results a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: #1c1c1c;
}

.cs_flag {
    flex: 0 0 20px;
    display: flex;
}

.cs_flag img,
.cs_chip_flag img {
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.45);
}

.cs_name {
    flex: 1 1 auto;
}

.cs_count {
    color: #6b6b6b;
    font-size: smaller;
    text-align: right;
}

.cs_title {
    padding: 10px 16px 4px 16px;
    color: #6b6b6b;
    font-size: smaller;
}

.cs_results li[role='option']:not(.cs_all) + .cs_title {
    border-top: 1px solid #e0e0e0;
}

.cs_all {
    border-bottom: 1px solid #e0e0e0;
}

.cs_all a {
    color: var(--primarycolor);
    font-weight: 700;
}

.cs_results li[role='option']:hover,
.cs_results li[aria-selected="true"] {
    background-color: #fbecee;
}

.cs_status {
    padding: 12px 16px;
    color: #6b6b6b;
}

@media (max-width: 768px) {
    .cs_root {
        width: 90%;
    }

    .cs_chip:not([hidden]) + .cs_input {
        font-size: large;
    }
}
