.ai-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 4000;
    --ai-chat-font-xs: clamp(10px, calc(9px + 0.15vw), 12px);
    --ai-chat-font-sm: clamp(11px, calc(10px + 0.18vw), 13px);
    --ai-chat-font-md: clamp(13px, calc(12px + 0.2vw), 15px);
    --ai-chat-font-lg: clamp(15px, calc(13.5px + 0.25vw), 18px);
    font-family: inherit;
}

.ai-chat-widget__launcher {
    position: relative;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: transparent;
    box-shadow: 0 10px 25px rgba(0, 173, 239, 0.35);
    cursor: pointer;
    outline: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-radius 0.3s ease;
    animation: ai-chat-launcher-idle 2.8s ease-in-out infinite, ai-chat-launcher-pulse 2s infinite;
}

.ai-chat-widget__launcher:hover,
.ai-chat-widget__launcher:focus {
    transform: translateY(-3px) scale(1.05);
    animation: ai-chat-launcher-pulse 2s infinite;
}

.ai-chat-widget__launcher::before {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #00adef 0%, #0088cc 100%);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35);
    content: "";
    transition: border-radius 0.3s ease;
    z-index: -1;
}

.ai-chat-widget__launcher-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 30px;
    height: 22px;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform-origin: center;
}

.ai-chat-widget__launcher-icon::after {
    position: absolute;
    left: 6px;
    bottom: -4px;
    width: 8px;
    height: 8px;
    background: #ffffff;
    clip-path: polygon(0 0, 100% 0, 18% 100%);
    content: "";
}

.ai-chat-widget__launcher-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #00adef;
    display: block;
}

.ai-chat-widget__icon-close {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6) rotate(-45deg);
    width: 22px;
    height: 22px;
    color: #ffffff;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Switch icons on open state */
.ai-chat-widget--open .ai-chat-widget__launcher-icon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6) rotate(45deg);
}

.ai-chat-widget--open .ai-chat-widget__icon-close {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.ai-chat-widget--open .ai-chat-widget__launcher {
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0, 173, 239, 0.35);
}

.ai-chat-widget--open .ai-chat-widget__launcher::before {
    border-radius: 50%;
    background: linear-gradient(135deg, #00adef 0%, #0077b3 100%);
}



/* Badge "1" */
.ai-chat-widget__launcher-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 6px rgba(239, 68, 68, 0.4);
    animation: ai-chat-badge-bounce 1s ease infinite alternate;
    z-index: 3;
    transition: opacity 0.3s ease;
}

@keyframes ai-chat-badge-bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-3px); }
}

.ai-chat-widget--open .ai-chat-widget__launcher-badge {
    opacity: 0;
    pointer-events: none;
}



.ai-chat-widget__status-dot {
    display: none;
}

.ai-chat-widget__panel {
    display: none;
    position: absolute;
    right: 0;
    bottom: 75px;
    width: 376px;
    height: 640px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    overflow: hidden;
    border: 1px solid rgba(28, 39, 49, 0.12);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    transform-origin: right bottom;
}

.ai-chat-widget--open .ai-chat-widget__panel {
    display: flex;
    flex-direction: column;
    animation: ai-chat-panel-in 180ms ease-out both;
}

.ai-chat-widget--closing .ai-chat-widget__panel {
    display: flex;
    flex-direction: column;
    animation: ai-chat-panel-out 160ms ease-in both;
}

.ai-chat-widget__header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(28, 39, 49, 0.08);
}

.ai-chat-widget__avatar {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #7c4dff 0%, #1d8fe3 100%);
    font-size: 14px;
    font-weight: 700;
}

.ai-chat-widget__title-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.ai-chat-widget__header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 2px;
}

.ai-chat-widget__text-size {
    display: none;
    align-items: center;
    gap: 0;
    margin-right: 4px;
}

.ai-chat-widget--expanded .ai-chat-widget__text-size {
    display: flex;
}

.ai-chat-widget__text-size-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: #66758a;
    background: transparent;
    line-height: 1;
    cursor: pointer;
}

.ai-chat-widget__text-size-btn--small {
    font-size: 12px;
}

.ai-chat-widget__text-size-btn--medium {
    font-size: 16px;
}

.ai-chat-widget__text-size-btn--large {
    font-size: 22px;
}

.ai-chat-widget__text-size-btn:hover,
.ai-chat-widget__text-size-btn:focus,
.ai-chat-widget__text-size-btn.is-active {
    color: #202a36;
    background: rgba(28, 39, 49, 0.06);
    outline: none;
}

