:root {
    color-scheme: light dark;
    --bg: #0e1117;
    --surface: #161b26;
    --surface-secondary: #1f2635;
    --accent: #f97316;
    --accent-soft: rgba(249, 115, 22, 0.16);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.18);
    --card-bg: rgba(15, 23, 42, 0.6);
    --shadow: 0 24px 48px rgba(15, 23, 42, 0.45);
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --transition: 200ms ease;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top right, rgba(249, 115, 22, 0.15), transparent 40%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.chat-shell {
    width: min(1100px, 100vw);
    background: rgba(15, 23, 42, 0.72);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr auto;
    backdrop-filter: blur(14px);
}

.chat-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.chat-header .badge {
    height: 48px;
    width: 48px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.9), rgba(249, 115, 22, 0.6));
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 18px;
    color: #0b1120;
}

.chat-header h1 {
    font-size: 26px;
    margin: 0;
    line-height: 1.2;
}

.chat-header p {
    margin: 4px 0 0;
    color: var(--text-muted);
}

.chat-log {
    padding: 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fade-in var(--transition);
}

.message .avatar {
    height: 44px;
    width: 44px;
    border-radius: 12px;
    background: var(--surface-secondary);
    display: grid;
    place-items: center;
    font-weight: 600;
    color: var(--accent);
}

.message.user .avatar {
    background: rgba(249, 115, 22, 0.15);
    color: var(--text);
}

.message .bubble {
    background: var(--surface-secondary);
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.message.user .bubble {
    background: var(--accent-soft);
    border-color: rgba(249, 115, 22, 0.35);
}

.cards-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.property-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.25);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.4);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 50px rgba(15, 23, 42, 0.5);
}

.property-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.property-card .card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.property-card h3 {
    margin: 0;
    font-size: 20px;
}

.property-card .subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.property-card .price-badge {
    display: inline-block;
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.22), rgba(249, 115, 22, 0.10));
    border: 1px solid rgba(249, 115, 22, 0.45);
    color: #f97316;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.property-card p {
    margin: 0;
    line-height: 1.5;
    color: rgba(226, 232, 240, 0.92);
}

.property-card .actions {
    margin-top: auto;
}

.property-card a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: rgba(249, 115, 22, 0.18);
    color: #f8fafc;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition);
}

.property-card a:hover {
    background: rgba(249, 115, 22, 0.3);
}

.load-more-btn {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 12px;
    background: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.load-more-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
}

.chat-footer {
    padding: 20px 24px 24px;
    border-top: 1px solid var(--border);
}

.input-bar {
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
}

.input-bar textarea {
    flex: 1;
    resize: none;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    max-height: 140px;
}

.input-bar textarea:focus {
    outline: none;
}

.input-bar button {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.9), rgba(249, 115, 22, 0.7));
    border: none;
    color: #0b1120;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 12px 20px rgba(249, 115, 22, 0.25);
}

.input-bar button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.input-bar button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 30px rgba(249, 115, 22, 0.35);
}

.typing-indicator {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: var(--text-muted);
    letter-spacing: 2px;
    font-size: 12px;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 16px;
        background: var(--bg);
    }

    .chat-shell {
        height: 100vh;
        width: 100vw;
        border-radius: 0;
    }

    .chat-header {
        padding: 20px 20px 12px;
    }

    .chat-log {
        padding: 20px;
    }

    .chat-footer {
        padding: 16px;
    }
}