/* ========================================
   Prompt Speaker (ADR-0170) — who reads the question recording, and the
   menu offering its other renders. Modelled on Read Aloud's sample-answer
   voice menu: an avatar and a name on the trigger, avatar, name and accent
   on each row. Tokens only.
   ======================================== */

.prompt-speaker {
    position: relative;
    display: inline-flex;
    flex: none;
    margin-top: 8px;
    font-size: 14px;
}

.prompt-speaker[hidden] {
    display: none;
}

/* In the Question Audio header it sits at the end of the row, before the
   speed control; under a Prompt Handoff player it gets a line of its own. */
.audio-player-header .prompt-speaker {
    margin-top: 0;
    margin-left: auto;
}

.prompt-speaker__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* 34px joins the Listening row's chip family (Transcript, speed). The
       left/right insets are uneven because the chevron glyph sits ~3.5px
       inside its svg, so the avatar and chevron ends look even. */
    min-height: 34px;
    height: 34px;
    padding: 0 3px 0 6px;
    border: 1px solid var(--border-tinted);
    border-radius: var(--pill);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.prompt-speaker__toggle:hover:not(:disabled),
.prompt-speaker__toggle[aria-expanded="true"] {
    background: var(--brand-purple-tint);
}

.prompt-speaker__toggle:disabled {
    cursor: default;
    opacity: 0.56;
}

.prompt-speaker__caret {
    color: var(--chrome-ink-muted);
}

.prompt-speaker__mark {
    width: 24px;
    height: 24px;
    flex: none;
    overflow: hidden;
    border: 1px solid var(--border-tinted);
    border-radius: 50%;
    background: var(--brand-purple-tint);
}

.prompt-speaker__mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.prompt-speaker__menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    right: 0;
    min-width: 232px;
    padding: 4px;
    border: 1px solid var(--border-tinted);
    border-radius: var(--chrome-radius-card);
    background: var(--surface);
    box-shadow: 0 12px 32px var(--chrome-scrim);
}

.prompt-speaker__menu[hidden] {
    display: none;
}

.prompt-speaker__item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius);
    background: none;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.prompt-speaker__item:hover,
.prompt-speaker__item:focus-visible {
    background: var(--brand-purple-tint);
}

.prompt-speaker__item[aria-checked="true"] {
    font-weight: 700;
}

.prompt-speaker__item .prompt-speaker__mark {
    width: 28px;
    height: 28px;
}

.prompt-speaker__item-accent {
    margin-left: auto;
    color: var(--chrome-ink-muted);
    font-size: 12px;
}

@media (max-width: 768px) {
    .prompt-speaker__item {
        min-height: 44px;
    }
}
