/* style.css (ФИНАЛЬНАЯ ВЕРСИЯ) */
body { 
    margin: 0; 
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
}

/* --- Режим Карты --- */
#map-mode-container { display: block; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
#controls {
    position: absolute; top: 10px; left: 10px; width: 280px;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px);
    padding: 15px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}
#controls h2, #controls p { margin: 0 0 10px 0; }
#controls textarea, #controls input {
    width: 95%; padding: 8px; border: 1px solid #ccc; border-radius: 4px;
    margin-bottom: 10px; font-size: 14px;
}
#controls textarea { resize: vertical; }
#controls button {
    width: 100%; padding: 12px; border: none; border-radius: 4px;
    background-color: #007bff; color: white; font-size: 16px; cursor: pointer;
}

#plan-mode-container {
    display: none; /* Изначально скрыт */
    width: 100vw;
    height: 100vh;
    background-color: #F8F9FA;
    /* Строка ниже была лишней и вызывала конфликт. Мы ее убираем. */
    /* display: flex; */
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#plan-sheet {
    width: 80%;
    height: 80%;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #E9ECEF;
    position: relative;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#plan-title {
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #343A40;
}

#plan-svg-container {
    flex-grow: 1;
    position: relative;
}

#plan-svg-container svg {
    overflow: visible;
    position: absolute;
    width: 100%;
    height: 100%;
}

#plan-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
}
#plan-controls button {
    padding: 10px 15px; border: 1px solid #ccc; border-radius: 4px;
    background-color: white; cursor: pointer; font-size: 14px;
}

/* Элементы чертежа */
#plan-adornments {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
}
#north-arrow { text-align: center; font-weight: bold; }
#arrow-pointer {
    width: 0; height: 0; border-left: 7px solid transparent;
    border-right: 7px solid transparent; border-bottom: 14px solid #333;
    margin: 0 auto;
}
#scale-bar {
    position: relative; /* Необходимо для позиционирования псевдоэлемента */
    height: 8px; /* Немного увеличим высоту для лучшего вида */
    border-bottom: 2px solid #333;
    border-left: 2px solid #333;
    border-right: 2px solid #333;
    box-sizing: content-box; /* Важно для корректной высоты границ */
}

#scale-bar::after {
    content: attr(data-label); /* Магия: берем текст из data-атрибута */
    position: absolute;
    top: 100%; /* Располагаем подпись сразу под линейкой */
    margin-top: 2px; /* Добавляем небольшой отступ от линейки до текста */
    left: 50%;
    transform: translateX(-50%); /* Центрируем текст по горизонтали */
    font-size: 12px;
    color: #333;
}
/* Стили для печати */
@media print {
    body { background: white; }
    #map-mode-container, #plan-controls { display: none; }
    #plan-mode-container { display: flex; }
    #plan-sheet {
        width: 100%; height: 100%; border: none; box-shadow: none;
        padding: 20mm;
    }
}

/* Правило vector-effect больше не нужно, мы его убрали */