.property-chatbot {
    --chat-green: #173e34;
    --chat-accent: #28634d;
    --chat-canvas: #f3f7f3;
    --chat-ink: #17312e;
    position: fixed;
    z-index: 1050;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    font-family: "Segoe UI", Arial, sans-serif;
}

.property-chatbot *,
.property-chatbot *::before,
.property-chatbot *::after {
    box-sizing: border-box;
}

.property-chatbot [hidden] {
    display: none !important;
}

.chat-launcher {
    display: inline-flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 19px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--chat-green);
    box-shadow: 0 12px 32px rgba(16, 47, 41, .3);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.chat-launcher:hover {
    transform: translateY(-3px);
    background: var(--chat-accent);
    box-shadow: 0 16px 36px rgba(16, 47, 41, .35);
}

.chat-launcher i {
    font-size: 17px;
}

.chat-panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    display: flex;
    width: min(390px, calc(100vw - 28px));
    height: min(590px, calc(100vh - 110px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1e9e2;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(12, 37, 29, .24);
    animation: chat-appear .18s ease-out;
}

@keyframes chat-appear {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
    display: flex;
    min-height: 76px;
    align-items: center;
    gap: 11px;
    padding: 13px 16px;
    color: #fff;
    background: linear-gradient(120deg, #173e34, #28634d);
}

.chat-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    color: var(--chat-green);
    background: #d8e66b;
}

.chat-heading {
    display: grid;
    gap: 4px;
}

.chat-heading strong {
    font-size: 14px;
}

.chat-heading small {
    color: rgba(255, 255, 255, .76);
    font-size: 10px;
}

.chat-online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 4px;
    border-radius: 50%;
    background: #c7e86d;
}

.chat-close {
    display: grid;
    width: 36px;
    height: 36px;
    margin-left: auto;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    cursor: pointer;
}

.chat-close:hover {
    background: rgba(255, 255, 255, .22);
}

.chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 16px;
    background: var(--chat-canvas);
    overscroll-behavior: contain;
}

.chat-message {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 15px;
    color: var(--chat-ink);
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.bot-message {
    align-self: flex-start;
    border: 1px solid #e3ebe3;
    border-bottom-left-radius: 5px;
    background: #fff;
}

.user-message {
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    color: #fff;
    background: var(--chat-accent);
}

.chat-results {
    display: grid;
    gap: 8px;
}

.chat-browse-link {
    align-self: flex-start;
    padding: 8px 12px;
    border: 1px solid #dce8dd;
    border-radius: 999px;
    color: var(--chat-green);
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.chat-browse-link:hover {
    border-color: #b6cfb9;
    background: #eff6ef;
}

.chat-result {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid #e0e9e1;
    border-radius: 12px;
    color: var(--chat-ink);
    background: #fff;
    text-decoration: none;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.chat-result:hover {
    transform: translateY(-1px);
    border-color: #98b7a0;
    box-shadow: 0 6px 16px rgba(23, 62, 52, .08);
}

.chat-result strong {
    font-size: 11px;
    line-height: 1.4;
}

.chat-result span {
    color: var(--chat-accent);
    font-size: 11px;
    font-weight: 750;
}

.chat-result small {
    color: #77847d;
    font-size: 10px;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px 4px;
    background: #fff;
}

.chat-suggestions button {
    padding: 7px 9px;
    border: 1px solid #dce8dd;
    border-radius: 999px;
    color: var(--chat-green);
    background: #f8fbf8;
    font-size: 10px;
    font-weight: 650;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.chat-suggestions button:hover {
    border-color: #b6cfb9;
    background: #eff6ef;
}

.chat-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
}

.chat-form input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 13px;
    border: 1px solid #dce5dd;
    border-radius: 999px;
    outline: 0;
    color: var(--chat-ink);
    background: #fff;
    font: inherit;
    font-size: 12px;
}

.chat-form input:focus {
    border-color: #72977b;
    box-shadow: 0 0 0 3px rgba(40, 99, 77, .11);
}

.chat-form button {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--chat-accent);
    cursor: pointer;
    transition: background .15s ease;
}

.chat-form button:hover {
    background: var(--chat-green);
}

.chat-form button:disabled {
    opacity: .55;
    cursor: wait;
}

.chat-disclaimer {
    margin: 0;
    padding: 0 12px 10px;
    color: #87928b;
    background: #fff;
    font-size: 9px;
    text-align: center;
}

.property-chatbot.is-loading .chat-heading small::after {
    content: " · searching";
}

@media (max-width: 480px) {
    .property-chatbot {
        right: 12px;
        bottom: 12px;
    }

    .chat-panel {
        right: -2px;
        bottom: 65px;
        width: min(390px, calc(100vw - 24px));
        height: min(560px, calc(100vh - 95px));
    }

    .chat-launcher {
        min-height: 50px;
        padding: 0 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-panel,
    .chat-launcher,
    .chat-result {
        animation: none;
        transition: none;
    }
}
