div.input-tags {
    position: relative;
    z-index: 999;
    height: fit-content;
}

div.input-tags div.search {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    box-sizing: border-box;
    border: var(--border-thickness) solid var(--background-primary);
    border-bottom: none;
    background-color: var(--background-tertiary);
    padding: 8px;
    width: 100%;
    height: fit-content;
}

div.input-tags div.search input.query {
    border: none;
    caret-color: var(--font-color-primary);
    field-sizing: content;
}

div.input-tags div.search button.item {
    cursor: pointer;
    box-sizing: border-box;
    background-color: var(--background-secondary);
    padding: 0 4px;
}

div.input-tags div.search button.item:focus-visible,
div.input-tags div.search button.item:hover {
    color: var(--font-color-accent);
}

/* Tag Search Results */

div.input-tags div.results {
    display: grid;
    position: absolute;
    top: 100%;
    left: 0;
    box-sizing: border-box;
    border: var(--border-thickness) solid var(--background-primary);
    border-right-width: 0;
    border-bottom-width: 0;
    border-left-width: 0;
    background-color: var(--background-tertiary);
    width: 100%;
}

div.input-tags div.results:has(button) {
    border-right-width: 1px;
    border-bottom-width: 1px;
    /* give the search results a border but not a chin while empty */
    border-left-width: 1px;
}

div.input-tags div.results button.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    padding: 8px;
    width: 100%;
    height: 32px;
    line-height: 32px;
    text-align: left;
}

div.input-tags div.results button.item span.label {
    text-align: left;
}

div.input-tags div.results button.item:focus-visible,
div.input-tags div.results button.item:hover,
div.input-tags div.results button.item.select {
    background-color: var(--background-primary);
}

div.input-tags div.results button.item span.usage {
    color: var(--font-color-secondary);
}

div.input-tags div.search input.query,
div.input-tags div.search button.item,
div.input-tags div.search button.item {
    /* prevent input from overflowing */
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
