.hgvp-chat-widget,
.hgvp-chat-widget * {
    box-sizing: border-box;
}

.hgvp-chat-widget {
    --hgvp-chat-primary: #7c3aed;
    --hgvp-chat-accent: #22c55e;
    --hgvp-chat-dark: #09090d;
    position: fixed;
    right: 18px;
    bottom: 96px;
    z-index: 99998;
    font-family: Arial, Helvetica, sans-serif;
    color: #fff;
}

.hgvp-chat-widget.hgvp-chat-pos-left {
    right: auto;
    left: 18px;
}

.hgvp-chat-widget.hgvp-chat-clean-entry:not(.open) {
    pointer-events: none;
}

.hgvp-chat-widget.hgvp-chat-clean-entry:not(.open) .hgvp-chat-launch,
.hgvp-chat-widget.hgvp-chat-clean-entry:not(.open) .hgvp-chat-invite {
    display: none;
}

.hgvp-chat-launch {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--hgvp-chat-primary), var(--hgvp-chat-accent));
    color: #fff;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .34), 0 0 0 10px rgba(124, 58, 237, .13);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .18s ease, box-shadow .18s ease;
}

.hgvp-chat-launch:hover {
    transform: translateY(-2px) scale(1.03);
}

.hgvp-chat-launch svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hgvp-chat-launch-icon {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
    border: 2px solid rgba(255,255,255,.72);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}

.hgvp-chat-unread {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.hgvp-chat-widget.has-unread .hgvp-chat-unread {
    display: flex;
}

.hgvp-chat-invite {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: max-content;
    min-width: 210px;
    max-width: min(275px, calc(100vw - 36px));
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    padding: 11px 16px 11px 46px;
    background: linear-gradient(135deg, rgba(20, 13, 32, .98), rgba(124, 58, 237, .94));
    box-shadow: 0 18px 50px rgba(0,0,0,.36), 0 0 0 6px rgba(239,68,68,.10), 0 0 32px rgba(124,58,237,.42);
    transform: translateY(10px) scale(.96);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    animation: hgvp-chat-invite-glow 1.8s ease-in-out infinite;
}

.hgvp-chat-pos-left .hgvp-chat-invite {
    right: auto;
    left: 0;
}

.hgvp-chat-widget.invited:not(.open) .hgvp-chat-invite {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.hgvp-chat-invite strong {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .02em;
    margin: 0;
    text-shadow: 0 1px 10px rgba(0,0,0,.3);
}

.hgvp-chat-invite p {
    display: none;
}

.hgvp-chat-invite-badge {
    position: absolute;
    left: 10px;
    top: 50%;
    width: 27px;
    height: 27px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 950;
    border: 2px solid #fff;
    box-shadow: 0 0 0 5px rgba(239,68,68,.2);
}

@keyframes hgvp-chat-invite-glow {
    0%, 100% { box-shadow: 0 18px 50px rgba(0,0,0,.36), 0 0 0 6px rgba(239,68,68,.08), 0 0 24px rgba(124,58,237,.34); }
    50% { box-shadow: 0 20px 58px rgba(0,0,0,.42), 0 0 0 9px rgba(239,68,68,.17), 0 0 38px rgba(124,58,237,.52); }
}

.hgvp-chat-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(390px, calc(100vw - 22px));
    height: min(620px, calc(100vh - 126px));
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.14);
    background: #101018;
    box-shadow: 0 30px 90px rgba(0,0,0,.48);
    transform: translateY(14px) scale(.96);
    opacity: 0;
    pointer-events: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    transition: opacity .22s ease, transform .22s ease;
}

.hgvp-chat-pos-left .hgvp-chat-panel {
    right: auto;
    left: 0;
}

.hgvp-chat-widget.open .hgvp-chat-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.hgvp-chat-widget.open .hgvp-chat-launch {
    transform: scale(.88);
    opacity: .78;
}

.hgvp-chat-head {
    padding: 14px;
    background:
        radial-gradient(circle at 22% 0%, rgba(124,58,237,.42), transparent 34%),
        linear-gradient(135deg, #11111a, #171124 70%, #0d0d13);
    border-bottom: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: 11px;
}

.hgvp-chat-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    object-fit: contain;
    padding: 5px;
    border: 1px solid rgba(255,255,255,.12);
}

