/**
 * Eve AI - Unified Stylesheet
 * Used by eve_ai_homepage.html and ev_energy_interface.html
 * ev.energy branding and design system
 */

/* ============================================
   CSS Variables / Design Tokens
   Imported from centralized theme configuration
   IMPORTANT: @import MUST come before all other rules (except @charset)
   ============================================ */
@import url('/static/css/theme-variables.css');

/* ============================================
   Font Face Definitions
   ============================================ */
@font-face {
    font-family: 'Trade Gothic Next';
    src: url('/static/fonts/TradeGothicNextSRPro-HvCn.woff2') format('woff2'),
         url('/static/fonts/TradeGothicNextSRPro-HvCn.otf') format('opentype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}


/* ============================================
   Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-x: hidden;
    max-width: 100vw;
    background-color: #0A0F14;
}

html.light-mode {
    background-color: #FFFFFF;
}

body {
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    font-family: var(--font-body);
    background:
        radial-gradient(ellipse at top right, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        linear-gradient(to top right, #050709 0%, #0A0F14 40%, #141A1F 100%);
    background-color: var(--background);
    background-attachment: fixed;
    color: var(--text-primary);
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    transition: background 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

/* Light mode body background */
body.light-mode {
    background: #FFFFFF !important;
    background-image:
        radial-gradient(ellipse at top right, rgba(0, 210, 106, 0.03) 0%, transparent 50%),
        linear-gradient(to top right, #FFFFFF 0%, #F8FAFC 40%, #F1F5F9 100%) !important;
    background-attachment: fixed !important;
}

/* ============================================
   Global Heading Styles
   ============================================ */
h1, h2, h3 {
    font-family: var(--font-heading);
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

h1 {
    font-size: 42px;
    font-weight: 900; /* Libre Franklin Black */
}

h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
}

h3 {
    font-size: 24px;
    font-weight: 700; /* Libre Franklin Bold */
}

/* ============================================
   Layout Containers
   ============================================ */
.app-container {
    display: flex;
    height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--gradient-dark);
}

.main-container {
    max-width: var(--chat-max-width);
    margin: 0 auto;
    width: 100%;
    padding: 0 24px 24px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Prevent browser from auto-adjusting scroll position when content is
       inserted above the viewport, which causes visible jitter. */
    overflow-anchor: none;
}

/* ============================================
   Animated Background (Homepage)
   ============================================ */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #0A0F14;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 210, 106, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(0, 184, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 50%, rgba(0, 210, 106, 0.06) 0%, transparent 50%),
        linear-gradient(to top right, #000000 0%, #111827 50%, #1f2937 100%);
    z-index: -1;
    transition: background 0.3s ease;
}

/* Light mode background gradient */
.light-mode .background-gradient {
    background-color: #FFFFFF;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 210, 106, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(0, 184, 212, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 50%, rgba(0, 210, 106, 0.04) 0%, transparent 50%),
        linear-gradient(to bottom, #FFFFFF 0%, #F8FAFC 50%, #F1F5F9 100%);
}

/* ============================================
   Header Styles (now in main content area)
   ============================================ */
/* Header styles are defined in the sidebar section below */

.header-spacer {
    display: none;
}

.chat-header {
    padding: 20px 24px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-light) 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.chat-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 32px;
    width: auto;
}

/* Mobile logo - hidden by default, shown on mobile viewports */
.logo-mobile {
    display: none;
    height: 24px;
    width: auto;
}

.ev-logo {
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
}

/* Hide header nav-links - now in sidebar */
.nav-links {
    display: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Auth Button Styles */
.auth-button-container {
    display: flex;
    align-items: center;
}

.auth-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.auth-button svg {
    width: 16px;
    height: 16px;
}

.login-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.login-btn:hover {
    background: rgba(0, 210, 106, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.logout-btn:hover {
    background: rgba(255, 75, 75, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.logout-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.logout-btn .spin {
    animation: authSpin 1s linear infinite;
}

@keyframes authSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Welcome Section (Homepage)
   ============================================ */
.welcome-section {
    text-align: center;
    padding: 60px 0 0px;
    transition: all 0.3s ease;
}

.welcome-section.minimized {
    padding: 20px 0;
}

.welcome-section.minimized .welcome-title {
    font-size: 16px;
    letter-spacing: 0;
    margin-bottom: 0;
}

.welcome-section.minimized .welcome-title .highlight {
    color: var(--primary-color);
}

.welcome-section.minimized .welcome-subtitle,
.welcome-section.minimized .eve-badge {
    display: none;
}

.eve-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 210, 106, 0.1);
    border: 1px solid rgba(0, 210, 106, 0.3);
    border-radius: 100px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
}

.eve-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.welcome-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1;
    transition: all 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-transform: uppercase;
}

.welcome-title .highlight {
    color: var(--primary-color);
    font-style: normal;
}

.welcome-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto;
}

/* ============================================
   Personalized Welcome Greeting
   ============================================ */
.welcome-greeting {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.1;
    transition: all 0.3s ease;
}

.greeting-text {
    color: var(--text-primary);
}

.user-name-green {
    color: var(--primary-color);
}

/* Eve Mood Container - Fixed height to prevent layout shift */
.eve-mood-container {
    min-height: 32px;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.eve-mood-summary {
    font-size: 1rem;
    color: var(--text-secondary);
    opacity: 1;
    line-height: 1.5;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.3s ease, color 0.3s ease;
    white-space: nowrap;
}

.eve-mood-summary.loading {
    opacity: 0.5;
    pointer-events: none;
}

.eve-mood-summary.loading .mood-chevron {
    display: none;
}

.eve-mood-summary:not(.loading):hover {
    opacity: 1;
    color: var(--text-primary);
}

/* Green heart icon with glow effect */
.eve-mood-summary .mood-icon {
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
}

.eve-mood-summary .mood-icon svg,
.eve-mood-summary .mood-heart-icon {
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    color: var(--primary);
    filter: drop-shadow(0 0 4px rgba(92, 250, 115, 0.4));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.eve-mood-summary:not(.loading) .mood-icon svg,
.eve-mood-summary:not(.loading) .mood-heart-icon {
    animation: mood-glow 3s ease-in-out infinite;
}

@keyframes mood-glow {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(92, 250, 115, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(92, 250, 115, 0.6));
    }
}

.eve-mood-summary:hover .mood-icon svg,
.eve-mood-summary:hover .mood-heart-icon {
    filter: drop-shadow(0 0 10px rgba(92, 250, 115, 0.7));
    transform: scale(1.1);
}

.eve-mood-summary .mood-chevron {
    margin-left: 6px;
    width: 12px;
    height: 12px;
    stroke: var(--text-secondary);
    transition: transform 0.2s ease;
}

.eve-mood-summary.expanded .mood-chevron {
    transform: rotate(180deg);
}

.welcome-section.minimized .eve-mood-container {
    display: none;
}

/* ============================================
   Energy Mix Icons
   ============================================ */
.energy-icons {
    display: none;
    justify-content: center;
    gap: 24px;
    margin: 16px 0 20px;
    flex-wrap: wrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.energy-icons.expanded {
    display: flex;
    max-height: 80px;
    opacity: 1;
}

.energy-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.energy-icon-item.active {
    opacity: 1;
}

.energy-icon-item.active:hover {
    transform: scale(1.1);
}

.energy-icon {
    width: 28px;
    height: 28px;
    stroke: var(--text-secondary);
    transition: stroke 0.3s ease;
}

.energy-icon-item.active .energy-icon {
    stroke: var(--primary-color);
}

.energy-percent {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.energy-icon-item.active .energy-percent {
    color: var(--primary-color);
}

/* Wind turbine spinning animation */
.energy-icon.wind-turbine {
    transform-origin: center;
}

.energy-icon-item.active .energy-icon.wind-turbine {
    animation: spin 3s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Sun pulsing/glowing animation */
.energy-icon-item.active .energy-icon.sun {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(255, 200, 0, 0.5));
        stroke: var(--primary-color);
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(255, 200, 0, 0.8));
        stroke: #f59e0b;
    }
}

/* Nuclear subtle pulse */
.energy-icon-item.active .energy-icon.nuclear {
    animation: pulse 2.5s ease-in-out infinite;
}

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

/* Flame flicker effect */
.energy-icon-item.active .energy-icon.flame {
    animation: flicker 0.5s ease-in-out infinite alternate;
}

@keyframes flicker {
    0% { transform: scale(1); }
    100% { transform: scale(1.05) translateY(-1px); }
}

/* Water wave effect */
.energy-icon-item.active .energy-icon.water {
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Hide energy icons when minimized */
.welcome-section.minimized .energy-icons {
    display: none;
}

/* Hide greeting when minimized */
.welcome-section.minimized .welcome-greeting {
    font-size: 16px;
    margin-bottom: 0;
}

.welcome-section.minimized .location-insight {
    display: none;
}

/* ============================================
   Eve's Mood Card - "Ask Eve about..."
   ============================================ */
.eve-mood-card {
    display: inline-block;
    background: linear-gradient(135deg, rgba(0, 210, 106, 0.08) 0%, rgba(0, 210, 106, 0.02) 100%);
    border: 1px solid rgba(0, 210, 106, 0.2);
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 24px;
    text-align: left;
    max-width: 420px;
    transition: all 0.3s ease;
}

.eve-mood-card:hover {
    border-color: rgba(0, 210, 106, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 210, 106, 0.1);
}

/* Mood category-based styling */
.eve-mood-card[data-category="green"] {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(34, 197, 94, 0.02) 100%);
    border-color: rgba(34, 197, 94, 0.25);
}

.eve-mood-card[data-category="opportunity"] {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-color: rgba(59, 130, 246, 0.25);
}

.eve-mood-card[data-category="caution"] {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
    border-color: rgba(245, 158, 11, 0.25);
}

.eve-mood-card[data-category="insight"] {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.02) 100%);
    border-color: rgba(139, 92, 246, 0.25);
}

.mood-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.mood-emoji {
    font-size: 1.75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.mood-emoji svg {
    color: var(--text-secondary);
}

.mood-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mood-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    opacity: 0.8;
}

.mood-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mood-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.mood-grid-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.grid-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e;
    animation: pulse 2s infinite;
}

.grid-status-text {
    font-weight: 500;
}

/* Location selector in mood card */
.location-selector {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    max-width: 200px;
}

.location-selector:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.location-selector:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 210, 106, 0.2);
}

