/* GRSAV AI Chatbot — transparent launcher, sticky panel */
.grsav-chat-launcher {
    position: fixed;
    z-index: 1060;
    bottom: calc(88px + env(safe-area-inset-bottom, 0));
    right: 14px;
    width: 58px;
    height: 58px;
    padding: 0;
    border: none;
    background: transparent !important;
    box-shadow: none;
    cursor: pointer;
    transition: transform .2s;
}

@media (min-width: 992px) {
    .grsav-chat-launcher {
        bottom: 24px;
        right: 24px;
        width: 64px;
        height: 64px;
    }
}

.grsav-chat-launcher:hover {
    transform: scale(1.06);
}

.grsav-chat-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .25));
    border-radius: 50%;
}

.grsav-chat-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #F9A825;
    animation: chatPulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes chatPulse {
    0% { transform: scale(1); opacity: .8; }
    100% { transform: scale(1.35); opacity: 0; }
}

.grsav-chat-panel {
    position: fixed;
    z-index: 1065;
    bottom: calc(88px + env(safe-area-inset-bottom, 0));
    right: 12px;
    left: 12px;
    max-width: 400px;
    margin-left: auto;
    height: min(72vh, 520px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(.92) translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: transform .25s, opacity .25s, visibility .25s;
    border: 1px solid #FFE082;
}

@media (min-width: 992px) {
    .grsav-chat-panel {
        bottom: 100px;
        right: 24px;
        left: auto;
        width: 380px;
    }
}

.grsav-chat-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.grsav-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1F2937, #374151);
    color: #fff;
}

.grsav-chat-header-avatar {
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.grsav-chat-header-text {
    flex: 1;
    min-width: 0;
}

.grsav-chat-header-text strong {
    display: block;
    font-size: 15px;
}

.grsav-chat-header-text small {
    opacity: .85;
    font-size: 11px;
}

.grsav-chat-online {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22C55E;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.grsav-chat-close {
    border: none;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

.grsav-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #FAFAFA;
}

.grsav-chat-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.grsav-chat-bubble.bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-bottom-left-radius: 4px;
}

.grsav-chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #F9A825, #FF8F00);
    color: #1F2937;
    font-weight: 500;
    border-bottom-right-radius: 4px;
}

.grsav-chat-bubble.typing {
    opacity: .7;
    font-style: italic;
}

.grsav-chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.grsav-chat-quick button {
    border: 1px solid #FFE082;
    background: #FFF8E1;
    border-radius: 50px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #1F2937;
    cursor: pointer;
}

.grsav-chat-quick button:hover {
    background: #F9A825;
}

.grsav-chat-lead {
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
    background: #FFFDE7;
}

.grsav-chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #E5E7EB;
    background: #fff;
}

.grsav-chat-input-row input {
    flex: 1;
    border: 2px solid #E5E7EB;
    border-radius: 50px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
}

.grsav-chat-input-row input:focus {
    border-color: #F9A825;
}

.grsav-chat-input-row button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #F9A825;
    color: #1F2937;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

body.grsav-chat-open .flash-jump-fab {
    opacity: 0;
    pointer-events: none;
}
