/**
 * UX2 people picker — appjs/common/ux2/picker.js (skoPicker). Looks like a form-control; one person as text, or
 * several as chips; the matches drop down under it. The same box serves every searchable dropdown
 * (appjs/common/ux2/searchSelect.js: selects and text boxes with suggestions) and every pill field
 * (appjs/common/ux2/pillInput.js). Loaded on every UX2 page (engine/ux2.php ux2HeadTags); pages add nothing.
 */
.ux2-picker {
    position: relative;
}

.ux2-picker-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 42px;
    padding: 5px 8px 5px 12px;
    border: 1px solid var(--ux2k-line, #e4e7ec);
    border-radius: 8px;
    background: #fff;
    cursor: text;
}

.ux2-picker-box:focus-within {
    border-color: var(--ux2k-brand, #1e5f69);
    box-shadow: 0 0 0 3px var(--ux2k-ring, rgba(30, 95, 105, .2));
}

.ux2-picker-chips {
    display: contents;
}

.ux2-picker-input {
    flex: 1 1 140px;
    min-width: 120px;
    padding: 4px 0;
    border: 0;
    outline: 0;
    background: none;
    color: var(--ux2k-ink, #181c32);
    font: inherit;
    font-size: 14px;
}

.ux2-picker-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--ux2k-muted, #6b6f85);
    font-size: 11px;
}

.ux2-picker-clear:hover {
    background: var(--ux2k-soft, #f5f7f9);
}

.ux2-picker-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 2px 2px 2px 3px;
    border-radius: 999px;
    background: var(--ux2k-tint, #e9f0f1);
    color: var(--ux2k-brand-dark, #154951);
    font-size: 13px;
    font-weight: 500;
}

.ux2-picker-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: inherit;
}

.ux2-picker-chip button:hover,
.ux2-picker-chip button:focus-visible {
    background: rgba(24, 28, 50, .1);
}

.ux2-picker-av {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ux2k-brand, #1e5f69);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    overflow: hidden;
}

.ux2-picker-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ux2-picker-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    max-height: 280px;
    margin: 0;
    padding: 4px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--ux2k-line, #e4e7ec);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--ux2k-pop, 0 12px 32px rgba(24, 28, 50, .16));
}

/* Not enough room below (a drawer's footer, the bottom of the window): the list opens upwards (searchSelect.js) */
.ux2-picker.is-up .ux2-picker-list {
    top: auto;
    bottom: calc(100% + 4px);
}

.ux2-picker-list [role="option"] {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.ux2-picker-list [role="option"][aria-selected="true"],
.ux2-picker-list [role="option"]:hover {
    background: var(--ux2k-tint, #e9f0f1);
}

.ux2-picker-list [role="option"] .ux2-picker-av {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.ux2-picker-list [role="option"] > :is(i.bi, svg.sko-i) {
    margin-left: auto;
    color: var(--ux2k-brand, #1e5f69);
}

.ux2-picker-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ux2-picker-who b {
    font-weight: 500;
}

.ux2-picker-who small {
    color: var(--ux2k-muted, #6b6f85);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ux2-picker-list mark {
    padding: 0;
    background: var(--ux2k-amber-bg, #fff4e0);
    color: inherit;
}

.ux2-picker-head {
    padding: 8px 8px 4px;
    color: var(--ux2k-quiet, #8a8fa3);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ux2-picker-none,
.ux2-picker-more {
    padding: 8px;
    color: var(--ux2k-muted, #6b6f85);
    font-size: 12px;
}

/* Pill fields (appjs/common/ux2/pillInput.js): text pills in the picker's box; click to change, × to remove */
.ux2-pill {
    padding-left: 10px;
}

/* components.css's status pill shares the name and loads later: keep the picker's look on pill fields */
.ux2-picker-chip.ux2-pill {
    padding: 2px 2px 2px 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--ux2k-brand-dark, #154951);
    background: var(--ux2k-tint, #e9f0f1);
}


/* The pill's text is a button (click to change): not the 20px × button's size */
.ux2-picker-chip .ux2-pill-text {
    width: auto;
    height: auto;
    max-width: 260px;
    padding: 0 2px;              /* room for the first and last letters, which overflow: hidden cut */
    margin: 0 -2px;
    overflow: hidden;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

span.ux2-pill-text {
    cursor: default;
}

.ux2-pill-text:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--ux2k-brand, #1e5f69);
    outline-offset: 2px;
}

/* An error on the field shows on its box */
.ux2-picker-box:has(.is-invalid) {
    border-color: #d92d20;
}

/* A text box with suggestions (searchSelect.js on <input list>): the "Use …" row for something new */
.ux2-ss.is-combo .ux2-picker-input {
    flex: 1 1 auto;
}

.ux2-picker-list .is-add b {
    color: var(--ux2k-brand, #1e5f69);
}

/* Read aloud, not shown (the boxes' "3 found" for screen readers), on every page */
.ux2-picker .ux2-vh,
.ux2-pills .ux2-vh {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}