/* Tappable chip selectors for threads & fits (mobile-first).
   Used to replace fiddly free-text typing (M10×1.5, H7/g6, ...) with taps.
   Tokens come from base.css so light/dark themes both work. */

.chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip-row--scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: thin;
    /* reserve focus space so the last chip isn't clipped */
    margin-right: -2px;
}

.chip {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-app);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font: 600 14px 'Inter', sans-serif;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background var(--transition-fast),
                color var(--transition-fast),
                border-color var(--transition-fast),
                transform var(--transition-fast),
                box-shadow var(--transition-fast);
}

.chip:active {
    transform: scale(0.95);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.35);
}

/* subtle "coarse pitch" hint marker after the chip text */
.chip-tag {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.65;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.chip-row--scroll .chip {
    flex: 0 0 auto;
}

.chip-row--scroll::-webkit-scrollbar {
    height: 4px;
}

.chip-row--scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.chip-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 12px 0 4px;
    font-weight: 600;
}

.chip-label:first-child {
    margin-top: 0;
}

.recent-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 0;
}

.recent-row:empty {
    display: none;
}

.recent-row .chip {
    background: var(--bg-surface);
    border-style: dashed;
    font-size: 13px;
    min-height: 36px;
}

.recent-row .chip:hover {
    border-color: var(--primary-light);
}
