/* VoicePa VPP stem mixer. Scoped to its own classes; no DAW styles are changed. */
.custom-thumbnail-container .vpp-stem-mixer-trigger {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: rgba(19, 24, 35, .76);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .24);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: background-color .16s ease, transform .16s ease, box-shadow .16s ease;
    -webkit-tap-highlight-color: transparent;
}

.custom-thumbnail-container .vpp-stem-mixer-trigger:hover {
    background: rgba(27, 34, 48, .9);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}

.custom-thumbnail-container .vpp-stem-mixer-trigger:active {
    transform: translateY(0);
}

.custom-thumbnail-container .vpp-stem-mixer-trigger:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .95);
    outline-offset: 2px;
}

.vpp-stem-mixer-trigger__icon {
    width: 21px;
    height: 21px;
    display: block;
}

.vpp-stem-mixer-portal[hidden] {
    display: none !important;
}

.vpp-stem-mixer-portal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    box-sizing: border-box;
}

.vpp-stem-mixer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 17, 25, .58);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.vpp-stem-mixer-dialog {
    --vpp-stem-text: #202532;
    --vpp-stem-muted: #6f7787;
    --vpp-stem-line: rgba(41, 48, 66, .11);
    position: relative;
    z-index: 1;
    width: min(540px, 100%);
    max-height: min(82dvh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--vpp-stem-text);
    background: #fffdf9;
    border-radius: 20px;
    box-shadow: 0 26px 80px rgba(10, 14, 24, .34);
    transform: translateY(12px) scale(.985);
    opacity: 0;
    transition: transform .2s cubic-bezier(.2, .85, .25, 1), opacity .16s ease;
}

.vpp-stem-mixer-portal.is-open .vpp-stem-mixer-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.vpp-stem-mixer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 20px 15px;
    border-bottom: 1px solid var(--vpp-stem-line);
}

.vpp-stem-mixer-head__copy {
    min-width: 0;
}

.vpp-stem-mixer-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #7a5d3d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    line-height: 1.2;
}

.vpp-stem-mixer-title {
    margin: 0;
    color: var(--vpp-stem-text);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
}

.vpp-stem-mixer-description {
    margin: 7px 0 0;
    color: var(--vpp-stem-muted);
    font-size: 12px;
    line-height: 1.65;
}

.vpp-stem-mixer-close {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #505867;
    background: rgba(38, 46, 63, .07);
    cursor: pointer;
}

.vpp-stem-mixer-close:hover {
    background: rgba(38, 46, 63, .12);
}

.vpp-stem-mixer-close:focus-visible,
.vpp-stem-mixer-row__mute:focus-visible,
.vpp-stem-mixer-button:focus-visible,
.vpp-stem-mixer-row__slider:focus-visible {
    outline: 3px solid rgba(87, 116, 255, .42);
    outline-offset: 2px;
}

.vpp-stem-mixer-close svg {
    width: 18px;
    height: 18px;
}

.vpp-stem-mixer-body {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 14px 16px 16px;
    -webkit-overflow-scrolling: touch;
}

.vpp-stem-mixer-list {
    display: grid;
    gap: 10px;
}

.vpp-stem-mixer-row {
    --vpp-stem-accent: #7b8496;
    --vpp-stem-soft: #f1f3f6;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 14px;
    padding: 13px 14px 13px 17px;
    border: 1px solid #dfe3ea;
    border: 1px solid color-mix(in srgb, var(--vpp-stem-accent) 18%, #dfe3ea);
    border-radius: 15px;
    background: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--vpp-stem-soft) 72%, #fff) 0%, #fff 72%);
    box-sizing: border-box;
}

.vpp-stem-mixer-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 0 5px 5px 0;
    background: var(--vpp-stem-accent);
}

.vpp-stem-mixer-row[data-category="male"] {
    --vpp-stem-accent: #4d75f2;
    --vpp-stem-soft: #edf2ff;
}

.vpp-stem-mixer-row[data-category="female"] {
    --vpp-stem-accent: #ed668d;
    --vpp-stem-soft: #fff0f5;
}

