.mapObjectToolButton{
    position:relative;
}

/* ================================
   ОКНО ВЫБОРА ОБЪЕКТА
================================ */

.mapObjectPanel{
    position:fixed;
    top:50%;
    left:50%;
    width:420px;
    max-width:calc(100vw - 40px);
    transform:translate(-50%,-50%) scale(.95);
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    z-index:10000;
    overflow:hidden;
    box-sizing:border-box;
    border:1px solid #e5e7eb;
    border-radius:22px;
    background:rgba(255,255,255,.98);
    box-shadow:0 25px 70px rgba(0,0,0,.18);
    transition:opacity .2s ease,transform .2s ease,visibility .2s ease;
}

.mapObjectPanel.active{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translate(-50%,-50%) scale(1);
}

.mapObjectPanelHeader{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:18px 20px;
    border-bottom:1px solid #eef0f3;
}

.mapObjectPanelTitle{
    display:flex;
    align-items:center;
    gap:12px;
    color:#111827;
    font-size:17px;
    font-weight:800;
}

.mapObjectPanelTitle i{
    width:44px;
    height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:13px;
    background:#ecfdf5;
    color:#059669;
    font-size:18px;
}

.mapObjectPanelClose{
    width:34px;
    height:34px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    border:0;
    border-radius:10px;
    background:transparent;
    color:#9ca3af;
    cursor:pointer;
    transition:background .18s ease,color .18s ease,transform .18s ease;
}

.mapObjectPanelClose:hover{
    background:#f3f4f6;
    color:#374151;
    transform:scale(1.04);
}

.mapObjectPanelBody{
    padding:20px;
}

.mapObjectPanelDescription{
    margin:0 0 16px;
    color:#6b7280;
    font-size:14px;
    line-height:1.5;
}

