.ai-chat-modal {
        align-items: flex-end;
        justify-content: flex-end;
        padding: 0;
        --ai-chat-viewport-height: 100dvh;
        --ai-chat-viewport-offset-top: 0px;
    }
    .ai-chat-modal:not(.hidden) {
        display: flex;
    }
    .ai-chat-modal.keyboard-open {
        inset: auto 0 auto;
        top: var(--ai-chat-viewport-offset-top);
        height: var(--ai-chat-viewport-height);
    }
    .ai-chat-panel {
        width: min(100%, 620px);
        height: min(700px, var(--ai-chat-viewport-height, 100dvh));
        max-height: var(--ai-chat-viewport-height);
        min-height: min(420px, var(--ai-chat-viewport-height, 100dvh));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
    }
    @media (min-width: 768px) {
        .ai-chat-modal {
            align-items: flex-end;
            padding: 1rem;
        }
        .ai-chat-modal.keyboard-open {
            inset: 0;
            height: auto;
        }
        .ai-chat-panel {
            width: min(620px, calc(100vw - 2rem));
            height: min(740px, calc(var(--ai-chat-viewport-height, 100dvh) - 2rem));
            max-height: calc(var(--ai-chat-viewport-height, 100dvh) - 2rem);
            min-height: 420px;
            border-radius: 1.5rem;
        }
    }
    @media (max-height: 480px) and (max-width: 767px) {
        .ai-chat-panel {
            min-height: 0;
        }
    }
    #aiChatMessages {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
    #aiChatMessages::-webkit-scrollbar {
        width: 5px;
    }
    #aiChatMessages::-webkit-scrollbar-track {
        background: transparent;
    }
    #aiChatMessages::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
    }
    #aiChatMessages::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
    .ai-chat-slider {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 6px;
        padding-top: 4px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .ai-chat-slider::-webkit-scrollbar {
        height: 4px;
    }
    .ai-chat-slider::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }
    .ai-slider-card {
        flex: 0 0 250px;
        scroll-snap-align: start;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        transition: transform 0.15s, border-color 0.15s;
    }
    .ai-slider-card:hover {
        transform: translateY(-2px);
        border-color: #4bb59d;
    }

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.animate-slide-up {
    animation: slideUp 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

