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

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #0a1628 0%, #1a2845 100%);
            color: #fff;
            overflow: hidden;
        }

        #app {
            display: flex;
            height: 100vh;
        }

        /* Sidebar */
        #sidebar {
            width: 180px;
            min-width: 180px;
            max-width: 180px;
            flex-shrink: 0;
            background: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(10px);
            padding: 6px;
            overflow-y: auto;
            border-right: 2px solid #00d4ff;
            position: fixed;  /* Fixed to always stay in viewport */
            left: 0;
            top: 0;
            height: 100vh;
            z-index: 10000000;  /* Highest z-index, always on top */
        }

        #sidebar::-webkit-scrollbar {
            width: 6px;
        }
        #sidebar::-webkit-scrollbar-thumb {
            background: rgba(0, 212, 255, 0.3);
            border-radius: 3px;
        }

        h1 {
            color: #00d4ff;
            font-size: 0.95em;
            margin-bottom: 2px;
            text-align: center;
        }

        .subtitle {
            color: #81d4fa;
            font-size: 0.6em;
            text-align: center;
            margin-bottom: 8px;
            opacity: 0.8;
        }

        .section {
            background: rgba(0, 180, 216, 0.1);
            border: 1px solid rgba(0, 212, 255, 0.2);
            border-radius: 4px;
            padding: 5px;
            margin-bottom: 6px;
        }

        .section-title {
            color: #00d4ff;
            font-size: 0.75em;
            font-weight: bold;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .section-title::before {
            content: '▸';
            color: #00d4ff;
        }

        .input-group {
            margin-bottom: 8px;
        }

        .input-group label {
            display: block;
            color: #81d4fa;
            font-size: 0.7em;
            margin-bottom: 3px;
        }

        .input-group input {
            width: 100%;
            background: rgba(0, 0, 0, 0.4);
            border: 1px solid rgba(0, 212, 255, 0.3);
            border-radius: 4px;
            padding: 5px 8px;
            color: #fff;
            font-size: 0.75em;
            transition: all 0.3s;
        }

        .input-group input:focus {
            outline: none;
            border-color: #00d4ff;
            box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
        }

        .input-row {
            display: flex;
            gap: 10px;
        }

        .input-row .input-group {
            flex: 1;
        }

        .btn {
            width: 100%;
            background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
            color: #000;
            border: none;
            padding: 12px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: bold;
            font-size: 0.9em;
            margin-top: 8px;
            transition: all 0.3s;
        }

        .btn:hover {
            transform: scale(1.02);
            box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .btn-secondary:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .btn-primary {
            background: linear-gradient(135deg, #00d4ff, #0066ff);
            color: white;
            border: 1px solid rgba(0, 212, 255, 0.5);
            font-weight: bold;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, #00e5ff, #0077ff);
            box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
        }

        .preset-btns {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 8px;
            margin-bottom: 10px;
        }

        .preset-btn {
            background: rgba(0, 212, 255, 0.15);
            border: 1px solid rgba(0, 212, 255, 0.3);
            color: #00d4ff;
            padding: 10px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.85em;
            transition: all 0.3s;
            text-align: center;
        }

        .preset-btn:hover {
            background: rgba(0, 212, 255, 0.3);
        }

        .preset-btn.active {
            background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
            color: #000;
        }

        .checkbox-group {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
            cursor: pointer;
        }

        .checkbox-group input[type="checkbox"] {
            width: auto;
            margin: 0;
        }

        .checkbox-group label {
            margin: 0;
            cursor: pointer;
            color: #fff;
            font-size: 0.9em;
        }

        /* Main View Area */
        #main-view {
            flex: 1;
            display: flex;
            flex-direction: column;
            margin-left: 180px;  /* Leave space for fixed sidebar */
        }

        #view-tabs {
            display: flex;
            background: rgba(0, 0, 0, 0.4);
            padding: 10px 20px;
            gap: 10px;
            border-bottom: 1px solid rgba(0, 212, 255, 0.2);
            position: relative;
            z-index: 10000000;  /* Higher than sidebar (9999999) to ensure tabs are always visible */
        }

        .view-tab {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #fff;
            padding: 10px 25px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9em;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .view-tab:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .view-tab.active {
            background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
            color: #000;
            font-weight: bold;
        }

        #view-container {
            flex: 1;
            position: relative;
            overflow: visible;
        }

        .view-panel {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            min-height: 500px;
            display: none;
            z-index: 100;
            overflow-y: auto;
            background: #000;
            visibility: visible;
        }

        .view-panel.active {
            display: block !important;
            z-index: 1000 !important;
            visibility: visible !important;
        }

        /* 3D Container */
        #three-container {
            width: 100%;
            height: 100%;
        }

        /* Info Panel */
        #info-panel {
            position: absolute;
            bottom: 20px;
            right: 20px;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(0, 212, 255, 0.3);
            border-radius: 10px;
            padding: 15px 20px;
            min-width: 200px;
        }

        .info-row {
            display: flex;
            justify-content: space-between;
            margin: 5px 0;
            font-size: 0.85em;
        }

        .info-label {
            color: #81d4fa;
        }

        .info-value {
            color: #fff;
            font-weight: bold;
        }

        /* Canvas styles */
        canvas {
            display: block;
            width: 100%;
            height: 100%;
        }

        /* Loading */
        #loading {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(10, 22, 40, 0.9);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        #loading.hidden {
            display: none;
        }

        .loader {
            text-align: center;
        }

        .spinner {
            width: 50px;
            height: 50px;
            border: 3px solid rgba(0, 212, 255, 0.3);
            border-top-color: #00d4ff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* 2D View specific */
        .view-2d {
            display: flex;
            gap: 20px;
            padding: 20px;
            height: 100%;
        }

        .view-2d-left {
            flex: 1;
            position: relative;
        }

        .view-2d-right {
            width: 300px;
            background: rgba(0, 0, 0, 0.4);
            border-radius: 10px;
            padding: 20px;
        }

        .canvas-container {
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 10px;
            overflow: hidden;
        }