.ai-chat-widget__title {
    overflow: hidden;
    color: #202a36;
    font-size: 15px;
    font-size: var(--ai-chat-font-lg);
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-chat-widget__status {
    display: none;
}

.ai-chat-widget__expand,
.ai-chat-widget__close {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    color: #66758a;
    background: transparent;
    cursor: pointer;
}

.ai-chat-widget__expand:hover,
.ai-chat-widget__expand:focus,
.ai-chat-widget__close:hover,
.ai-chat-widget__close:focus {
    color: #202a36;
    background: rgba(28, 39, 49, 0.06);
}

.ai-chat-widget--expanded .ai-chat-widget__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
}

.ai-chat-widget--expanded .ai-chat-widget__launcher {
    display: none;
}

.ai-chat-widget--expanded.ai-chat-widget--text-small {
    --ai-chat-font-xs: 10px;
    --ai-chat-font-sm: 11px;
    --ai-chat-font-md: 13px;
    --ai-chat-font-lg: 15px;
}

.ai-chat-widget--expanded.ai-chat-widget--text-large {
    --ai-chat-font-xs: 14px;
    --ai-chat-font-sm: 17px;
    --ai-chat-font-md: 20px;
    --ai-chat-font-lg: 26px;
}

.ai-chat-widget__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: 16px 18px 18px;
}

.ai-chat-widget__greeting {
    margin: 0 0 14px;
    padding: 0 0 0 10px;
    border-left: 3px solid rgba(91, 112, 245, 0.28);
    border-radius: 0;
    color: #5b6b7f;
    background: transparent;
    font-size: 13px;
    font-size: var(--ai-chat-font-md);
    line-height: 1.45;
}

.ai-chat-widget__suggestions-container {
    margin-top: auto;
    margin-bottom: 12px;
}

.ai-chat-widget__suggestions-title {
    margin: 0 0 8px;
    color: #4664e8;
    font-size: 13px;
    font-size: var(--ai-chat-font-md);
    font-weight: 700;
}

.ai-chat-widget__suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
    max-height: 180px;
    overflow-y: auto;
    padding: 4px 4px 4px 0;
}

.ai-chat-widget__suggestions::-webkit-scrollbar {
    width: 4px;
}
.ai-chat-widget__suggestions::-webkit-scrollbar-track {
    background: transparent;
}
.ai-chat-widget__suggestions::-webkit-scrollbar-thumb {
    background: rgba(111, 99, 255, 0.25);
    border-radius: 4px;
}
.ai-chat-widget__suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(111, 99, 255, 0.45);
}

.ai-chat-widget__suggestion {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    height: auto;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid rgba(0, 173, 239, 0.28);
    border-radius: 10px;
    color: #243247;
    background: #fff;
    font-size: 12px;
    font-size: var(--ai-chat-font-sm);
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    cursor: pointer;
    overflow: hidden;
}

.ai-chat-widget__suggestion span {
    display: block;
    flex: 1;
    white-space: normal;
    word-break: break-word;
}

.ai-chat-widget__suggestion:hover,
.ai-chat-widget__suggestion:focus {
    border-color: #00adef;
    background: #f0faff;
}

.ai-chat-widget__suggestion .fa {
    flex: 0 0 18px;
    color: #00adef;
    font-size: 14px;
}

.ai-chat-widget__messages {
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 12px;
    overflow-y: auto;
}

.ai-chat-widget__message {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    animation: ai-chat-message-in 180ms ease-out both;
}

.ai-chat-widget__message--user {
    align-items: flex-end;
}

.ai-chat-widget__message--assistant {
    align-items: flex-start;
}

.ai-chat-widget__message-bubble-wrap {
    position: relative;
    max-width: 88%;
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.ai-chat-widget__message--user .ai-chat-widget__message-bubble-wrap {
    flex-direction: row-reverse;
}

.ai-chat-widget__message-text {
    width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 13px;
    font-size: var(--ai-chat-font-md);
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-wrap !important;
    word-break: break-word;
}

.ai-chat-widget__copy-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    font-size: 13px;
    border-radius: 6px;
    transition: opacity 0.2s, color 0.2s, background-color 0.2s;
    height: 28px;
    width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.ai-chat-widget__message-bubble-wrap:hover .ai-chat-widget__copy-btn {
    opacity: 1;
}

.ai-chat-widget__copy-btn:hover {
    color: #1e293b;
    background-color: #f1f5f9;
}

.ai-chat-widget__copy-btn.copied {
    color: #10b981 !important;
}

.ai-chat-widget__message--user .ai-chat-widget__message-text {
    color: #fff;
    background: #00adef;
    border-bottom-right-radius: 4px;
}

.ai-chat-widget__message--assistant .ai-chat-widget__message-text {
    color: #263342;
    background: #f3f6fb;
    border-bottom-left-radius: 4px;
}

.ai-chat-widget__typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    padding: 8px 12px;
    border-radius: 14px 14px 14px 4px;
    background: #f3f6fb;
    animation: ai-chat-typing-bubble 1.2s ease-in-out infinite;
}

