/* --- GLOBAL RESETS & VARS --- */
:root {
    --theme: 2;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    
    --brand-primary: #1e40af;
    --brand-primary-light: #eff6ff;
    --brand-secondary: #3b82f6;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    
    --accent: #f59e0b;
    --error: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* No page scrollbars */
}

/* --- HEADER --- */
.dashboard-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand-primary);
}

.logo-area .subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.reset-btn {
    background-color: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.mobile-inspect-btn {
    background-color: var(--brand-secondary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: none; /* Desktop hidden, toggled via app.js */
}

.connection-config {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.connection-config input {
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: monospace;
    width: 200px;
    font-size: 0.8rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.status-badge.online {
    background-color: var(--success-light);
    color: var(--success);
}

.status-badge.offline {
    background-color: #fef2f2;
    color: var(--error);
}

/* --- MAIN LAYOUT GRID --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    flex: 1;
    height: calc(100vh - 65px - 45px); /* viewport minus header minus footer */
    overflow: hidden;
    transition: grid-template-columns 0.3s ease;
}



/* --- CHAT PANE --- */
.chat-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background-color: #f1f5f9;
    border-right: 1px solid var(--border-color);
    position: relative;
    overflow: hidden; /* Locked container height to prevent squeezing/stretching */
}

.chat-messages-scroll-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    min-height: 0;
    width: 100%;
}
.chat-messages {
    flex: none; /* Flow naturally inside scroll container */
    overflow-y: visible; /* No scrollbar inside centered container */
    min-height: 0;
    padding: 20px 20px 800px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
}

/* Bubble Styling */
.chat-bubble {
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-size: 0.92rem;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-bubble {
    align-self: flex-end;
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px solid #5c6f8a36;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    color: #5c6c82;
    border-bottom-right-radius: 2px;
    max-width: 60%;
    font-size: 0.85rem;
    line-height: 1.5;
    scroll-margin-top: 1rem;
}
.user-bubble p {
    margin: 0;
    font-size: 0.85rem;
}
.bot-bubble {
    align-self: flex-start;
    background-color: transparent;
    color: var(--text-primary);
    width: 100%;
    max-width: 100%;
    border: none;
    box-shadow: none;
    padding: 0;
}

.system-bubble {
    align-self: center;
    background-color: #f8fafc;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    text-align: center;
    max-width: 90%;
    font-size: 0.85rem;
}

/* Applied Filter Chips */
.filter-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.filter-chip {
    background-color: #f1f5f9;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.filter-chip .chip-label {
    display: inline-block;
    transition: text-decoration 0.15s ease;
}

.filter-chip .chip-action-btn {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.65;
    margin-left: 2px;
    padding: 0 1px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    line-height: 1;
    transition: all 0.15s ease;
}

.filter-chip .chip-action-btn:hover {
    opacity: 1.0;
    transform: scale(1.12);
}
.filter-chip .chip-action-btn.disabled-chip-action,
.filter-chip .chip-action-btn:disabled {
    opacity: 0.25 !important;
    cursor: default !important;
    pointer-events: none !important;
    transform: none !important;
}

/* Marked Deletion / Exclusion State (Red 50 / Red 200 / Red 800) */
.filter-chip.chip-marked-exclusion {
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.12) !important;
}

.filter-chip.chip-marked-exclusion .chip-label {
    text-decoration: line-through !important;
    opacity: 0.55 !important;
}

.filter-chip.chip-marked-exclusion > i {
    opacity: 0.55 !important;
}

.filter-chip.chip-marked-exclusion .chip-action-btn {
    color: #dc2626 !important;
    opacity: 0.65;
}

.filter-chip.chip-marked-exclusion .chip-action-btn:hover {
    opacity: 1.0 !important;
    transform: scale(1.12);
}
.filter-chip.location-chip {
    background-color: hsl(156 59% 94% / 1);
    color: hsl(156 59% 30% / 1);
    border-color: hsl(156 59% 70% / 1);
}

.filter-chip.spec-chip {
    background-color: hsl(200 60% 94% / 1);
    color: hsl(200 60% 30% / 1);
    border-color: hsl(200 60% 70% / 1);
}

.filter-chip.landmark-query-chip {
    background-color: hsl(215 24% 94% / 1);
    color: hsl(215 24% 30% / 1);
    border: 1.5px solid hsl(215 24% 70% / 1);
    border-color: hsl(215 24% 70% / 1);
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(100, 116, 139, 0.1);
}

.filter-chip.commute-target-chip {
    background-color: hsl(24 82% 94% / 1);
    color: hsl(24 82% 30% / 1);
    border: 1.5px solid hsl(24 82% 70% / 1);
    border-color: hsl(24 82% 70% / 1);
    padding: 3px 8px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(100, 116, 139, 0.1);
}

/* --- CHAT INPUT BAR --- */
.chat-input-container {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    box-sizing: border-box;
}

.chat-input-bar textarea {
    flex: 1 1 auto;
    width: 100%;
    height: 44px;
    min-height: 44px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 11px 14px;
    resize: none;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-primary);
    background-color: var(--bg-main, #ffffff);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    display: block;
    margin: 0;
}

.chat-input-bar textarea:focus {
    outline: none;
    border-color: var(--brand-secondary);
}

.send-btn {
    flex: 0 0 auto;
    background-color: var(--brand-secondary);
    color: white;
    border: none;
    padding: 0 20px;
    height: 44px;
    min-width: 44px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box;
}

.send-btn:hover {
    background-color: var(--brand-primary);
    transform: scale(1.02);
}

.send-btn i {
    font-size: 1.15rem;
}

.send-btn:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .send-btn {
        padding: 0;
        width: 44px;
        min-width: 44px;
        height: 44px;
        border-radius: 8px;
    }
    .send-btn .send-btn-text {
        display: none !important;
    }
}

