/* ===== CHAT WIDGET ===== */
:root {
    --ch-blue: #2563eb;
    --ch-blue-dark: #1d4ed8;
    --ch-accent: #fbbf24;
    --ch-bg: #f8fafc;
    --ch-card: #ffffff;
    --ch-border: #e2e8f0;
    --ch-text: #0f172a;
    --ch-muted: #64748b;
    --ch-radius: 22px;
    --ch-shadow: 0 16px 50px rgba(2, 6, 23, 0.28);
}

@keyframes chatGlow {
    0% { box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4); }
    50% { box-shadow: 0 14px 36px rgba(37, 99, 235, 0.52); }
    100% { box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4); }
}

/* Toggle button */
.chat-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.42);
    z-index: 9000;
    transition: transform 0.22s, box-shadow 0.22s, filter 0.22s;
    animation: chatGlow 4s ease-in-out infinite;
}
.chat-toggle:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 16px 34px rgba(37, 99, 235, 0.5); filter: saturate(1.08); }
.chat-toggle svg { width: 26px; height: 26px; color: #fff; transition: opacity 0.2s; }
.chat-toggle .icon-close { display: none; }
.chat-toggle.open .icon-chat { display: none; }
.chat-toggle.open .icon-close { display: block; }

.chat-badge {
    position: absolute;
    top: -1px; right: -1px;
    width: 20px; height: 20px;
    background: linear-gradient(140deg, #ef4444 0%, #b91c1c 100%);
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
}
.chat-badge.visible { display: flex; }

/* Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 430px;
    max-height: 700px;
    background: radial-gradient(circle at 15% -20%, #f8fafc 0%, #ffffff 45%);
    border-radius: var(--ch-radius);
    box-shadow: var(--ch-shadow);
    border: 1px solid rgba(148, 163, 184, 0.45);
    display: flex;
    flex-direction: column;
    z-index: 8999;
    overflow: hidden;
    font-family: "Segoe UI", "Tahoma", "Arial", sans-serif;
    transform: scale(0.92) translateY(16px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(.34,1.48,.64,1), opacity 0.2s ease;
}
.chat-window::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 86% 12%, rgba(37, 99, 235, 0.14) 0%, rgba(37, 99, 235, 0) 44%),
        radial-gradient(circle at 12% 88%, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 38%),
        linear-gradient(180deg, rgba(59, 130, 246, 0.09) 0%, rgba(255, 255, 255, 0) 42%);
}
.chat-window.visible {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 16px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
    color: #fff;
    flex-shrink: 0;
    position: relative;
}
.chat-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.24);
}
.chat-header-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 2px solid rgba(255,255,255,0.4);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
}
.chat-header-avatar svg {
    width: 21px;
    height: 21px;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-header-status {
    font-size: 12px;
    opacity: 0.92;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
}
.chat-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--ch-accent);
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}
.chat-status-dot.online { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.25); }

/* Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background:
        radial-gradient(circle at 18% 14%, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 38%),
        repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.06) 0, rgba(148, 163, 184, 0.06) 1px, transparent 1px, transparent 9px),
        linear-gradient(180deg, rgba(239, 246, 255, 0.34) 0%, rgba(255, 255, 255, 0) 42%);
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }

/* Form phase */
.chat-form { display: flex; flex-direction: column; gap: 12px; padding: 6px 2px; }
.chat-form-title { font-size: 17px; font-weight: 700; color: var(--ch-text); letter-spacing: 0; }
.chat-form-sub { font-size: 13px; color: var(--ch-muted); margin-top: -6px; line-height: 1.5; }
.chat-input {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ch-text);
    background: var(--ch-bg);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    resize: none;
}
.chat-input:focus { border-color: var(--ch-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16); background: #fff; }
.chat-input.error { border-color: #ef4444; }
.chat-btn-start {
    padding: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.12s, box-shadow 0.2s;
}
.chat-btn-start:hover { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25); }
.chat-btn-start:active { transform: scale(0.98); }
.chat-btn-start:disabled { opacity: 0.55; cursor: not-allowed; }

/* Waiting phase */
.chat-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 8px;
    text-align: center;
}
.chat-waiting-dots { display: flex; gap: 7px; }
.chat-waiting-dots span {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--ch-blue);
    opacity: 0.25;
    animation: chatDot 1.4s ease-in-out infinite;
}
.chat-waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-waiting-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatDot { 0%,80%,100%{opacity:0.2;transform:scale(0.8)} 40%{opacity:1;transform:scale(1.15)} }
.chat-waiting p { font-size: 13px; color: var(--ch-muted); }

