/* Standalone chat calling — options menu + in-page audio overlay */
.chat-calling-slot {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.chat-calling {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.chat-calling-toggle {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
}

.chat-calling-toggle:hover,
.chat-calling-toggle[aria-expanded="true"] {
    background: rgba(15, 23, 42, 0.06);
    color: #111827;
}

.admin-chat-panel .chat-calling-toggle:hover,
.admin-chat-panel .chat-calling-toggle[aria-expanded="true"] {
    background: #f3f4f6;
    color: #111827;
}

.chat-calling-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 176px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chat-calling-menu[hidden] { display: none !important; }

.chat-calling-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: none;
    background: transparent;
    color: #111827;
    text-align: left;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.chat-calling-item i {
    width: 1.1rem;
    text-align: center;
    color: #4b5563;
}

.chat-calling-item[data-action="audio"] i { color: #2563eb; }
.chat-calling-item[data-action="whatsapp"] i { color: #16a34a; }
.chat-calling-item[data-action="phone"] i { color: #0f766e; }

.chat-calling-item:hover:not(:disabled) {
    background: #f3f4f6;
}

.chat-calling-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.chat-calling-empty {
    padding: 10px 12px;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Full-screen website-to-website audio overlay */
.chat-calling-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
}

.chat-calling-overlay[hidden] {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.chat-calling-overlay-inner {
    width: min(720px, 100%);
    margin: 0 auto;
    background: #0f172a;
    color: #fff;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    min-height: min(88vh, 720px);
}

.chat-calling-overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex: 0 0 auto;
}

.chat-calling-overlay-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chat-calling-overlay-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.chat-calling-overlay-status {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.65);
}

.chat-calling-overlay-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}

.chat-calling-overlay-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

.chat-calling-stage {
    flex: 1 1 auto;
    min-height: 280px;
    background: #020617;
    position: relative;
}

.chat-calling-stage iframe {
    border: 0;
    width: 100%;
    height: 100%;
}

.chat-calling-overlay-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.35);
}

.chat-calling-ctrl {
    min-width: 88px;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 6px 12px;
}

.chat-calling-ctrl i { font-size: 1.05rem; }

.chat-calling-ctrl:hover {
    background: rgba(255, 255, 255, 0.18);
}

.chat-calling-ctrl.is-muted {
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
}

.chat-calling-ctrl.is-hangup {
    background: #dc2626;
    min-width: 104px;
}

.chat-calling-ctrl.is-hangup:hover {
    background: #b91c1c;
}

.msg-call-wrap .chat-calling-join-btn,
button.chat-calling-join-btn {
    cursor: pointer;
    border: none;
}
