:root {
    --chat-bg-start: #f3efe8;
    --chat-bg-end: #ece7de;
    --chat-panel: #f9f6ef;
    --chat-border: #cfc6b8;
    --chat-text: #1e1b18;
    --chat-muted: #6f675e;
    --chat-primary: #c44f23;
    --chat-primary-soft: #f7ebdf;
    --chat-accent: #2b9a53;
    --chat-user: #c44f23;
    --chat-assistant: #ffffff;
    --chat-error: #b42318;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--chat-bg-start), var(--chat-bg-end));
    color: var(--chat-text);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.chat-page .card {
    background: var(--chat-panel);
    border: 1px solid var(--chat-border) !important;
    box-shadow: 0 16px 46px rgba(57, 44, 31, 0.09) !important;
}

.chat-shell {
    width: 100%;
    max-width: 600px;
    transition: all 0.3s ease;
}

.chat-header {
    background: linear-gradient(90deg, #f8f4ec, #f3ede2);
}

.chat-kicker {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.26em;
    color: #b74a1f;
    text-transform: uppercase;
}

.chat-brand {
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1;
    font-family: "Bodoni Moda", "Times New Roman", serif;
    font-weight: 700;
}

.chat-brand span {
    color: var(--chat-primary);
}

.chat-status {
    font-size: 0.8rem;
    color: #4c8d56;
    font-weight: 600;
}

.chat-window {
    min-height: 62vh;
    max-height: 62vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
}

.chat-message {
    border-radius: 0.75rem;
    padding: 0.75rem 0.95rem;
    max-width: 86%;
    border: 1px solid var(--chat-border);
    line-height: 1.45;
    box-shadow: 0 1px 1px rgba(32, 22, 12, 0.05);
}

.chat-message.user {
    margin-left: auto;
    background: var(--chat-user);
    color: #fff;
    border-bottom-right-radius: 0.35rem;
}

.chat-message.assistant {
    margin-right: auto;
    background: var(--chat-assistant);
    border-bottom-left-radius: 0.35rem;
}

.chat-message.streaming {
    border-color: #99a8e5;
}

.chat-stream-indicator {
    display: inline-flex;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

.chat-stream-indicator i {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: #8c97bf;
    display: inline-block;
    animation: chat-dot 1.1s infinite ease-in-out;
}

.chat-stream-indicator i:nth-child(2) {
    animation-delay: 0.16s;
}

.chat-stream-indicator i:nth-child(3) {
    animation-delay: 0.32s;
}

.chat-message.is-error {
    border-color: #ef9a9a;
}

.chat-message pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
}

.chat-message-content h3 {
    margin: 0.35rem 0 0.45rem;
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 700;
}

.chat-system-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--chat-muted);
}

.chat-system-note.is-error {
    color: var(--chat-error);
    font-weight: 600;
}

.chat-action-box {
    margin-top: 0.25rem;
    margin-right: auto;
    max-width: 86%;
    border: 1px dashed #c8b8a6;
    background: #fffaf2;
    border-radius: 0.75rem;
    padding: 0.75rem;
    display: grid;
    gap: 0.55rem;
}

.chat-action-title {
    margin: 0;
    font-size: 0.9rem;
    color: #5e5245;
}

.chat-action-buttons {
    display: flex;
    gap: 0.5rem;
}

.chat-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(249, 245, 238, 0.7);
    z-index: 5;
}

.chat-loader.active {
    display: flex;
}

.chat-loader::after {
    content: '';
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    border: 3px solid #dfd5c8;
    border-top-color: var(--chat-primary);
    animation: chat-spin 0.85s linear infinite;
}

@keyframes chat-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes chat-dot {
    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.35;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-form .form-control:focus {
    border-color: #d17c57;
    box-shadow: 0 0 0 0.2rem rgba(196, 79, 35, 0.16);
}

.chat-form .btn-primary {
    background-color: var(--chat-primary);
    border-color: var(--chat-primary);
}

.chat-form .btn-primary:hover {
    background-color: #aa411a;
    border-color: #aa411a;
}

.chat-form {
    background: #f3eee4;
}

.chat-form .form-control {
    border-color: #cec4b7;
    background: #fffdf9;
}

.chat-container {
    display: flex;
    gap: 2.5rem;
    transition: all 0.3s ease;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
}

.chat-container.has-results .chat-shell {
    margin-right: 0;
}

.search-results-sidebar {
    flex: 1;
    min-width: 450px;
    max-width: 1000px;
    display: none;
    flex-direction: column;
    padding: 2rem;
    background: #fdfdfd;
    border-left: 1px solid #f0f0f0;
    height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
}

.chat-container.has-results .search-results-sidebar {
    display: flex;
}

.search-summary-box {
    padding: 0 0 1.5rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.search-summary-box h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a0aec0;
    margin-bottom: 0.75rem;
}

.search-criteria-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    padding: 0.4rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    width: auto;
    transition: all 0.2s ease;
}

.pill:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.results-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* FORCING 2 COLUMNS */
    gap: 1.5rem;
    margin-top: 1rem;
}

.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    border: 1px solid #f2f2f2;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.property-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background-size: cover;
    background-position: center;
    background-color: #fafafa;
}

.property-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.property-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: #1a202c;
    margin: 0;
}

.property-price {
    font-weight: 800;
    font-size: 1.15rem;
    color: #e53e3e; /* Clear red */
    white-space: nowrap;
}

.property-location {
    font-size: 0.9rem;
    color: #718096;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;
    line-height: 1.4;
}

.property-location svg {
    margin-top: 3px;
    flex-shrink: 0;
    color: #cbd5e0;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1100px) {
    .chat-container {
        flex-direction: column;
    }
    .chat-container.has-results .chat-shell {
        max-width: 100%;
    }
    .search-results-sidebar {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .chat-window {
        min-height: 56vh;
        max-height: 56vh;
        padding: 1rem !important;
    }

    .chat-brand {
        font-size: 24px;
    }

    .chat-header {
        align-items: flex-start !important;
        gap: 8px;
    }

    .chat-header > div:last-child {
        align-items: flex-start !important;
    }
}
