.eb-chat-launcher,
.eb-chat-widget,
.eb-chat-widget * {
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}

.eb-chat-launcher {
    position: fixed;
    right: 18px;
    bottom: 22px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #064e3b, #0f766e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    cursor: pointer;
    box-shadow: 0 16px 35px rgba(15, 118, 110, .35);
}

.eb-chat-pulse {
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid rgba(20,184,166,.35);
    animation: ebPulse 1.8s infinite;
}

@keyframes ebPulse {
    from { transform: scale(.9); opacity: .9; }
    to { transform: scale(1.2); opacity: 0; }
}

.eb-chat-icon {
    font-size: 25px;
}

.eb-chat-widget {
    position: fixed;
    right: 18px;
    bottom: 92px;
    width: 380px;
    max-width: calc(100vw - 24px);
    height: 620px;
    max-height: calc(100vh - 112px);
    background: #fff;
    border-radius: 26px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 99999;
    box-shadow: 0 25px 75px rgba(15,23,42,.25);
}

.eb-chat-widget.open {
    display: flex;
    animation: ebOpen .2s ease;
}

@keyframes ebOpen {
    from { opacity: 0; transform: translateY(16px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.eb-chat-header {
    background: linear-gradient(135deg, #064e3b, #0f766e, #14b8a6);
    color: white;
    padding: 14px 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.eb-chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    color: #0f766e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 17px;
    flex-shrink: 0;
}

.eb-chat-title {
    flex: 1;
    min-width: 0;
}

.eb-chat-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
}

.eb-chat-title p {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: .92;
}

#ebChatClose {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    color: white;
    font-size: 25px;
    cursor: pointer;
}

.eb-chat-user {
    padding: 9px 12px;
    background: #ffffff;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #111827;
}

.eb-chat-user span,
.eb-chat-user strong {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px 9px;
    border-radius: 999px;
    line-height: 1;
}

.eb-chat-welcome {
    margin: 12px;
    padding: 13px 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff8db, #fffbea);
    color: #5f4600;
    font-size: 14px;
    line-height: 1.45;
}

.eb-quick-replies {
    display: flex;
    gap: 8px;
    padding: 0 12px 10px;
    overflow-x: auto;
}

.eb-quick-replies::-webkit-scrollbar {
    display: none;
}

.eb-quick-replies button {
    appearance: none;
    border: 0;
    background: #f1f5f9;
    color: #0f172a;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.eb-quick-replies button:active {
    transform: scale(.96);
}

.eb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 18px;
    background:
        linear-gradient(rgba(255,255,255,.68), rgba(255,255,255,.68)),
        #e7ddd4;
    scroll-behavior: smooth;
}

.eb-message-row {
    display: flex;
    margin-bottom: 11px;
}

.eb-message-row.user {
    justify-content: flex-end;
}

.eb-message-row.admin {
    justify-content: flex-start;
}

.eb-bubble {
    max-width: 78%;
    padding: 10px 12px 8px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    color: #111827;
    word-wrap: break-word;
    box-shadow: 0 3px 10px rgba(15,23,42,.08);
}

.eb-message-row.user .eb-bubble {
    background: #d9ffc7;
    border-bottom-right-radius: 6px;
}

.eb-message-row.admin .eb-bubble {
    background: white;
    border-bottom-left-radius: 6px;
}

.eb-message-text {
    white-space: pre-wrap;
}

.eb-time {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #64748b;
    text-align: right;
}

.eb-chat-img {
    display: block;
    max-width: 210px;
    width: 100%;
    border-radius: 15px;
    margin-top: 7px;
}

.eb-file-link {
    margin-top: 7px;
    display: block;
    padding: 10px;
    border-radius: 14px;
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
    font-size: 13px;
}

.eb-file-preview {
    display: none;
    margin: 0 12px 8px;
    padding: 8px 10px;
    border-radius: 14px;
    background: #ecfeff;
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
}

.eb-file-preview.show {
    display: block;
}

.eb-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

.eb-attach-btn,
#ebSendBtn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eb-attach-btn {
    background: #e6fffb;
    color: #0f766e;
    font-size: 20px;
    cursor: pointer;
}

.eb-attach-btn input {
    display: none;
}

#ebMessageInput {
    flex: 1;
    min-height: 44px;
    max-height: 95px;
    resize: none;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.35;
    outline: none;
    background: white;
}

#ebMessageInput:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20,184,166,.12);
}

#ebSendBtn {
    background: #0f766e;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

#ebSendBtn:disabled {
    opacity: .55;
}

@media (max-width: 520px) {
    .eb-chat-widget {
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }

    .eb-chat-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }

    .eb-chat-launcher {
        right: 16px;
        bottom: 18px;
    }

    .eb-chat-welcome {
        margin: 10px;
        font-size: 13.5px;
    }

    .eb-quick-replies {
        padding: 0 10px 9px;
    }

    .eb-chat-messages {
        padding: 12px 12px 16px;
    }

    .eb-bubble {
        max-width: 82%;
        font-size: 14px;
    }

    .eb-chat-img {
        max-width: 200px;
    }
}



@media (max-width: 520px) {
    .eb-chat-widget.open {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .eb-chat-header,
    .eb-chat-user,
    .eb-chat-welcome,
    .eb-quick-replies,
    .eb-file-preview,
    .eb-chat-form {
        flex-shrink: 0 !important;
    }

    .eb-chat-messages {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding-bottom: 18px !important;
    }

    .eb-chat-form {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        z-index: 999999 !important;
        padding: 8px 10px 48px !important;
        background: #f8fafc !important;
        border-top: 1px solid #e5e7eb !important;
    }

    .eb-attach-btn,
    #ebSendBtn {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
    }

    #ebMessageInput {
        min-height: 42px !important;
        max-height: 82px !important;
    }
}
