
.ai-message-text p {
    margin: 0 0 12px;
}

.ai-message-text p:last-child {
    margin-bottom: 0;
}

.ai-message-text strong {
    font-weight: 700;
}

.ai-message-text ol,
.ai-message-text ul {
    margin: 10px 0 12px 22px;
    padding: 0;
}

.ai-message-text li {
    margin: 5px 0;
}

.ai-message-text h2,
.ai-message-text h3,
.ai-message-text h4 {
    margin: 14px 0 8px;
    font-weight: 700;
}

.ai-message-text h2:first-child,
.ai-message-text h3:first-child,
.ai-message-text h4:first-child {
    margin-top: 0;
}

.ai-message-text {
    line-height: 1.6;
}

.ai-message-text p {
    margin: 0 0 12px;
}

.ai-message-text p:last-child {
    margin-bottom: 0;
}

.ai-message-text strong {
    font-weight: 700;
}

.ai-message-text em {
    font-style: italic;
}

.ai-message-text ul,
.ai-message-text ol {
    margin: 8px 0 14px 22px;
    padding: 0;
}

.ai-message-text li {
    margin: 5px 0;
}

.ai-message-text h1,
.ai-message-text h2,
.ai-message-text h3 {
    margin: 14px 0 8px;
    line-height: 1.3;
}

.ai-message-text h1 {
    font-size: 1.35em;
}

.ai-message-text h2 {
    font-size: 1.2em;
}

.ai-message-text h3 {
    font-size: 1.1em;
}

.ai-message-text blockquote {
    margin: 10px 0;
    padding-left: 12px;
    border-left: 3px solid #ccc;
}

.ai-message-text code {
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
}

.ai-message-text pre {
    overflow-x: auto;
    padding: 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.06);
}

.ai-message-text pre code {
    padding: 0;
    background: transparent;
}

.ai-message-text a {
    text-decoration: underline;
}


.ai-message-text {
    line-height: 1.65;
    font-size: inherit;
    color: inherit;
}

.ai-message-text p {
    margin: 0 0 12px;
}

.ai-message-text p:last-child {
    margin-bottom: 0;
}

.ai-message-text strong {
    font-weight: 700;
}

.ai-message-text em {
    font-style: italic;
}

.ai-message-text ol,
.ai-message-text ul {
    margin: 8px 0 14px 24px;
    padding-left: 18px;
}

.ai-message-text ol {
    list-style-type: decimal;
}

.ai-message-text ul {
    list-style-type: disc;
}

.ai-message-text li {
    margin: 6px 0;
    padding-left: 3px;
}

.ai-message-text h1,
.ai-message-text h2,
.ai-message-text h3 {
    font-weight: 700;
    margin: 14px 0 8px;
    line-height: 1.3;
}

.ai-message-text h1 {
    font-size: 1.35em;
}

.ai-message-text h2 {
    font-size: 1.2em;
}

.ai-message-text h3 {
    font-size: 1.1em;
}

.ai-message-text code {
    font-family: monospace;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .07);
}


/* =========================================================
   AI CHAT MARKDOWN RESPONSE STYLING
   ========================================================= */

.ai-message-text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: normal;
    line-height: 1.6;
}

.ai-message-text p {
    display: block;
    margin: 0 0 12px;
}

.ai-message-text p:last-child {
    margin-bottom: 0;
}

.ai-message-text strong {
    font-weight: 700;
}

.ai-message-text em {
    font-style: italic;
}

.ai-message-text ol,
.ai-message-text ul {
    display: block;
    margin: 8px 0 14px 24px;
    padding-left: 18px;
}

.ai-message-text ol {
    list-style-type: decimal !important;
}

.ai-message-text ul {
    list-style-type: disc !important;
}

.ai-message-text li {
    display: list-item !important;
    margin: 5px 0;
    padding-left: 3px;
}

.ai-message-text h1,
.ai-message-text h2,
.ai-message-text h3 {
    display: block;
    font-weight: 700;
    line-height: 1.3;
    margin: 14px 0 8px;
}

.ai-message-text h1 {
    font-size: 1.35em;
}

.ai-message-text h2 {
    font-size: 1.2em;
}

.ai-message-text h3 {
    font-size: 1.1em;
}

