.selectpicker {
    position: relative;
    width: 300px;
}

.selectpicker input[type="text"] {
    font-size: 1em;
    width:6em;
}
div#picPicker input[type="text"],
div#sicPicker input[type="text"] {
    width:24em;
}

.picker-options {
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 0;
    right: 0;

    max-height: 200px;
    margin: 2px 0 0;
    padding: 0;

    overflow-y: auto;
    background: var(--bg-neutral-1);
    border: 1px solid var(--border-neutral-5);
    box-shadow: 0 2px 5px var(--shadow-dark-a15);
}

.picker-option {
    display: block;
    padding: 8px 10px;

    font: inherit;
    text-align: left;

    background: var(--bg-neutral-1);
    border: 0;
    cursor: pointer;
    width:90%;
    border-radius:0;
    box-shadow:0;
}

.picker-option:hover,
.picker-option.active {
    background: var(--bg-surface-2);
}

span#aircraftType{
    padding-left:1em;
}

/* Tags on logbook flights (p_logflight.php, p_tags.php, p_logbook.php) */
.tag-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 2px 1px 8px;
    border-radius: 3px;
    font-size: 12.5px;
    line-height: 19px;
    white-space: nowrap;
}

.tag-chip.tag-chip-static {
    padding: 1px 8px;
}

button.tag-chip-remove,
button.tag-chip-remove:hover:enabled,
button.tag-chip-remove:active:enabled,
button.tag-chip-remove:focus {
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: inherit;
    font-size: 11px;
    cursor: pointer;
    opacity: 0.75;
    box-shadow: none;
    margin: 0;
    line-height: 1;
}

button.tag-chip-remove:hover:enabled,
button.tag-chip-remove:focus-visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

/* Dashed box around the tags on Log flight */
div#flightTags {
    padding: 3px 6px;
    border: 1px dashed var(--border-neutral-5);
    border-radius: 3px;
    cursor: text;
}

div#flightTags:focus-within {
    border-color: var(--border-brand-dark);
}

div#tagPicker {
    width: auto;
    flex: 1 1 8em;
}

/* The input blends into the box, only the placeholder shows */
div#tagPicker input[type="text"],
div#tagPicker input[type="text"]:focus {
    width: 100%;
    min-width: 8em;
    padding: 2px 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font-size: 12.5px;
}

div#tagPicker input[type="text"]::placeholder {
    color: var(--text-neutral-7);
    font-style: italic;
}

/* Show every tag, no scroll bar */
div#tagPicker .picker-options {
    right: auto;
    min-width: 15em;
    max-height: none;
    overflow-y: visible;
}


.picker-option .tag-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 50%;
    vertical-align: -1px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.picker-option.tag-add-new {
    border-top: 1px solid var(--border-neutral-3);
    color: var(--text-brand-accent);
    font-weight: bold;
}

.picker-empty {
    padding: 8px 10px;
    color: var(--text-neutral-7);
}

.tag-swatches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

button.tag-swatch,
button.tag-swatch:hover:enabled,
button.tag-swatch:active:enabled,
button.tag-swatch:focus {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

button.tag-swatch:focus-visible {
    outline: 2px solid var(--border-brand-dark);
    outline-offset: 1px;
}

button.tag-swatch.selected {
    border-color: var(--border-neutral-12);
}

.tag-swatches input[type="color"] {
    width: 26px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border-neutral-5);
    background: none;
    cursor: pointer;
}

/* Floats to the right edge of the remarks cell, the text keeps its place on the left */
i.logbook-tag-mark {
    float: right;
    margin-left: 6px;
    line-height: inherit;
    color: var(--text-brand-accent);
    cursor: help;
}

/* p_tags.php */
.tag-settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-neutral-2);
}

.tag-settings-row .tag-preview {
    width: 9em;
}

.tag-settings-row input[type="text"] {
    width: 11em;
}

.tag-settings-row .tag-usage {
    min-width: 6em;
    color: var(--text-neutral-7);
    font-size: 12px;
}

.tag-settings-row a.tag-usage {
    color: var(--text-brand-accent);
    text-decoration: underline;
}

.tag-settings-row.tag-settings-add {
    border-bottom: 0;
}

.tag-settings-empty {
    padding: 8px 10px;
    color: var(--text-neutral-7);
}

/* Tag filter in p_own_summary.php: click a tag to select it */
.tag-filter-option {
    position: relative;
    cursor: pointer;
}

/* The checkbox is hidden but still reachable with the keyboard */
.tag-filter-option input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

.tag-filter-option .tag-chip {
    opacity: 0.4;
}

.tag-filter-option input[type="checkbox"]:checked + .tag-chip {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--border-brand-dark);
}

.tag-filter-option input[type="checkbox"]:focus-visible + .tag-chip {
    outline: 2px solid var(--border-brand-dark);
    outline-offset: 2px;
}

.tag-filter-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 6px;
}

.tag-filter-mode label {
    cursor: pointer;
}