.ai-chat-widget__typing span {
    display: block;
}

.ai-chat-widget__typing-text {
    font-size: 12px;
    font-size: var(--ai-chat-font-sm);
    color: #64748b;
    font-weight: 500;
    margin-right: 4px;
}

.ai-chat-widget__typing-dot {
    display: block;
    flex: 0 0 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8a96a8;
    transform-origin: center;
    will-change: opacity, transform, background-color;
    animation: ai-chat-typing-dot 1.05s ease-in-out infinite;
}

.ai-chat-widget__typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.ai-chat-widget__typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

.ai-chat-widget__typing-dot:nth-child(4) {
    animation-delay: 0.45s;
}

.ai-chat-widget__cards {
    display: grid;
    gap: 8px;
    width: 88%;
    margin-top: 8px;
}

.ai-chat-widget__card {
    padding: 9px 10px;
    border: 1px solid rgba(91, 112, 245, 0.22);
    border-radius: 10px;
    background: #fff;
}

.ai-chat-widget__card-title {
    color: #243247;
    font-size: 12px;
    font-size: var(--ai-chat-font-sm);
    font-weight: 700;
    line-height: 1.3;
}

.ai-chat-widget__card-description {
    margin-top: 3px;
    color: #5b6b7f;
    font-size: 12px;
    font-size: var(--ai-chat-font-sm);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.ai-chat-widget__composer {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(28, 39, 49, 0.12);
    border-radius: 24px;
    background: #fff;
}

.ai-chat-widget__input {
    min-width: 0;
    flex: 1 1 auto;
    min-height: 34px;
    max-height: 120px;
    padding: 8px 0;
    overflow-y: hidden;
    border: 0;
    color: #202a36;
    background: transparent;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 13px;
    font-size: var(--ai-chat-font-md);
    line-height: 1.4;
    -ms-overflow-style: none;
    outline: none;
    resize: none;
    scrollbar-width: none;
}

.ai-chat-widget__input::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.ai-chat-widget__send {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #00adef;
    cursor: pointer;
}

.ai-chat-widget__send:hover,
.ai-chat-widget__send:focus {
    background: #008cc3;
}

.ai-chat-widget__send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@keyframes ai-chat-panel-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ai-chat-panel-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }
}