.ai-message-text code {
    font-family: monospace;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.07);
}

.ai-message-text a {
    text-decoration: underline;
}


/* =========================================================
   AI CHAT MARKDOWN
   ========================================================= */

.ai-message-text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;

    white-space: normal;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: normal;
}

.ai-message-text p {
    display: block;
    margin: 0 0 12px;
}

.ai-message-text p:last-child {
    margin-bottom: 0;
}

.ai-message-text strong,
.ai-message-text b {
    font-weight: 700;
}

.ai-message-text em,
.ai-message-text i {
    font-style: italic;
}

.ai-message-text ul,
.ai-message-text ol {
    display: block;

    margin-top: 8px;
    margin-bottom: 14px;

    padding-left: 24px;
}

.ai-message-text ul {
    list-style-type: disc;
}

.ai-message-text ol {
    list-style-type: decimal;
}

.ai-message-text li {
    display: list-item;
    margin: 5px 0;
    padding-left: 3px;
}

.ai-message-text li > p {
    margin: 0;
}

.ai-message-text h1,
.ai-message-text h2,
.ai-message-text h3,
.ai-message-text h4 {
    display: block;
    margin: 16px 0 8px;
    line-height: 1.3;
}

.ai-message-text h1 {
    font-size: 1.35em;
}

.ai-message-text h2 {
    font-size: 1.2em;
}

.ai-message-text h3 {
    font-size: 1.1em;
}

.ai-message-text blockquote {
    margin: 10px 0;
    padding: 8px 12px;
    border-left: 3px solid rgba(0,0,0,.2);
}

.ai-message-text code {
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0,0,0,.06);
    font-size: .9em;
}

.ai-message-text pre {
    display: block;
    margin: 12px 0;
    padding: 12px;
    overflow-x: auto;
    border-radius: 8px;
    background: rgba(0,0,0,.06);
}

.ai-message-text pre code {
    padding: 0;
    background: transparent;
}

.ai-message-text a {
    text-decoration: underline;
}

.ai-message-text hr {
    margin: 14px 0;
    border: 0;
    border-top: 1px solid rgba(0,0,0,.12);
}


/* =========================================================
   AI CHAT MARKDOWN
   ========================================================= */

.ai-message-text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;

    white-space: normal;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: normal;
}

.ai-message-text p {
    display: block;
    margin: 0 0 12px;
}

.ai-message-text p:last-child {
    margin-bottom: 0;
}

.ai-message-text strong,
.ai-message-text b {
    font-weight: 700;
}

.ai-message-text em,
.ai-message-text i {
    font-style: italic;
}

.ai-message-text ul,
.ai-message-text ol {
    display: block;

    margin-top: 8px;
    margin-bottom: 14px;

    padding-left: 24px;
}

.ai-message-text ul {
    list-style-type: disc;
}

.ai-message-text ol {
    list-style-type: decimal;
}

.ai-message-text li {
    display: list-item;
    margin: 5px 0;
    padding-left: 3px;
}

.ai-message-text li > p {
    margin: 0;
}

.ai-message-text h1,
.ai-message-text h2,
.ai-message-text h3,
.ai-message-text h4 {
    display: block;
    margin: 16px 0 8px;
    line-height: 1.3;
}

.ai-message-text h1 {
    font-size: 1.35em;
}

.ai-message-text h2 {
    font-size: 1.2em;
}

.ai-message-text h3 {
    font-size: 1.1em;
}

.ai-message-text blockquote {
    margin: 10px 0;
    padding: 8px 12px;
    border-left: 3px solid rgba(0,0,0,.2);
}

.ai-message-text code {
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0,0,0,.06);
    font-size: .9em;
}

.ai-message-text pre {
    display: block;
    margin: 12px 0;
    padding: 12px;
    overflow-x: auto;
    border-radius: 8px;
    background: rgba(0,0,0,.06);
}

.ai-message-text pre code {
    padding: 0;
    background: transparent;
}

.ai-message-text a {
    text-decoration: underline;
}

.ai-message-text hr {
    margin: 14px 0;
    border: 0;
    border-top: 1px solid rgba(0,0,0,.12);
}


/* =========================================================
   FINAL AI CHAT MARKDOWN STYLES
   2026-09-18
   ========================================================= */

