/* ========================================
   Speaker Selector — 3 Inline Attribute Buttons
   ======================================== */

/* ── Controls Container — inline in the header row ── */

.sp-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding-left: 8px;
}

/* ── Button Wrapper (positions dropdown) ── */

.sp-btn-wrap {
    position: relative;
}

/* ── Attribute Buttons (round, cassette-style) ── */

.sp-attr-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    padding: 0;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Accent & gender: round circles */
.sp-btn-accent,
.sp-btn-gender {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
}

/* The gender mark is a picture (#832), 14px in the 28px ring — half the
   button, which is where the ♀ at 0.85rem sat. `.nav-icon` in main.css says
   how it sits; the button's ink reaches the stroke through `currentColor`. */
.sp-btn-gender .nav-icon {
    --nav-icon-size: 14px;
}

/* Trait: pill shape (wider for text) */
.sp-btn-trait {
    border-radius: 14px;
    width: auto;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ── Hover & Active States ── */

.sp-attr-btn:hover {
    border-color: #6366f1;
    background: linear-gradient(135deg, #eef2ff, #ddd6fe);
    transform: scale(1.05);
}

.sp-attr-btn.sp-open {
    border-color: #6366f1;
    background: linear-gradient(135deg, #eef2ff, #c7d2fe);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.2),
        0 2px 8px rgba(99, 102, 241, 0.2);
}

/* ── Dropdown ── */

.sp-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 100;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 4px;
    min-width: 120px;
    animation: sp-dd-in 0.12s ease-out;
}

@keyframes sp-dd-in {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Dropdown Option ── */

.sp-dd-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: #334155;
    font-family: inherit;
    transition: all 0.1s;
    white-space: nowrap;
}

.sp-dd-option:hover {
    background: #f1f5f9;
}

.sp-dd-option.sp-dd-active {
    background: #eef2ff;
    color: #4338ca;
    font-weight: 700;
}

.sp-dd-flag {
    font-size: 1.15rem;
}

/* The dropdown row's mark sits beside the gender's word, so it is smaller
   than the button's: the word is doing the naming there. */
.sp-dd-icon {
    display: inline-flex;
    flex: none;
    --nav-icon-size: 13px;
}

/* Open attribute button (was the B1 theme, the only level ever applied) */
.wfd-theme-root .sp-attr-btn.sp-open {
    border-color: #6366f1;
    background: linear-gradient(135deg, #eef2ff, #c7d2fe);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Phone touch targets */
@media (max-width: 768px) {
    .sp-attr-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Dropdown colours (were the B1 theme, the only level ever applied) */
.wfd-theme-root .sp-dd-option.sp-dd-active {
    background: #eef2ff;
    color: #4338ca;
}

.wfd-theme-root .sp-dropdown {
    border-color: #c7d2fe;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .sp-controls {
        gap: 4px;
    }

    .sp-btn-accent,
    .sp-btn-gender {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }

    .sp-btn-trait {
        height: 26px;
        padding: 0 6px;
        font-size: 0.55rem;
    }

    .sp-dropdown {
        min-width: 100px;
    }

    .sp-dd-option {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
}
