/* Chip picker button inside signup form */
.chip-picker-btn {
    position: relative;
    width: 100%;
    margin-top: 5px;
    padding: 0 34px 0 10px;
    font-size: 15px;
    text-align: left;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    height: 42px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: border-color 0.15s;
    font-family: Arial, sans-serif;
}

.chip-picker-btn::after {
    content: "\25be";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #bbb;
    pointer-events: none;
    line-height: 1;
}

.chip-picker-btn:hover {
    border-color: #999;
}

.chip-picker-btn.chip-selected {
    color: #333;
}

.chip-picker-selected-thumb {
    width: 34px;
    height: 26px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    display: block;
}

/* Chip Picker Modal */
#chipPickerModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 10001;
    overflow-y: auto;
    padding: 20px 0;
    box-sizing: border-box;
}

#chipPickerModal.hidden {
    display: none;
}

#chip-picker-container {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.3s ease-out;
}

#chip-picker-container h2 {
    text-align: center;
    margin: 0 0 16px;
    font-size: 1.4em;
}

/* Grid: 2 columns, full-width no-pref card spans both */
.chip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.chip-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.chip-card:hover {
    border-color: #4CAF50;
}

.chip-card.selected {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25);
}

.chip-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.chip-card-info {
    padding: 8px;
}

.chip-card-name {
    font-weight: bold;
    font-size: 13px;
    color: #222;
}

.chip-card-mfr {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* No preference — spans full width, text centered */
.chip-card.no-pref-card {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    font-size: 14px;
    color: #555;
    background: #f9f9f9;
}

.chip-card.no-pref-card.selected {
    background: #f0fff0;
    color: #333;
}

/* Cancel button (mobile only, same pattern as signup form) */
#chipPickerModal .cancel-button {
    display: none;
}

@media screen and (max-width: 480px) {
    #chipPickerModal .cancel-button {
        display: block;
    }

    #chipPickerModal .close-button {
        display: none;
    }
}