.hgvp-chat-title {
    min-width: 0;
    flex: 1;
}

.hgvp-chat-title strong {
    display: block;
    font-size: 14px;
    line-height: 1.2;
    color: #fff;
}

.hgvp-chat-title span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    font-size: 12px;
    margin-top: 4px;
}

.hgvp-chat-title span::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--hgvp-chat-accent);
    box-shadow: 0 0 0 4px rgba(34,197,94,.13);
}

.hgvp-chat-widget.offline .hgvp-chat-title span::before {
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245,158,11,.13);
}

.hgvp-chat-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.hgvp-chat-messages {
    min-height: 0;
    overflow: auto;
    padding: 15px;
    background:
        linear-gradient(180deg, rgba(124,58,237,.08), transparent 28%),
        #0b0b11;
}

.hgvp-chat-day {
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
    margin: 0 0 12px;
}

.hgvp-chat-bubble {
    max-width: 86%;
    margin: 8px 0;
    display: grid;
    gap: 5px;
}

.hgvp-chat-bubble.visitor {
    margin-left: auto;
}

.hgvp-chat-bubble .hgvp-chat-text {
    padding: 10px 12px;
    border-radius: 14px;
    background: #1d1b28;
    color: #f8fafc;
    font-size: 13px;
    line-height: 1.42;
    border: 1px solid rgba(255,255,255,.08);
    white-space: pre-wrap;
}

.hgvp-chat-bubble.visitor .hgvp-chat-text {
    background: linear-gradient(135deg, var(--hgvp-chat-primary), #4f46e5);
    border-color: rgba(255,255,255,.16);
}

.hgvp-chat-bubble time {
    color: #64748b;
    font-size: 10px;
    padding: 0 4px;
}

.hgvp-chat-bubble.visitor time {
    text-align: right;
}

.hgvp-chat-options {
    display: grid;
    gap: 7px;
    margin-top: 4px;
}

.hgvp-chat-option {
    border: 1px solid rgba(124,58,237,.45);
    color: #fff;
    background: rgba(124,58,237,.14);
    border-radius: 11px;
    padding: 10px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    text-align: left;
}

.hgvp-chat-option:hover {
    background: rgba(124,58,237,.28);
}

.hgvp-chat-contact {
    display: grid;
    gap: 8px;
    margin-top: 6px;
    padding: 11px;
    border-radius: 14px;
    border: 1px solid rgba(34,197,94,.25);
    background: rgba(34,197,94,.08);
}

.hgvp-chat-contact.compact {
    border-color: rgba(124,58,237,.42);
    background: linear-gradient(135deg, rgba(124,58,237,.16), rgba(34,197,94,.10));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.hgvp-chat-contact input {
    width: 100%;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 10px;
    background: rgba(255,255,255,.07);
    color: #fff;
    padding: 11px 12px;
    font-size: 16px;
    outline: none;
}

.hgvp-chat-contact.compact input[name="whatsapp"] {
    border-color: rgba(34,197,94,.55);
    background: rgba(34,197,94,.12);
    font-weight: 900;
}

.hgvp-chat-notification-permission {
    display: grid;
    gap: 5px;
    border: 1px solid rgba(124,58,237,.42);
    border-radius: 12px;
    padding: 9px;
    background: rgba(124,58,237,.12);
}

.hgvp-chat-notification-permission strong {
    color: #fff;
    font-size: 12px;
    font-weight: 950;
}

.hgvp-chat-notification-permission span {
    color: #cbd5e1;
    font-size: 11px;
    line-height: 1.35;
}

.hgvp-chat-notification-permission button {
    margin-top: 2px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #16a34a, #7c3aed);
    color: #fff;
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 950;
    cursor: pointer;
}

.hgvp-chat-notification-permission.active {
    border-color: rgba(34,197,94,.45);
    background: rgba(34,197,94,.10);
}

.hgvp-chat-notification-permission.blocked,
.hgvp-chat-notification-permission.unavailable {
    border-color: rgba(148,163,184,.28);
    background: rgba(148,163,184,.08);
}

.hgvp-chat-contact input::placeholder {
    color: #94a3b8;
}

.hgvp-chat-contact label {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: #cbd5e1;
    font-size: 11px;
    line-height: 1.3;
}

.hgvp-chat-contact label input {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.hgvp-chat-submit-contact,
.hgvp-chat-whatsapp-final {
    width: 100%;
    border: 0;
    border-radius: 11px;
    background: var(--hgvp-chat-accent);
    color: #fff;
    padding: 12px;
    font-size: 13px;
    font-weight: 950;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hgvp-chat-typing {
    display: none;
    color: #94a3b8;
    font-size: 12px;
    padding: 0 15px 8px;
    background: #0b0b11;
}

.hgvp-chat-widget.admin-typing .hgvp-chat-typing {
    display: block;
}

.hgvp-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.09);
    background: #101018;
}

.hgvp-chat-input {
    width: 100%;
    min-height: 46px;
    max-height: 98px;
    resize: none;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 13px;
    padding: 12px;
    background: rgba(255,255,255,.07);
    color: #fff;
    outline: none;
    font-size: 16px;
    line-height: 1.35;
}

.hgvp-chat-send {
    border: 0;
    border-radius: 13px;
    background: var(--hgvp-chat-accent);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.hgvp-chat-send svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hgvp-chat-error {
    color: #fecaca;
    font-size: 12px;
    padding: 0 15px 10px;
    background: #0b0b11;
}

@media (max-width: 640px) {
    .hgvp-chat-widget {
        right: 12px;
        bottom: 154px;
    }

    .hgvp-chat-widget.hgvp-chat-pos-left {
        left: 12px;
    }

    .hgvp-chat-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 78px;
        width: auto;
        height: min(590px, calc(100dvh - 104px));
        border-radius: 17px;
    }

    .hgvp-chat-pos-left .hgvp-chat-panel {
        left: 10px;
        right: 10px;
    }

    .hgvp-chat-invite {
        width: min(314px, calc(100vw - 24px));
        bottom: 70px;
    }

    .hgvp-chat-launch {
        width: 56px;
        height: 56px;
    }
}

.hgvp-chat-widget.hgvp-chat-clean-entry.open {
    inset: 0;
    right: auto;
    bottom: auto;
    width: 100vw;
    height: 100svh;
    transform: none;
    display: grid;
    place-items: stretch;
    z-index: 100000;
}

.hgvp-chat-widget.hgvp-chat-clean-entry.open::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 22% 12%, rgba(124,58,237,.24), transparent 34%),
        radial-gradient(circle at 78% 80%, rgba(34,197,94,.18), transparent 30%),
        rgba(3, 4, 10, .86);
    backdrop-filter: blur(10px);
}

