/* RentHome Chat Widget */
#rh-chat-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
    -webkit-user-select: none;
    user-select: none;
    font-size: 22px;
}

#rh-chat-box {
    position: fixed;
    right: 18px;
    bottom: 86px;
    width: 360px;
    max-width: calc(100vw - 36px);
    height: min(520px, 75vh);
    /* Responsive height */
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 14px 46px rgba(0, 0, 0, .26);
    z-index: 9999;
    overflow: hidden;
    display: none;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#rh-chat-header {
    padding: 12px 14px;
    font-weight: 700;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    /* Fixed height for calc */
}

#rh-chat-close {
    cursor: pointer;
    opacity: .7;
}

#rh-chat-close:hover {
    opacity: 1;
}

#rh-chat-log {
    padding: 12px;
    height: calc(100% - 110px);
    /* Subtract header and inputbar approx heights */
    overflow-y: auto;
    background: #fafafa;
}

.rh-msg {
    display: flex;
    margin-bottom: 10px;
}

.rh-bubble {
    max-width: 84%;
    padding: 10px 12px;
    border-radius: 14px;
    white-space: pre-wrap;
    line-height: 1.25;
    font-size: 14px;
}

.rh-ai {
    justify-content: flex-start;
}

.rh-ai .rh-bubble {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    color: #111827;
}

.rh-user {
    justify-content: flex-end;
}

.rh-user .rh-bubble {
    background: #111827;
    color: #fff;
}

#rh-chat-inputbar {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(0, 0, 0, .08);
    height: 60px;
    /* Fixed height for calc */
}

#rh-chat-input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
}

#rh-chat-send {
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    background: #111827;
    color: #fff;
    cursor: pointer;
}

#rh-chat-send:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.rh-choices {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.rh-choice {
    border: 1px solid rgba(0, 0, 0, .12);
    background: #fff;
    border-radius: 999px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
}

.rh-choice:hover {
    background: #f3f4f6;
}

.rh-note {
    font-size: 12px;
    opacity: .75;
    margin-top: 8px;
}