@keyframes ai-chat-message-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ai-chat-typing-dot {
    0%,
    70%,
    100% {
        background-color: #95a2b3;
        opacity: 0.42;
        transform: scale(0.72);
    }

    35% {
        background-color: #60718a;
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes ai-chat-typing-bubble {
    0%,
    100% {
        box-shadow: 0 0 0 rgba(138, 150, 168, 0);
    }

    50% {
        box-shadow: 0 8px 18px rgba(138, 150, 168, 0.12);
    }
}

@keyframes ai-chat-launcher-idle {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-chat-widget__launcher,
    .ai-chat-widget__panel,
    .ai-chat-widget__message {
        animation: none;
        transition: none;
    }
}

@media (max-width: 600px) {
    .ai-chat-widget {
        right: 16px;
        bottom: 16px;
    }

    .ai-chat-widget__panel {
        right: -8px;
        bottom: 70px;
        width: calc(100vw - 32px);
        height: calc(100vh - 104px);
        max-height: none;
        border-radius: 16px;
    }

    .ai-chat-widget__copy-btn {
        opacity: 0.5;
    }

    .ai-chat-widget__invite {
        right: 0;
        bottom: 72px;
        width: calc(100vw - 32px);
    }

    .ai-chat-widget__invite-body::after {
        right: 22px;
        bottom: -6px;
        top: auto;
        transform: rotate(45deg);
        background: #ffffff;
        border-right: 1px solid rgba(0, 173, 239, 0.25);
        border-bottom: 1px solid rgba(0, 173, 239, 0.25);
        border-top: none;
        border-left: none;
        margin-top: 0;
    }
}

.ai-chat-widget__end-banner {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    margin: 0 4px 8px;
    border: 0;
    background: transparent;
    animation: ai-chat-message-in 180ms ease-out both;
}

.ai-chat-widget__end-btn {
    width: auto;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid rgba(229, 62, 62, 0.3);
    border-radius: 14px;
    background: transparent;
    color: #8a6470;
    font-size: 11px;
    font-size: var(--ai-chat-font-xs);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    text-align: center;
}

.ai-chat-widget__end-btn:hover,
.ai-chat-widget__end-btn:focus {
    border-color: rgba(197, 48, 48, 0.55);
    color: #c53030;
    background: #fff5f5;
    outline: none;
}

.ai-chat-widget__end-banner--urgent {
    justify-content: stretch;
    margin: 0 0 12px;
}

.ai-chat-widget__end-banner--urgent .ai-chat-widget__end-btn {
    width: 100%;
    min-height: 40px;
    padding: 10px 16px;
    border-color: #e53e3e;
    border-radius: 12px;
    color: #fff;
    background: #e53e3e;
    font-size: 13px;
    font-size: var(--ai-chat-font-sm);
    font-weight: 600;
}

.ai-chat-widget__end-banner--urgent .ai-chat-widget__end-btn:hover,
.ai-chat-widget__end-banner--urgent .ai-chat-widget__end-btn:focus {
    border-color: #c53030;
    color: #fff;
    background: #c53030;
}

/* Skeleton Loading Shimmer Styles */
@keyframes ai-chat-skeleton-shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.ai-chat-widget--loading-skeleton {
    background-image: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%) !important;
    background-size: 200px 100% !important;
    background-repeat: no-repeat !important;
    background-color: transparent !important;
    animation: ai-chat-skeleton-shimmer 1.5s infinite linear !important;
    color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    pointer-events: none !important;
    user-select: none !important;
}

.ai-chat-widget--disabled {
    opacity: 0.6 !important;
    pointer-events: none !important;
}

.ai-chat-widget__message-time {
    font-size: 10px;
    font-size: var(--ai-chat-font-xs);
    color: #94a3b8;
    margin-top: 4px;
    padding: 0 4px;
}

.ai-chat-widget__message--user .ai-chat-widget__message-time {
    align-self: flex-end;
}

.ai-chat-widget__message--assistant .ai-chat-widget__message-time {
    align-self: flex-start;
}

.ai-chat-widget__avatar-wrap {
    position: relative;
    display: flex;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
}

.ai-chat-widget__avatar-status {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 12px;
    height: 12px;
    background-color: #25c46a;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 2;
}

@keyframes ai-chat-launcher-pulse {
    0% {
        box-shadow: 0 10px 25px rgba(0, 173, 239, 0.3), 0 0 0 0 rgba(0, 173, 239, 0.4);
    }
    70% {
        box-shadow: 0 10px 25px rgba(0, 173, 239, 0.3), 0 0 0 14px rgba(0, 173, 239, 0);
    }
    100% {
        box-shadow: 0 10px 25px rgba(0, 173, 239, 0.3), 0 0 0 0 rgba(0, 173, 239, 0);
    }
}

/* Invitation Speech Bubble */
.ai-chat-widget__invite {
    position: absolute;
    right: 72px;
    bottom: 0;
    width: 292px;
    z-index: 3999;
    pointer-events: auto;
}

.ai-chat-widget__invite-body {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 38px 12px 14px;
    background: #ffffff;
    border: 1px solid rgba(0, 173, 239, 0.25);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-widget__invite-body:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 173, 239, 0.18);
}

.ai-chat-widget__invite-body::after {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 173, 239, 0.25);
    border-right: 1px solid rgba(0, 173, 239, 0.25);
    border-bottom: none;
    border-left: none;
    content: "";
    margin-top: -6px;
}

.ai-chat-widget__invite-avatar {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00adef 0%, #0077b3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 173, 239, 0.2);
}

.ai-chat-widget__invite-emoji {
    font-size: 18px;
    animation: ai-chat-hand-wave 1.5s infinite;
    transform-origin: 70% 70%;
}

.ai-chat-widget__waving-hand {
    display: inline-block;
    animation: ai-chat-hand-wave 1.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes ai-chat-hand-wave {
    0%, 100% { transform: rotate(0deg); }
    20%, 60% { transform: rotate(-12deg); }
    40%, 80% { transform: rotate(16deg); }
}

.ai-chat-widget__invite-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ai-chat-widget__invite-title {
    color: #0f172a;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-chat-widget__invite-desc {
    color: #475569;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.ai-chat-widget__invite-arrow {
    color: #00adef;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.ai-chat-widget__invite-body:hover .ai-chat-widget__invite-arrow {
    transform: translateX(4px);
}

.ai-chat-widget__invite-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.ai-chat-widget__invite-close:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.05);
}