.hgvp-chat-widget.hgvp-chat-clean-entry.open .hgvp-chat-panel {
    position: fixed;
    inset: 18px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    width: min(880px, calc(100vw - 36px));
    height: calc(100svh - 36px);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.16);
    z-index: 1;
    box-shadow: 0 34px 120px rgba(0,0,0,.62);
}

.hgvp-chat-widget.hgvp-chat-clean-entry.open .hgvp-chat-launch,
.hgvp-chat-widget.hgvp-chat-clean-entry.open .hgvp-chat-invite {
    display: none;
}

.hgvp-chat-widget.hgvp-chat-clean-entry.open .hgvp-chat-head {
    min-height: 86px;
    padding: 18px 22px;
    background:
        radial-gradient(circle at 20% 0%, rgba(34,197,94,.32), transparent 32%),
        linear-gradient(135deg, #111827, #241143 62%, #0b0f1a);
}

.hgvp-chat-widget.hgvp-chat-clean-entry.open .hgvp-chat-messages {
    padding: 22px;
    background: linear-gradient(180deg, #101018, #0b0b11);
}

.hgvp-chat-widget.hgvp-chat-clean-entry.open .hgvp-chat-bubble .hgvp-chat-text {
    max-width: min(680px, 86vw);
    font-size: 15px;
}

@media (max-width: 640px) {
    .hgvp-chat-widget.hgvp-chat-clean-entry.open .hgvp-chat-panel {
        inset: 0;
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
        transform: none;
        left: 0;
    }

    .hgvp-chat-widget.hgvp-chat-clean-entry.open .hgvp-chat-head {
        min-height: 76px;
        padding: 14px;
    }

    .hgvp-chat-widget.hgvp-chat-clean-entry.open .hgvp-chat-messages {
        padding: 16px 12px;
    }
}
