


.graph-element {
    position: absolute;
    cursor: move;
    user-select: none;
    outline: 2px solid transparent;
    border-radius: 4px;
    transition: outline-color 0.15s ease;
}

.graph-element:hover {
    outline-color: rgba(175, 153, 255, 0.4);
}

.graph-element.selected {
    outline-color: var(--text-editor-accent-highlight, #af99ff);
}


.graph-element .content {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    padding: 4px 8px;
    font-size: 14px;
    color: #000000;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: hidden;
    outline: none;
    cursor: move;
}

.graph-element .content[contenteditable="true"] {
    cursor: text !important;
    user-select: text !important;
}

.graph-element .content:focus {
    outline: none;
    background: rgba(175, 153, 255, 0.08);
    border-radius: 3px;
}


.graph-element .resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--text-editor-accent-highlight, #af99ff);
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: none;
    z-index: 10;
    pointer-events: none;
    touch-action: none;
}

.graph-element.selected .resize-handle {
    display: block;
    pointer-events: auto;
}

.resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }


.graph-element .rotate-handle {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--text-editor-accent-highlight, #af99ff);
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: grab;
    display: none;
    z-index: 10;
    pointer-events: none;
}

.graph-element .rotate-handle::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 12px;
    background: var(--text-editor-accent-highlight, #af99ff);
}

.graph-element.selected .rotate-handle {
    display: block;
    pointer-events: auto;
}

.graph-element .rotate-handle:active {
    cursor: grabbing;
}


.coord-point {
    position: absolute;
    cursor: default;
    user-select: none;
    z-index: 5;
}

.coord-point .point-dot {
    width: 12px;
    height: 12px;
    background: var(--text-editor-accent-highlight, #af99ff);
    border-radius: 50%;
    transition: transform 0.15s ease;
    cursor: move;
}

.coord-point:hover .point-dot {
    transform: scale(1.3);
}

.coord-point.selected .point-dot {
    transform: scale(1.3);
}

.coord-point .point-label {
    position: absolute;
    font-size: 12px;
    color: #000000;
    background: rgba(255, 255, 255, 0.95);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
    min-width: 30px;
    text-align: center;
    outline: none;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    box-sizing: border-box;
}

.coord-point .point-label:active {
    cursor: grabbing;
}

.coord-point .point-label[contenteditable="true"] {
    cursor: text !important;
    user-select: text !important;
}

.coord-point .point-label:focus {
    outline: 1px solid var(--text-editor-accent-highlight, #af99ff);
    background: #ffffff;
}


.axis-label-node.graph-element {
    padding: 12px;
    cursor: default;
}


.axis-label-node.graph-element .content {
    cursor: default;
    width: max-content;
    height: auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    box-sizing: border-box;
}


.shape-box {
    position: relative;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    pointer-events: auto;
    cursor: move;
}

.graph-element.selected .shape-box {
    border-color: var(--text-editor-accent-highlight, #af99ff);
}


.resize-handle.line-endpoint-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--text-editor-accent-highlight, #af99ff);
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: move;
    z-index: 10;
    pointer-events: auto;
    opacity: 1;
}


.canvas-element {
    position: absolute;
    cursor: move;
    user-select: none;
}

.canvas-element.selected {
    outline: none;
}


.canvas-container.is-paste-armed,
.canvas-container.is-paste-armed *,
.canvas-container.is-add-point-armed,
.canvas-container.is-add-point-armed * {
    cursor: crosshair !important;
}


.graph-element .image-content {
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.graph-element .image-content img {
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    width: 100%;
    height: 100%;
}