/* Messages */
.chat-msg-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0;
}
.chat-msg {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 15px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
    position: relative;
}
.chat-msg.from-user {
    align-self: flex-end;
    background: linear-gradient(140deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
}
.chat-msg.from-user::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    background: #1d4ed8;
    border-bottom-left-radius: 12px;
    clip-path: polygon(100% 0, 0 100%, 100% 100%);
}
.chat-msg.from-manager {
    align-self: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: var(--ch-text);
    border-bottom-left-radius: 4px;
}
.chat-msg.from-manager::after {
    content: "";
    position: absolute;
    left: -6px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    clip-path: polygon(0 100%, 0 0, 100% 100%);
}
.chat-msg.from-system {
    align-self: center;
    background: rgba(37, 99, 235, 0.09);
    color: var(--ch-muted);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 100px;
    text-align: center;
    max-width: 90%;
}
.chat-msg-sender {
    font-size: 11px;
    color: #1d4ed8;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-bottom: 3px;
    padding-left: 6px;
}
.chat-msg-img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    display: block;
    cursor: pointer;
}
.chat-msg-file {
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
}
.chat-msg-file svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Button in message */
.chat-msg-button {
    display: block;
    margin-top: 12px;
    padding: 11px 18px;
    background: rgba(37, 99, 235, 0.13);
    color: var(--ch-blue);
    text-decoration: none;
    border-radius: 12px;
    border: 1.5px solid rgba(37, 99, 235, 0.32);
    font-size: 13.5px;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    backdrop-filter: blur(8px);
}
.chat-msg-button:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: var(--ch-blue);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
}
.chat-msg-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 1px;
}
.chat-msg-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

