#map { height: 100vh; width: 100%; }
body { margin: 0; }

/* Стили для окна управления слоями */
.leaflet-control-layers {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: Arial, sans-serif;
    font-size: 14px;
}
.leaflet-control-layers label {
    color: #333;
    padding: 5px 10px;
}
.leaflet-control-layers input[type="checkbox"],
.leaflet-control-layers input[type="radio"] {
    margin-right: 8px;
}
.leaflet-control-layers-expanded {
    padding: 10px;
}

.chat-input {
    flex:1; 
    border:none; 
    padding:12px; 
    border-radius:25px; 
    background:rgba(255,255,255,0.9); 
    color:#333; 
    font-size:14px; 
    outline:none; 
    box-shadow:inset 0 2px 5px rgba(0,0,0,0.1);
}

.chat-container {
    opacity: 0.8;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 850px;
    z-index: 1000;
    background: linear-gradient(#0b476a, #79BD8F);
    border-radius:12px; 
    box-shadow:0 10px 30px rgba(102, 126, 234, 0.3); 
    backdrop-filter:blur(10px); 
    border:1px solid rgba(255,255,255,0.2);
}

.chat-messages{
    height:250px; 
    overflow-y:auto; 
    padding:15px; 
    background:rgba(255, 255, 255, 0.95); 
    border-radius:12px 12px 0 0;
}

.chat-send{
    background:linear-gradient(135deg, #ff6b6b 0%, #ff8e88 100%); 
    color:white; 
    border:none; 
    padding:12px 20px; 
    border-radius:25px; 
    margin-left:10px; 
    cursor:pointer; 
    font-size:16px; 
    transition:transform 0.2s; 
    box-shadow:0 4px 15px rgba(255,107,107,0.4);
}

.chat-status{
    padding:8px 15px; 
    background:rgba(255,255,255,0.2); 
    font-size:12px; 
    border-radius:0 0 12px 12px; 
    color:white; 
    font-weight:500;
}
/* Стили для всплывающих окон */
.custom-popup .leaflet-popup-content-wrapper {
    background-color: #f0f8ff;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}
.custom-popup .leaflet-popup-content {
    font-family: 'Verdana', sans-serif;
    font-size: 12px;
    color: #333;
    padding: 10px;
}
.custom-popup .leaflet-popup-tip {
    background-color: #f0f8ff;
}

/* Стили для векторных слоев */
.custom-vector path.leaflet-interactive {
    stroke: #0066cc;
    stroke-width: 3;
    fill: #99ccff;
    fill-opacity: 0.5;
    transition: fill-opacity 0.2s;
}
.custom-vector path.leaflet-interactive:hover {
    fill-opacity: 0.8;
}

/* Стили для кастомных маркеров */
.custom-marker {
    transition: transform 0.2s;
}
.custom-marker:hover {
    transform: scale(1.2);
}

/* Стили для подсказок */
.leaflet-tooltip {
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    padding: 5px;
}



.message {
    display: flex;
    max-width: 85%;
    margin: 4px 0;
}

.message.user {
    align-self: flex-end;     /* пользователь → справа */
    justify-content: flex-end;
}

.message.assistant,
.message.system {
    align-self: flex-start;   /* ассистент и системные → слева */
    justify-content: flex-start;
}

.bubble {
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 15px;
    word-wrap: break-word;
    hyphens: auto;
    position: relative;
}

/* Пользователь (справа) */
.message.user .bubble {
    background: #007bff;          
    color: white;
    border-bottom-right-radius: 4px;   
}

/* Ассистент (слева) */
.message.assistant .bubble {
    background: #e9ecef;           /* светло-серый */
    color: #212529;
    border-bottom-left-radius: 4px;
}

/* Системные сообщения (ошибки, лимит и т.д.) */
.message.system .bubble {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    align-self: center;
    font-size: 0.9em;
    padding: 8px 12px;
    border-radius: 10px;
}

/* Аватарки (опционально, но сильно улучшает вид) */
.bubble::before {
    content: '';
    width: 28px;
    height: 28px;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
}

/* Аватар слева для ассистента */
.message.assistant .bubble::before {
    left: -38px;
    background: #6c757d url('https://api.dicebear.com/9.x/bottts/svg?seed=assistant') center/cover;
}

/* Аватар справа для пользователя */
.message.user .bubble::before {
    right: -38px;
    background: #0d6efd url('https://api.dicebear.com/9.x/personas/svg?seed=user') center/cover;
}