﻿:root {
            --bg-main: #0c1620;
            --text-light: #ecf6ff;
            --accent: #27c4be;
            --accent-strong: #17a09b;
            --line: #2d3e53;
            --panel-bg: rgba(7, 14, 22, 0.86);
            --panel-soft: #0f1b29;
        }

        * {
            box-sizing: border-box;
        }

        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
            background: var(--bg-main);
            color: var(--text-light);
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        #app {
            width: 100vw;
            height: 100vh;
            overflow: hidden;
        }

        #viewportWrap {
            position: relative;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle at 20% 20%, rgba(40, 72, 102, 0.12) 0%, rgba(12, 22, 32, 0.02) 65%);
        }

        body.has-graph-background #graph-canvas {
            opacity: 1 !important;
        }

        body.has-graph-background::before {
            background:
                radial-gradient(120% 90% at 50% 0%, rgba(3, 8, 16, 0.05) 0%, rgba(3, 8, 16, 0.12) 56%, rgba(3, 8, 16, 0.18) 100%),
                linear-gradient(180deg, rgba(2, 5, 11, 0.03), rgba(2, 5, 11, 0.12)) !important;
        }

        #viewport {
            width: 100%;
            height: 100%;
            display: block;
            cursor: grab;
        }

        #axesGizmo {
            position: absolute;
            left: 14px;
            bottom: 56px;
            width: 138px;
            height: 138px;
            display: block;
            z-index: 6;
            pointer-events: none;
            border-radius: 10px;
            border: 1px solid rgba(133, 170, 202, 0.35);
            background: rgba(7, 16, 26, 0.42);
            backdrop-filter: blur(2px);
        }

        #hint {
            position: absolute;
            left: 16px;
            bottom: 14px;
            font-size: 0.8rem;
            padding: 7px 10px;
            border-radius: 8px;
            background: rgba(8, 17, 26, 0.72);
            border: 1px solid rgba(148, 185, 216, 0.25);
            backdrop-filter: blur(4px);
            z-index: 5;
        }

        #viewportControls {
            position: absolute;
            top: 14px;
            left: 16px;
            z-index: 6;
            padding: 6px 9px;
            border-radius: 8px;
            border: 1px solid rgba(170, 205, 238, 0.45);
            background: rgba(6, 15, 24, 0.72);
            backdrop-filter: blur(4px);
        }

        #homeButton {
            position: absolute;
            top: 14px;
            right: 16px;
            z-index: 9;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 86px;
            border-radius: 8px;
            border: 1px solid rgba(170, 205, 238, 0.45);
            background: rgba(6, 15, 24, 0.8);
            color: #efffe7;
            text-decoration: none;
            font-size: 0.82rem;
            font-weight: 700;
            padding: 8px 12px;
            backdrop-filter: blur(4px);
            transition: background 0.2s ease, transform 0.15s ease;
        }

        #homeButton:hover {
            background: rgba(10, 24, 38, 0.92);
            transform: translateY(-1px);
        }

        #langToggleBtn {
            position: absolute;
            top: 56px;
            right: 16px;
            z-index: 9;
            display: inline-flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: center;
            min-width: 132px;
            border-radius: 8px;
            border: 1px solid rgba(170, 205, 238, 0.45);
            background: rgba(6, 15, 24, 0.8);
            color: #efffe7;
            font-size: 0.72rem;
            font-weight: 700;
            padding: 6px 10px;
            cursor: pointer;
            backdrop-filter: blur(4px);
            transition: background 0.2s ease, transform 0.15s ease;
            text-align: left;
        }

        #langToggleBtn:hover {
            background: rgba(10, 24, 38, 0.92);
            transform: translateY(-1px);
        }

        .lang-toggle-title {
            font-size: 0.62rem;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            color: rgba(210, 228, 244, 0.86);
            margin-bottom: 2px;
        }

        .lang-toggle-values {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 0.72rem;
            letter-spacing: 0.015em;
            color: rgba(224, 239, 253, 0.95);
        }

        .lang-toggle-option {
            opacity: 0.62;
            transition: opacity 0.18s ease, color 0.18s ease, text-shadow 0.18s ease;
        }

        .lang-toggle-option.is-active {
            opacity: 1;
            color: #f5fffd;
            text-shadow: 0 0 8px rgba(130, 238, 219, 0.4);
        }

        .lang-toggle-sep {
            opacity: 0.5;
        }

        #selectionColorPanel {
            position: absolute;
            left: 14px;
            top: 14%;
            transform: translateY(-50%);
            z-index: 8;
            display: grid;
            gap: 6px;
            justify-items: center;
            text-align: center;
            width: min(200px, calc(100vw - 24px));
            padding: 6px 8px;
            border-radius: 10px;
            border: 1px solid rgba(133, 170, 202, 0.35);
            background: rgba(7, 16, 26, 0.72);
            backdrop-filter: blur(6px);
        }

        .selection-color-title {
            margin: 0;
            color: #d8e9fa;
            font-size: 0.72rem;
            font-weight: 600;
            line-height: 1.35;
        }

        .selection-color-row {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .selection-color-icon {
            width: 16px;
            height: 16px;
            border-radius: 999px;
            border: 1px solid rgba(178, 208, 236, 0.5);
            background:
                conic-gradient(
                    from 30deg,
                    #ff6b6b,
                    #ffd166,
                    #7bd389,
                    #64b5f6,
                    #c792ea,
                    #ff6b6b
                );
            box-shadow: inset 0 0 0 1px rgba(10, 18, 28, 0.38);
            flex: 0 0 auto;
        }

        #selectionColorInput {
            width: 44px;
            height: 30px;
            border-radius: 7px;
            border: 1px solid rgba(166, 199, 230, 0.45);
            background: transparent;
            cursor: pointer;
            padding: 0;
        }

        #selectionColorInput::-webkit-color-swatch-wrapper {
            padding: 0;
        }

        #selectionColorInput::-webkit-color-swatch {
            border: none;
            border-radius: 6px;
        }

        #selectionColorInput::-moz-color-swatch {
            border: none;
            border-radius: 6px;
        }

        #selectionColorApplyBtn {
            border: 1px solid rgba(120, 158, 189, 0.4);
            border-radius: 7px;
            background: rgba(12, 24, 36, 0.9);
            color: #e7f2ff;
            font-size: 0.72rem;
            font-weight: 700;
            padding: 4px 10px;
            cursor: pointer;
        }

        #selectionColorApplyBtn:hover:not(:disabled) {
            border-color: rgba(132, 205, 238, 0.56);
            background: rgba(16, 34, 49, 0.96);
        }

        #selectionColorApplyBtn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            border-color: rgba(98, 121, 142, 0.38);
            background: rgba(10, 20, 30, 0.7);
        }

        .overlay-toggle {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.76rem;
            color: #e7f2ff;
            user-select: none;
            cursor: pointer;
        }

        .overlay-toggle input[type="checkbox"] {
            width: 14px;
            height: 14px;
            margin: 0;
            accent-color: #74d6ff;
        }

        #topToolbar {
            position: absolute;
            top: 14px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 8;
            display: flex;
            gap: 10px;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            width: min(920px, calc(100vw - 56px));
        }

        .toolbar-btn {
            min-width: 164px;
            border-radius: 10px;
            border: 1px solid #4dd6d2;
            padding: 8px 12px;
            font-size: 0.85rem;
            font-weight: 700;
            background: rgba(13, 28, 39, 0.92);
            color: #dff9ff;
            cursor: pointer;
            transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
        }

        .toolbar-btn:hover {
            transform: translateY(-1px);
            background: rgba(17, 39, 55, 0.96);
        }

        .toolbar-btn:disabled {
            cursor: not-allowed;
            opacity: 0.55;
            border-color: #51657a;
        }

        .toolbar-btn.locked {
            text-decoration: line-through;
            text-decoration-thickness: 2px;
        }

        .toolbar-btn.toolbar-btn--small {
            min-width: 128px;
            padding-inline: 10px;
            font-size: 0.8rem;
        }

        .toolbar-btn.is-active {
            border-color: #7de7d5;
            background: rgba(18, 45, 47, 0.95);
            color: #d9fff9;
            box-shadow: 0 0 0 1px rgba(125, 231, 213, 0.2) inset;
        }

        #openAddNodeBtn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 9px;
        }

        .btn-plus-neon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            border-radius: 999px;
            font-size: 1.08rem;
            font-weight: 900;
            line-height: 1;
            color: #d4ffdd;
            border: 1px solid rgba(120, 255, 165, 0.95);
            background: radial-gradient(circle at 35% 30%, rgba(121, 255, 156, 0.85), rgba(36, 162, 74, 0.88));
            box-shadow:
                0 0 8px rgba(102, 255, 153, 0.85),
                0 0 16px rgba(102, 255, 153, 0.45),
                inset 0 0 5px rgba(214, 255, 228, 0.65);
        }

        #emptyGraphAddNodeBtn {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            z-index: 8;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            min-width: 260px;
            border-radius: 14px;
            border: 1px solid rgba(119, 255, 166, 0.58);
            padding: 14px 18px;
            font-size: 1rem;
            font-weight: 800;
            color: #e6fff0;
            background: rgba(8, 24, 18, 0.84);
            box-shadow:
                0 0 16px rgba(85, 255, 145, 0.26),
                inset 0 0 0 1px rgba(179, 255, 208, 0.16);
            cursor: pointer;
            transition: transform 0.16s ease, background 0.2s ease, box-shadow 0.2s ease;
        }

        #emptyGraphAddNodeBtn:hover {
            transform: translate(-50%, -51%);
            background: rgba(10, 31, 22, 0.9);
            box-shadow:
                0 0 22px rgba(85, 255, 145, 0.34),
                inset 0 0 0 1px rgba(179, 255, 208, 0.24);
        }

        #emptyGraphAddNodeBtn[hidden] {
            display: none !important;
        }

        .empty-add-plus {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            border-radius: 999px;
            font-size: 1.22rem;
            line-height: 1;
            font-weight: 900;
            color: #ddffe8;
            border: 1px solid rgba(120, 255, 165, 0.95);
            background: radial-gradient(circle at 35% 30%, rgba(121, 255, 156, 0.9), rgba(36, 162, 74, 0.92));
            box-shadow:
                0 0 10px rgba(102, 255, 153, 0.9),
                0 0 20px rgba(102, 255, 153, 0.45),
                inset 0 0 6px rgba(214, 255, 228, 0.72);
            flex: 0 0 auto;
        }

        .export-menu {
            position: relative;
            display: inline-flex;
        }

        .export-menu-btn {
            min-width: 206px;
            justify-content: space-between;
            gap: 8px;
        }

        .export-menu-caret {
            font-size: 0.8rem;
            opacity: 0.9;
        }

        .export-menu-list {
            position: absolute;
            top: calc(100% + 2px);
            left: 0;
            min-width: 290px;
            display: none;
            grid-auto-rows: minmax(0, auto);
            gap: 4px;
            padding: 6px;
            border-radius: 10px;
            border: 1px solid rgba(133, 170, 202, 0.35);
            background: rgba(7, 16, 26, 0.94);
            backdrop-filter: blur(6px);
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
            z-index: 20;
        }

        .export-menu:focus-within .export-menu-list,
        .export-menu.open .export-menu-list {
            display: grid;
        }

        .export-menu-item {
            border: 1px solid rgba(120, 158, 189, 0.36);
            border-radius: 8px;
            background: rgba(12, 24, 36, 0.9);
            color: #e7f2ff;
            font-size: 0.78rem;
            font-weight: 600;
            padding: 7px 10px;
            text-align: left;
            line-height: 1.25;
            white-space: normal;
            cursor: pointer;
        }

        .export-menu-item:hover {
            border-color: rgba(132, 205, 238, 0.56);
            background: rgba(16, 34, 49, 0.96);
        }

        .export-menu-item:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            border-color: rgba(98, 121, 142, 0.38);
            background: rgba(10, 20, 30, 0.7);
        }

        .floating-card {
            position: absolute;
            top: 58px;
            left: 50%;
            transform: translateX(-50%);
            width: min(360px, calc(100vw - 34px));
            max-height: calc(100vh - 150px);
            overflow: auto;
            z-index: 7;
            border: 1px solid var(--line);
            border-radius: 12px;
            padding: 10px;
            background: var(--panel-bg);
            backdrop-filter: blur(7px);
            display: none;
        }

        .floating-card.open {
            display: block;
        }

        .floating-card h2 {
            margin: 0 0 8px;
            font-size: 0.88rem;
            color: #eef6ff;
        }

        .field {
            display: grid;
            gap: 3px;
            margin-bottom: 6px;
        }

        .field label {
            font-size: 0.76rem;
            font-weight: 600;
            color: #d5e3f3;
        }

        .field input,
        .field select {
            width: 100%;
            border-radius: 7px;
            border: 1px solid #415567;
            padding: 6px 7px;
            font-size: 0.78rem;
            color: #f2f7ff;
            background: #070c12;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .field input::placeholder {
            color: #94a5b9;
        }

        .field input:focus,
        .field select:focus {
            outline: none;
            border-color: #6a8eb2;
            box-shadow: 0 0 0 2px rgba(106, 142, 178, 0.25);
        }

        .action-btn {
            background: var(--accent);
            color: #041014;
            border: 1px solid #4ce0e1;
            width: 100%;
            border-radius: 8px;
            padding: 8px 9px;
            font-size: 0.8rem;
            cursor: pointer;
            font-weight: 700;
        }

        .action-btn:hover {
            background: var(--accent-strong);
            color: #e8feff;
            border-color: #4ad4d6;
        }

        .action-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            border-color: #415364;
            color: #c5ceda;
        }

        .connections {
            max-height: 96px;
            overflow-y: auto;
            border: 1px dashed #4c6176;
            border-radius: 7px;
            padding: 6px;
            background: #08121c;
        }

        .connection-item {
            display: grid;
            grid-template-columns: 1fr 78px;
            gap: 6px;
            align-items: center;
            margin-bottom: 5px;
            font-size: 0.75rem;
            color: #dbe9f7;
        }

        .connection-item:last-child {
            margin-bottom: 0;
        }

        .connection-item label {
            display: flex;
            align-items: center;
            gap: 6px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .muted {
            margin: 0;
            color: #9eafc2;
            font-size: 0.72rem;
        }

        .list {
            margin: 5px 0 0;
            padding-left: 15px;
            font-size: 0.73rem;
            max-height: 70px;
            overflow-y: auto;
        }

        .status {
            margin: 0;
            font-size: 0.72rem;
            color: #abd4ff;
            min-height: 14px;
        }

        #infoDock {
            position: absolute;
            right: 16px;
            bottom: 16px;
            width: 250px;
            max-height: 48vh;
            overflow: auto;
            border-radius: 10px;
            border: 1px solid var(--line);
            background: var(--panel-bg);
            backdrop-filter: blur(7px);
            z-index: 6;
            padding: 8px;
        }

        #infoDock h3 {
            margin: 6px 0 3px;
            font-size: 0.75rem;
            color: #d5deea;
        }

        .graph-label-layer {
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
            z-index: 10;
        }

        .graph-label {
            --label-opacity: 0;
            --pill-scale: 1;
            pointer-events: none;
            opacity: var(--label-opacity);
            will-change: opacity;
        }

        .graph-label__pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            min-width: 28px;
            padding: 8px 12px;
            border-radius: 999px;
            border: 1px solid rgba(173, 214, 255, 0.46);
            background: rgba(7, 15, 24, 0.76);
            color: #eaf6ff;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.01em;
            line-height: 1;
            box-shadow:
                0 8px 18px rgba(0, 0, 0, 0.32),
                inset 0 1px 0 rgba(255, 255, 255, 0.09);
            backdrop-filter: blur(6px);
            transform: scale(var(--pill-scale));
            transform-origin: center;
            transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
        }

        .graph-label.is-hovered .graph-label__pill {
            border-color: rgba(139, 224, 255, 0.86);
            background: rgba(10, 28, 44, 0.86);
            box-shadow:
                0 10px 22px rgba(0, 0, 0, 0.34),
                0 0 14px rgba(71, 198, 255, 0.24),
                inset 0 1px 0 rgba(255, 255, 255, 0.14);
        }

        .graph-label.is-selected .graph-label__pill {
            border-color: rgba(111, 238, 209, 0.95);
            background: rgba(9, 34, 35, 0.9);
            box-shadow:
                0 12px 26px rgba(0, 0, 0, 0.35),
                0 0 16px rgba(70, 231, 200, 0.28),
                inset 0 1px 0 rgba(255, 255, 255, 0.14);
        }

        .graph-label.is-collision-hidden {
            visibility: hidden;
        }

        .axis-label {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 20px;
            height: 20px;
            padding: 0 6px;
            border-radius: 999px;
            border: 1px solid rgba(185, 214, 240, 0.45);
            background: rgba(6, 14, 22, 0.8);
            color: #eaf5ff;
            font-size: 0.72rem;
            font-weight: 700;
            line-height: 1;
            letter-spacing: 0.02em;
            box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
            backdrop-filter: blur(4px);
            pointer-events: none;
            user-select: none;
        }

        .axis-label--x {
            color: #ff9ea7;
            border-color: rgba(255, 158, 167, 0.62);
        }

        .axis-label--y {
            color: #9af5b4;
            border-color: rgba(154, 245, 180, 0.62);
        }

        .axis-label--z {
            color: #9ec4ff;
            border-color: rgba(158, 196, 255, 0.62);
        }

        .stats-strip {
            margin: 0 0 6px;
            display: flex;
            gap: 6px;
        }

        .pill {
            display: inline-flex;
            align-items: center;
            border-radius: 999px;
            padding: 4px 8px;
            font-size: 0.7rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            color: #d6ecff;
            background: #112031;
            border: 1px solid #2f475f;
        }

        @media (max-width: 980px) {
            #topToolbar {
                top: 12px;
                width: calc(100vw - 24px);
                justify-content: center;
                flex-wrap: wrap;
            }

            #homeButton {
                top: 10px;
                right: 10px;
            }

            #langToggleBtn {
                top: 50px;
                right: 10px;
                min-width: 118px;
                padding: 5px 9px;
            }

            .lang-toggle-title {
                font-size: 0.58rem;
            }

            .lang-toggle-values {
                font-size: 0.68rem;
            }

            #selectionColorPanel {
                top: 50%;
                left: 8px;
                transform: translateY(-50%);
                width: min(182px, calc(100vw - 16px));
            }

            #selectionColorInput {
                width: 42px;
                height: 28px;
            }

            #axesGizmo {
                left: 10px;
                bottom: 54px;
                width: 114px;
                height: 114px;
            }

            .selection-color-icon {
                width: 15px;
                height: 15px;
            }

            .toolbar-btn {
                min-width: 148px;
                font-size: 0.8rem;
            }

            .floating-card {
                top: 102px;
            }

            #infoDock {
                width: min(250px, calc(100vw - 18px));
                right: 9px;
                bottom: 9px;
            }
        }
