/**
 * VINwriter — Searchable <select> enhancer
 *
 * Scoped to .ss-root so pages can drop it in without touching the rest
 * of the layout. The original <select> is hidden but remains in the DOM
 * for form submission + accessibility fallback.
 */

.ss-root {
    position: relative;
    width: 100%;
    font-family: inherit;
}
.ss-root select.ss-native {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    border: 0;
}

.ss-control {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: text;
    outline: none;
}
.ss-control input {
    flex: 1;
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    padding: 0;
    outline: none;
    min-width: 0;
}
.ss-control input::placeholder { color: var(--text-faint, #666); }
.ss-control .ss-caret {
    flex-shrink: 0;
    width: 12px; height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a0a0a0' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
    opacity: 0.7;
    pointer-events: none;
    transition: transform 0.15s ease;
}
.ss-root.ss-open .ss-caret { transform: rotate(180deg); }

/* Dropdown portals to <body> to escape any ancestor `overflow:hidden` */
.ss-dropdown {
    position: fixed;
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg-level1, #1c1c1e);
    border: 1px solid var(--separator, rgba(255,255,255,0.08));
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(0,0,0,0.45);
    z-index: 9999;
    padding: 4px;
    display: none;
    -webkit-overflow-scrolling: touch;
}
.ss-dropdown.ss-visible { display: block; }

.ss-opt {
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.92rem;
    color: var(--text-primary, #e8e8e8);
    cursor: pointer;
    line-height: 1.3;
    user-select: none;
}
.ss-opt:hover,
.ss-opt.ss-active {
    background: var(--bg-level3, rgba(255,255,255,0.08));
}
.ss-opt.ss-selected {
    color: var(--accent, #c0272d);
    font-weight: 600;
}
.ss-empty {
    padding: 14px 12px;
    font-size: 0.85rem;
    color: var(--text-faint, #666);
    text-align: center;
}
