﻿body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f172a;
    color: #e5e7eb;
}

.app {
    max-width: 600px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #1f2937;
}

    .header h1 {
        margin: 0;
        font-size: 1.3rem;
    }

    .header p {
        margin: 0.25rem 0 0;
        font-size: 0.8rem;
        color: #9ca3af;
    }

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.msg-row {
    display: flex;
}

    .msg-row.you {
        justify-content: flex-end;
    }

    .msg-row.bot {
        justify-content: flex-start;
    }

.msg-bubble {
    max-width: 80%;
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.3;
    background: #111827;
    border: 1px solid #1f2937;
}

.msg-row.you .msg-bubble {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.msg-sender {
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    opacity: 0.8;
}

.msg-text {
}

.msg-meta {
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: #9ca3af;
}

.tool-result {
    background: #020617;
    font-size: 0.75rem;
}

    .tool-result pre {
        margin: 0;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

.chat-input {
    border-top: 1px solid #1f2937;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    background: #020617;
}

    .chat-input textarea {
        flex: 1;
        resize: none;
        border-radius: 0.75rem;
        border: 1px solid #374151;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        background: #030712;
        color: #e5e7eb;
    }

        .chat-input textarea:focus {
            outline: none;
            border-color: #2563eb;
        }

    .chat-input button {
        border: none;
        border-radius: 999px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        background: #22c55e;
        color: #020617;
        font-weight: 600;
        cursor: pointer;
    }

        .chat-input button:active {
            transform: translateY(1px);
        }

/* Traffic routes card + map + collapsible JSON */

.traffic-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.traffic-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.25rem;
}

.traffic-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e5e7eb;
}

.traffic-subtitle {
    font-size: 0.7rem;
    color: #9ca3af;
}

.traffic-map {
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #1f2937;
    background: #020617;
    margin-bottom: 0.25rem;
}

/* Map container used by Google Maps */
.traffic-map-inner {
    width: 100%;
    height: 180px;
}

.traffic-map-label {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    border-top: 1px solid #1f2937;
    color: #9ca3af;
}

.traffic-map-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

.traffic-routes-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.traffic-route-item {
    padding: 0.3rem 0.4rem;
    border-radius: 0.4rem;
    background: #020617;
    border: 1px solid #1f2937;
    position: relative;
}

.traffic-route-summary {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.traffic-route-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: #9ca3af;
    align-items: center;
}

.traffic-badge {
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid #374151;
}

/* congestion levels */
.traffic-badge-light {
    border-color: #22c55e;
    color: #bbf7d0;
}

.traffic-badge-moderate {
    border-color: #eab308;
    color: #facc15;
}

.traffic-badge-heavy {
    border-color: #f97316;
    color: #fed7aa;
}

.traffic-badge-severe {
    border-color: #ef4444;
    color: #fecaca;
}

.traffic-badge-unknown {
    border-color: #4b5563;
    color: #9ca3af;
}

.traffic-best-tag {
    position: absolute;
    top: 0.3rem;
    right: 0.4rem;
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: #22c55e1a;
    color: #22c55e;
    border: 1px solid #22c55e33;
}

.traffic-json {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid #1f2937;
    font-size: 0.7rem;
}

.traffic-json-toggle-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.2rem;
}

.traffic-json-toggle {
    border: 1px solid #374151;
    background: #020617;
    color: #9ca3af;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.7rem;
    cursor: pointer;
}

    .traffic-json-toggle:hover {
        border-color: #4b5563;
        color: #e5e7eb;
    }

.traffic-json-content {
    max-height: 150px;
    overflow-y: auto;
    border-radius: 0.4rem;
    background: #020617;
    border: 1px solid #111827;
    padding: 0.3rem 0.4rem;
}

    .traffic-json-content pre {
        margin: 0;
        white-space: pre;
    }