/* Footer input */
.chat-footer {
    border-top: 1px solid #dbeafe;
    padding: 11px 12px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.65) 0%, rgba(255, 255, 255, 0.96) 100%);
}
.chat-footer-input {
    flex: 1;
    border: 1.5px solid #cbd5e1;
    border-radius: 11px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--ch-text);
    background: var(--ch-bg);
    outline: none;
    resize: none;
    max-height: 100px;
    min-height: 38px;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    line-height: 1.45;
}
.chat-footer-input:focus { border-color: var(--ch-blue); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.chat-footer-input:disabled { opacity: 0.5; }
.chat-icon-btn {
    width: 36px; height: 36px;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    background: var(--ch-bg);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.18s, border-color 0.18s, transform 0.12s;
    flex-shrink: 0;
}
.chat-icon-btn:hover { background: #e0e7ff; border-color: var(--ch-blue); transform: translateY(-1px); }
.chat-icon-btn svg { width: 17px; height: 17px; color: var(--ch-muted); }
.chat-send-btn {
    width: 36px; height: 36px;
    border-radius: 11px;
    background: linear-gradient(140deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
    flex-shrink: 0;
}
.chat-send-btn:hover { background: linear-gradient(140deg, #1d4ed8 0%, #1e40af 100%); box-shadow: 0 8px 14px rgba(37, 99, 235, 0.3); }
.chat-send-btn:active { transform: scale(0.92); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.chat-send-btn svg { width: 17px; height: 17px; color: #fff; }

.chat-window.visible .chat-msg-wrap {
    animation: fadeSlideIn 0.22s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Closed state */
.chat-closed-banner {
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #9a3412;
    text-align: center;
    margin: 8px 2px;
}

@media (max-width: 480px) {
    .chat-window { right: 6px; left: 6px; width: auto; bottom: 76px; max-height: calc(100vh - 84px); }
    .chat-toggle { bottom: 16px; right: 16px; width: 58px; height: 58px; }
    .chat-header { padding: 16px 14px 14px; }
    .chat-msg { max-width: 88%; }
}

/* ===== NATIVE PHONE PUSH NOTIFICATION (iOS & Android) ===== */
.mobile-push-banner {
    position: fixed;
    top: max(12px, env(safe-area-inset-top, 12px));
    left: 50%;
    transform: translate3d(-50%, -140%, 0);
    opacity: 0;
    z-index: 2147483647;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    cursor: grab;
    pointer-events: auto;
    will-change: transform, opacity;
    transition:
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.35s ease;
}
.mobile-push-banner.is-visible {
    transform: translate3d(-50%, 0, 0);
    opacity: 1;
}
.mobile-push-banner.is-fading-out {
    transform: translate3d(-50%, -22px, 0);
    opacity: 0;
    transition:
        transform 1.55s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 1.55s ease;
    pointer-events: none;
}
.mobile-push-banner.is-swiped-up {
    transform: translate3d(-50%, -160%, 0) !important;
    opacity: 0 !important;
    transition:
        transform 0.25s cubic-bezier(0.4, 0, 1, 1),
        opacity 0.22s ease !important;
    pointer-events: none;
}
.mobile-push-banner.is-dragging {
    transition: none !important;
    cursor: grabbing;
}

/* ── iOS (iPhone) Style ── */
.mobile-push-banner--ios {
    width: min(94vw, 392px);
    padding: 13px 15px 9px;
    border-radius: 24px;
    background: rgba(248, 249, 252, 0.88);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.22),
        0 3px 10px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    color: #1c1c1e;
}
.mobile-push-ios-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mobile-push-ios-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #ffffff;
}
.mobile-push-ios-icon--success {
    background: linear-gradient(180deg, #34c759 0%, #248a3d 100%);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.35);
}
.mobile-push-ios-icon--danger {
    background: linear-gradient(180deg, #ff453a 0%, #d70015 100%);
    box-shadow: 0 4px 12px rgba(255, 69, 58, 0.35);
}
.mobile-push-ios-icon--brand {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 5px;
}
.mobile-push-ios-icon svg,
.mobile-push-ios-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}
.mobile-push-ios-icon--brand img {
    width: 100%;
    height: 100%;
}
.mobile-push-ios-body {
    flex: 1;
    min-width: 0;
}
.mobile-push-ios-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}
.mobile-push-ios-sender {
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.015em;
    color: #1c1c1e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-push-ios-time {
    font-size: 12.5px;
    color: rgba(60, 60, 67, 0.58);
    flex-shrink: 0;
}
.mobile-push-ios-text {
    font-size: 14px;
    line-height: 1.34;
    color: #2c2c2e;
    word-break: break-word;
}
.mobile-push-grabber {
    width: 34px;
    height: 4px;
    border-radius: 99px;
    background: rgba(60, 60, 67, 0.2);
    margin: 8px auto 0;
}

/* ── Android (Material You / OneUI) Style ── */
.mobile-push-banner--android {
    width: min(95vw, 404px);
    padding: 13px 16px 11px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow:
        0 14px 36px rgba(15, 23, 42, 0.24),
        0 3px 10px rgba(15, 23, 42, 0.1);
    font-family: Roboto, "Segoe UI", Arial, sans-serif;
    color: #1f1f1f;
}
.mobile-push-android-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
    font-size: 12px;
    color: #444746;
}
.mobile-push-android-mini {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    color: #ffffff;
    flex-shrink: 0;
}
.mobile-push-android-mini--success {
    background: #16a34a;
}
.mobile-push-android-mini--danger {
    background: #dc2626;
}
.mobile-push-android-mini--brand {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.5px;
}
.mobile-push-android-mini svg,
.mobile-push-android-mini img {
    width: 10px;
    height: 10px;
    object-fit: contain;
    display: block;
}
.mobile-push-android-mini--brand img {
    width: 100%;
    height: 100%;
}
.mobile-push-android-app {
    font-weight: 600;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-push-android-dot,
.mobile-push-android-time {
    color: #5f6368;
    flex-shrink: 0;
}
.mobile-push-android-chevron {
    margin-left: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f1f5f9;
    display: grid;
    place-items: center;
    color: #475569;
    flex-shrink: 0;
}
.mobile-push-android-chevron svg {
    width: 11px;
    height: 11px;
}
.mobile-push-android-main {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mobile-push-android-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.mobile-push-android-badge--success {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
    border: 1.5px solid rgba(22, 163, 74, 0.28);
}
.mobile-push-android-badge--danger {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    border: 1.5px solid rgba(220, 38, 38, 0.28);
}
.mobile-push-android-badge--brand {
    background: #ffffff;
    border: 1.5px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    padding: 6px;
}
.mobile-push-android-badge svg,
.mobile-push-android-badge img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}
.mobile-push-android-badge--brand img {
    width: 100%;
    height: 100%;
}
.mobile-push-android-content {
    flex: 1;
    min-width: 0;
}
.mobile-push-android-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #1f1f1f;
    line-height: 1.25;
    margin-bottom: 2px;
}
.mobile-push-android-text {
    font-size: 13.8px;
    line-height: 1.38;
    color: #444746;
    word-break: break-word;
}

/* ===== FULLSCREEN AUDIO CALL OVERLAY ===== */
.chat-call-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background:
        radial-gradient(circle at 50% 22%, rgba(79, 70, 229, 0.34) 0%, transparent 56%),
        radial-gradient(circle at 50% 88%, rgba(16, 185, 129, 0.14) 0%, transparent 52%),
        linear-gradient(180deg, #0f172a 0%, #090d18 100%);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: max(36px, env(safe-area-inset-top, 36px)) 24px max(48px, env(safe-area-inset-bottom, 48px));
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    user-select: none;
    animation: chatCallFadeIn 0.28s ease-out;
}
.chat-call-overlay[hidden] {
    display: none !important;
}
@keyframes chatCallFadeIn {
    from { opacity: 0; transform: scale(1.03); }
    to { opacity: 1; transform: scale(1); }
}
.chat-call-top-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.02em;
}
.chat-call-top-pill svg {
    width: 14px;
    height: 14px;
    color: #34d399;
}
.chat-call-top-bar {
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.chat-call-quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 12px;
    font-weight: 650;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}
.chat-call-sig-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 13px;
}
.chat-call-sig-bars i {
    width: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
    display: inline-block;
}
.chat-call-sig-bars i:nth-child(1) { height: 4px; }
.chat-call-sig-bars i:nth-child(2) { height: 7px; }
.chat-call-sig-bars i:nth-child(3) { height: 10px; }
.chat-call-sig-bars i:nth-child(4) { height: 13px; }
.chat-call-sig-bars.q-good i { background: #22c55e; }
.chat-call-sig-bars.q-mid i:nth-child(-n+3) { background: #f59e0b; }
.chat-call-sig-bars.q-bad i:nth-child(-n+2) { background: #ef4444; }

/* Live VU meters (аккуратный микшер уровня голоса у клиента) */
.chat-call-vu-box {
    width: min(88vw, 315px);
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.085);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 8px;
}
.chat-call-vu-box[hidden] {
    display: none !important;
}
.chat-call-vu-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
}
.chat-call-vu-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.56);
    display: inline-grid;
    place-items: center;
}
.chat-call-vu-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}
.chat-call-vu-label {
    width: 112px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 550;
    letter-spacing: -0.01em;
}
.chat-call-vu-track {
    flex: 1;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}
.chat-call-vu-fill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.85) 0%, rgba(52, 211, 153, 0.92) 100%);
    transition: width 0.07s linear;
}
.chat-call-vu-fill--self {
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.85) 0%, rgba(167, 243, 208, 0.92) 100%);
}
.chat-call-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    margin: auto 0;
}
.chat-call-avatar-wrap {
    position: relative;
    width: 116px;
    height: 116px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
}
.chat-call-avatar-ring,
.chat-call-avatar-ring-2 {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(99, 102, 241, 0.45);
    animation: chatCallPulseRing 2.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.chat-call-avatar-ring-2 {
    animation-delay: 1.1s;
}
@keyframes chatCallPulseRing {
    0% { transform: scale(0.95); opacity: 0.85; }
    100% { transform: scale(1.55); opacity: 0; }
}
.chat-call-avatar {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    display: grid;
    place-items: center;
    color: #ffffff;
}
.chat-call-avatar svg {
    width: 44px;
    height: 44px;
}
.chat-call-caller {
    font-size: clamp(26px, 5vw, 34px);
    font-weight: 750;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.18;
}
.chat-call-status {
    font-size: 16px;
    color: rgba(226, 232, 240, 0.82);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.chat-call-waves {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 28px;
    margin-top: 6px;
}
.chat-call-waves[hidden] {
    display: none !important;
}
.chat-call-waves span {
    width: 4px;
    height: 10px;
    border-radius: 99px;
    background: #34d399;
    animation: chatCallWave 1s ease-in-out infinite;
}
.chat-call-waves span:nth-child(2) { animation-delay: 0.15s; height: 18px; }
.chat-call-waves span:nth-child(3) { animation-delay: 0.3s; height: 24px; }
.chat-call-waves span:nth-child(4) { animation-delay: 0.45s; height: 16px; }
.chat-call-waves span:nth-child(5) { animation-delay: 0.6s; height: 11px; }
@keyframes chatCallWave {
    0%, 100% { transform: scaleY(0.55); opacity: 0.6; }
    50% { transform: scaleY(1.25); opacity: 1; }
}
.chat-call-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 44px;
    width: 100%;
    max-width: 360px;
}
.chat-call-actions[hidden] {
    display: none !important;
}
.chat-call-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.chat-call-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    display: grid;
    place-items: center;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}
