/* ============================================================ searchable
 *
 * The dropdown that replaces a long <select>: a button, a box you type into,
 * and a fixed-height scrolling list. See public/assets/js/searchable.js.
 *
 * In a file of its own because both sides of the system use it — the
 * registration form's long lists and the admin filters — and only the public
 * layout loads app.css. Kept as real CSS rather than utility classes because
 * these elements are built after the page is drawn, and the CDN build of
 * Tailwind has already decided which classes it generated.
 */

.ss { position: relative; }
.ss-native {
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1px;
    opacity: 0;
    pointer-events: none;
}
.ss-button {
    width: 100%;
    text-align: left;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: #fff;
    min-height: 2.375rem;
    cursor: pointer;
}
.ss-button::after {
    content: '';
    position: absolute;
    right: 0.75rem; top: 50%;
    width: 0.4rem; height: 0.4rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    opacity: 0.45;
}
.ss-button:focus { outline: 2px solid #3b82f6; outline-offset: -1px; }
.ss-empty { color: #9ca3af; }

.ss-panel {
    display: none;
    position: absolute;
    z-index: 30;
    left: 0; right: 0; top: calc(100% + 2px);
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 0.375rem;
}
.ss-open .ss-panel { display: block; }
.ss-search {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}
/* Ten rows is enough to scan and short enough to sit on a phone screen. */
.ss-list { max-height: 15rem; overflow-y: auto; }
.ss-option {
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
    cursor: pointer;
}
.ss-option:hover { background: #eff6ff; }
.ss-selected { background: #dbeafe; font-weight: 600; }
.ss-none { padding: 0.5rem; font-size: 0.8125rem; color: #9ca3af; }

html.dark .ss-button,
html.dark .ss-panel,
html.dark .ss-search { background: #181b2e; border-color: #353b58; color: #e5e7eb; }
html.dark .ss-option:hover { background: #252a42; }
html.dark .ss-selected { background: #2a2f48; }

/*
 * A host control that drew its own dropdown arrow.
 *
 * The admin filter chips style their <select> as appearance-none and position
 * a chevron beside it, because without one the box reads as a text field. Once
 * the chip is enhanced the button brings its own arrow (.ss-button::after), so
 * the original showed through beside it and the chip had two. The enhanced
 * markup puts .ss before the leftover chevron, so a sibling rule reaches it —
 * and with the script off, .ss never exists and the chevron stays.
 */
.ss ~ .ss-chip-arrow { display: none; }