/* Eye-catching Pulsing Ripples Behind Launcher */
.ai-chat-widget__launcher-ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 173, 239, 0.4) 0%, rgba(0, 173, 239, 0.05) 70%, transparent 100%);
    box-shadow: 0 0 15px rgba(0, 173, 239, 0.3);
    pointer-events: none;
    z-index: 0;
    animation: ai-chat-ripple 2.4s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.ai-chat-widget__launcher-ripple--delay {
    animation-delay: 1.2s;
}

.ai-chat-widget--open .ai-chat-widget__launcher-ripple,
.ai-chat-widget--closing .ai-chat-widget__launcher-ripple {
    display: none;
}

@keyframes ai-chat-ripple {
    0% {
        transform: scale(0.95);
        opacity: 0.9;
    }
    50% {
        opacity: 0.65;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* ==========================================================================
   Dynamic Form Integration (Modal & Action Card)
   ========================================================================== */

/* Form Action Card inside Assistant Message */
.ai-chat-widget__form-card {
    margin-top: 8px;
    margin-bottom: 2px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 173, 239, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 88%;
}

.ai-chat-widget__form-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-widget__form-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #00adef;
    color: #ffffff;
    border-radius: 6px;
    font-size: 12px;
}

.ai-chat-widget__form-card-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0369a1;
}

.ai-chat-widget__form-card-desc {
    font-size: 11px;
    color: #475569;
    line-height: 1.4;
}

.ai-chat-widget__form-card-btn {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #00adef 0%, #0284c7 100%);
    color: #ffffff;
    border: 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 173, 239, 0.3);
    transition: all 0.2s ease;
}

.ai-chat-widget__form-card-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 173, 239, 0.4);
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
}

.ai-chat-widget__form-card-btn:active {
    transform: translateY(0);
}

/* Modal Overlay - Full Screen Viewport Level in front of page and chat widget */
.ai-chat-widget__form-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: ai-chat-modal-fade-in 0.2s ease-out;
}

@keyframes ai-chat-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Dialog */
.ai-chat-widget__form-modal {
    width: 100%;
    max-width: 500px;
    max-height: 88vh;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ai-chat-modal-scale-up 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ai-chat-modal-scale-up {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Modal Header */
.ai-chat-widget__form-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.ai-chat-widget__form-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ai-chat-widget__form-modal-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #00adef 0%, #0284c7 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 173, 239, 0.25);
}

.ai-chat-widget__form-modal-title-wrap {
    min-width: 0;
}

.ai-chat-widget__form-modal-title {
    font-size: 15px;
    font-size: var(--ai-chat-font-md);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.ai-chat-widget__form-modal-subtitle {
    font-size: 12px;
    font-size: var(--ai-chat-font-xs);
    color: #64748b;
    margin-top: 2px;
    line-height: 1.35;
}

.ai-chat-widget__form-modal-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.ai-chat-widget__form-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Modal Body */
.ai-chat-widget__form-modal-body {
    flex: 1 1 auto;
    padding: 20px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #ffffff;
}

.ai-chat-widget__form-modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ai-chat-widget__form-error {
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
}

.ai-chat-widget__form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-chat-widget__form-label {
    font-size: 12.5px;
    font-size: var(--ai-chat-font-sm);
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
}

.ai-chat-widget__form-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ai-chat-widget__form-input-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}

.ai-chat-widget__form-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 13px;
    font-size: var(--ai-chat-font-md);
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.ai-chat-widget__form-input::placeholder {
    color: #94a3b8;
    font-size: 12px;
    font-size: var(--ai-chat-font-sm);
}

.ai-chat-widget__form-input:focus {
    border-color: #00adef;
    box-shadow: 0 0 0 3px rgba(0, 173, 239, 0.18);
    background: #fafcfe;
}

/* Modal Footer */
.ai-chat-widget__form-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.ai-chat-widget__form-btn {
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-size: var(--ai-chat-font-md);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.ai-chat-widget__form-btn--secondary {
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.ai-chat-widget__form-btn--secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.ai-chat-widget__form-btn--primary {
    background: linear-gradient(135deg, #00adef 0%, #0284c7 100%);
    color: #ffffff;
    border: 0;
    box-shadow: 0 2px 8px rgba(0, 173, 239, 0.35);
}

.ai-chat-widget__form-btn--primary:hover {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    box-shadow: 0 4px 12px rgba(0, 173, 239, 0.45);
    transform: translateY(-1px);
}

.ai-chat-widget__form-btn--primary:active {
    transform: translateY(0);
}



