.assistant-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.assistant-fab,
.whatsapp-fab,
.assistant-suggestion,
.assistant-send,
.assistant-close {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.assistant-fab::before,
.assistant-fab::after,
.assistant-fab .robot-antenna,
.assistant-fab .robot-antenna::before {
    pointer-events: none;
}

.assistant-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.assistant-fab,
.whatsapp-fab {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.assistant-fab {
    background: linear-gradient(135deg, #38bdf8 0%, #a78bfa 52%, #ec4899 100%);
    position: relative;
    font-size: 0;
}

.whatsapp-fab {
    background: #25d366;
    font-size: 0;
}

.whatsapp-fab svg {
    width: 30px;
    height: 30px;
    display: block;
    fill: currentColor;
}

.assistant-fab:hover,
.whatsapp-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.38);
}

.assistant-fab::before {
    content: '';
    width: 28px;
    height: 22px;
    border-radius: 9px;
    background: #ffffff;
    box-shadow: inset 0 -3px 0 rgba(15, 23, 42, 0.12);
}

.assistant-fab::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #0f172a;
    box-shadow:
        11px 0 0 #0f172a,
        5.5px 9px 0 2px #38bdf8;
    top: 21px;
    left: 20px;
}

.assistant-fab .robot-antenna {
    position: absolute;
    width: 2px;
    height: 8px;
    background: #ffffff;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 999px;
}

.assistant-fab .robot-antenna::before {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
}

.assistant-panel {
    width: min(360px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 110px));
    margin-bottom: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 18px;
    background: rgba(10, 14, 39, 0.96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    overflow: hidden;
    transform: translateY(12px) scale(0.96);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(236, 72, 153, 0.16));
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.assistant-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
}

.assistant-status {
    color: #a7f3d0;
    font-size: 12px;
    line-height: 1.2;
}

.assistant-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.assistant-messages {
    height: 320px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.assistant-message {
    max-width: 86%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.55;
}

.assistant-message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.09);
    color: #e2e8f0;
}

.assistant-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #38bdf8, #8b5cf6);
    color: #ffffff;
}

.assistant-suggestions {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto;
}

.assistant-suggestion {
    flex: 0 0 auto;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: #dbeafe;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.assistant-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.82);
}

.assistant-input {
    min-width: 0;
    flex: 1;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 11px 12px;
    font: inherit;
    font-size: 13px;
    outline: none;
}

.assistant-input::placeholder {
    color: #94a3b8;
}

.assistant-send {
    border: 0;
    border-radius: 13px;
    background: #38bdf8;
    color: #06111f;
    padding: 0 14px;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 640px) {
    .assistant-widget {
        right: 12px;
        bottom: 70px;
    }

    .assistant-panel {
        max-height: calc(100vh - 120px);
        width: min(320px, calc(100vw - 24px));
    }

    .assistant-messages {
        height: 240px;
    }

    .assistant-fab,
    .whatsapp-fab {
        width: 52px;
        height: 52px;
        border-radius: 16px;
    }

    .assistant-actions {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .assistant-widget {
        right: 8px;
        bottom: 75px;
    }

    .assistant-panel {
        width: min(300px, calc(100vw - 16px));
        max-height: calc(100vh - 130px);
    }

    .assistant-fab,
    .whatsapp-fab {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .assistant-messages {
        height: 200px;
    }

    .assistant-suggestion {
        padding: 6px 8px;
        font-size: 11px;
    }

    .assistant-input {
        padding: 9px 10px;
        font-size: 12px;
    }
}