.chat-call-btn:hover {
    transform: scale(1.06);
}
.chat-call-btn:active {
    transform: scale(0.95);
}
.chat-call-btn svg {
    width: 30px;
    height: 30px;
}
.chat-call-btn--accept {
    background: linear-gradient(180deg, #34c759 0%, #22c55e 100%);
    box-shadow: 0 12px 30px rgba(34, 197, 94, 0.48);
    animation: chatCallAcceptBounce 1.6s ease-in-out infinite;
}
@keyframes chatCallAcceptBounce {
    0%, 100% { box-shadow: 0 12px 30px rgba(34, 197, 94, 0.48), 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 14px 34px rgba(34, 197, 94, 0.6), 0 0 0 14px rgba(34, 197, 94, 0); }
}
.chat-call-btn--decline {
    background: linear-gradient(180deg, #ff453a 0%, #ef4444 100%);
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.45);
}
.chat-call-btn--util {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.chat-call-btn--util.is-muted,
.chat-call-btn--util.is-active {
    background: #ffffff;
    color: #0f172a;
}
.chat-call-btn--util svg {
    width: 24px;
    height: 24px;
}
.chat-call-btn-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.86);
}
#chatCallActiveActions {
    gap: 20px;
    max-width: 440px;
}

/* 3-dots audio settings popover */
.chat-call-more-popover {
    width: min(92vw, 340px);
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 12px;
}
.chat-call-more-popover[hidden] {
    display: none !important;
}
.chat-call-more-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-call-more-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 650;
    color: rgba(255, 255, 255, 0.92);
}
.chat-call-more-head b {
    color: #34d399;
    font-variant-numeric: tabular-nums;
}
.chat-call-more-slider {
    width: 100%;
    accent-color: #34d399;
    cursor: pointer;
}
.chat-call-speaker-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}
.chat-call-speaker-toggle.is-loud {
    background: rgba(52, 211, 153, 0.18);
    border-color: rgba(52, 211, 153, 0.5);
    color: #34d399;
}