.ai-search-hero.chat-mode .ai-message-text,
.ai-message-text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: normal !important;
    line-height: 1.65 !important;
    font-size: 16px !important;
    color: inherit !important;
}

/* Paragraphs */
.ai-search-hero.chat-mode .ai-message-text p,
.ai-message-text p {
    display: block !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
}

.ai-search-hero.chat-mode .ai-message-text p:last-child,
.ai-message-text p:last-child {
    margin-bottom: 0 !important;
}

/* Bold / italic */
.ai-message-text strong,
.ai-message-text b {
    font-weight: 700 !important;
}

.ai-message-text em,
.ai-message-text i {
    font-style: italic !important;
}

/* Lists */
.ai-message-text ul,
.ai-message-text ol {
    display: block !important;
    margin: 10px 0 16px 0 !important;
    padding-left: 28px !important;
}

.ai-message-text ul {
    list-style-type: disc !important;
}

.ai-message-text ol {
    list-style-type: decimal !important;
}

.ai-message-text li {
    display: list-item !important;
    margin: 6px 0 !important;
    padding-left: 3px !important;
}

.ai-message-text li > p {
    margin: 0 !important;
}

/* Headings */
.ai-message-text h1,
.ai-message-text h2,
.ai-message-text h3,
.ai-message-text h4 {
    display: block !important;
    margin: 18px 0 9px !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
}

.ai-message-text h1 {
    font-size: 1.45em !important;
}

.ai-message-text h2 {
    font-size: 1.3em !important;
}

.ai-message-text h3 {
    font-size: 1.15em !important;
}

/* Links */
.ai-message-text a {
    text-decoration: underline !important;
    font-weight: 600 !important;
}

/* Quotes */
.ai-message-text blockquote {
    display: block !important;
    margin: 12px 0 !important;
    padding: 8px 14px !important;
    border-left: 3px solid currentColor !important;
    opacity: .85;
}

/* Inline code */
.ai-message-text code {
    font-family: monospace !important;
    font-size: .9em !important;
    padding: 2px 5px !important;
    border-radius: 4px !important;
    background: rgba(0,0,0,.07) !important;
}

/* Code blocks */
.ai-message-text pre {
    display: block !important;
    overflow-x: auto !important;
    margin: 12px 0 !important;
    padding: 12px !important;
    border-radius: 8px !important;
    background: rgba(0,0,0,.07) !important;
}

.ai-message-text pre code {
    padding: 0 !important;
    background: transparent !important;
}

/* Horizontal rule */
.ai-message-text hr {
    margin: 16px 0 !important;
    border: 0 !important;
    border-top: 1px solid rgba(0,0,0,.15) !important;
}

/* Prevent empty markdown elements from creating weird blank responses */
.ai-message-text > :empty {
    display: none !important;
}


/* =========================================================
   FINAL AI CHAT MARKDOWN STYLES
   ========================================================= */

.ai-message-text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: normal !important;
    line-height: 1.65 !important;
    font-size: inherit !important;
    color: inherit !important;
}

.ai-message-text p {
    display: block !important;
    margin: 0 0 12px !important;
}

.ai-message-text p:last-child {
    margin-bottom: 0 !important;
}

.ai-message-text strong,
.ai-message-text b {
    font-weight: 700 !important;
}

.ai-message-text em,
.ai-message-text i {
    font-style: italic !important;
}