.mapObjectTools{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.mapObjectTool{
    width:100%;
    display:flex;
    align-items:center;
    gap:13px;
    padding:13px;
    box-sizing:border-box;
    border:1px solid #e5e7eb;
    border-radius:15px;
    background:#fff;
    color:#111827;
    text-align:left;
    cursor:pointer;
    transition:border-color .18s ease,background .18s ease,transform .18s ease,box-shadow .18s ease;
}

.mapObjectTool:hover{
    border-color:#a7f3d0;
    background:#f0fdf4;
    box-shadow:0 7px 20px rgba(16,185,129,.08);
    transform:translateY(-1px);
}

.mapObjectTool.active{
    border-color:#86efac;
    background:#f0fdf4;
    box-shadow:0 7px 20px rgba(16,185,129,.08);
}

.mapObjectToolIcon{
    width:42px;
    height:42px;
    flex:0 0 42px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:11px;
    background:#f0fdf4;
    color:#059669;
    font-size:17px;
}

.mapObjectToolInfo{
    min-width:0;
    flex:1;
}

.mapObjectToolTitle{
    margin-bottom:3px;
    color:#111827;
    font-size:13px;
    font-weight:800;
}

.mapObjectToolDescription{
    color:#6b7280;
    font-size:11px;
    line-height:1.4;
}

/* ================================
   ОКНО СОХРАНЕНИЯ
================================ */

.mapObjectSavePanel{
    position:fixed;
    top:50%;
    left:50%;
    width:700px;
    max-width:calc(100vw - 40px);
    max-height:calc(100vh - 40px);
    transform:translate(-50%,-50%) scale(.95);
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    z-index:10001;
    overflow:auto;
    box-sizing:border-box;
    border:1px solid #e5e7eb;
    border-radius:22px;
    background:rgba(255,255,255,.98);
    box-shadow:0 25px 70px rgba(0,0,0,.18);
    transition:opacity .2s ease,transform .2s ease,visibility .2s ease;
}

.mapObjectSavePanel.active{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translate(-50%,-50%) scale(1);
}

.mapObjectSaveBody{
    padding:20px;
}

.mapObjectTypeInfo{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:17px;
    padding:10px 12px;
    border:1px solid #d1fae5;
    border-radius:13px;
    background:#f0fdf4;
    color:#047857;
    font-size:12px;
    font-weight:800;
}

.mapObjectTypeInfo i{
    width:30px;
    height:30px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:9px;
    background:#dcfce7;
    color:#059669;
}

.mapObjectFormGroup{
    flex:1;
    margin-bottom:13px;
}

.mapObjectFormGroup label{
    display:block;
    margin-bottom:6px;
    color:#6b7280;
    font-size:14px;
    font-weight:600;
}

.mapObjectInput,
.mapObjectTextarea{
    box-sizing:border-box;
    width:100%;
    border:1px solid #e5e7eb;
    outline:none;
    border-radius:11px;
    background:#f8fafc;
    color:#111827;
    font-family:inherit;
    font-size:13px;
    transition:border-color .2s ease,background .2s ease,box-shadow .2s ease;
}

.mapObjectInput{
    height:40px;
    padding:0 11px;
}

.mapObjectTextarea{
    min-height:75px;
    resize:vertical;
    padding:10px 11px;
}

.mapObjectInput:hover,
.mapObjectTextarea:hover{
    border-color:#d1d5db;
}

.mapObjectInput:focus,
.mapObjectTextarea:focus{
    border-color:#86efac;
    background:#fff;
    box-shadow:0 0 0 3px rgba(16,185,129,.08);
}

.mapObjectInput::placeholder,
.mapObjectTextarea::placeholder{
    color:#9ca3af;
}

.mapObjectInput option{
    color:#222;
    background:#fff;
}

.mapObjectStyleRow{
    display:flex;
    gap:10px;
}

.mapObjectColorInput{
    box-sizing:border-box;
    width:100%;
    height:40px;
    padding:3px;
    border:1px solid #e5e7eb;
    border-radius:11px;
    background:#f8fafc;
    cursor:pointer;
}

.mapObjectColorInput:hover{
    border-color:#d1d5db;
}

.mapObjectSaveActions{
    display:flex;
    justify-content:flex-end;
    gap:9px;
    margin-top:7px;
    padding-top:15px;
    border-top:1px solid #eef0f3;
}

.mapObjectCancelButton,
.mapObjectSaveButton{
    height:40px;
    padding:0 16px;
    border-radius:11px;
    border:1px solid #e5e7eb;
    font-family:inherit;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
    transition:background .18s ease,transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}

.mapObjectCancelButton{
    background:#fff;
    color:#374151;
}

.mapObjectSaveButton{
    border-color:#059669;
    background:#059669;
    color:#fff;
    box-shadow:0 4px 12px rgba(5,150,105,.15);
}

.mapObjectCancelButton:hover,
.mapObjectSaveButton:hover{
    transform:translateY(-1px);
}

.mapObjectCancelButton:hover{
    background:#f8fafc;
    border-color:#d1d5db;
}

.mapObjectSaveButton:hover{
    background:#047857;
    border-color:#047857;
    box-shadow:0 6px 16px rgba(5,150,105,.2);
}

.mapObjectSaveButton:disabled{
    opacity:.5;
    cursor:not-allowed;
    transform:none;
    box-shadow:none;
}

/* ================================
   ПАНЕЛЬ РИСОВАНИЯ ОБЪЕКТА
================================ */

.mapObjectDrawingPanel{
    position:fixed;
    top:20px;
    right:20px;
    width:330px;
    max-width:calc(100vw - 40px);
    box-sizing:border-box;
    z-index:9999;
    padding:16px;
    border:1px solid #e5e7eb;
    border-radius:18px;
    background:rgba(255,255,255,.98);
    box-shadow:0 18px 50px rgba(0,0,0,.16);
    opacity:0;
    visibility:hidden;
    transform:translateY(-8px);
    pointer-events:none;
    transition:opacity .2s ease,transform .2s ease,visibility .2s ease;
}

.mapObjectDrawingPanel.active{
    opacity:1;
    visibility:visible;
    transform:translateY(0);
    pointer-events:auto;
}

.mapObjectDrawingPanel .drawingPanelHeader{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:15px;
}

.mapObjectDrawingPanel .drawingPanelHeaderTitle{
    display:flex;
    align-items:center;
    gap:11px;
    min-width:0;
}

.mapObjectDrawingPanel .drawingPanelHeaderIcon{
    width:42px;
    height:42px;
    flex:0 0 42px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    background:#ecfdf5;
    color:#059669;
}

.mapObjectDrawingPanel .drawingPanelHeaderIcon i{
    font-size:17px;
}

.mapObjectDrawingPanel .drawingPanelTitle{
    color:#111827;
    font-size:16px;
    font-weight:800;
    line-height:1.2;
}

.mapObjectDrawingPanel .drawingPanelSubtitle{
    margin-top:3px;
    color:#6b7280;
    font-size:11px;
    line-height:1.3;
}

.mapObjectDrawingPanel .drawingPanelClose{
    width:32px;
    height:32px;
    flex:0 0 32px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    border:0;
    border-radius:9px;
    background:transparent;
    color:#9ca3af;
    cursor:pointer;
    transition:background .18s ease,color .18s ease;
}

.mapObjectDrawingPanel .drawingPanelClose:hover{
    background:#f3f4f6;
    color:#374151;
}

.mapObjectDrawingPanel .drawingPanelInstruction{
    display:flex;
    align-items:flex-start;
    gap:10px;
    margin-bottom:14px;
    padding:12px;
    border:1px solid #e5e7eb;
    border-radius:13px;
    background:#f8fafc;
}

.mapObjectDrawingPanel .drawingPanelInstructionIcon{
    width:34px;
    height:34px;
    flex:0 0 34px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:9px;
    background:#eff6ff;
    color:#2563eb;
}

.mapObjectDrawingPanel .drawingPanelInstructionText{
    display:flex;
    flex-direction:column;
    gap:4px;
    color:#6b7280;
    font-size:12px;
    line-height:1.4;
}

.mapObjectDrawingPanel .drawingPanelInstructionText strong{
    color:#111827;
    font-size:13px;
    font-weight:800;
}

.mapObjectDrawingPanel .drawingPanelStats{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:9px;
    margin-bottom:14px;
}

.mapObjectDrawingPanel .drawingPanelStat{
    min-width:0;
    padding:11px 12px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#fff;
}

.mapObjectDrawingPanel .drawingPanelStatLabel{
    display:block;
    margin-bottom:4px;
    color:#6b7280;
    font-size:11px;
    line-height:1.2;
}

.mapObjectDrawingPanel .drawingPanelStatValue{
    display:block;
    color:#111827;
    font-size:16px;
    font-weight:800;
    line-height:1.2;
}

.mapObjectDrawingPanel .drawingPanelActions{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.mapObjectDrawingPanel .drawingPanelButton{
    width:100%;
    min-height:40px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    padding:0 14px;
    border-radius:11px;
    font-family:inherit;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
    transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease;
}

.mapObjectDrawingPanel .drawingPanelButtonPrimary{
    border:1px solid #059669;
    background:#059669;
    color:#fff;
    box-shadow:0 4px 12px rgba(5,150,105,.14);
}

.mapObjectDrawingPanel .drawingPanelButtonPrimary:hover:not(:disabled){
    background:#047857;
    border-color:#047857;
    transform:translateY(-1px);
    box-shadow:0 6px 16px rgba(5,150,105,.18);
}

.mapObjectDrawingPanel .drawingPanelButtonCancel{
    border:1px solid #e5e7eb;
    background:#fff;
    color:#374151;
}

.mapObjectDrawingPanel .drawingPanelButtonCancel:hover{
    background:#f8fafc;
    border-color:#d1d5db;
    transform:translateY(-1px);
}

.mapObjectDrawingPanel .drawingPanelButton:disabled{
    opacity:.45;
    cursor:not-allowed;
    transform:none;
    box-shadow:none;
}

.mapObjectDrawingPanel .drawingPanelFooter{
    margin-top:12px;
    padding-top:11px;
    border-top:1px solid #eef0f3;
    color:#6b7280;
    font-size:11px;
    line-height:1.45;
    text-align:center;
}

/* ================================
   СТАРАЯ ПОДСКАЗКА
================================ */

.mapObjectDrawingHint{
    position:fixed;
    left:50%;
    bottom:24px;
    transform:translateX(-50%);
    z-index:9998;
    max-width:calc(100vw - 40px);
    padding:9px 14px;
    border:1px solid #e5e7eb;
    border-radius:10px;
    background:rgba(255,255,255,.96);
    box-shadow:0 8px 25px rgba(0,0,0,.12);
    color:#374151;
    font-size:12px;
    line-height:1.3;
    pointer-events:none;
}

/* ================================
   СООБЩЕНИЕ
================================ */

.mapObjectMessage{
    position:fixed;
    left:50%;
    bottom:25px;
    transform:translateX(-50%);
    z-index:11000;
    max-width:calc(100vw - 40px);
    padding:10px 16px;
    border:1px solid #d1fae5;
    border-radius:11px;
    background:#ecfdf5;
    color:#047857;
    box-shadow:0 10px 30px rgba(0,0,0,.14);
    font-size:12px;
    font-weight:700;
}

.mapObjectMessage.error{
    border-color:#fecaca;
    background:#fef2f2;
    color:#b91c1c;
}

/* ================================
   АДАПТИВ
================================ */

@media(max-width:700px){
    .mapObjectPanel{
        width:calc(100vw - 30px);
        max-width:420px;
    }

    .mapObjectSavePanel{
        width:calc(100vw - 30px);
        max-width:700px;
        max-height:calc(100vh - 30px);
    }

    .mapObjectDrawingPanel{
        top:12px;
        right:12px;
        width:calc(100vw - 24px);
        max-width:360px;
    }
}

@media(max-width:450px){
    .mapObjectPanel{
        width:calc(100vw - 24px);
        border-radius:18px;
    }

    .mapObjectSavePanel{
        width:calc(100vw - 24px);
        max-height:calc(100vh - 24px);
        border-radius:18px;
    }

    .mapObjectPanelHeader{
        padding:15px;
    }

    .mapObjectPanelBody,
    .mapObjectSaveBody{
        padding:15px;
    }

    .mapObjectStyleRow{
        flex-direction:column;
        gap:0;
    }

    .mapObjectSaveActions{
        flex-direction:column-reverse;
    }

    .mapObjectCancelButton,
    .mapObjectSaveButton{
        width:100%;
    }

    .mapObjectDrawingPanel{
        top:10px;
        right:10px;
        width:calc(100vw - 20px);
    }
}

/* Балун для просмотра территории */
.map-object-balloon-wrapper{
    position:relative;
    transform-origin:bottom center;
    pointer-events:auto;
}

.map-object-balloon{
    width:320px;
    max-width:calc(100vw - 30px);
    box-sizing:border-box;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.85);
    border-radius:18px;
    background:rgba(255,255,255,.97);
    box-shadow:0 18px 50px rgba(0,0,0,.22);
    font-family:inherit;
}

.map-object-balloon__header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:16px 16px 13px;
}

