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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: sans-serif;
    background: #1e1e1e;
    color: #fff;
}

#app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
}

#viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#world {
    /*position: absolute;*/
    top: 0;
    left: 0;
    transform-origin: 0 0;
    /*transform: translateZ(0);
    will-change: transform;*/
}

.chank {
    position: absolute;
    width: 5000px;
    height: 5000px;
    border: 1px dashed rgba(0, 225, 255, 0.616);
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

.chank-id {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: rgba(255, 255, 255, 0.04);
    font-weight: bold;
}

#selection-box {
    position: absolute;
    border: 1px dashed #0078d7;
    background: rgba(0, 120, 215, 0.1);
    pointer-events: none;
    display: none;
    z-index: 9999;
}

#ctx-menu {
    position: absolute;
    background: #2c2c2c;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px 0;
    display: none;
    z-index: 10000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#ctx-delete {
    padding: 6px 15px;
    font-size: 12px;
    color: #ff5555;
    cursor: pointer;
}

#ctx-menu div:hover {
    background: #3c3c3c;
}

#macaroni-ctx {
    position: absolute;
    background: #2c2c2c;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px 0;
    display: none;
    z-index: 10001;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.m-ctx-item {
    padding: 6px 15px;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
}

.m-ctx-item:hover {
    background: #3c3c3c;
}

.m-ctx-del {
    color: #ff5555 !important;
    border-bottom: 1px solid #444;
    margin-bottom: 4px;
}

.color-picker-row {
    display: flex;
    gap: 6px;
    padding: 6px 15px;
    border-top: 1px solid #444;
    margin-top: 4px;
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

svg.macaroni-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

svg.macaroni-layer path.m-line {
    cursor: pointer;
    pointer-events: stroke !important;
}

svg.macaroni-layer path.m-line:hover {
    stroke-width: 6px !important;
    stroke: #ffcc00 !important;
}

.pg-bar {
    width: 80%;
    background: #eee;
    height: 6px;
    border-radius: 3px;
    margin-top: 6px;
    display: none;
}

.pg-fill {
    width: 0%;
    background: #4a90e2;
    height: 100%;
    border-radius: 3px;
}



.node, .node-header {
    cursor: move;
}

.node-nodeImage .node-img {
    cursor: move !important;
}













/* ПОЧИНЕНО: Категорически запрещаем любые плавные анимации для нод и их обводок! */
.node, 
.node-selected, 
.chank, 
.macaroni-layer {
    transition: none !important;
    animation: none !important;
    will-change: auto !important;
}

/* Выделение должно переключаться мгновенно, без создания новых слоев в браузере */
.node.node-selected {
    outline: 2px solid #0078d7 !important;
    box-shadow: none !important; /* Убираем тяжелые размытые тени, они заставляют GPU мигать */
}






