        :root {
            --primary: #2563eb;
            --primary-light: #dbeafe;
            --secondary: #059669;
            --danger: #dc2626;
            --warning: #f59e0b;
            --info: #3b82f6;
            --bg-primary: #f8f9fa;
            --bg-secondary: #ffffff;
            --text-primary: #171717;
            --text-secondary: #737373;
            --border: #e5e7eb;
            --shadow: rgba(0, 0, 0, 0.1);
            --font-mono: 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            background-color: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.6;
            overflow: hidden;
        }

        .app {
            display: grid;
            grid-template-columns: 300px 1fr 400px;
            grid-template-rows: 60px 1fr;
            grid-template-areas:
                "header header header"
                "sidebar main preview";
            height: 100vh;
        }

        .header {
            grid-area: header;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border);
            padding: 0 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 2px 4px var(--shadow);
        }

        .logo {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .header-actions {
            display: flex;
            gap: 10px;
        }

        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .btn-primary {
            background: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background: #1d4ed8;
        }

        .btn-secondary {
            background: var(--secondary);
            color: white;
        }

        .btn-secondary:hover {
            background: #047857;
        }

        .btn-warning {
            background: var(--warning);
            color: white;
        }

        .btn-warning:hover {
            background: #d97706;
        }

        .btn-danger {
            background: var(--danger);
            color: white;
        }

        .btn-danger:hover {
            background: #b91c1c;
        }

        .sidebar {
            grid-area: sidebar;
            background: var(--bg-secondary);
            border-right: 1px solid var(--border);
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .search-box input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--border);
            border-radius: 6px;
        }

        .concept-tree {
            list-style: none;
            flex: 1;
            overflow-y: auto;
        }

        .concept-item {
            padding: 10px 12px;
            margin: 4px 0;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            transition: all 0.2s ease;
            border: 1px solid transparent;
        }

        .concept-item:hover {
            background-color: var(--primary-light);
            border-color: var(--primary);
        }

        .concept-item.selected {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .concept-icon {
            margin-right: 8px;
            font-size: 0.9em;
            width: 20px;
            text-align: center;
        }

        .concept-category {
            font-weight: 600;
            color: var(--text-secondary);
            margin-top: 15px;
            margin-bottom: 5px;
            padding-left: 5px;
            border-left: 3px solid var(--primary);
        }

        .main {
            grid-area: main;
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        .tabs {
            display: flex;
            border-bottom: 1px solid var(--border);
            margin-bottom: 20px;
        }

        .tab {
            padding: 10px 20px;
            cursor: pointer;
            border-bottom: 2px solid transparent;
        }

        .tab.active {
            border-bottom-color: var(--primary);
            color: var(--primary);
            font-weight: 500;
        }

        .tab-content {
            flex: 1;
            overflow-y: auto;
        }

        .constructor {
            background: var(--bg-secondary);
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 4px 12px var(--shadow);
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .constructor-header {
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .graph-container {
            width: 100%;
            height: 250px;
            margin-bottom: 20px;
            border: 2px solid var(--border);
            border-radius: 8px;
            background: white;
            position: relative;
        }

        .graph-value-display {
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 5px 10px;
            border-radius: 4px;
            font-family: var(--font-mono);
            font-size: 12px;
            pointer-events: none;
            z-index: 10;
        }

        .parameters {
            display: grid;
            gap: 16px;
            margin-bottom: 20px;
        }

        .parameter-group {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .parameter-group label {
            min-width: 120px;
            color: var(--text-secondary);
            font-weight: 500;
        }

        input[type="range"] {
            flex: 1;
            height: 6px;
            background: var(--border);
            border-radius: 3px;
            outline: none;
            transition: background 0.2s ease;
        }

        input[type="range"]:hover {
            background: #d1d5db;
        }

        input[type="number"] {
            width: 80px;
            padding: 8px;
            border: 1px solid var(--border);
            border-radius: 6px;
            text-align: center;
            transition: border-color 0.2s ease;
        }

        input[type="number"]:focus {
            border-color: var(--primary);
            outline: none;
        }

        .constructor-actions {
            display: flex;
            gap: 10px;
            margin-top: auto;
        }

        .preview {
            grid-area: preview;
            background: var(--bg-secondary);
            border-left: 1px solid var(--border);
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .query-input {
            width: 100%;
            min-height: 100px;
            padding: 12px;
            border: 2px solid var(--border);
            border-radius: 8px;
            resize: vertical;
            font-family: inherit;
            transition: border-color 0.2s ease;
        }

        .query-input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .dsl-preview {
            background: #1a1a1a;
            color: #00ff88;
            padding: 16px;
            border-radius: 8px;
            font-family: var(--font-mono);
            font-size: 0.9rem;
            overflow-x: auto;
            flex: 1;
            white-space: pre-wrap;
        }

        .execute-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .execute-btn:hover:not(:disabled) {
            background: #1d4ed8;
            transform: translateY(-1px);
        }

        .execute-btn:disabled {
            background: var(--text-secondary);
            cursor: not-allowed;
        }

        .composite-builder {
            border: 2px dashed var(--border);
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .component-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin: 15px 0;
        }

        .component-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px;
            background: var(--bg-primary);
            border-radius: 6px;
        }

        .component-select {
            flex: 1;
            padding: 5px;
            border: 1px solid var(--border);
            border-radius: 4px;
        }

        .weight-input {
            width: 60px;
            padding: 4px;
            border: 1px solid var(--border);
            border-radius: 4px;
            text-align: center;
        }

        .data-source-input {
            width: 100%;
            padding: 8px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-family: var(--font-mono);
            font-size: 0.9rem;
        }

        .debug-container {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            margin-top: 20px;
            max-height: 300px;
            overflow-y: auto;
        }

        .debug-item {
            padding: 8px;
            border-bottom: 1px solid var(--border);
            font-family: var(--font-mono);
            font-size: 0.85rem;
        }

        .debug-value {
            float: right;
            font-weight: 600;
            color: var(--primary);
        }

        .export-options {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-top: 15px;
        }

        .export-btn {
            padding: 10px;
            background: var(--bg-primary);
            border: 1px solid var(--border);
            border-radius: 6px;
            cursor: pointer;
            text-align: center;
            transition: all 0.2s ease;
        }

        .export-btn:hover {
            background: var(--primary-light);
            border-color: var(--primary);
        }

        .synonyms-list {
            margin-top: 10px;
        }

        .synonym-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 5px;
            background: var(--bg-primary);
            border-radius: 4px;
            margin-bottom: 5px;
        }

        .synonym-input {
            flex: 1;
            padding: 4px;
            border: 1px solid var(--border);
            border-radius: 4px;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: white;
            padding: 30px;
            border-radius: 12px;
            width: 90%;
            max-width: 500px;
            max-height: 80vh;
            overflow-y: auto;
        }

        .modal-wide {
            max-width: 700px;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--border);
            border-radius: 6px;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .fade-in {
            animation: fadeIn 0.3s ease forwards;
        }

        .concept-highlight {
            background-color: #dcfce7;
            padding: 2px 4px;
            border-radius: 4px;
            border: 1px solid #bbf7d0;
            font-weight: 500;
        }

        .notification {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 12px 20px;
            color: white;
            border-radius: 8px;
            z-index: 1000;
            animation: fadeIn 0.3s ease;
            max-width: 400px;
            word-wrap: break-word;
        }

        .notification.success {
            background: var(--secondary);
        }

        .notification.error {
            background: var(--danger);
        }

        .notification.warning {
            background: var(--warning);
        }

        .notification.info {
            background: var(--info);
        }