/* Seamless in-call page navigation iframe */
.chat-call-nav-frame-wrap {
    position: fixed;
    inset: 0;
    z-index: 2147483640;
    background: #ffffff;
}
.chat-call-nav-frame-wrap[hidden] {
    display: none !important;
}
.chat-call-nav-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ===== WEAK NETWORK MODAL ===== */
.czi-weak-net-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483644;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: chatCallFadeIn 0.25s ease-out;
}
.czi-weak-net-overlay[hidden] {
    display: none !important;
}
.czi-weak-net-box {
    width: min(92vw, 390px);
    background: #ffffff;
    border-radius: 22px;
    padding: 28px 24px 22px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(226, 232, 240, 0.9);
    color: #0f172a;
}
.czi-weak-net-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin: 0 auto 16px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.32);
    color: #d97706;
    display: grid;
    place-items: center;
}
.czi-weak-net-icon svg {
    width: 28px;
    height: 28px;
}
.czi-weak-net-title {
    font-size: 18.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.25;
}
.czi-weak-net-sub {
    font-size: 14px;
    line-height: 1.55;
    color: #475569;
    margin: 0 0 20px;
}
.czi-weak-net-actions {
    display: flex;
    gap: 10px;
}
.czi-weak-net-btn-reload {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.czi-weak-net-btn-close {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

/* Minimized floating call pill */
.chat-call-mini-pill {
    position: fixed;
    top: max(14px, env(safe-area-inset-top, 14px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 2147483645;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(52, 211, 153, 0.45);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.chat-call-mini-pill[hidden] {
    display: none !important;
}
.chat-call-mini-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
}