.location-selector option {
    background: var(--surface);
    color: var(--text-primary);
}

/* Live data indicator */
.eve-mood-card[data-live="true"] .grid-status-dot {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* Grid status with change button */
.grid-live-status {
    margin-right: 6px;
}

.change-location-btn {
    background: transparent;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.change-location-btn:hover {
    opacity: 1;
}

.change-location-btn svg {
    stroke: var(--text-tertiary);
}

.change-location-btn:hover svg {
    stroke: var(--primary-color);
}

/* Hide mood card when minimized */
.welcome-section.minimized .eve-mood-card {
    display: none;
}

/* Mood suggestion chip styling */
.suggestion-chip.mood-suggestion {
    background: linear-gradient(135deg, rgba(0, 210, 106, 0.15) 0%, rgba(0, 210, 106, 0.05) 100%);
    border-color: rgba(0, 210, 106, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-chip.mood-suggestion:hover {
    background: linear-gradient(135deg, rgba(0, 210, 106, 0.25) 0%, rgba(0, 210, 106, 0.1) 100%);
    border-color: rgba(0, 210, 106, 0.5);
}

.mood-suggestion-icon {
    font-size: 14px;
}

.mood-suggestion-text {
    flex: 1;
}

/* Data Sources Link in Features Title */
.data-sources-link {
    color: var(--primary-color);
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.data-sources-link .data-sources-icon {
    opacity: 0.8;
    vertical-align: middle;
}

.data-sources-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.data-sources-link:hover {
    color: #00D4AA;
}

.data-sources-link:hover::after {
    opacity: 0.8;
}

/* ============================================
   Features Grid (Homepage)
   ============================================ */
.features-section {
    padding: 0;
    width: 100%;
}

.features-section.hidden {
    display: none;
}

.features-title {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: rgba(0, 210, 106, 0.3);
    transform: translateY(-2px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    background: rgba(0, 210, 106, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--primary-color);
}

.feature-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.feature-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============================================
   Chat Section - Simplified for reliable mobile rendering
   ============================================ */
.chat-section {
    position: relative;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages:empty {
    display: none;
}

/* Scroll to bottom button - absolutely positioned above input area */
.scroll-to-bottom {
    position: absolute;
    bottom: 160px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #374151;
    border: 1px solid var(--border);
    color: #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    z-index: 150;
    opacity: 1;
}

.scroll-to-bottom:hover {
    background: var(--surface);
    border-color: var(--primary-color);
    color: var(--primary-color);
    opacity: 1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.scroll-to-bottom.hidden {
    display: none;
}

.chat-messages:not(:empty) + .suggestions {
    display: none;
}

.gi-context-notification {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin: 4px 0;
    font-size: 12px;
    color: var(--text-secondary, #9ca3af);
    background: var(--bg-secondary, rgba(255,255,255,0.04));
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 8px;
    transition: opacity 0.3s ease;
    align-self: center;
}

.gi-context-notification svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.gi-context-notification strong {
    color: var(--text-primary, #e5e7eb);
}

/* ============================================
   Message Styles
   ============================================ */
.message {
    margin-bottom: 0px;
    animation: fadeIn 0.3s ease-in;
    position: relative;
    z-index: 1; /* Ensure message is above any background elements */
}

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

.message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.user-avatar {
    background: var(--gradient-primary);
    color: var(--background);
}

.assistant-avatar {
    background: linear-gradient(135deg, var(--surface-light) 0%, var(--surface) 100%);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.message-role {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.message-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.message-content {
    background: linear-gradient(135deg, var(--surface-light) 0%, var(--surface) 100%);
    border-radius: 16px;
    padding: 16px 20px;
    margin-left: 44px;
    box-shadow: var(--shadow-sm);
    line-height: 1.6;
    border: 1px solid var(--border);
    font-size: 15px;
    overflow-x: hidden;
    /* Prevent jitter during streaming */
    overflow-wrap: break-word;
    word-break: break-word;
    min-height: 24px;
}

.user-message .message-content {
    background: linear-gradient(135deg, rgba(92, 250, 115, 0.15) 0%, rgba(92, 250, 115, 0.05) 100%);
    border-color: rgba(92, 250, 115, 0.3);
}

.message-content p {
    margin: 0 0 1em 0;
    color: var(--text-primary);
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content > *:first-child {
    margin-top: 0;
}

.message-content > *:last-child {
    margin-bottom: 0;
}

/* ============================================
   Suggestions (Homepage)
   ============================================ */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 0 24px 16px;
    margin-top: 10px;
}


.suggestion-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 10px 18px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.suggestion-chip:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
    background: rgba(92, 250, 115, 0.1);
}

/* ============================================
   Role Picker
   ============================================ */
.role-picker {
    text-align: center;
    padding: 0 24px 16px;
    margin-top: 10px;
}

.role-picker-title {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 12px;
}

.role-picker-cards {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.role-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 14px 12px;
    width: 140px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.role-card:hover {
    border-color: var(--primary-color);
    background: rgba(92, 250, 115, 0.06);
    transform: translateY(-1px);
}

.role-card-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.role-card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.role-card-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.role-explore-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.role-explore-btn:hover {
    color: var(--text-primary);
}

/* Role indicator (below suggestions) */
.role-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0 8px;
    font-size: 12px;
}

.role-indicator-label {
    color: var(--text-secondary);
}

.role-indicator-change {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.role-indicator-change:hover {
    color: var(--text-primary);
}

/* ============================================
   Markdown Styles - ev.energy branded
   Styles default marked.js output elements
   ============================================ */

/* Headings */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 1.25em 0 0.5em;
}

.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child,
.message-content h4:first-child {
    margin-top: 0;
}

.message-content h1 {
    font-size: 1.5em;
    border-bottom: none;
    padding-bottom: 0;
}

.message-content h2 {
    font-size: 1.25em;
    border-bottom: 1px solid rgba(0, 210, 106, 0.3);
    padding-bottom: 0.3em;
    color: var(--text-primary);
}

.message-content h3 {
    font-size: 1.1em;
    color: var(--primary-color);
}

.message-content h4 {
    font-size: 1em;
    color: var(--text-secondary);
}

/* Lists */
.message-content ul,
.message-content ol {
    margin: 0.5em 0 1em 0;
    padding-left: 1.5em;
    list-style-position: outside;
}

.message-content ul:last-child,
.message-content ol:last-child {
    margin-bottom: 0;
}

/* Unordered lists - bullets */
.message-content ul {
    list-style-type: disc;
}

/* Ordered lists - numbers */
.message-content ol {
    list-style-type: decimal;
}

.message-content li {
    margin: 0;
    padding: 0.1em 0;
    line-height: 1.2;
    color: var(--text-primary);
    display: list-item;
}

.message-content ul ul,
.message-content ol ol,
.message-content ul ol,
.message-content ol ul {
    margin: 0.25em 0;
}

.message-content li + br {
    display: none;
}

.message-content li::marker {
    color: var(--primary-color);
}

/* Strong/Bold */
.message-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Emphasis/Italic */
.message-content em {
    font-style: italic;
}

/* Tables */
.message-content .table-wrapper {
    overflow-x: auto;
    margin: 1em 0;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.message-content .table-wrapper:last-child {
    margin-bottom: 0;
}

.message-content .table-wrapper table {
    margin: 0;
    border: none;
    border-radius: 0;
}

.message-content table {
    min-width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 0.9em;
    margin: 1em 0;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.message-content table:last-child {
    margin-bottom: 0;
}

.message-content thead {
    background: linear-gradient(135deg, var(--surface-light) 0%, var(--surface) 100%);
}

.message-content th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--primary-color);
    white-space: nowrap;
    word-break: normal;
}

.message-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-primary);
    word-break: normal;
    overflow-wrap: normal;
}

.message-content tbody tr:hover {
    background: rgba(0, 210, 106, 0.05);
}

.message-content tbody tr:last-child td {
    border-bottom: none;
}

/* Blockquotes */
.message-content blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    border-left: 3px solid var(--primary-color);
    background: rgba(0, 210, 106, 0.05);
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
}

.message-content blockquote:last-child {
    margin-bottom: 0;
}

/* Links */
.message-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
    border-bottom: 1px solid transparent;
}

/* External link icon */
.message-content a[href^="http"]::after {
    content: " ↗";
    font-size: 0.85em;
    opacity: 0.7;
    vertical-align: super;
}

/* Reference/citation styling */
.message-content mark {
    background: rgba(255, 193, 7, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    color: inherit;
}

.message-content mark::before {
    content: "📖 ";
    font-size: 0.85em;
}

.message-content a:hover {
    text-decoration: underline;
    opacity: 0.9;
    border-bottom-color: var(--primary-color);
    text-shadow: 0 0 8px rgba(0, 210, 106, 0.5);
}

/* Horizontal rules */
.message-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5em 0;
}

/* Inline code (exclude code inside pre blocks — those are code blocks, not inline) */
.message-content code:not([class*="language-"]):not(pre code) {
    background: rgba(0, 210, 106, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
    border: 1px solid rgba(0, 210, 106, 0.2);
}

/* Images */
.message-content img {
    max-width: 100%;
    border-radius: 8px;
}

/* ============================================
   Code Blocks
   ============================================ */
.code-block-container {
    margin: 1em 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 210, 106, 0.05);
    border: 1px solid rgba(0, 210, 106, 0.3);
}

.code-block-container:last-child {
    margin-bottom: 0;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 210, 106, 0.1);
    font-size: 12px;
    color: var(--primary-color);
    border-bottom: 1px solid rgba(0, 210, 106, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.copy-code-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: none;
    font-weight: 500;
}

.copy-code-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.copy-code-btn.copied {
    color: var(--success);
    border-color: var(--success);
    background: var(--primary-color);
    color: var(--background);
}

.copy-code-btn svg {
    width: 14px;
    height: 14px;
}

.code-block {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: rgba(0, 210, 106, 0.03);
}

.code-block code {
    color: #e4e4e7;
    font-family: inherit;
    white-space: pre;
}

/* Syntax Highlighting */
.keyword { color: #c792ea; font-weight: 600; }
.string { color: #c3e88d; }
.number { color: #f78c6c; }
.comment { color: #546e7a; font-style: italic; }
.boolean { color: #ff9cac; }
.json-key { color: #82aaff; }
.punctuation { color: #89ddff; }
.function { color: #50fa7b; }
.class { color: #8be9fd; }
.operator { color: #ff79c6; }

/* Language-specific */
.language-python .function { color: #82aaff; }
.language-python .decorator { color: #c792ea; }
.language-javascript .function { color: #82aaff; }
.language-javascript .template { color: #f1fa8c; }
.language-json .property { color: #8be9fd; }
.language-bash .command { color: #50fa7b; }
.language-sql .keyword { color: #ff79c6; text-transform: uppercase; }

/* Scrollbar styling for code blocks */
.code-block::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.code-block::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.code-block::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* ============================================
   Metric Cards for Simulation Results
   ============================================ */
.metrics-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.metrics-container:last-child {
    margin-bottom: 0;
}

.metric-card {
    background: linear-gradient(135deg, var(--surface-light) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 210, 106, 0.2);
    border-color: var(--primary-color);
}

.metric-card.energy::before { background: linear-gradient(90deg, #00D26A, #00B8D4); }
.metric-card.peak::before { background: linear-gradient(90deg, #FF4B4B, #FFB800); }
.metric-card.savings::before { background: linear-gradient(90deg, #FFB800, #00D26A); }
.metric-card.vehicles::before { background: linear-gradient(90deg, #00B8D4, #BD93F9); }
.metric-card.compliance::before { background: linear-gradient(90deg, #00D26A, #50FA7B); }

.metric-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Chart/artifact card, overlay, and tray styles → static/css/artifact-viewer.css */

/* ============================================
   Tool Progress Indicators
   ============================================ */
.tool-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    background: rgba(0, 210, 106, 0.1);
    border: 1px solid rgba(0, 210, 106, 0.3);
    border-radius: 8px;
    font-size: 13px;
    color: var(--primary-color);
}

.tool-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 210, 106, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: toolSpin 0.8s linear infinite;
}

@keyframes toolSpin {
    to { transform: rotate(360deg); }
}

.tool-check {
    color: var(--primary-color);
    font-weight: bold;
}

.tool-error {
    color: #ff4444;
    font-weight: bold;
}

/* Tool result items — interleaved inline tool blocks (used by eve.html + grid-intelligence2) */
.tool-item {
    margin: 8px 0;
    padding: 6px 12px;
    border-left: 2px solid rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.04);
    border-radius: 0 6px 6px 0;
}

.tool-line {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--text-primary, #e5e7eb);
    font-weight: 500;
}

.tool-line .check {
    color: #22c55e;
    flex-shrink: 0;
}

.tool-line .name {
    flex: 1;
}

.tool-line .arrow {
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.2s;
    font-size: 12px;
}

.tool-line .arrow.open {
    transform: rotate(180deg);
}

.tool-details {
    display: none;
    margin-top: 8px;
    padding-left: 20px;
    color: var(--text-secondary, #9ca3af);
    font-size: 13px;
    font-weight: 400;
}

.tool-details.show {
    display: block;
}

/* PTC code execution display — blue theme to distinguish from green tool items */
.code-execution-item {
    border-left-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.06);
}

.code-execution-item .check {
    color: #818cf8;
}

.code-execution-code {
    margin: 4px 0;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: #a5b4fc;
}

.code-execution-code code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.code-execution-output {
    margin: 4px 0;
    padding: 6px 10px;
    background: rgba(34, 197, 94, 0.08);
    border-left: 2px solid rgba(34, 197, 94, 0.4);
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #86efac;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-execution-stderr {
    margin: 4px 0;
    padding: 6px 10px;
    background: rgba(239, 68, 68, 0.08);
    border-left: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #fca5a5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Light mode — tool items (green) */
.light-mode .tool-item {
    border-left-color: rgba(22, 163, 74, 0.4);
    background: rgba(22, 163, 74, 0.05);
}

.light-mode .tool-line {
    color: var(--text-primary, #1f2937);
}

.light-mode .tool-line .check {
    color: #16a34a;
}

.light-mode .tool-details {
    color: var(--text-secondary, #6b7280);
}

/* Light mode — code execution items (blue) */
.light-mode .code-execution-item {
    border-left-color: rgba(79, 70, 229, 0.4);
    background: rgba(79, 70, 229, 0.05);
}

.light-mode .code-execution-item .check {
    color: #6366f1;
}

.light-mode .code-execution-code {
    background: rgba(79, 70, 229, 0.06);
    color: #4338ca;
}

.light-mode .code-execution-output {
    background: rgba(22, 163, 74, 0.06);
    border-left-color: rgba(22, 163, 74, 0.4);
    color: #15803d;
}

.light-mode .code-execution-stderr {
    background: rgba(220, 38, 38, 0.06);
    border-left-color: rgba(220, 38, 38, 0.4);
    color: #dc2626;
}

/* Tool result feedback - shows completed tools */
.tool-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0;
}

.tool-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin: 12px 0;
    background: rgba(0, 210, 106, 0.08);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.tool-result-item .tool-check-icon {
    color: var(--primary-color);
    font-size: 14px;
}

.tool-result-item .tool-name {
    color: var(--primary-color);
    font-weight: 500;
}

.tool-result-item .tool-summary {
    color: var(--text-secondary);
    opacity: 0.8;
}

/* ============================================
   Typing Indicator / Loading Messages
   ============================================ */
.typing-indicator,
#typing-indicator,
#typingIndicator {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px 20px !important;
    margin-left: 44px !important;
    background: transparent !important;
    border-radius: 12px !important;
    border: none !important;
    width: fit-content !important;
}

/* White spinner */
.loading-spinner,
.typing-indicator .loading-spinner,
#typing-indicator .loading-spinner,
#typingIndicator .loading-spinner {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
    border-top: 2px solid #FFFFFF !important;
    border-radius: 50% !important;
    animation: indicatorSpin 0.7s linear infinite !important;
    flex-shrink: 0 !important;
}

@keyframes indicatorSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Typing message with bash-style block cursor */
.typing-message-container,
.typing-indicator .typing-message-container,
#typing-indicator .typing-message-container,
#typingIndicator .typing-message-container {
    display: flex !important;
    align-items: center !important;
    min-height: 20px;
}

.typing-message,
.typing-indicator .typing-message,
#typing-indicator .typing-message,
#typingIndicator .typing-message {
    color: #FFFFFF !important;
    font-size: 14px !important;
    font-style: italic !important;
}

/* Green bash-style block cursor */
.typing-cursor,
.typing-indicator .typing-cursor,
#typing-indicator .typing-cursor,
#typingIndicator .typing-cursor {
    display: inline-block !important;
    width: 9px !important;
    height: 17px !important;
    background: #00D26A !important;
    margin-left: 1px !important;
    animation: cursorFlash 0.7s step-start infinite !important;
}

@keyframes cursorFlash {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes blockBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ============================================
   Input Area
   ============================================ */
.input-section {
    flex-shrink: 0;
    padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #000000;
    border-top: 1px solid var(--border);
}

.light-mode .input-section {
    background: #FFFFFF;
}

.input-box {
    max-width: var(--chat-max-width);
    margin: 0 auto;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.input-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* Tool Icons Bar - shows connected tools above chat input */
.tool-icons-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-light);
}

.tool-icons-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.tool-icons-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding: 0;
}

.tool-icon:hover {
    background: var(--surface);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.tool-icon.connected {
    border-color: var(--success);
    background: rgba(92, 250, 115, 0.1);
}

.tool-icon.connected:hover {
    background: rgba(92, 250, 115, 0.15);
}

.tool-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.tool-icon:hover .tool-icon-img,
.tool-icon.connected .tool-icon-img {
    opacity: 1;
}

/* SVG icon styling (for internal tools) */
.tool-icon-svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.tool-icon:hover .tool-icon-svg,
.tool-icon.connected .tool-icon-svg {
    opacity: 1;
    stroke: var(--primary-color);
}

/* Connection status indicator dot */
.tool-icon-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    transition: background-color 0.2s ease;
}

.tool-icon-status.connected {
    background-color: var(--success);
}

.tool-icon-status.disconnected {
    background-color: var(--text-tertiary);
}

/* Toolbar chat actions (share + export) - pushed to right */
.toolbar-chat-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* Light mode adjustments for tool icons */
.light-mode .tool-icon:hover .tool-icon-img,
.light-mode .tool-icon.connected .tool-icon-img {
    opacity: 1;
}

.light-mode .tool-icon-status {
    border-color: var(--background);
}

.light-mode .tool-icon-svg {
    stroke: var(--text-primary);
    opacity: 0.6;
}

.light-mode .tool-icon:hover .tool-icon-svg,
.light-mode .tool-icon.connected .tool-icon-svg {
    opacity: 1;
}

.tool-icon.generating {
    pointer-events: none;
    opacity: 0.7;
}
.tool-icon.generating .tool-icon-svg {
    animation: tool-spin 1.2s linear infinite;
    stroke: var(--primary-color);
    opacity: 1;
}
@keyframes tool-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Report generation overlay */
.report-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.report-overlay.visible { opacity: 1; }
.report-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 420px;
    max-width: 90vw;
    padding: 28px 24px 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}
.report-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.report-modal-icon { display: flex; color: var(--primary-color); }
.report-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.report-modal-status {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.report-modal-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: report-pulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
}
.report-modal-status.success::before { background: var(--success); animation: none; }
.report-modal-status.error::before { background: #ef4444; animation: none; }
@keyframes report-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
.report-modal-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    min-height: 0;
}
.report-section-pill {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(63, 228, 127, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(63, 228, 127, 0.2);
    animation: pill-in 0.2s ease;
}
@keyframes pill-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.report-modal-stream {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: monospace;
    margin-bottom: 16px;
    min-height: 18px;
}
.report-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.report-modal-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface-light);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.15s ease;
}
.report-modal-btn:hover {
    background: var(--surface);
    border-color: var(--primary-color);
}
.report-modal-btn.primary {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
}
.report-modal-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    padding: 12px 16px;
    gap: 12px;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.input-field {
    flex: 1;
    position: relative;
}

.chat-input {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px; /* Must be >= 16px to prevent iOS auto-zoom on focus */
    color: var(--text-primary);
    font-family: inherit;
    resize: none;
    min-height: 24px;
    max-height: 150px;
    line-height: 1.5;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background-color: var(--surface-light);
    transition: border-color 0.2s, background-color 0.2s;
}

.chat-input::placeholder {
    color: var(--text-tertiary);
}

.chat-input:focus {
    outline: none;
}

/* Animated placeholder (Homepage) */
.input-placeholder {
    position: absolute;
    left: 24px;
    right: 110px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 15px;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.input-placeholder.hidden {
    display: none;
}

.placeholder-static {
    color: var(--text-tertiary);
}

/* ============================================
   Button Styles
   ============================================ */
.send-button {
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    height: 48px;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 210, 106, 0.3);
}

.send-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.send-button svg {
    width: 16px;
    height: 16px;
}

/* DR Event Button */
.dr-event-section {
    padding: 12px 24px;
    background: transparent;
}

.dr-event-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--surface-light) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dr-event-btn:hover {
    background: linear-gradient(135deg, rgba(0, 210, 106, 0.1) 0%, rgba(0, 210, 106, 0.05) 100%);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================
   Status Indicator
   ============================================ */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0, 210, 106, 0.1);
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid rgba(0, 210, 106, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    animation: pulse 2s infinite;
}

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

.status-dot.offline {
    background-color: var(--error);
    animation: none;
}

/* ============================================
   JSON Viewer (Interface)
   ============================================ */
.json-viewer {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    overflow-x: auto;
}

.json-viewer .json-key {
    color: #8be9fd;
}

.json-viewer .json-string {
    color: #f1fa8c;
}

.json-viewer .json-number {
    color: #bd93f9;
}

.json-viewer .json-boolean {
    color: #ff79c6;
}

.json-viewer .json-null {
    color: #6272a4;
}

/* ============================================
   Footer (Homepage)
   ============================================ */
.footer {
    padding: 12px 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
    background: transparent;
    margin-top: 0;
    margin-bottom: 16px;
}

/* Login page footer - not fixed, just at bottom of content */
.footer.login-footer {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    padding: 16px 24px;
    margin-top: auto;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 16px 20px;
    }

    .header-spacer {
        height: 64px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links .nav-link {
        display: none;
    }

    .auth-button-container {
        display: flex !important;
    }

    .auth-button:not(.hidden) {
        display: inline-flex !important;
    }

    .main-container {
        padding: 0 16px 16px;
    }

    .welcome-section {
        padding: 0;
        padding-top: 80px;  /* Clear the sidebar toggle area on mobile */
    }

    /* Mobile minimized state - reduce top padding but keep some clearance */
    .welcome-section.minimized {
        padding-top: 50px;
        padding-bottom: 10px;
    }

    .eve-badge {
        margin-top: 20px;
        margin-bottom: 12px;
    }

    .welcome-greeting {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }

    .location-insight {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .eve-mood-card {
        padding: 14px 18px;
        margin-bottom: 16px;
        max-width: 100%;
    }

    .mood-emoji {
        font-size: 1.5rem;
    }

    .mood-title {
        font-size: 1rem;
    }

    .mood-description {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .mood-grid-summary {
        font-size: 11px;
    }

    .eve-mood-summary {
        font-size: 0.85rem;
    }

    .welcome-title {
        font-size: 26px;
    }

    .features-section {
        padding: 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .suggestions {
        display: none;
    }

    .role-picker {
        padding: 0 16px 12px;
    }

    .role-picker-cards {
        gap: 8px;
        flex-wrap: nowrap;
    }

    .role-card {
        width: auto;
        flex: 1;
        min-width: 0;
        padding: 12px 8px 10px;
    }

    .role-card-icon {
        width: 20px;
        height: 20px;
    }

    .role-card-label {
        font-size: 12px;
    }

    .role-card-desc {
        font-size: 10px;
    }

    .chat-container {
        padding: 16px;
    }

    .message-content {
        margin-left: 0;
        margin-top: 8px;
    }

    .typing-indicator,
    #typing-indicator,
    #typingIndicator {
        margin-left: 0 !important;
    }

    .metrics-container {
        grid-template-columns: 1fr 1fr;
    }

    .dr-event-section {
        padding: 8px 16px;
    }

    .footer {
        left: 0;
        padding: 8px 16px;
    }

    .suggestions {
        left: 0;
        padding: 8px 16px;
    }

    /* Fix cursor alignment on mobile */
    .typing-cursor,
    #typingIndicator .typing-cursor,
    #typing-indicator .typing-cursor {
        margin-left: 0 !important;
        vertical-align: middle !important;
    }

    .typing-message-container,
    #typingIndicator .typing-message-container,
    #typing-indicator .typing-message-container {
        align-items: center !important;
    }

    /* Prevent overflow on mobile */
    .input-box,
    .input-wrapper,
    .message-content,
    .code-block,
    .code-block-container {
        max-width: 100%;
        overflow-x: auto;
    }

    /* Prevent map container overflow on mobile */
    .map-container {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .input-placeholder {
        right: 90px;
    }

    /* Mobile input adjustments - simplified with safe area support */
    .input-section {
        padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .input-box {
        border-radius: 12px;
    }

    /* Mobile tool icons bar */
    .tool-icons-bar {
        padding: 6px 12px;
        gap: 6px;
    }

    .tool-icons-label {
        font-size: 10px;
    }

    .tool-icon {
        width: 28px;
        height: 28px;
    }

    .tool-icon-img {
        width: 16px;
        height: 16px;
    }

    .tool-icon-svg {
        width: 14px;
        height: 14px;
    }

    .tool-icon-status {
        width: 8px;
        height: 8px;
    }

    .hide-mobile {
        display: none !important;
    }

    .input-wrapper {
        padding: 8px 12px;
        gap: 10px;
    }

    .chat-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 12px 16px;
        border-radius: 20px;
    }

    .send-button {
        padding: 10px 16px;
        height: 44px;
        border-radius: 22px;
    }

    /* Suggestion chips - 2 per line on mobile */
    .suggestions {
        gap: 8px;
        padding: 8px 0;
    }

    .suggestion-chip {
        padding: 8px 14px;
        font-size: 13px;
        flex: 0 1 auto;
    }
}

@media (max-width: 480px) {
    .metrics-container {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 12px 16px;
    }

    .header-spacer {
        height: 48px;
    }

    .logo-img {
        height: 24px;
    }

    .auth-button-container {
        display: flex !important;
    }

    .auth-button:not(.hidden) {
        display: inline-flex !important;
        padding: 8px 12px;
        font-size: 13px;
        min-width: 40px;
        justify-content: center;
    }

    .auth-button span {
        display: none;
    }

    .auth-button svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    /* Fix input placeholder overflow on small screens */
    .input-placeholder {
        right: 70px;
        left: 16px;
    }

    .placeholder-static {
        flex-shrink: 0;
    }

    .input-section {
        padding: 10px 12px;
    }

    .input-wrapper {
        padding: 6px 10px;
        gap: 8px;
    }

    .send-button {
        padding: 8px 12px;
        height: 40px;
        min-width: 40px;
    }

    .send-button span {
        display: none;
    }

    .chat-input {
        padding: 10px 14px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    /* Smaller suggestion chips on very small screens - still 2 per line */
    .suggestion-chip {
        padding: 7px 12px;
        font-size: 12px;
    }

    .role-picker {
        padding: 0 8px 10px;
    }

    .role-picker-cards {
        gap: 6px;
    }

    .role-card {
        padding: 10px 6px 8px;
        border-radius: 10px;
        gap: 4px;
    }

    .role-card-label {
        font-size: 11px;
    }

    .role-card-desc {
        font-size: 9px;
    }

    .role-explore-btn {
        font-size: 12px;
    }

    /* Smaller mood text to prevent wrapping on mobile */
    .eve-mood-summary {
        font-size: 0.75rem;
    }

    .eve-mood-summary .mood-icon {
        margin-right: 6px;
    }

    .eve-mood-summary .mood-icon svg {
        width: 1.25em;
        height: 1.25em;
    }

    .eve-mood-summary .mood-chevron {
        margin-left: 4px;
        width: 10px;
        height: 10px;
    }
}

/* ============================================
   Login Page Styles
   ============================================ */
.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 40px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 900; /* Libre Franklin Black */
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Auth Error Page */
.auth-error-card {
    text-align: center;
}

.auth-error-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--error) 0%, #FF6B6B 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.auth-error-title {
    color: var(--error);
}

.auth-error-message {
    margin-bottom: 24px;
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-link {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.form-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus {
    border-color: var(--primary-color);
    background: rgba(0, 210, 106, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 210, 106, 0.1);
}

.form-input:hover:not(:focus) {
    border-color: var(--text-tertiary);
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--text-secondary);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.eye-icon,
.eye-off-icon {
    width: 20px;
    height: 20px;
}

/* Login Button */
.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--background);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 4px;
}

.login-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-button svg {
    width: 18px;
    height: 18px;
}

/* Button Spinner */
.button-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(10, 15, 20, 0.3);
    border-top-color: var(--background);
    border-radius: 50%;
    animation: buttonSpin 0.7s linear infinite;
}

@keyframes buttonSpin {
    to { transform: rotate(360deg); }
}

/* Social Login Buttons */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

.social-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Google button */
.social-button.google {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    color: #1F2937;
}

.social-button.google:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Microsoft button */
.social-button.microsoft {
    background: #2F2F2F;
    border: 1px solid #3F3F3F;
    color: #FFFFFF;
}

.social-button.microsoft:hover {
    background: #3F3F3F;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Apple button */
.social-button.apple {
    background: #000000;
    border: 1px solid #2F2F2F;
    color: #FFFFFF;
}

.social-button.apple:hover {
    background: #1A1A1A;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-button.evenergy {
    background: linear-gradient(135deg, #00D26A 0%, #00B85C 100%);
    border: 1px solid #00D26A;
    color: #FFFFFF;
    font-weight: 600;
}

.social-button.evenergy:hover {
    background: linear-gradient(135deg, #00E676 0%, #00D26A 100%);
    box-shadow: 0 4px 12px rgba(0, 210, 106, 0.4);
    transform: translateY(-1px);
}

.social-button.evenergy svg {
    stroke: #FFFFFF;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider-text {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Info Section */
.info-section {
    background: rgba(0, 210, 106, 0.1);
    border: 1px solid rgba(0, 210, 106, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-top: 8px;
}

.info-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
}

.info-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-text a:hover {
    text-decoration: underline;
}

/* Footer Links (Login) */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 8px;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.notification-success {
    background: var(--primary-color);
    color: var(--background);
}

.notification-error {
    background: #FF4B4B;
    color: white;
}

.notification-info {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Login Page Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 80px 16px 16px;
        align-items: flex-start;
    }

    .login-card {
        padding: 24px 20px;
        margin-top: 0;
    }

    .login-header {
        margin-bottom: 24px;
    }

    .login-title {
        font-size: 22px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .social-buttons {
        gap: 10px;
        margin-bottom: 20px;
    }

    .social-button {
        padding: 12px 16px;
        font-size: 14px;
    }

    .info-section {
        padding: 12px;
    }

    .info-text {
        font-size: 12px;
    }

    .footer-links {
        flex-direction: row;
        gap: 16px;
    }

    .footer {
        padding: 12px 16px;
    }
}

/* ============================================
   Cookie Banner
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.cookie-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.cookie-text a:hover {
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: none;
}

.cookie-btn-primary {
    background: var(--gradient-primary);
    color: var(--background);
}

.cookie-btn-primary:hover {
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.cookie-btn-secondary:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

/* Cookie Banner Responsive */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 16px;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .cookie-text {
        font-size: 13px;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }

    .cookie-btn {
        flex: 1;
        max-width: 150px;
    }
}

/* ============================================
   Chat History Sidebar - Full Height Layout
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    max-width: 100vw;
    background: #000000;
}

.light-mode .app-layout {
    background: #FFFFFF;
}

/* Sidebar container - z-index above input section (100) */
.chat-sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: #1a1f25;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    overflow: hidden;
}

/* Sidebar collapsed state (controlled via parent class) */
.app-layout.sidebar-collapsed .chat-sidebar {
    transform: translateX(-100%);
}

/* Main content area */
.main-content-area {
    position: relative;
    flex: 1;
    margin-left: 280px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: margin-left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    background: #000000;
}

.light-mode .main-content-area {
    background: #FFFFFF;
}

.app-layout.sidebar-collapsed .main-content-area {
    margin-left: 0;
}

/* Sidebar logo section */
.sidebar-logo {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Hide logo completely when sidebar is collapsed */
.app-layout.sidebar-collapsed .sidebar-logo .logo {
    display: none;
}

.sidebar-logo .logo {
    display: flex;
    align-items: center;
}

.sidebar-logo .logo-img {
    height: 34px;
    width: auto;
    display: block;
}

.sidebar-logo .logo-mobile {
    display: none;
}

/* Header in main content area */
.header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    /* Note: z-index removed - header is transparent and should not create stacking context issues */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    display: none;
}

.sidebar-header {
    padding: 12px 16px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.app-layout.sidebar-collapsed .sidebar-header {
    opacity: 0;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary-color);
    color: #0A0F14;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

/* Data sources page main container override */
.data-sources-main {
    max-width: none;
    padding: 0;
}

.new-chat-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.light-mode .new-chat-btn {
    color: #FFFFFF;
}

/* ============================================
   Agent Selector (hidden - beta feature)
   ============================================ */
.agent-selector {
    display: none; /* Hidden for now - beta feature */
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.agent-selector-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.agent-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agent-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: left;
    width: 100%;
}

.agent-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.agent-btn.active {
    background: rgba(0, 210, 106, 0.1);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.agent-btn.active .agent-emoji {
    transform: scale(1.1);
}

.agent-emoji {
    font-size: 18px;
    width: 24px;
    text-align: center;
    transition: transform 0.2s ease;
}

/* Make Eve's lightning bolt ev.energy green */
.agent-btn[data-agent="eve"] .agent-emoji,
.eve-emoji-green {
    filter: hue-rotate(100deg) saturate(2) brightness(1.1);
    display: inline;
}

.agent-name {
    flex: 1;
}

.agent-beta {
    font-size: 8px;
    font-weight: 700;
    padding: 2px 5px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border-radius: 3px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: auto;
    box-shadow: 0 1px 3px rgba(255, 107, 53, 0.3);
}

.agent-btn.active .agent-beta {
    background: linear-gradient(135deg, #00d26a, #00b85c);
    box-shadow: 0 1px 3px rgba(0, 210, 106, 0.3);
}

/* Hide agent selector when sidebar is collapsed */
.app-layout.sidebar-collapsed .agent-selector {
    display: none;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.sidebar-toggle:hover {
    background: #31353b;
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

/* Expand button - fixed position so it's always visible while scrolling */
.sidebar-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.15s ease,
                color 0.15s ease,
                border-color 0.15s ease,
                box-shadow 0.15s ease;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 150;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.sidebar-expand-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.app-layout.sidebar-collapsed .sidebar-expand-btn {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-expand-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

/* Light mode sidebar expand button styling */
.light-mode .sidebar-expand-btn {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.light-mode .sidebar-expand-btn:hover {
    background: #e6fbf0;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.chat-list,
.sidebar-spacer {
    flex: 1;
}

.chat-list {
    overflow-y: auto;
    padding: 8px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.app-layout.sidebar-collapsed .chat-list {
    opacity: 0;
}

.chat-list::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-list::-webkit-scrollbar-thumb {
    background: #31353b;
    border-radius: 3px;
}

.chat-list::-webkit-scrollbar-thumb:hover {
    background: #484c51;
}

.chat-list-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.chat-item:hover {
    background: #252a30;
}

.chat-item.active {
    background: #21352d;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
    color: inherit;
}

.chat-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.chat-item-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chat-item:hover .chat-item-actions {
    opacity: 1;
}

.chat-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-item-btn:hover {
    background: #31353b;
    color: var(--text-primary);
}

.chat-item-btn.delete:hover {
    background: #3c262b;
    color: var(--error);
}

.chat-rename-input {
    width: 100%;
    padding: 4px 8px;
    background: var(--background);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border);
    background: #1a1f25;
    flex-shrink: 0;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.app-layout.sidebar-collapsed .sidebar-footer {
    opacity: 0;
}

.sidebar-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.sidebar-nav-link:hover {
    background: #252a30;
    color: var(--text-primary);
}

.sidebar-nav-link.active {
    background: #244031;
    color: var(--primary-color);
}

.sidebar-nav-link svg {
    flex-shrink: 0;
}

/* ============================================
   User Profile Section (Sidebar)
   ============================================ */
.sidebar-user-section {
    position: relative;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* User profile button with avatar */
.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.user-profile-btn:hover {
    background: #252a30;
}

.user-profile-btn[aria-expanded="true"] {
    background: #2c3136;
}

/* User avatar bubble */
.user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #00b85c);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(92, 250, 115, 0.25);
}

.user-initials {
    font-size: 13px;
    font-weight: 600;
    color: #0A0F14;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Anonymous avatar icon (email-only users) - inherits green from .user-avatar */
.user-avatar-anonymous .user-icon {
    color: #0A0F14;
}

.user-display-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-chevron {
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.user-profile-btn[aria-expanded="true"] .dropdown-chevron {
    transform: rotate(180deg);
}

/* User dropdown menu */
.user-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 300;
    overflow: hidden;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: left;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.user-dropdown-item.logout:hover {
    background: rgba(255, 75, 75, 0.1);
    color: var(--error);
}

.user-dropdown-item svg {
    flex-shrink: 0;
}

/* Theme toggle icons in dropdown */
.user-dropdown-item .sun-icon {
    display: none;
}

.user-dropdown-item .moon-icon {
    display: block;
}

.light-mode .user-dropdown-item .sun-icon {
    display: block;
}

.light-mode .user-dropdown-item .moon-icon {
    display: none;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Login button (when not authenticated) */
.sidebar-login-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.sidebar-login-btn:hover {
    background: #21352d;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.sidebar-login-btn svg {
    flex-shrink: 0;
}

/* ============================================
   Error Message Styles
   ============================================ */
.error-message-text {
    color: var(--error);
}

.error-retry-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: var(--background);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
}

.error-retry-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* Sidebar Responsive */
@media (max-width: 900px) {
    .chat-sidebar {
        box-shadow: var(--shadow-lg);
    }

    /* Mobile layout: simplified positioning */
    .main-content-area {
        margin-left: 0;
        height: 100vh;
        height: 100dvh;
    }

    .app-layout:not(.sidebar-collapsed) .main-content-area {
        margin-left: 0;
    }

    /* On mobile, show expand button and overlay sidebar */
    .sidebar-expand-btn {
        opacity: 1;
        pointer-events: auto;
    }

    .app-layout:not(.sidebar-collapsed) .sidebar-expand-btn {
        opacity: 0;
        pointer-events: none;
    }

    /* Hide powered-by feature boxes on mobile but keep the data sources title */
    .features-grid {
        display: none !important;
    }

    /* Compact sidebar spacing for mobile */
    .sidebar-logo {
        padding: 10px 12px;
    }

    /* On mobile, use smaller logo size */
    .sidebar-logo .logo-img,
    .header-logo .logo-img {
        height: 24px;
        width: auto;
    }

    /* Keep sidebar logo area sized appropriately on mobile */
    .sidebar-logo .logo {
        max-width: none;
    }

    /* Hide header logo on mobile - keep it hidden even when sidebar collapsed */
    .header-logo {
        display: none !important;
    }

    .sidebar-toggle {
        width: 32px;
        height: 32px;
    }

    .sidebar-header {
        padding: 8px 12px;
    }

    .new-chat-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .agent-selector {
        padding: 8px 12px;
    }

    .agent-selector-label {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .agent-list {
        gap: 2px;
    }

    .agent-btn {
        padding: 6px 10px;
        gap: 8px;
        font-size: 13px;
    }

    .agent-emoji {
        font-size: 16px;
        width: 20px;
    }

    .agent-beta {
        font-size: 7px;
        padding: 1px 4px;
    }

    .chat-list {
        padding: 4px;
    }

    .chat-item {
        padding: 8px 10px;
        margin-bottom: 1px;
    }

    .chat-item-title {
        font-size: 12px;
    }

    .chat-item-time {
        font-size: 10px;
    }

    .sidebar-footer {
        padding: 8px 12px 12px;
    }

    .sidebar-nav-links {
        gap: 2px;
        margin-bottom: 8px;
    }

    .sidebar-nav-link {
        padding: 6px 10px;
        gap: 8px;
        font-size: 12px;
    }

    .sidebar-nav-link svg {
        width: 14px;
        height: 14px;
    }

    /* User profile section - mobile */
    .sidebar-user-section {
        margin-top: 6px;
        padding-top: 10px;
    }

    .user-profile-btn {
        padding: 6px 8px;
        gap: 8px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .user-initials {
        font-size: 12px;
    }

    .user-display-name {
        font-size: 12px;
    }

    .dropdown-chevron {
        width: 10px;
        height: 10px;
    }

    .user-dropdown-item {
        padding: 14px 12px;
        font-size: 13px;
    }

    .sidebar-login-btn {
        padding: 8px 10px;
        gap: 8px;
        font-size: 12px;
    }

    .sidebar-login-btn svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .chat-sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }

    /* On full-width sidebar, dropdown items need larger touch targets */
    .user-dropdown-item {
        padding: 16px 14px;
    }
}

/* ============================================
   VPP Map Container (Google Maps)
   ============================================ */
.map-container {
    margin: 16px 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    z-index: 1; /* Ensure map stays below fixed input-section (z-index: 100) */
}

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

.map-title-section {
    flex: 1;
}

.map-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.map-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.map-fullscreen-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.map-fullscreen-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.vpp-map-canvas {
    width: 100%;
    max-width: 100%;
    height: 350px;
    border-radius: 8px;
    background: #1d2c4d;
    overflow: hidden;
}

/* Ensure Leaflet controls don't cause overflow */
.vpp-map-canvas .leaflet-control-attribution {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vpp-map-canvas .leaflet-control-container {
    max-width: 100%;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.map-legend-label {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.map-legend-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.map-legend-note {
    width: 100%;
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}

/* Map Data Sources - uses shared styles from map-view.css
   Only override container styling for inline maps context */
.map-container .data-sources-list {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-right: 0;
    background: transparent;
    gap: 4px 12px;
}

/* Smaller font for data sources in chat context */
.map-container .data-source-item a,
.map-container .data-source-item span:first-child {
    font-size: 10px;
}

.map-container .data-source-desc {
    font-size: 9px;
}

.map-container .data-sources-list:empty {
    display: none;
}

/* Map Stats Bar - matching /map page design */
.map-stats-bar {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface-secondary, rgba(0, 0, 0, 0.2));
    border-radius: 8px 8px 0 0;
    flex-wrap: nowrap;
    margin: -16px -16px 12px -16px;
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
}

.map-stat-item {
    text-align: center;
    flex: 1 1 0;
    min-width: 0;
}

.map-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary, #5CFA73);
}

.map-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Responsive map styles */
@media (max-width: 768px) {
    .vpp-map-canvas {
        height: 280px;
        max-width: 100%;
    }

    /* Ensure Leaflet containers don't overflow */
    .vpp-map-canvas .leaflet-container {
        max-width: 100%;
    }

    .map-stats-bar {
        gap: 6px;
        padding: 8px 12px;
        margin-left: -16px;
        margin-right: -16px;
    }

    .map-stat-item {
        flex: 1 1 0;
        min-width: 0;
    }

    .map-stat-value {
        font-size: 14px;
    }

    .map-stat-label {
        font-size: 9px;
    }

    .map-legend {
        gap: 8px;
    }

    .map-legend-item {
        flex: 0 0 auto;
    }
}

/* ============================================
   Chart View Page Styles
   Used by /chart/view/{id} for standalone chart viewing
   ============================================ */

.chart-view-page {
    min-height: 100vh;
    background: var(--background);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.chart-view-header {
    max-width: var(--chat-max-width);
    width: 100%;
    margin: 0 auto 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.chart-view-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.back-link:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.chart-view-container {
    max-width: var(--chat-max-width);
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

.chart-view-container .chart-container {
    max-height: none;
}

.chart-view-container .plotly-chart {
    height: 400px;
    max-height: 400px;
}

.chart-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}


.chart-view-footer {
    max-width: var(--chat-max-width);
    width: 100%;
    margin: 30px auto 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.chart-view-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.chart-view-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .chart-view-page {
        padding: 12px;
    }

    .chart-view-container .plotly-chart {
        height: 320px;
        max-height: 320px;
    }

    .chart-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Theme Toggle Button
   ============================================ */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 150;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.theme-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    stroke: white;
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

/* Light mode: show sun, hide moon */
.light-mode .theme-toggle .sun-icon {
    display: block;
}

.light-mode .theme-toggle .moon-icon {
    display: none;
}

/* Light mode theme toggle button styling */
.light-mode .theme-toggle {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.light-mode .theme-toggle svg {
    stroke: #333;
}

.light-mode .theme-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Header theme toggle container */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Sidebar theme toggle button */
.sidebar-theme-toggle {
    position: relative;
    cursor: pointer;
    background: transparent;
    border: none;
    font-family: inherit;
}

.sidebar-theme-toggle .sun-icon,
.sidebar-theme-toggle .moon-icon {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Dark mode: show moon icon */
.sidebar-theme-toggle .sun-icon {
    display: none;
}

.sidebar-theme-toggle .moon-icon {
    display: block;
}

/* Light mode: show sun icon */
.light-mode .sidebar-theme-toggle .sun-icon {
    display: block;
}

.light-mode .sidebar-theme-toggle .moon-icon {
    display: none;
}

/* ============================================
   Light Mode Component Overrides
   ============================================ */

/* Sidebar light mode */
.light-mode .chat-sidebar {
    background: #FFFFFF;
    border-right-color: var(--border);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

/* Sidebar logo section light mode */
.light-mode .sidebar-logo {
    border-bottom-color: var(--border);
}

/* Sidebar header light mode */
.light-mode .sidebar-header {
    border-bottom-color: var(--border);
}

/* Agent selector light mode */
.light-mode .agent-selector {
    border-bottom-color: var(--border);
}

.light-mode .agent-selector-label {
    color: var(--text-tertiary);
}

/* Chat list container light mode */
.light-mode .chat-list {
    background: transparent;
}

/* Logo in light mode - use dark version */
.light-mode .logo-img {
    filter: brightness(0) saturate(100%);
}

/* Feature cards light mode */
.light-mode .feature-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.light-mode .feature-card:hover {
    border-color: rgba(0, 210, 106, 0.3);
    box-shadow: var(--shadow-md);
}

/* Input box light mode */
.light-mode .input-box {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.light-mode .input-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.light-mode .chat-input {
    color: var(--text-primary);
    background: transparent;
}

.light-mode .chat-input::placeholder {
    color: var(--text-tertiary);
}

/* Suggestion chips light mode */
.light-mode .suggestion-chip {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-secondary);
}

.light-mode .suggestion-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.light-mode .role-card {
    background: var(--surface);
    border-color: var(--border);
}

.light-mode .role-card:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

/* Chat messages light mode */
.light-mode .chat-message.assistant {
    background: var(--surface);
    border-color: var(--border);
}

.light-mode .chat-message.user {
    background: var(--primary-light);
    border-color: rgba(0, 210, 106, 0.2);
}

/* Agent selector light mode */
.light-mode .agent-btn {
    color: var(--text-secondary);
}

.light-mode .agent-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.light-mode .agent-btn.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Chat list light mode */
.light-mode .chat-item {
    color: var(--text-secondary);
}

.light-mode .chat-item:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.light-mode .chat-item.active {
    background: #e6fbf0;
    color: var(--primary-color);
}

/* Sidebar footer light mode */
.light-mode .sidebar-footer {
    background: #FFFFFF;
    border-top-color: var(--border);
}

.light-mode .sidebar-nav-link {
    color: var(--text-secondary);
}

.light-mode .sidebar-nav-link:hover {
    background: #F1F5F9;
    color: var(--primary-color);
}

.light-mode .sidebar-nav-link.active {
    background: #d9f8e9;
    color: var(--primary-color);
}

/* User profile section light mode */
.light-mode .sidebar-user-section {
    border-top-color: var(--border);
}

.light-mode .user-profile-btn:hover {
    background: #f5f5f5;
}

.light-mode .user-profile-btn[aria-expanded="true"] {
    background: #f0f0f0;
}

.light-mode .user-avatar {
    background: linear-gradient(135deg, #00D26A, #00a857);
    box-shadow: 0 2px 8px rgba(0, 210, 106, 0.2);
}

.light-mode .user-initials {
    color: #FFFFFF;
}

.light-mode .user-avatar-anonymous .user-icon {
    color: #FFFFFF;
}

.light-mode .user-display-name {
    color: var(--text-primary);
}

.light-mode .dropdown-chevron {
    color: var(--text-tertiary);
}

.light-mode .user-dropdown {
    background: #FFFFFF;
    border-color: var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.light-mode .user-dropdown-item {
    color: var(--text-secondary);
}

.light-mode .user-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.light-mode .user-dropdown-item.logout:hover {
    background: rgba(255, 75, 75, 0.08);
    color: var(--error);
}

.light-mode .user-dropdown-divider {
    background: var(--border);
}

.light-mode .sidebar-login-btn {
    color: var(--text-secondary);
    border-color: var(--border);
}

.light-mode .sidebar-login-btn:hover {
    background: #e6fbf0;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Chart containers light mode */
.light-mode .chart-container {
    background: var(--surface);
    border-color: var(--border);
}

/* Eve badge light mode */
.light-mode .eve-badge {
    background: var(--primary-light);
    border-color: rgba(0, 210, 106, 0.3);
}

/* Eve mood card light mode */
.light-mode .eve-mood-card {
    background: linear-gradient(135deg, rgba(0, 210, 106, 0.06) 0%, rgba(0, 210, 106, 0.01) 100%);
    border-color: rgba(0, 210, 106, 0.25);
}

.light-mode .eve-mood-card[data-category="green"] {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.06) 0%, rgba(34, 197, 94, 0.01) 100%);
}

.light-mode .eve-mood-card[data-category="opportunity"] {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(59, 130, 246, 0.01) 100%);
}

.light-mode .eve-mood-card[data-category="caution"] {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(245, 158, 11, 0.01) 100%);
}

.light-mode .eve-mood-card[data-category="insight"] {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06) 0%, rgba(139, 92, 246, 0.01) 100%);
}

.light-mode .suggestion-chip.mood-suggestion {
    background: linear-gradient(135deg, rgba(0, 210, 106, 0.1) 0%, rgba(0, 210, 106, 0.03) 100%);
}

/* Cookie banner light mode */
.light-mode .cookie-banner {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}

/* Inline code light mode */
.light-mode code {
    background: var(--surface-light);
    color: var(--text-primary);
}

.light-mode pre {
    background: #f1f5f9;
    color: #1e293b;
}

.light-mode pre code,
.light-mode .code-block code {
    background: transparent;
    color: #1e293b;
}

.light-mode .code-block {
    background: #f1f5f9;
}

/* Bare pre during streaming — match the final grey code-block look */
.light-mode .message-content pre {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.light-mode .message-content pre code {
    color: #1e293b;
}

.light-mode .code-block-container {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.light-mode .code-header {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #475569;
}

/* Scroll to bottom button light mode */
.light-mode .scroll-to-bottom {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.light-mode .scroll-to-bottom:hover {
    background: #e2e8f0;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Tables light mode */
.light-mode table {
    border-color: var(--border);
}

.light-mode th {
    background: var(--surface-light);
    color: var(--text-primary);
    border-color: var(--border);
}

.light-mode td {
    border-color: var(--border);
    color: var(--text-secondary);
}

/* Scrollbar light mode */
.light-mode ::-webkit-scrollbar-track {
    background: var(--surface);
}

.light-mode ::-webkit-scrollbar-thumb {
    background: var(--border);
}

.light-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Header expand button light mode */
.light-mode .expand-sidebar-btn {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-secondary);
}

.light-mode .expand-sidebar-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Sidebar toggle light mode */
.light-mode .sidebar-toggle {
    color: var(--text-secondary);
}

.light-mode .sidebar-toggle:hover {
    background: var(--surface-light);
    color: var(--primary-color);
}

/* Footer light mode */
.light-mode .powered-footer {
    color: var(--text-tertiary);
}

.light-mode .powered-footer a {
    color: var(--primary-color);
}

/* Send button - keep consistent green */
.light-mode .send-button {
    background: var(--gradient-primary);
    color: #FFFFFF;
}

.light-mode .send-button:hover {
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Typing indicator light mode */
.light-mode .typing-indicator,
.light-mode #typing-indicator,
.light-mode #typingIndicator {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.light-mode .typing-message,
.light-mode .typing-indicator .typing-message,
.light-mode #typing-indicator .typing-message,
.light-mode #typingIndicator .typing-message {
    color: #1A1A2E !important;
}

.light-mode .loading-spinner,
.light-mode .typing-indicator .loading-spinner,
.light-mode #typing-indicator .loading-spinner,
.light-mode #typingIndicator .loading-spinner {
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    border-top: 2px solid #00D26A !important;
}

/* ============================================
   Login Page Light Mode
   ============================================ */

/* Login card - lighter shadow */
.light-mode .login-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Social buttons in light mode */
.light-mode .social-button.microsoft {
    background: #2F2F2F;
    border-color: #3F3F3F;
    color: #FFFFFF;
}

.light-mode .social-button.apple {
    background: #000000;
    border-color: #1A1A1A;
    color: #FFFFFF;
}

/* Info section light mode */
.light-mode .info-section {
    background: rgba(0, 210, 106, 0.08);
    border-color: rgba(0, 210, 106, 0.15);
}

/* Notification toast light mode */
.light-mode .notification-toast {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.light-mode .notification-success {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: #065F46;
}

.light-mode .notification-error {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

.light-mode .notification-info {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1E40AF;
}

/* Cookie button secondary light mode */
.light-mode .cookie-btn-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}

.light-mode .cookie-btn-secondary:hover {
    background: var(--surface-light);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

/* Chart container/card light mode → static/css/artifact-viewer.css */

/* Chart stats grid light mode */
.light-mode .chart-stats-grid {
    background: var(--surface);
    border-color: var(--border);
}

/* Chart view footer light mode */
.light-mode .chart-view-footer {
    color: var(--text-muted);
}

/* Back link light mode (for chart view pages) */
.light-mode .back-link {
    color: var(--text-secondary);
}

.light-mode .back-link:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* ============================================
   Alpha Indicator Badge
   ============================================ */

.alpha-indicator {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(247, 147, 30, 0.15));
    border: 1px solid rgba(255, 107, 53, 0.4);
    border-radius: 24px;
    font-family: 'Inter', 'Libre Franklin', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #ff6b35;
    z-index: 999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.2);
    cursor: default;
    user-select: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.alpha-indicator:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.3);
}

.alpha-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ff6b35;
    border-radius: 50%;
    animation: alphaPulse 2s ease-in-out infinite;
}

.alpha-indicator-tag {
    padding: 2px 6px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.alpha-indicator-text {
    color: rgba(255, 107, 53, 0.9);
    font-weight: 500;
    font-size: 10px;
    white-space: nowrap;
}

@keyframes alphaPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* Light mode adjustments */
.light-mode .alpha-indicator {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(247, 147, 30, 0.1));
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.15);
}

.light-mode .alpha-indicator:hover {
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.25);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .alpha-indicator {
        top: 8px;
        height: 32px;
        padding: 0 12px;
        gap: 6px;
    }

    .alpha-indicator-tag {
        font-size: 8px;
        padding: 2px 5px;
    }

    .alpha-indicator-text {
        font-size: 9px;
    }
}

/* ============================================
   Streaming Text Animation
   ChatGPT-style smooth streaming with cursor
   Uses streaming-markdown (append-only DOM)
   ============================================ */

/* Smooth content transitions during streaming */
.message-content.streaming {
    will-change: contents;
}

/* Streaming cursor — appended via CSS so it always trails the last element */
.message-content.streaming > *:last-child::after,
.message-content.streaming:empty::after {
    content: '▋';
    display: inline;
    color: var(--primary-color);
    animation: streamingCursor 1s step-end infinite;
    margin-left: 1px;
    font-size: 0.9em;
    vertical-align: baseline;
}

@keyframes streamingCursor {
    0%, 50% { opacity: 1; }
    50.1%, 100% { opacity: 0; }
}

/* streaming-markdown creates standard elements — ensure code blocks match theme */
.message-content pre {
    background: var(--code-bg, #1e1e2e);
    border-radius: 8px;
    overflow-x: auto;
}

.message-content pre code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    display: block;
    padding: 12px 16px;
}

.message-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9em;
}

/* Table overrides removed – primary table styles are in the Tables section above */

.message-content blockquote {
    border-left: 3px solid var(--primary-color);
    margin: 8px 0;
    padding: 4px 16px;
    opacity: 0.85;
}

.message-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 16px 0;
}

.message-content img {
    max-width: 100%;
    border-radius: 8px;
}

/* ============================================
   Map Dock Tab + Panel (Eve chat page)
   Mirrors the companion-dock-tab pattern from GI2
   but on the left edge of the main content area.
   ============================================ */

/* --- Horizontal flex layout (map + chat) --- */

.eve-map-layout {
    display: flex;
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.eve-chat-content {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* --- Map panel (left side, collapsed by default) --- */

.eve-map-panel {
    width: 0;
    min-width: 0;
    overflow: hidden;
    border-right: 0 solid var(--border, rgba(255, 255, 255, 0.1));
    background: var(--background, #0A0F14);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-width 0.2s ease;
    /* Contain Google Maps internal z-indices so they don't overlap the sidebar */
    position: relative;
    z-index: 0;
}

.eve-map-layout.map-open .eve-map-panel {
    width: 50%;
    min-width: 360px;
}

.eve-map-panel .gi2-map {
    width: 100%;
    height: 100%;
    position: relative;
}

.eve-map-panel .gi2-map #map {
    width: 100%;
    height: 100%;
}

/* Hide the map's own sidebar button — Eve page has its own in the header */
.eve-map-panel .gi2-expand-btn {
    display: none;
}

/* --- Map divider: show when map panel is open (base styles in dock-tabs.css) --- */

.eve-map-layout.map-open .panel-divider {
    width: 12px;
    opacity: 1;
}

/* Disable transitions while dragging */
.eve-map-layout.panel-dragging .eve-map-panel,
.eve-map-layout.panel-dragging .eve-chat-content {
    transition: none !important;
}

/* Hide dock tabs in embed mode */
body.eve-embed-mode .dock-tab {
    display: none;
}

/* --- Mobile: map panel + dock tab overrides --- */

@media (max-width: 768px) {
    /* Mobile: map panel is full-screen overlay */
    .eve-map-layout.map-open .eve-map-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        min-width: 0;
        z-index: 2000;
        border-right: none;
    }

    /* Sidebar must sit above fullscreen map on mobile */
    .chat-sidebar {
        z-index: 2050;
    }

    /* Sidebar expand button must also sit above fullscreen map */
    .app-layout.sidebar-collapsed .sidebar-expand-btn {
        z-index: 2060;
    }

    /* Hide capacity key on mobile (too small to be useful) */
    .eve-map-panel .gi2-capacity-key {
        display: none !important;
    }

    /* Mobile toggle icon state: when map is open show chat icon, hide map icon */
    .eve-map-layout.map-open ~ .mobile-view-toggle .mobile-toggle-map-icon {
        display: none !important;
    }
    .eve-map-layout.map-open ~ .mobile-view-toggle .mobile-toggle-chat-icon {
        display: block !important;
    }

    /* When map is closed: show map icon, hide chat icon (default) */
    .mobile-view-toggle .mobile-toggle-chat-icon {
        display: none;
    }

    /* --- Asset bar mobile: compact vertical layout overlaying layers --- */
    .eve-map-panel .gi2-asset-bar {
        left: 12px;
        right: auto;
        bottom: 16px;
        max-width: calc(100vw - 70px); /* leave room for zoom controls */
    }

    .eve-map-panel .gi2-asset-bar-inner {
        padding: 8px 10px;
    }

    .eve-map-panel .gi2-asset-bar-top {
        flex-wrap: wrap;
        gap: 6px;
    }

    .eve-map-panel .gi2-asset-name {
        font-size: 11px;
        border-right: none;
        padding-right: 0;
        width: 100%;
    }

    .eve-map-panel .gi2-asset-items {
        flex-wrap: wrap;
        gap: 4px;
    }

    .eve-map-panel .gi2-asset-item {
        padding: 3px 6px;
        gap: 3px;
    }

    .eve-map-panel .gi2-asset-label {
        display: none; /* icons + values only on mobile */
    }

    .eve-map-panel .gi2-asset-value {
        font-size: 11px;
    }

    .eve-map-panel .gi2-asset-icon {
        font-size: 10px;
    }

    .eve-map-panel .gi2-ask-eve-btn {
        margin-left: 0;
        margin-top: 4px;
        width: 100%;
        justify-content: center;
    }
}

/* Reduced motion for map panel (dock tabs handled in dock-tabs.css) */
@media (prefers-reduced-motion: reduce) {
    .eve-map-panel {
        transition: none !important;
    }
}