.vpp-stem-mixer-row[data-category="female-role"] {
    --vpp-stem-accent: #8a68df;
    --vpp-stem-soft: #f4efff;
}

.vpp-stem-mixer-row[data-category="environment"] {
    --vpp-stem-accent: #2caa83;
    --vpp-stem-soft: #eaf9f3;
}

.vpp-stem-mixer-row.is-muted {
    opacity: .72;
}

.vpp-stem-mixer-row__main {
    min-width: 0;
}

.vpp-stem-mixer-row__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.vpp-stem-mixer-row__badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    color: var(--vpp-stem-accent);
    color: color-mix(in srgb, var(--vpp-stem-accent) 80%, #202532);
    background: var(--vpp-stem-soft);
    background: color-mix(in srgb, var(--vpp-stem-soft) 82%, #fff);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.vpp-stem-mixer-row__badge--dialogue {
    color: #5b4a31;
    background: #fff2cf;
}

.vpp-stem-mixer-row__title {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    color: #242936;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
}

.vpp-stem-mixer-row__meta {
    display: block;
    margin-top: 3px;
    color: var(--vpp-stem-muted);
    font-size: 11px;
    line-height: 1.45;
}

.vpp-stem-mixer-row__mute {
    align-self: center;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    color: var(--vpp-stem-accent);
    background: var(--vpp-stem-soft);
    background: color-mix(in srgb, var(--vpp-stem-soft) 76%, #fff);
    cursor: pointer;
    transition: transform .14s ease, background-color .14s ease, color .14s ease;
}

.vpp-stem-mixer-row__mute:hover {
    transform: translateY(-1px);
}

.vpp-stem-mixer-row__mute[aria-pressed="true"] {
    color: #fff;
    background: var(--vpp-stem-accent);
}

.vpp-stem-mixer-row__mute svg {
    width: 21px;
    height: 21px;
}

.vpp-stem-mixer-row__control {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
    gap: 10px;
}

.vpp-stem-mixer-row__slider {
    width: 100%;
    min-width: 0;
    accent-color: var(--vpp-stem-accent);
    cursor: pointer;
}

.vpp-stem-mixer-row__value {
    color: #424a5a;
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.vpp-stem-mixer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px max(13px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--vpp-stem-line);
    background: rgba(255, 253, 249, .96);
}

.vpp-stem-mixer-footer__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vpp-stem-mixer-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border: 0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.vpp-stem-mixer-button--reset {
    color: #626b7a;
    background: transparent;
}

.vpp-stem-mixer-button--cancel {
    color: #48505f;
    background: #eef0f4;
}

.vpp-stem-mixer-button--save {
    color: #fff;
    background: linear-gradient(135deg, #5f73f4 0%, #835ee5 100%);
    box-shadow: 0 8px 20px rgba(94, 97, 220, .25);
}

.vpp-stem-mixer-button:hover {
    filter: brightness(.98);
}

.vpp-stem-mixer-status {
    min-height: 1.4em;
    margin: 10px 2px 0;
    color: #5e6675;
    font-size: 11px;
    line-height: 1.5;
}

body.vpp-stem-mixer-open {
    overflow: hidden !important;
}

@media (max-width: 520px) {
    .vpp-stem-mixer-portal {
        align-items: flex-end;
        padding: 0;
    }

    .vpp-stem-mixer-dialog {
        width: 100%;
        max-height: min(88dvh, 760px);
        border-radius: 20px 20px 0 0;
        transform: translateY(24px);
    }

    .vpp-stem-mixer-head {
        padding: 17px 16px 13px;
    }

    .vpp-stem-mixer-body {
        padding: 12px 12px 14px;
    }

    .vpp-stem-mixer-row {
        padding: 12px 12px 12px 15px;
    }

    .vpp-stem-mixer-footer {
        padding-inline: 12px;
    }

    .vpp-stem-mixer-button {
        padding-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vpp-stem-mixer-dialog,
    .custom-thumbnail-container .vpp-stem-mixer-trigger,
    .vpp-stem-mixer-row__mute {
        transition: none !important;
    }
}
