.ai-chat-bubble {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    background: #0080ff;
    color: #ffffff;
    box-shadow: 0 18px 46px rgba(0, 88, 176, 0.34);
    display: grid;
    place-items: center;
}

.ai-chat-bubble svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

.ai-search-chat {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    width: min(420px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 48px));
    background: #ffffff;
    border: 1px solid rgba(0, 128, 255, 0.24);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.ai-search-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 14px;
    background: #0080ff;
    color: #ffffff;
}

.ai-search-chat__header strong,
.ai-search-chat__header span {
    display: block;
    letter-spacing: 0;
}

.ai-search-chat__header strong {
    font-size: 18px;
    line-height: 22px;
    font-weight: 700;
}

.ai-search-chat__header span {
    margin-top: 2px;
    font-size: 13px;
    line-height: 17px;
    opacity: 0.9;
}

.ai-search-chat__close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    display: grid;
    place-items: center;
}

.ai-search-chat__body {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f7f9fc;
}

.ai-search-chat__message {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 19px;
    letter-spacing: 0;
}

.ai-search-chat__message--bot {
    align-self: flex-start;
    background: #ffffff;
    color: #303030;
    border: 1px solid #e5eaf0;
}

.ai-search-chat__message--user {
    align-self: flex-end;
    background: #0080ff;
    color: #ffffff;
}

.ai-search-chat__status {
    padding: 12px 13px;
    border-radius: 12px;
    background: #ffffff;
    color: #4b5563;
    border: 1px solid #e5eaf0;
    font-size: 14px;
    line-height: 18px;
}

.ai-search-chat__status--error {
    color: #b42318;
    border-color: #f0b8b2;
    background: #fff5f5;
}

.ai-search-chat__typing {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    padding: 12px 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e5eaf0;
}

.ai-search-chat__typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #0080ff;
    opacity: 0.35;
    animation: aiTypingPulse 1.1s infinite ease-in-out;
}

.ai-search-chat__typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.ai-search-chat__typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes aiTypingPulse {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.ai-search-chat__results {
    display: grid;
    gap: 10px;
}

.ai-property-card {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    background: #ffffff;
    border: 1px solid #e5eaf0;
    border-radius: 14px;
}

.ai-property-card__media {
    width: 86px;
    height: 78px;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f7;
    display: block;
}

.ai-property-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ai-property-card__content {
    min-width: 0;
}

.ai-property-card__type {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(0, 128, 255, 0.1);
    color: #0080ff;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
}

.ai-property-card__title {
    display: block;
    margin: 8px 0 4px;
    color: #111827;
    font-size: 15px;
    line-height: 19px;
    font-weight: 700;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.ai-property-card p {
    margin: 0;
    color: #5f6672;
    font-size: 13px;
    line-height: 17px;
}

.ai-property-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 9px;
    color: #303846;
    font-size: 12px;
    line-height: 16px;
}

.ai-property-card__button {
    width: 48px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #0080ff;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.ai-search-chat__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
    background: #ffffff;
    border-top: 1px solid #e5eaf0;
}

.ai-search-chat__form textarea {
    min-height: 48px;
    max-height: 120px;
    resize: vertical;
    border: 1px solid #d6deea;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    line-height: 18px;
    outline: none;
}

.ai-search-chat__form textarea:focus {
    border-color: #0080ff;
}

.ai-search-chat__form button {
    align-self: end;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: #0080ff;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.ai-search-chat__form button:disabled {
    opacity: 0.65;
}

@media (max-width: 640px) {
    .ai-chat-bubble {
        right: 14px;
        bottom: 14px;
        width: 58px;
        height: 58px;
    }

    .ai-search-chat {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        border-radius: 16px;
    }

    .ai-search-chat__form {
        grid-template-columns: 1fr;
    }

    .ai-search-chat__form button {
        width: 100%;
    }

    .ai-property-card {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .ai-property-card__media {
        width: 74px;
        height: 74px;
    }

    .ai-property-card__button {
        grid-column: 1 / -1;
        width: 100%;
    }
}