.ai-message-text h1,
.ai-message-text h2,
.ai-message-text h3,
.ai-message-text h4 {
    display: block !important;
    margin: 18px 0 10px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.ai-message-text h1 {
    font-size: 1.35em !important;
}

.ai-message-text h2 {
    font-size: 1.2em !important;
}

.ai-message-text h3 {
    font-size: 1.1em !important;
}

.ai-message-text ul,
.ai-message-text ol {
    display: block !important;
    margin: 10px 0 14px 24px !important;
    padding-left: 20px !important;
}

.ai-message-text ul {
    list-style-type: disc !important;
}

.ai-message-text ol {
    list-style-type: decimal !important;
}

.ai-message-text li {
    display: list-item !important;
    margin: 5px 0 !important;
    padding-left: 3px !important;
}

.ai-message-text li > p {
    display: inline !important;
    margin: 0 !important;
}

.ai-message-text blockquote {
    display: block !important;
    margin: 12px 0 !important;
    padding: 8px 14px !important;
    border-left: 3px solid currentColor !important;
    opacity: .8 !important;
}

.ai-message-text code {
    font-family: monospace !important;
    padding: 2px 5px !important;
    border-radius: 4px !important;
    background: rgba(0,0,0,.06) !important;
}

.ai-message-text pre {
    display: block !important;
    overflow-x: auto !important;
    margin: 12px 0 !important;
    padding: 12px !important;
    border-radius: 8px !important;
    background: rgba(0,0,0,.06) !important;
}

.ai-message-text pre code {
    padding: 0 !important;
    background: transparent !important;
}

.ai-message-text a {
    text-decoration: underline !important;
}

.ai-message-text hr {
    margin: 16px 0 !important;
    border: 0 !important;
    border-top: 1px solid currentColor !important;
    opacity: .2 !important;
}

/* =========================================================
   AI CHAT PROPERTY LISTING CAROUSEL
   ========================================================= */

.ai-listings-message {
    width: 100%;
}

.ai-listings {
    position: relative;
    width: 100%;
    margin-top: 12px;
}

.ai-listings-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc(
        (100% - 20px) / 3
    );

    gap: 10px;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 2px 2px 12px;

    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;

    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ai-listings-track::-webkit-scrollbar {
    display: none;
}


/* =========================================================
   PROPERTY CARD
   ========================================================= */

.ai-listing-card {
    min-width: 0;
    width: 100%;

    overflow: hidden;

    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 14px;

    background: #fff;

    cursor: pointer;

    scroll-snap-align: start;

    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.ai-listing-card:hover {
    transform: translateY(-2px);

    border-color: rgba(0, 0, 0, 0.16);

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.10);
}

.ai-listing-card:active {
    transform: translateY(0);
}


/* =========================================================
   PROPERTY IMAGE
   ========================================================= */

.ai-listing-image {
    display: block;

    width: 100%;
    height: 190px;

    object-fit: cover;

    background: #f1f1f1;
}

.ai-listing-image-empty {
    display: flex;

    align-items: center;
    justify-content: center;

    color: #777;

    font-size: 12px;
}


/* =========================================================
   PROPERTY INFO
   ========================================================= */

.ai-listing-info {
    min-width: 0;

    padding: 13px 14px 15px;
}

.ai-listing-price {
    margin-bottom: 4px;

    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.ai-listing-address {
    overflow: hidden;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-listing-location {
    margin-top: 3px;

    color: #666;

    font-size: 12px;
}

.ai-listing-details {
    margin-top: 8px;

    color: #555;

    font-size: 12px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .ai-listings-track {
        grid-auto-columns: calc(
            (100% - 10px) / 2
        );
    }

    .ai-listing-image {
        height: 175px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .ai-listings-track {
        /*
         * Approximately 1.5 cards visible.
         * The next card intentionally peeks into view.
         */
        grid-auto-columns: 66.6667%;

        gap: 10px;

        padding-left: 2px;
        padding-right: 18%;
    }

    .ai-listing-image {
        height: 170px;
    }

    .ai-listing-info {
        padding: 12px;
    }

    .ai-listing-price {
        font-size: 17px;
    }

    .ai-listing-address {
        font-size: 13px;
    }

}

/* =========================================================
   AI SEARCH -> CHAT TRANSITION
   ========================================================= */

.ai-chat {
    display: none;
}

.ai-chat.is-active {
    display: block;
}

.ai-search-hero.ai-search-complete .ai-search-box {
    display: none;
}


/* =========================================================
   FINAL AI SEARCH -> CHAT VISIBILITY OVERRIDE
   ========================================================= */

.ai-search-hero.ai-search-complete .ai-search-box {
    display: none !important;
}

.ai-search-hero .ai-chat {
    display: none;
}

.ai-search-hero .ai-chat.is-active {
    display: block !important;
}

/* =========================================================
   AI PROPERTY CAROUSEL — POLISHED LAYER
   ========================================================= */

.ai-listings-message {
    width: 100%;
    max-width: 100%;
}

.ai-listings {
    width: 100%;
    margin-top: 10px;
}

.ai-listings-track {
    display: flex;
    gap: 14px;

    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 4px 4px 14px;

    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
}

.ai-listings-track::-webkit-scrollbar {
    display: none;
}

.ai-listing-card {
    position: relative;

    flex: 0 0 calc((100% - 28px) / 3);

    min-width: 0;

    overflow: hidden;

    border: 1px solid rgba(20, 24, 32, 0.10);
    border-radius: 18px;

    background: #fff;

    box-shadow:
        0 2px 8px rgba(20, 24, 32, 0.05);

    cursor: pointer;

    scroll-snap-align: start;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.ai-listing-card:hover {
    transform: translateY(-3px);

    border-color: rgba(20, 24, 32, 0.16);

    box-shadow:
        0 10px 28px rgba(20, 24, 32, 0.12);
}

.ai-listing-card:active {
    transform: translateY(-1px);
}

.ai-listing-media {
    position: relative;

    width: 100%;
    height: 190px;

    overflow: hidden;

    background: #eef0f2;
}

.ai-listing-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    background: #eef0f2;
}

.ai-listing-image-empty {
    display: flex;

    align-items: center;
    justify-content: center;

    color: #777;

    font-size: 13px;
}

.ai-listing-photo-label {
    position: absolute;

    left: 10px;
    bottom: 10px;

    padding: 6px 9px;

    border-radius: 999px;

    background: rgba(0, 0, 0, 0.62);
    color: #fff;

    font-size: 11px;
    font-weight: 600;

    backdrop-filter: blur(5px);
}

.ai-listing-info {
    min-width: 0;

    padding: 15px 15px 16px;
}

.ai-listing-price {
    margin-bottom: 6px;

    color: #15171a;

    font-size: 20px;
    font-weight: 750;
    line-height: 1.15;
}

.ai-listing-address {
    overflow: hidden;

    color: #202328;

    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-listing-location {
    margin-top: 3px;

    overflow: hidden;

    color: #70757b;

    font-size: 12px;
    line-height: 1.3;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-listing-details {
    margin-top: 10px;

    color: #4f555b;

    font-size: 12px;
    font-weight: 550;
    line-height: 1.35;
}

.ai-listing-action {
    display: inline-flex;

    margin-top: 13px;

    padding: 7px 11px;

    border-radius: 999px;

    background: #f2f3f5;
    color: #22262b;

    font-size: 11px;
    font-weight: 650;
}

.ai-listing-card:hover .ai-listing-action {
    background: #e9ebee;
}

/* Tablet */

@media (max-width: 900px) {

    .ai-listing-card {
        flex-basis: calc((100% - 14px) / 2);
    }

    .ai-listing-media {
        height: 180px;
    }
}

/* Mobile */

@media (max-width: 600px) {

    .ai-listings-track {
        gap: 12px;

        padding-left: 2px;
        padding-right: 22%;
    }

    .ai-listing-card {
        flex-basis: 78%;
    }

    .ai-listing-media {
        height: 180px;
    }

    .ai-listing-info {
        padding: 13px;
    }

    .ai-listing-price {
        font-size: 18px;
    }
}


/* =========================================================
   FINAL AI PROPERTY CAROUSEL OVERRIDE
   Keep property cards HORIZONTAL — never stack vertically.
   ========================================================= */

.ai-listings {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.ai-listings-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;

    width: 100% !important;
    max-width: 100% !important;

    gap: 14px !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    padding: 4px 4px 14px !important;

    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
}

.ai-listings-track::-webkit-scrollbar {
    display: none;
}

.ai-listing-card {
    display: block !important;

    flex: 0 0 calc((100% - 28px) / 3) !important;

    width: auto !important;
    min-width: 0 !important;

    scroll-snap-align: start;
}

@media (max-width: 900px) {

    .ai-listing-card {
        flex: 0 0 calc((100% - 14px) / 2) !important;
    }
}

@media (max-width: 600px) {

    .ai-listings-track {
        gap: 12px !important;
        padding-left: 2px !important;
        padding-right: 22% !important;
    }

    .ai-listing-card {
        flex: 0 0 78% !important;
    }
}

/* =========================================================
   FINAL CAROUSEL SCROLLBAR HIDE
   ========================================================= */

.ai-listings-track {
    overflow-x: auto !important;
    overflow-y: hidden !important;

    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.ai-listings-track::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

