
.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;
}



/* Voice input and spoken AI response controls. */
.ai-voice-button {
    display: inline-flex !important;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px !important;
    margin: 0 6px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #252a32 !important;
    box-shadow: none !important;
    cursor: pointer;
}
.ai-voice-button svg { width: 21px; height: 21px; fill: currentColor; }
.ai-voice-button.is-recording { color: #c62828 !important; border-color: #c62828 !important; }
.ai-voice-status {
    position: absolute;
    left: 22px;
    bottom: -20px;
    z-index: 5;
    color: #666;
    font: 12px/1.3 Inter, sans-serif;
}
.ai-chat-input, .ai-search-box { position: relative; }
.ai-message-listen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    margin-top: 8px;
    padding: 4px 10px;
    border: 1px solid #e1e4e8;
    border-radius: 999px;
    background: #fff;
    color: #333;
    font: 500 12px/1.2 Inter, sans-serif;
    cursor: pointer;
}
.ai-message-listen:disabled { opacity: .6; cursor: wait; }


/* Mobile AI search bar: fit the microphone and Buy/Rent selector inside the bar. */
@media (max-width: 500px) {
    .ai-search-box {
        box-sizing: border-box;
        min-width: 0;
        padding-left: 16px !important;
        padding-right: 8px !important;
        gap: 0;
    }
    .ai-search-box > input#aiInput {
        min-width: 0;
        width: 0;
        flex: 1 1 0%;
        padding-left: 7px !important;
        padding-right: 2px !important;
    }
    .ai-search-box > .ai-voice-button {
        flex: 0 0 30px;
        width: 30px;
        height: 36px !important;
        margin: 0 2px !important;
    }
    .ai-search-box > .ai-voice-button svg {
        width: 19px;
        height: 19px;
    }
    .ai-search-box > .ai-search-type {
        flex: 0 0 auto;
    }
    .ai-search-box > .ai-search-type > button {
        height: 42px;
        padding: 0 9px;
        gap: 2px;
        font-size: 13px;
        white-space: nowrap;
    }
    .ai-search-box > .ai-search-type > button .material-symbols-outlined {
        font-size: 17px;
    }
}


/* Keep voice controls free of inherited dark button fills. */
.ai-search-box .ai-voice-button,
.ai-chat-input .ai-voice-button,
.ai-voice-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    filter: none !important;
}
.ai-search-box .ai-voice-button:hover,
.ai-search-box .ai-voice-button:focus,
.ai-chat-input .ai-voice-button:hover,
.ai-chat-input .ai-voice-button:focus,
.ai-voice-button:hover,
.ai-voice-button:focus {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
.ai-voice-button svg { display: block; }
.ai-message-listen svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* Compact inline audio action, sized to sit on the reply's final line. */
.ai-message-listen {
    display: inline-flex;
    vertical-align: -0.2em;
    align-items: center;
    justify-content: center;
    width: 1.55em;
    height: 1.55em;
    min-height: 0;
    margin: 0 0 0 0.35em;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f2f4;
    color: #343941;
    line-height: 1;
    cursor: pointer;
}
.ai-message-listen:hover,
.ai-message-listen:focus-visible { background: #e7e9ed; }
.ai-message-listen svg {
    display: block;
    width: 0.9em;
    height: 0.9em;
    flex: 0 0 0.9em;
}


/* Follow-up card opens the full filtered map search from AI results. */
.ai-map-search-message { width: 100%; }
.ai-map-search-card {
    display: flex;
    align-items: center;
    gap: 13px;
    width: min(100%, 560px);
    box-sizing: border-box;
    margin: 2px 0 10px;
    padding: 15px 17px;
    border: 1px solid #e4e7eb;
    border-radius: 15px;
    background: #fff;
    color: #17191c;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(16, 24, 40, .045);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.ai-map-search-card:hover {
    border-color: #c7cdd4;
    box-shadow: 0 7px 20px rgba(16, 24, 40, .09);
    transform: translateY(-1px);
}
.ai-map-search-icon {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f3f5;
    color: #252b32;
}
.ai-map-search-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ai-map-search-copy { display: flex; flex: 1 1 auto; min-width: 0; flex-direction: column; gap: 4px; }
.ai-map-search-copy strong { font-size: 14px; font-weight: 600; line-height: 1.35; }
.ai-map-search-copy small { color: #737b86; font-size: 12px; line-height: 1.4; }
.ai-map-search-arrow { flex: 0 0 auto; color: #69717c; font-size: 20px; }
@media (max-width: 600px) {
    .ai-map-search-card { gap: 10px; padding: 13px; border-radius: 13px; }
    .ai-map-search-icon { flex-basis: 36px; width: 36px; height: 36px; }
    .ai-map-search-copy strong { font-size: 13px; }
    .ai-map-search-copy small { font-size: 11px; }
}