.map-object-balloon__title{
    min-width:0;
    color:#1f2937;
    font-size:16px;
    font-weight:700;
    line-height:1.3;
}

.map-object-balloon__close{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 32px;
    width:32px;
    height:32px;
    padding:0;
    border:0;
    border-radius:10px;
    background:#f3f4f6;
    color:#6b7280;
    cursor:pointer;
    transition:.15s ease;
}

.map-object-balloon__close:hover{
    background:#e5e7eb;
    color:#1f2937;
}

.map-object-balloon__divider{
    height:1px;
    background:#e5e7eb;
}

.map-object-balloon__body{
    padding:14px 16px 16px;
}

.map-object-balloon__section{
    margin-bottom:14px;
}

.map-object-balloon__section:last-child{
    margin-bottom:0;
}

.map-object-balloon__label{
    margin-bottom:5px;
    color:#9ca3af;
    font-size:10px;
    font-weight:700;
    letter-spacing:.07em;
    line-height:1.3;
    text-transform:uppercase;
}

.map-object-balloon__value{
    display:flex;
    align-items:center;
    gap:8px;
    color:#374151;
    font-size:14px;
    font-weight:500;
    line-height:1.4;
}

.map-object-balloon__value i{
    width:18px;
    text-align:center;
    color:#4d8b69;
}

.map-object-balloon__description{
    color:#4b5563;
    font-size:13px;
    line-height:1.55;
    white-space:pre-line;
    overflow-wrap:anywhere;
}