/* ── Chips & inline remove buttons ──────────────────────────────────────────
   Shared styles for the picker widgets: floating option panels, menu-item
   rows, selected-value chips and their remove buttons. Class names stay
   per-widget (autocomplete / SN groups) so templates and controllers are
   untouched; this file only dedupes declarations that were copy-pasted
   between autocomplete.css and dropdown.css, and resets the global button
   chrome (forms.css) inside chips.
   Genuine per-widget deltas are kept next to their class: panel layering,
   corner radius, list density, frame padding.
   -------------------------------------------------------------------------- */

/* ── Panels ─────────────────────────────────────────────────────────────── */

.autocomplete-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + var(--space-1));
    z-index: 10;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px var(--shadow-dropdown);
    max-height: 18rem;
    overflow-y: auto;
}

/* ── Menu items ─────────────────────────────────────────────────────────── */

.autocomplete-option {
    width: 100%;
    margin: 0;
    padding: var(--space-1) var(--space-2);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.autocomplete-option:hover,
.autocomplete-option:focus-visible {
    background-color: var(--bg-hover);
}

/* ── Selected chips ─────────────────────────────────────────────────────── */

.autocomplete-chip,
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background-color: var(--bg-hover);
    padding: 0 var(--space-1);
    font-size: 0.8rem;
    line-height: 1.3;
}

.autocomplete-chip {
    padding: 0 var(--space-2);
}

.autocomplete-chip-remove,
.tag-chip-remove,
.sn-group-remove-btn {
    width: auto;
    max-width: none;
    height: auto;
    border: 0;
    padding: 0 var(--space-1);
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    line-height: 1;
    font-size: 0.9rem;
    cursor: pointer;
}

.tag-chip-remove {
    font-size: 0.85rem;
}

.sn-group-remove-btn {
    border-radius: var(--radius-sm);
}

.autocomplete-chip-remove:hover,
.autocomplete-chip-remove:focus-visible,
.tag-chip-remove:hover,
.tag-chip-remove:focus-visible,
.sn-group-remove-btn:hover,
.sn-group-remove-btn:focus-visible {
    background-color: var(--bg-accent);
    color: var(--text-main);
}

/* ── Selected-chip containers ───────────────────────────────────────────── */

.autocomplete-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-top: var(--space-2);
}

.autocomplete-chips:not(.has-chips) {
    display: none;
}