.input-toggles {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Switch styling */
.switch-container {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.switch-container input {
    display: none;
}

.switch-slider {
    width: 32px;
    height: 18px;
    background-color: #cbd5e1;
    border-radius: 9px;
    margin-right: 8px;
    position: relative;
    transition: background-color 0.2s;
}

.switch-slider::before {
    content: "";
    width: 14px;
    height: 14px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.switch-container input:checked + .switch-slider {
    background-color: var(--brand-secondary);
}

.switch-container input:checked + .switch-slider::before {
    transform: translateX(14px);
}

/* --- ROBOT LOADING PROGRESS BALLOON --- */
.bot-loading-bubble {
    align-self: flex-start;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.88rem;
    max-width: 80%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.pulsing-dot {
    width: 10px;
    height: 10px;
    background-color: var(--brand-secondary);
    border-radius: 50%;
    animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* View Toggles & Inspect Debug Button Layout */
.bot-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    margin-bottom: 12px;
}

.view-toggles-row {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: var(--card-bg);
    padding: 6px 6px;
    border-radius: 12px;
    border: 2px solid #5c6f8a38;
    width: fit-content;
    box-shadow: 0 0px 2px -1px rgb(0 0 0 / 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.view-toggle-btn {
    background-color: transparent !important;
    border: none !important;
    color: #475569 !important;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: none !important; /* removed bottom border */
    border-radius: 0px !important; /* removed border radius */
    box-shadow: none !important; /* no box-shadow */
}

.view-toggle-btn.active {
    background-color: transparent !important; /* transparent active background */
    color: var(--brand-secondary) !important; /* highlight active with blue */
    box-shadow: none !important; /* removed active shadow */
    border-bottom: none !important; /* removed active bottom border */
    border-radius: 0px !important; /* removed active border radius */
    font-weight: 800; /* slightly emphasize active state */
}

/* Per-Message Inspect Debug Button inside bubble */
.chat-inspect-btn {
    background-color: transparent;
    border: 1.5px solid var(--brand-secondary);
    color: var(--brand-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chat-inspect-btn:hover {
    background-color: var(--brand-primary-light);
    color: var(--brand-primary);
}

/* Google Maps Containers */
.google-map-container {
    height: 350px;
    width: 100%;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    margin-top: 10px;
    background-color: #e5e7eb;
}

/* Matching Projects card designs inside bubble */
.chat-project-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.chat-project-card {
    background-color: var(--card-bg);
    border: 2px solid #5c6f8a38;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.chat-project-card h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.chat-project-card .builder {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

.chat-project-specs {
    font-size: 0.82rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    color: #334155;
}

.chat-project-specs strong {
    color: #475569;
}

.chat-project-configs {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.chat-config-bubble {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* --- INSPECTION PANE (Overlay Slide-Out Drawer) --- */
.backdrop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px); /* Modern overlay blur! */
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.backdrop-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Custom utility class to fully remove background and box-shadow */
.toggle-list-btn {
    background: transparent !important;
    box-shadow: none !important;
}

.inspection-pane {
    background-color: var(--card-bg);
    border-left: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    right: 0;
    width: 700px; /* Increased width of the panel as requested! */
    max-width: 90vw;
    height: 100vh;
    z-index: 10000; /* overlay on top of everything! */
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(100%); /* start offscreen */
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    overflow-y: auto; /* Enable vertical scrollbar on the observability panel! */
}

.inspection-pane.active {
    transform: translateX(0); /* slides in overlay beautifully */
}

.inspection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.inspection-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-primary);
}

.close-inspect-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    font-weight: bold;
}

/* Latency profiling style */
.latency-container h3 {
    font-size: 0.95rem;
    color: var(--brand-primary);
    margin-bottom: 10px;
    font-weight: 700;
}

.latency-group {
    font-size: 0.8rem;
}

.latency-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.latency-label {
    width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.latency-track {
    flex: 1;
    background-color: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.latency-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.latency-value {
    width: 60px;
    text-align: right;
}

/* Tabs */
.tabs-header {
    display: flex;
    border-bottom: 1.5px solid var(--border-color);
    margin-top: 18px;
    margin-bottom: 12px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.tab-btn.active {
    color: var(--brand-secondary);
    border-bottom-color: var(--brand-secondary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.json-code {
    background-color: #0f172a;
    color: #38bdf8;
    padding: 14px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 500px;
}

.cron-tools-box h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--brand-primary);
}

/* ========================================================================= */
/* Rich Formatted Summary Text & Semantic Entity Tagging                     */
/* ========================================================================= */

.bot-message-wrapper p strong {
    font-weight: 700;
    color: var(--text-primary);
}

.bot-message-wrapper p em {
    font-style: italic;
    color: var(--text-secondary);
}

.bot-message-wrapper p .rc-entity-tag,
p[id^="summary-text-"] .rc-entity-tag,
.rc-entity-tag {
    display: inline;
    transition: color 0.15s ease, background-color 0.15s ease;
}

/* 1. Project Entity (Royal Blue #2563eb) - ALWAYS BOLD + Clickable Anchor */
body.theme-1 [id^="summary-text-"] .rc-entity-project,
body.theme-2 [id^="summary-text-"] .rc-entity-project,
.bot-message-wrapper p .rc-entity-project,
p[id^="summary-text-"] .rc-entity-project,
.rc-entity-project {
    color: #2563eb !important;
    font-weight: 700 !important;
    text-decoration: none;
    cursor: pointer;
}

body.theme-1 [id^="summary-text-"] .rc-entity-project:hover,
body.theme-2 [id^="summary-text-"] .rc-entity-project:hover,
.rc-entity-project:hover {
    text-decoration: underline;
    color: #1d4ed8 !important;
}

/* 2. Base Location / Neighborhood Entity (Teal/Emerald #1f7d73) - Normal Weight unless inside strong */
body.theme-1 [id^="summary-text-"] .rc-entity-location,
body.theme-2 [id^="summary-text-"] .rc-entity-location,
.bot-message-wrapper p .rc-entity-location,
p[id^="summary-text-"] .rc-entity-location,
.rc-entity-location {
    color: #1f7d73 !important;
    font-weight: inherit;
}

/* 3. Commute Target / Workplace Entity (Vibrant Orange #df6616) - Normal Weight unless inside strong */
body.theme-1 [id^="summary-text-"] .rc-entity-commute,
body.theme-2 [id^="summary-text-"] .rc-entity-commute,
.bot-message-wrapper p .rc-entity-commute,
p[id^="summary-text-"] .rc-entity-commute,
.rc-entity-commute {
    color: #df6616 !important;
    font-weight: inherit;
}

/* 4. Landmark / School / Mall Entity (Slate/Indigo #4e627e) - Normal Weight unless inside strong */
body.theme-1 [id^="summary-text-"] .rc-entity-landmark,
body.theme-2 [id^="summary-text-"] .rc-entity-landmark,
.bot-message-wrapper p .rc-entity-landmark,
p[id^="summary-text-"] .rc-entity-landmark,
.rc-entity-landmark {
    color: #4e627e !important;
    font-weight: inherit;
}

/* Nested Entity inside Bold Emphasis: Inherits Bold + Entity Color */
strong .rc-entity-tag,
strong.rc-entity-tag,
b .rc-entity-tag,
.bot-message-wrapper p strong .rc-entity-tag,
p[id^="summary-text-"] strong .rc-entity-tag {
    font-weight: 700 !important;
}

.section-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.cron-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cron-btn {
    background-color: #f1f5f9;
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cron-btn:hover {
    background-color: #e2e8f0;
}

/* --- MOBILE LAYOUT & HEADER OVERRIDES --- */
.icon-text-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.icon-text-btn i {
    font-size: 1rem;
}

@media (max-width: 1023px) {
    .dashboard-header {
        padding: 8px 12px;
        flex-wrap: nowrap !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .logo-area {
        flex: 0 0 auto;
    }
    .logo-area h1 {
        font-size: 1.05rem;
        white-space: nowrap;
        margin: 0;
    }
    .logo-area .subtitle {
        display: none !important;
    }
    .header-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: auto;
        flex: 0 0 auto;
    }
    .icon-text-btn {
        padding: 6px;
        width: 36px;
        min-width: 36px;
        height: 36px;
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .icon-text-btn .btn-text {
        display: none !important;
    }
    .icon-text-btn i {
        font-size: 1.15rem;
        margin: 0;
    }
    .connection-config {
        display: none !important;
    }
    .mobile-inspect-btn {
        display: inline-flex !important;
    }

    .send-btn {
        width: 44px;
        min-width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 8px;
    }
    .send-btn .send-btn-text {
        display: none !important;
    }
    .send-btn i {
        font-size: 1.25rem;
        margin: 0;
    }
    
    .inspection-pane {
        position: fixed;
        right: -100%;
        top: 0;
        width: 85%;
        max-width: 380px;
        height: 100%;
        z-index: 1000;
        box-shadow: -4px 0 15px rgba(0,0,0,0.15);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
    }
    
    .inspection-pane.active {
        right: 0;
    }
    
    .backdrop-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(15, 23, 42, 0.4);
        z-index: 999;
        display: none;
    }
    
    .backdrop-overlay.active {
        display: block;
    }
    
    .chat-bubble {
        max-width: 98%;
    }
    .chat-messages {
        padding: 14px 10px 800px 10px;
    }
    .user-bubble {
        scroll-margin-top: 0.8rem;
    }
}
/* --- FOOTER --- */
.dashboard-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 8px;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* --- SPLIT PANEL CHAT LAYOUT --- */
.concierge-split-container {
    display: flex;
    flex-direction: row !important;
    gap: 24px;
    align-items: stretch;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: none;
    scrollbar-width: none;
}

.concierge-split-container::-webkit-scrollbar {
    display: none;
}

.concierge-left-col {
    min-height: 360px;
    flex: 0 0 60%;
    max-width: 60%;
    box-sizing: border-box;
    background: var(--card-bg);
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    padding: 20px;
    border: 2px solid #5c6f8a36;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: flex-start;
    height: auto;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.concierge-left-col::-webkit-scrollbar {
    width: 4px;
}
.concierge-left-col::-webkit-scrollbar-track {
    background: transparent;
}
.concierge-left-col::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.concierge-right-col {
    min-height: 360px;
    flex: 0 0 calc(40% - 24px);
    max-width: calc(40% - 24px);
    box-sizing: border-box;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: auto;
    opacity: 0;
    transform: translateX(-24px);
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1), transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.concierge-right-col.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.right-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
    gap: 8px;
    flex-wrap: wrap;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.view-toggle-btn i {
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .view-toggle-btn {
        padding: 5px 8px;
    }
}

.right-content-area {
    flex: 1;
    min-height: 0;
    position: relative;
}

.chat-project-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    height: 100%;
    padding-right: 4px;
}

.chat-project-cards-grid::-webkit-scrollbar {
    width: 4px;
}
.chat-project-cards-grid::-webkit-scrollbar-track {
    background: transparent;
}
.chat-project-cards-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.google-map-element {
    height: 100%;
    width: 100%;
    border-radius: 12px;
    border: 2px solid #5c6f8a24;
    background-color: #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
@media (max-width: 899px) {
    .concierge-split-container {
        flex-direction: row !important;
        gap: 16px;
        scroll-snap-type: x mandatory;
        padding-bottom: 4px;
    }
    .concierge-left-col {
        min-height: 320px;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        padding: 16px;
    }
    .concierge-right-col {
        min-height: 320px;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        height: 380px;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
    .right-header-row {
        width: 100% !important;
    }
    .view-toggles-row {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 6px !important;
    }
    .view-toggle-btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
    }
}

/* External Latency Footnote sitting directly under the bot bubble */
.bot-message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.bot-message-wrapper .chat-bubble {
    margin-bottom: 6px; /* snug gap above footnote */
}

.bot-message-wrapper .latency-footnote {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
    margin-left: 18px; /* aligns with chat bubble start */
    margin-top: 2px;
    margin-bottom: 12px; /* separates from next user message */
}


/* --- SYNC UPDATES BUTTON & SPECIAL VIEW --- */
.sync-updates-btn {
    background-color: var(--brand-secondary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.sync-updates-btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.inspection-pane.only-updates-view .latency-container,
.inspection-pane.only-updates-view .tabs-header {
    display: none !important;
}

.inspection-pane.only-updates-view .tab-content:not(#cron-tab) {
    display: none !important;
}

.inspection-pane.only-updates-view #cron-tab {
    display: block !important;
}

/* --- THEME OVERRIDES --- */
body.theme-1 .concierge-left-col {
    min-height: 360px;
    gap: 12px !important;
    border-bottom-left-radius: 2px !important;
}

body.theme-2 .concierge-left-col {
    min-height: 360px;
    gap: 12px !important; /* Retain consistent gap of 12px! */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0px !important;
    border-bottom-left-radius: 2px !important;
}

body.theme-2 .bot-message-wrapper .latency-footnote {
    margin-top: 12px !important;
    margin-left: 0px !important;
}

/* --- USER BUBBLE THEME OVERRIDES --- */
body.theme-1 .user-bubble {
    background: var(--card-bg) !important;
    border-radius: 12px !important;
    border: 2px solid #5c6f8a36 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    color: #5c6c82 !important;
    border-bottom-right-radius: 2px !important;
}

body.theme-2 .user-bubble {
    background: var(--card-bg) !important;
    border-radius: 12px !important;
    border: 2px solid #5c6f8a36 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    color: #5c6c82 !important;
    border-bottom-right-radius: 2px !important;
}

/* --- SUMMARY TEXT THEME COLOR MODIFIERS --- */
body.theme-1 .bottom-section p,
body.theme-1 [id^="summary-text-"] {
    color: #5c6c82 !important;
}
body.theme-2 .bottom-section p,
body.theme-2 [id^="summary-text-"] {
    color: #475568 !important;
}


/* --- 4-PART PROGRESSIVE PROGRESS ANIMATION SPLIT CSS --- */

/* Stacking Container Base */
.progress-stack {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  max-height: 200px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.3s ease-out, 
              margin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stacking Line Base */
.progress-list-item {
  opacity: 1;
  max-height: 24px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
  min-height: 14px;
  margin-bottom: 6px;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Entering transition */
.progress-list-item.new-item {
  animation: slideInHeadingLine 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInHeadingLine {
  from { opacity: 0; transform: translateY(6px); max-height: 0; margin-bottom: 0; }
  to { opacity: 1; transform: translateY(0); max-height: 24px; margin-bottom: 6px; }
}

/* Collapsed Stack Rule - butter-smooth transition */
.progress-stack.collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.progress-stack.collapsed .progress-list-item {
  opacity: 0 !important;
  max-height: 0 !important;
  margin-bottom: 0 !important;
  transform: translateY(-6px) !important;
}

/* Quick Heading Animation for Text Changes */
.animate-heading-change {
  animation: headingQuickFade 0.22s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes headingQuickFade {
  from { opacity: 0.3; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- DYNAMIC REGION BOUNDARY EDITOR & METRICS --- */
.region-edit-btn {
    background-color: #0284c7;
    color: #ffffff;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.region-edit-btn:hover {
    background-color: #0369a1;
}

.region-edit-btn.active {
    background-color: #f59e0b;
    color: #1e293b;
    box-shadow: 0 0 0 2px #f59e0b40;
}

.region-save-btn {
    background-color: #10b981;
    color: #ffffff;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.region-save-btn:hover {
    background-color: #059669;
}

.region-metrics-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 320px;
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border: 1.5px solid #0284c7;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 9000;
    font-family: inherit;
}

.region-metrics-panel .metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.region-metrics-panel .metrics-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0284c7;
}

.region-metrics-panel .metrics-close-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #64748b;
    cursor: pointer;
    padding: 0 4px;
}

.region-metrics-panel .metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    font-size: 0.75rem;
}

.region-metrics-panel .metric-item {
    display: flex;
    flex-direction: column;
}

.region-metrics-panel .metric-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.region-metrics-panel .metric-val {
    font-weight: 700;
    color: #1e293b;
    margin-top: 2px;
}

.region-metrics-panel .badge-bbox {
    display: inline-block;
    background-color: #fef3c7;
    color: #92400e;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    width: fit-content;
}

.region-metrics-panel .badge-circle {
    display: inline-block;
    background-color: #ede9fe;
    color: #5b21b6;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    width: fit-content;
}

.region-metrics-panel .metrics-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
}

.region-metrics-panel .metrics-actions label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* --- QUICK FOLLOW-UP ACTION CHIPS (LIGHT SLATE FILTER-CHIP THEME) --- */
.followup-chips-container {
    animation: fadeIn 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    margin-top: 18px;
}

.followup-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.followup-chip {
    display: inline-flex;
    align-items: center;
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 2px 4px 2px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(100, 116, 139, 0.04);
    transition: all 0.15s ease;
    user-select: none;
}

.followup-chip:hover {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
    color: #475569;
    box-shadow: 0 1px 3px rgba(100, 116, 139, 0.1);
}

.followup-chip .chip-text {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px 3px 0;
    color: inherit;
}

.followup-chip .chip-text i {
    color: #94a3b8;
    font-size: 0.8rem;
    transition: color 0.15s ease;
}

.followup-chip:hover .chip-text i {
    color: #64748b;
}
.followup-chip .chip-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-left: 6px;
    margin-right: 2px;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.15s ease;
}

.followup-chip:hover .chip-count-pill {
    background: #e2e8f0;
    color: #94a3b8;
    border-color: #cbd5e1;
}
.followup-chip .chip-edit-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    border-left: 1px solid #e2e8f0;
    padding: 2px 6px;
    margin-left: 4px;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.followup-chip .chip-edit-btn:hover {
    color: #475569;
    background-color: rgba(148, 163, 184, 0.15);
}
