/* Keep the original compact staff row while showing every contact channel. */
.consult-modern--channels .staff-modern-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.consult-modern--channels .staff-modern-name,
.consult-modern--channels .consult-modern-bubble:has(.staff-modern-row:nth-child(7)) .staff-modern-name {
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
}

.consult-modern--channels .staff-modern-name::before,
.consult-modern--channels .staff-modern-name svg,
.consult-modern--channels .bubble-modern-avatar {
    flex-shrink: 0;
}

.consult-modern--channels .bubble-modern-info {
    min-width: 0;
    overflow-wrap: anywhere;
}

.consult-modern--channels .staff-modern-channels {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    max-width: 124px;
}

.consult-modern--channels .staff-modern-action,
.consult-modern--channels .consult-modern-bubble:has(.staff-modern-row:nth-child(7)) .staff-modern-action {
    box-sizing: border-box;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.consult-modern--channels .staff-modern-action > .fa {
    flex: none;
    font-size: 18px;
    text-align: center;
}

.consult-modern--channels .staff-modern-action--account,
.consult-modern--channels .staff-modern-action--account:hover {
    color: #475569;
    background: #f1f5f9;
    cursor: help;
}

.consult-modern--channels .staff-modern-empty {
    display: block;
    padding: 14px 0;
    color: var(--primary-blue, #006eff);
    font-size: 13px;
    line-height: 1.5;
}

.consult-modern--channels .staff-modern-action:focus-visible,
.consult-modern--channels .staff-modern-empty:focus-visible {
    outline: 2px solid var(--primary-blue, #006eff);
    outline-offset: 2px;
}

.consult-modern--channels .consult-modern-item.has-channel-tip .consult-modern-bubble {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Render outside the scrollable roster so contact details are never clipped. */
.support-channel-tooltip {
    position: fixed;
    z-index: 10010;
    box-sizing: border-box;
    width: max-content;
    min-width: 128px;
    max-width: min(260px, calc(100vw - 24px));
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    background: #15243d;
    box-shadow: 0 8px 24px rgba(15, 35, 65, 0.22);
    font-family: inherit;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: anywhere;
    user-select: text;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.support-channel-tooltip[hidden] {
    display: none;
}

.support-channel-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.support-channel-tooltip::after {
    content: '';
    position: absolute;
    left: var(--tip-arrow-x, 50%);
    bottom: -5px;
    width: 9px;
    height: 9px;
    background: #15243d;
    transform: translateX(-50%) rotate(45deg);
}

.support-channel-tooltip[data-placement="bottom"]::after {
    top: -5px;
    bottom: auto;
}

.support-channel-tooltip__label {
    display: block;
    margin-bottom: 2px;
    color: #bdd8ff;
    font-size: 12px;
    font-weight: 400;
}

.support-channel-tooltip__value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 1025px) {
    .consult-modern--channels .consult-modern-item.has-channel-tip .consult-modern-bubble {
        transform: translateY(-50%) translateX(0);
    }
}

@media (max-width: 1024px) {
    .consult-modern--channels .staff-modern-channels {
        max-width: 148px;
    }

    .consult-modern--channels .staff-modern-action,
    .consult-modern--channels .consult-modern-bubble:has(.staff-modern-row:nth-child(7)) .staff-modern-action {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        min-height: 44px;
    }

    .consult-modern--channels .consult-modern-item {
        position: static;
    }

    .consult-modern--channels .consult-modern-item .consult-modern-bubble,
    .consult-modern--channels .consult-modern-bubble:has(.staff-modern-row:nth-child(7)) {
        top: auto;
        bottom: 0;
        right: calc(100% + 10px);
        margin: 0;
        max-height: calc(100dvh - 160px);
        overflow-x: hidden;
        overflow-y: auto;
        transform: none;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .consult-modern--channels .consult-modern-bubble::before,
    .consult-modern--channels .consult-modern-bubble::after {
        display: none;
    }

    .consult-modern--channels .consult-modern-bubble:has(.staff-modern-row:nth-child(7)) .bubble-modern-body {
        grid-template-columns: minmax(0, 1fr);
        max-height: none;
        overflow: visible;
    }

    .consult-modern--channels .consult-modern-bubble:has(.staff-modern-row:nth-child(7)) .staff-modern-row {
        border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
    }

    .consult-modern--channels .consult-modern-bubble:has(.staff-modern-row:nth-child(7)) .staff-modern-row:last-child {
        border-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .consult-modern--channels .staff-modern-action,
    .support-channel-tooltip {
        transition: none;
    }
}
