        /* ═══════════════════════════════════════════════════════════════
           FINXIS CDM BUILDER — CSS VARIABLES (GRAYSCALE PALETTE)
           ═══════════════════════════════════════════════════════════════ */
        :root {
            --gray-900: #0a0a0a;
            --gray-850: #141414;
            --gray-800: #1a1a1a;
            --gray-700: #262626;
            --gray-600: #404040;
            --gray-500: #737373;
            --gray-400: #a3a3a3;
            --gray-300: #d4d4d4;
            --gray-200: #e5e5e5;
            --gray-100: #f5f5f5;
            
            --bg-primary: var(--gray-900);
            --bg-secondary: var(--gray-850);
            --bg-tertiary: var(--gray-800);
            --bg-elevated: var(--gray-700);
            
            --border-primary: var(--gray-700);
            --border-secondary: var(--gray-600);
            --border-active: var(--gray-400);
            
            --text-primary: var(--gray-100);
            --text-secondary: var(--gray-300);
            --text-tertiary: var(--gray-400);
            --text-muted: var(--gray-500);
            
            --accent: var(--gray-300);
            --accent-hover: var(--gray-100);
            
            --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            --font-mono: "JetBrains Mono", "Fira Code", Consolas, Monaco, monospace;
            
            --header-height: 60px;
            --footer-height: 32px;
            --sidebar-width: 280px;
            --tab-height: 48px;
            --type-selector-height: 52px;
        }

        /* ═══════════════════════════════════════════════════════════════
           BASE RESET & LAYOUT
           ═══════════════════════════════════════════════════════════════ */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            width: 100%;
            height: 100%;
            overflow: hidden;
            font-family: var(--font-sans);
            font-size: 14px;
            line-height: 1.5;
            background: var(--bg-primary);
            color: var(--text-primary);
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        .app-container {
            display: grid;
            grid-template-rows: var(--header-height) 1fr var(--footer-height);
            grid-template-columns: var(--sidebar-width) 1fr;
            grid-template-areas:
                "header header"
                "sidebar main"
                "footer footer";
            width: 100%;
            height: 100vh;
        }

        /* ═══════════════════════════════════════════════════════════════
           HEADER
           ═══════════════════════════════════════════════════════════════ */
        .app-header {
            grid-area: header;
            display: flex;
            align-items: center;
            padding: 0 24px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            gap: 16px;
        }

        .header-brand {
            font-size: 18px;
            font-weight: 700;
            letter-spacing: 0.05em;
            color: var(--text-primary);
            text-transform: uppercase;
        }

        .header-divider {
            width: 1px;
            height: 24px;
            background: var(--border-secondary);
        }

        .header-title {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-secondary);
        }

        .header-actions {
            margin-left: auto;
            display: flex;
            gap: 12px;
        }

        .btn {
            padding: 8px 16px;
            border: 1px solid var(--border-secondary);
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            font-family: var(--font-sans);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            border-radius: 4px;
            transition: all 0.15s ease;
        }

        .btn:hover {
            background: var(--bg-elevated);
            border-color: var(--border-active);
            color: var(--text-primary);
        }

        .btn-primary {
            background: var(--gray-100);
            color: var(--gray-900);
            border-color: var(--gray-100);
        }

        .btn-primary:hover {
            background: var(--gray-200);
            border-color: var(--gray-200);
        }

        /* ═══════════════════════════════════════════════════════════════
           SIDEBAR — FILE LIST
           ═══════════════════════════════════════════════════════════════ */
        .app-sidebar {
            grid-area: sidebar;
            display: flex;
            flex-direction: column;
            background: var(--bg-secondary);
            border-right: 1px solid var(--border-primary);
            overflow: hidden;
        }

        .sidebar-header {
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-primary);
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
        }

        /* Sidebar toolbar: view mode toggles + search */
        .sidebar-toolbar {
            padding: 8px 10px;
            border-bottom: 1px solid var(--border-primary);
            display: flex;
            flex-direction: column;
            gap: 6px;
            flex-shrink: 0;
        }

        .sidebar-view-modes {
            display: flex;
            gap: 2px;
            background: var(--bg-secondary);
            border-radius: 4px;
            padding: 2px;
        }

        .sidebar-mode-btn {
            flex: 1;
            padding: 4px 6px;
            font-size: 11px;
            font-weight: 500;
            background: transparent;
            border: none;
            border-radius: 3px;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.12s ease;
        }

        .sidebar-mode-btn:hover {
            color: var(--text-secondary);
            background: var(--bg-tertiary);
        }

        .sidebar-mode-btn.active {
            background: var(--bg-primary);
            color: var(--text-primary);
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        }

        .sidebar-search-input {
            width: 100%;
            padding: 5px 8px;
            font-size: 12px;
            background: var(--bg-primary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            color: var(--text-primary);
            outline: none;
            box-sizing: border-box;
        }

        .sidebar-search-input:focus {
            border-color: var(--accent);
        }

        .sidebar-search-input::placeholder {
            color: var(--text-muted);
        }

        /* Type/enum list items */
        .type-list-item {
            padding: 5px 12px;
            cursor: pointer;
            font-size: 12px;
            color: var(--text-secondary);
            border-left: 2px solid transparent;
            transition: all 0.12s ease;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .type-list-item:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .type-list-item.active {
            background: var(--bg-elevated);
            border-left-color: var(--accent);
            color: var(--text-primary);
        }

        .type-list-badge {
            font-size: 9px;
            font-weight: 700;
            padding: 1px 4px;
            border-radius: 3px;
            flex-shrink: 0;
            font-family: var(--font-mono);
        }

        .type-list-badge.type { background: #2d5a9e30; color: #6ba5f7; }
        .type-list-badge.enum { background: #9e5a2d30; color: #f7a56b; }

        .type-list-name {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }

        .type-list-ns {
            font-size: 10px;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 80px;
        }

        /* Search results */
        .search-result-item {
            padding: 6px 12px;
            cursor: pointer;
            font-size: 12px;
            color: var(--text-secondary);
            border-left: 2px solid transparent;
            transition: all 0.12s ease;
        }

        .search-result-item:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .search-result-file {
            font-size: 11px;
            color: var(--text-muted);
            margin-bottom: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .search-result-line {
            font-family: var(--font-mono);
            font-size: 11px;
            color: var(--text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .search-result-line mark {
            background: #b8860b50;
            color: var(--accent);
            border-radius: 2px;
            padding: 0 1px;
        }

        .search-result-count {
            padding: 6px 12px;
            font-size: 11px;
            color: var(--text-muted);
            border-bottom: 1px solid var(--border-primary);
        }

        /* Text highlight in code viewer */
        .code-viewer mark.search-highlight {
            background: #b8860b60;
            color: var(--accent);
            border-radius: 2px;
            padding: 0 1px;
            scroll-margin-top: 60px;
        }

        .code-viewer mark.search-highlight.first {
            background: #b8860b90;
            outline: 2px solid var(--accent);
        }

        .file-list {
            flex: 1;
            overflow-y: auto;
            padding: 8px 0;
        }

        .file-item {
            padding: 8px 16px;
            cursor: pointer;
            font-size: 13px;
            color: var(--text-secondary);
            border-left: 2px solid transparent;
            transition: all 0.12s ease;
            display: flex;
            align-items: center;
        }

        .file-item:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .file-item.active {
            background: var(--bg-elevated);
            border-left-color: var(--accent);
            color: var(--text-primary);
            font-weight: 500;
        }

        .file-icon {
            display: inline-block;
            width: 16px;
            margin-right: 8px;
            opacity: 0.6;
            flex-shrink: 0;
        }

        .file-name {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Folder tree structure */
        .folder-item {
            margin: 2px 0;
        }

        .folder-toggle {
            padding: 6px 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            user-select: none;
            transition: background 0.15s ease;
            font-size: 13px;
        }

        .folder-toggle:hover {
            background: var(--bg-tertiary);
        }

        .toggle-icon {
            font-size: 10px;
            color: var(--text-muted);
            width: 12px;
            display: inline-block;
            flex-shrink: 0;
        }

        .folder-icon {
            opacity: 0.7;
            flex-shrink: 0;
        }

        .folder-name {
            font-weight: 500;
            color: var(--text-primary);
        }

        .folder-children {
            margin-top: 2px;
        }

        .folder-children.collapsed {
            display: none;
        }

        .sidebar-empty {
            padding: 24px 16px;
            text-align: center;
            color: var(--text-muted);
            font-size: 12px;
            line-height: 1.6;
        }

        .sidebar-empty-icon {
            font-size: 32px;
            margin-bottom: 12px;
            opacity: 0.3;
        }

        /* ═══════════════════════════════════════════════════════════════
           MAIN CONTENT AREA
           ═══════════════════════════════════════════════════════════════ */
        .app-main {
            grid-area: main;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: var(--bg-primary);
        }

        /* ─── TYPE SELECTOR ────────────────────────────────────────── */
        .type-selector-bar {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            height: var(--type-selector-height);
            position: relative;
        }

        .type-selector-label {
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            white-space: nowrap;
        }

        .type-selector-input {
            flex: 1;
            max-width: 600px;
            padding: 8px 12px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-secondary);
            border-radius: 4px;
            color: var(--text-primary);
            font-family: var(--font-mono);
            font-size: 13px;
            outline: none;
            transition: border-color 0.15s ease;
        }

        .type-selector-input:focus {
            border-color: var(--border-active);
        }

        .type-selector-input::placeholder {
            color: var(--text-muted);
        }

        .type-selector-dropdown {
            position: absolute;
            top: calc(var(--type-selector-height) - 4px);
            left: 96px;
            width: 600px;
            max-height: 400px;
            overflow-y: auto;
            background: var(--bg-elevated);
            border: 1px solid var(--border-active);
            border-radius: 4px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.4);
            z-index: 1000;
        }

        .type-selector-dropdown.hidden {
            display: none;
        }

        .type-dropdown-group {
            border-bottom: 1px solid var(--border-primary);
        }

        .type-dropdown-group:last-child {
            border-bottom: none;
        }

        .type-dropdown-group-title {
            padding: 8px 12px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            background: var(--bg-secondary);
        }

        .type-dropdown-item {
            padding: 8px 12px 8px 24px;
            cursor: pointer;
            font-size: 13px;
            font-family: var(--font-mono);
            color: var(--text-secondary);
            transition: all 0.12s ease;
        }

        .type-dropdown-item:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .type-dropdown-item.selected {
            background: var(--bg-tertiary);
            color: var(--accent);
        }

        .type-info {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .type-info-namespace {
            font-size: 11px;
            font-family: var(--font-mono);
            color: var(--text-muted);
        }

        /* ─── TABS ────────────────────────────────────────────────────── */
        .tabs-container {
            display: flex;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            height: var(--tab-height);
        }

        .tab {
            padding: 0 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-tertiary);
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.15s ease;
            position: relative;
        }

        .tab:hover {
            color: var(--text-secondary);
            background: var(--bg-tertiary);
        }

        .tab.active {
            color: var(--text-primary);
            border-bottom-color: var(--accent);
        }

        .tab.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--accent);
        }

        /* ─── TAB CONTENT ─────────────────────────────────────────────── */
        .tab-content {
            flex: 1;
            display: none;
            overflow: hidden;
        }

        .tab-content.active {
            display: flex;
        }

        /* ═══════════════════════════════════════════════════════════════
           TEXT TAB — ROSETTA FILE VIEWER
           ═══════════════════════════════════════════════════════════════ */
        .text-viewer {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .viewer-toolbar {
            display: flex;
            align-items: center;
            padding: 8px 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            gap: 12px;
        }

        .viewer-filename {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            font-family: var(--font-mono);
        }

        .code-viewer {
            flex: 1;
            overflow: auto;
            padding: 16px;
            font-family: var(--font-mono);
            font-size: 13px;
            line-height: 1.6;
            color: var(--text-secondary);
            background: var(--bg-primary);
            white-space: pre;
        }

        .code-viewer .highlight {
            background: var(--bg-elevated);
            padding: 2px 4px;
            margin: -2px -4px;
            border-left: 3px solid var(--accent);
        }

        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: var(--text-muted);
            text-align: center;
            padding: 48px;
        }

        .empty-state-icon {
            font-size: 48px;
            margin-bottom: 16px;
            opacity: 0.3;
        }

        .empty-state-text {
            font-size: 14px;
            line-height: 1.6;
        }

        /* ═══════════════════════════════════════════════════════════════
           JSON TREE VIEWER
           ═══════════════════════════════════════════════════════════════ */
        .json-tree {
            font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
            font-size: 13px;
            line-height: 1.6;
            color: var(--text-primary);
        }

        .json-toggle {
            cursor: pointer;
            user-select: none;
            color: var(--text-muted);
            padding: 0 4px;
            font-size: 10px;
        }

        .json-toggle:hover {
            color: var(--accent);
        }

        .json-children.collapsed {
            display: none;
        }

        .json-item {
            padding: 2px 0;
        }

        .json-key {
            color: #88c0d0;
            font-weight: 500;
        }

        .json-string {
            color: #a3be8c;
        }

        .json-number {
            color: #b48ead;
        }

        .json-boolean {
            color: #d08770;
        }

        .json-null {
            color: #bf616a;
            font-style: italic;
        }

        .json-bracket {
            color: var(--text-muted);
        }

        .json-colon,
        .json-comma {
            color: var(--text-muted);
        }

        /* ═══════════════════════════════════════════════════════════════
           RUNE SYNTAX HIGHLIGHTING
           ═══════════════════════════════════════════════════════════════ */
        .rune-output-pre {
            font-family: var(--font-mono);
            font-size: 13px;
            line-height: 1.65;
            white-space: pre;
            overflow-x: auto;
            color: var(--text-secondary);
        }

        .rune-keyword {
            color: #c586c0;
            font-weight: 600;
        }

        .rune-type {
            color: #4ec9b0;
        }

        .rune-attr {
            color: #9cdcfe;
        }

        .rune-value-str {
            color: #ce9178;
        }

        .rune-value-num {
            color: #b5cea8;
        }

        .rune-value-enum {
            color: #d4976c;
        }

        .rune-value-bool {
            color: #569cd6;
        }

        .rune-comment {
            color: #6a9955;
            font-style: italic;
        }

        .rune-arrow {
            color: var(--text-muted);
        }

        .rune-param {
            color: #dcdcaa;
        }

        .rune-cardinality {
            color: #808080;
            font-size: 0.9em;
        }

        /* ═══════════════════════════════════════════════════════════════
           TREE TAB — INTERACTIVE TREE VIEW
           ═══════════════════════════════════════════════════════════════ */
        .tree-viewer {
            flex: 1;
            overflow: auto;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .tree-breadcrumb {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-primary);
            border-radius: 6px;
            padding: 10px 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            font-size: 13px;
        }

        .breadcrumb-item {
            color: var(--accent);
            cursor: pointer;
            transition: color 0.15s ease;
            text-decoration: none;
        }

        .breadcrumb-item:hover {
            color: var(--text-primary);
            text-decoration: underline;
        }

        .breadcrumb-item.active {
            color: var(--text-primary);
            font-weight: 600;
            cursor: default;
        }

        .breadcrumb-item.active:hover {
            text-decoration: none;
        }

        .breadcrumb-separator {
            color: var(--text-muted);
            user-select: none;
        }

        .tree-node {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        .tree-node-item {
            padding: 6px 0 6px 20px;
            cursor: pointer;
            font-size: 13px;
            font-family: var(--font-mono);
            color: var(--text-secondary);
            position: relative;
            user-select: none;
            transition: color 0.12s ease;
        }

        .tree-node-item:hover {
            color: var(--text-primary);
        }

        .tree-node-item.highlighted {
            color: var(--accent);
            font-weight: 600;
        }

        .tree-toggle {
            position: absolute;
            left: 0;
            width: 16px;
            height: 16px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            color: var(--text-muted);
            transition: transform 0.15s ease;
        }

        .tree-toggle.collapsed {
            transform: rotate(-90deg);
        }

        .tree-node-label {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .tree-node-type {
            opacity: 0.6;
            font-size: 11px;
        }

        .tree-children {
            margin-left: 16px;
            border-left: 1px solid var(--border-primary);
            padding-left: 4px;
        }

        .tree-children.collapsed {
            display: none;
        }

        /* ═══════════════════════════════════════════════════════════════
           CODE TAB — QUERY + SPLIT VIEW
           ═══════════════════════════════════════════════════════════════ */
        .code-tab {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .query-section {
            display: flex;
            flex-direction: column;
            padding: 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            gap: 12px;
        }

        .query-input {
            width: 100%;
            padding: 12px 16px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-secondary);
            border-radius: 4px;
            color: var(--text-primary);
            font-family: var(--font-sans);
            font-size: 14px;
            outline: none;
            transition: border-color 0.15s ease;
        }

        .query-input:focus {
            border-color: var(--border-active);
        }

        .query-input::placeholder {
            color: var(--text-muted);
        }

        .query-actions {
            display: flex;
            gap: 8px;
        }

        .split-view {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 1fr;
            overflow: hidden;
        }

        .split-panel {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border-right: 1px solid var(--border-primary);
        }

        .split-panel:last-child {
            border-right: none;
        }

        .panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
        }

        .panel-title {
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
        }

        .panel-toggle {
            display: flex;
            gap: 4px;
            background: var(--bg-tertiary);
            border-radius: 4px;
            padding: 2px;
        }

        .panel-toggle-btn {
            padding: 4px 12px;
            font-size: 11px;
            font-weight: 500;
            color: var(--text-tertiary);
            background: transparent;
            border: none;
            cursor: pointer;
            border-radius: 3px;
            transition: all 0.12s ease;
        }

        .panel-toggle-btn:hover {
            color: var(--text-secondary);
        }

        .panel-toggle-btn.active {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }

        /* Rune inline/function toggle */
        .rune-inline-toggle {
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            font-size: 11px;
            color: var(--text-muted);
            padding: 3px 8px;
            border-radius: 4px;
            border: 1px solid var(--border-primary);
            background: var(--bg-primary);
            transition: all 0.15s;
            user-select: none;
        }

        .rune-inline-toggle:hover {
            border-color: var(--text-muted);
        }

        .rune-inline-toggle input[type="checkbox"] {
            accent-color: #58a6ff;
            margin: 0;
            cursor: pointer;
        }

        .rune-toggle-label {
            white-space: nowrap;
        }

        .panel-content {
            flex: 1;
            overflow: auto;
            padding: 16px;
            font-family: var(--font-mono);
            font-size: 13px;
            line-height: 1.6;
            color: var(--text-secondary);
            background: var(--bg-primary);
        }

        /* ═══════════════════════════════════════════════════════════════
           TEST TAB
           ═══════════════════════════════════════════════════════════════ */
        .test-tab {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }

        .test-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            gap: 16px;
        }

        .test-selector {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
        }

        .test-selector label {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
            white-space: nowrap;
        }

        .func-selector-wrapper {
            position: relative;
            flex: 1;
            max-width: 500px;
        }

        .func-search-input {
            width: 100%;
            padding: 8px 12px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-secondary);
            border-radius: 4px;
            color: var(--text-primary);
            font-family: var(--font-mono);
            font-size: 13px;
            outline: none;
            cursor: text;
        }

        .func-search-input:focus {
            border-color: var(--border-active);
        }

        .func-search-input:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .func-search-input::placeholder {
            color: var(--text-muted);
            font-family: var(--font-sans);
        }

        .func-selected-display {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 7px 12px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-active);
            border-radius: 4px;
            margin-bottom: 4px;
        }

        .func-selected-display.hidden {
            display: none;
        }

        .func-selected-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            font-family: var(--font-mono);
        }

        .func-selected-sig {
            font-size: 12px;
            color: var(--text-muted);
            font-family: var(--font-mono);
        }

        .func-selected-clear {
            margin-left: auto;
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 14px;
            padding: 0 4px;
            line-height: 1;
        }

        .func-selected-clear:hover {
            color: var(--text-primary);
        }

        .func-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            max-height: 400px;
            overflow-y: auto;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-secondary);
            border-top: none;
            border-radius: 0 0 4px 4px;
            z-index: 100;
            box-shadow: 0 8px 24px rgba(0,0,0,0.3);
        }

        .func-dropdown.hidden {
            display: none;
        }

        .func-dropdown-count {
            padding: 6px 12px;
            font-size: 11px;
            color: var(--text-muted);
            border-bottom: 1px solid var(--border-primary);
            background: var(--bg-secondary);
            position: sticky;
            top: 0;
        }

        .func-dropdown-empty {
            padding: 16px 12px;
            font-size: 13px;
            color: var(--text-muted);
            text-align: center;
        }

        .func-dropdown-group {
            margin-bottom: 2px;
        }

        .func-dropdown-group-title {
            padding: 6px 12px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            position: sticky;
            top: 25px;
        }

        .func-dropdown-item {
            padding: 8px 12px;
            cursor: pointer;
            border-bottom: 1px solid var(--border-primary);
            transition: background 0.1s ease;
        }

        .func-dropdown-item:hover {
            background: var(--bg-elevated);
        }

        .func-dropdown-item-header {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .func-dropdown-name {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
            font-family: var(--font-mono);
        }

        .func-dropdown-sig {
            font-size: 12px;
            color: var(--text-muted);
            font-family: var(--font-mono);
        }

        .func-dropdown-desc {
            font-size: 11px;
            color: var(--text-tertiary);
            margin-top: 2px;
            line-height: 1.4;
        }

        .func-dropdown-params {
            font-size: 11px;
            color: var(--text-muted);
            font-family: var(--font-mono);
            margin-top: 2px;
        }

        /* ─── Function Details (Inputs Panel) ─── */
        .func-details {
            padding: 16px;
        }

        .func-detail-header {
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border-primary);
        }

        .func-detail-name {
            font-size: 16px;
            font-weight: 600;
            font-family: var(--font-mono);
            color: var(--text-primary);
            margin: 0 0 4px 0;
        }

        .func-detail-namespace {
            font-size: 11px;
            color: var(--text-muted);
        }

        .func-detail-desc {
            font-size: 13px;
            color: var(--text-secondary);
            margin-top: 8px;
            line-height: 1.5;
        }

        .func-section {
            margin-bottom: 16px;
        }

        .func-section-title {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            margin-bottom: 8px;
            padding-bottom: 4px;
            border-bottom: 1px solid var(--border-primary);
        }

        .func-no-params {
            font-size: 12px;
            color: var(--text-muted);
            font-style: italic;
            padding: 8px 0;
        }

        .func-input-row {
            padding: 10px 12px;
            margin-bottom: 8px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
        }

        .func-input-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .func-input-name {
            font-size: 13px;
            font-weight: 600;
            font-family: var(--font-mono);
            color: var(--text-primary);
        }

        .func-input-type {
            font-size: 11px;
            padding: 2px 6px;
            border-radius: 3px;
            font-family: var(--font-mono);
        }

        .func-input-type.complex {
            background: rgba(168, 162, 158, 0.15);
            color: var(--gray-300);
            border: 1px solid var(--border-secondary);
        }

        .func-input-type.primitive {
            background: rgba(168, 162, 158, 0.08);
            color: var(--text-muted);
        }

        .func-input-card {
            font-size: 11px;
            color: var(--text-muted);
            font-family: var(--font-mono);
        }

        .func-input-req {
            font-size: 10px;
            color: var(--gray-300);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 600;
        }

        .func-input-control {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .func-primitive-input {
            flex: 1;
            padding: 6px 10px;
            font-size: 13px;
        }

        .func-input-selected {
            font-size: 12px;
            color: var(--text-muted);
            font-style: italic;
        }

        .func-input-selected.selected {
            color: var(--text-primary);
            font-style: normal;
            font-weight: 500;
        }

        .func-output-row {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
        }

        .func-output-name {
            font-size: 13px;
            font-family: var(--font-mono);
            color: var(--text-secondary);
        }

        .func-source {
            font-family: var(--font-mono);
            font-size: 12px;
            line-height: 1.6;
            color: var(--text-secondary);
            background: var(--bg-primary);
            padding: 12px;
            border-radius: 4px;
            border: 1px solid var(--border-primary);
            overflow-x: auto;
            white-space: pre;
            margin-top: 8px;
        }

        /* ─── Function Execution Results ─── */
        .exec-result {
            padding: 16px;
            height: 100%;
            overflow-y: auto;
        }

        .exec-result-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border-primary);
        }

        .exec-status-icon {
            font-size: 18px;
        }

        .exec-status-text {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .exec-elapsed {
            margin-left: auto;
            font-size: 12px;
            font-family: var(--font-mono);
            color: var(--text-muted);
            background: var(--bg-primary);
            padding: 2px 8px;
            border-radius: 3px;
        }

        .exec-func-info {
            font-family: var(--font-mono);
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 16px;
        }

        .exec-func-name {
            font-weight: 600;
            color: var(--text-primary);
        }

        .exec-func-arrow {
            color: var(--text-muted);
        }

        .exec-func-output-type {
            color: var(--text-tertiary);
        }

        .exec-section {
            margin-bottom: 12px;
        }

        .exec-section-title {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            margin-bottom: 6px;
            padding-bottom: 4px;
            border-bottom: 1px solid var(--border-primary);
            user-select: none;
        }

        .exec-output-tree {
            background: var(--bg-primary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            padding: 12px;
            overflow-x: auto;
            font-family: var(--font-mono);
            font-size: 12px;
            line-height: 1.6;
        }

        /* ── Result Viewer Toolbar ── */
        .exec-output-toolbar {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 8px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-primary);
            border-bottom: none;
            border-radius: 4px 4px 0 0;
            flex-wrap: wrap;
        }

        .exec-output-toolbar + .exec-output-tree {
            border-radius: 0 0 4px 4px;
        }

        .exec-toolbar-group {
            display: flex;
            align-items: center;
            gap: 2px;
            background: var(--bg-primary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            overflow: hidden;
        }

        .exec-toolbar-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 3px 8px;
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 11px;
            font-family: var(--font-mono);
            transition: all 0.15s;
            white-space: nowrap;
        }

        .exec-toolbar-btn:hover {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        .exec-toolbar-btn.active {
            background: rgba(88, 166, 255, 0.15);
            color: #58a6ff;
        }

        .exec-toolbar-btn svg {
            flex-shrink: 0;
        }

        .exec-toolbar-fontsize {
            padding: 3px 8px;
            font-size: 11px;
            color: var(--text-secondary);
            font-family: var(--font-mono);
            min-width: 36px;
            text-align: center;
            border-left: 1px solid var(--border-primary);
            border-right: 1px solid var(--border-primary);
        }

        .exec-toolbar-sep {
            width: 1px;
            height: 18px;
            background: var(--border-primary);
            margin: 0 4px;
        }

        .exec-toolbar-spacer {
            flex: 1;
        }

        .exec-output-tree.word-wrap-on {
            white-space: pre-wrap !important;
            word-break: break-all;
        }

        .exec-output-tree.word-wrap-on .json-item {
            white-space: pre-wrap;
            word-break: break-all;
        }

        .exec-errors {
            background: rgba(220, 38, 38, 0.08);
            border: 1px solid rgba(220, 38, 38, 0.2);
            border-radius: 4px;
            padding: 10px 12px;
        }

        .exec-error-item {
            font-size: 13px;
            color: #f87171;
            margin-bottom: 4px;
            line-height: 1.5;
        }

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

        .exec-error-message {
            font-size: 13px;
            color: #f87171;
            font-family: var(--font-mono);
            line-height: 1.5;
            word-break: break-word;
        }

        .exec-result-body {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.6;
        }

        .exec-result-body p {
            margin-bottom: 8px;
        }

        .exec-request-preview {
            font-family: var(--font-mono);
            font-size: 11px;
            line-height: 1.5;
            color: var(--text-muted);
            background: var(--bg-primary);
            padding: 10px;
            border-radius: 4px;
            border: 1px solid var(--border-primary);
            overflow-x: auto;
            white-space: pre;
            margin-top: 6px;
        }

        .exec-log {
            font-family: var(--font-mono);
            font-size: 11px;
            line-height: 1.5;
            color: var(--text-tertiary);
            background: var(--bg-primary);
            padding: 10px;
            border-radius: 4px;
            border: 1px solid var(--border-primary);
            overflow-x: auto;
            white-space: pre;
            margin-top: 6px;
            max-height: 200px;
            overflow-y: auto;
        }

        .exec-actions {
            display: flex;
            gap: 8px;
            margin-top: 16px;
            padding-top: 12px;
            border-top: 1px solid var(--border-primary);
        }

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

        .exec-spinner {
            display: inline-block;
            animation: spin 1.5s linear infinite;
        }

        .test-actions {
            display: flex;
            gap: 8px;
        }

        /* ═══════════════════════════════════════════════════════════════
           MAPPING TAB
           ═══════════════════════════════════════════════════════════════ */
        .mapping-tab {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .mapping-header {
            display: flex;
            align-items: center;
            padding: 12px 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            gap: 12px;
            flex-wrap: wrap;
        }

        .mapping-header-row {
            display: flex;
            align-items: center;
            gap: 12px;
            width: 100%;
        }

        .mapping-format-selector {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .mapping-format-selector label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            white-space: nowrap;
        }

        .mapping-format-selector select {
            background: var(--bg-tertiary);
            color: var(--text-primary);
            border: 1px solid var(--border-secondary);
            border-radius: 4px;
            padding: 6px 10px;
            font-size: 13px;
            font-family: var(--font-mono);
        }

        .mapping-target-selector {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
        }

        .mapping-target-selector label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            white-space: nowrap;
        }

        .mapping-target-input {
            flex: 1;
            max-width: 350px;
            background: var(--bg-tertiary);
            color: var(--text-primary);
            border: 1px solid var(--border-secondary);
            border-radius: 4px;
            padding: 6px 10px;
            font-size: 13px;
            font-family: var(--font-mono);
        }

        .mapping-target-input:focus {
            outline: none;
            border-color: var(--text-tertiary);
        }

        .mapping-actions {
            display: flex;
            gap: 8px;
            margin-left: auto;
        }

        .mapping-body {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 1.4fr 1fr;
            overflow: hidden;
        }

        .mapping-panel {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border-right: 1px solid var(--border-primary);
        }

        .mapping-panel:last-child {
            border-right: none;
        }

        .mapping-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 14px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
        }

        .mapping-panel-title {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
        }

        .mapping-panel-content {
            flex: 1;
            overflow: auto;
            padding: 0;
            background: var(--bg-primary);
        }

        /* ─── Source Schema Panel ─── */
        .source-upload-area {
            padding: 16px;
            text-align: center;
            border-bottom: 1px solid var(--border-primary);
        }

        .source-drop-zone {
            border: 2px dashed var(--border-secondary);
            border-radius: 6px;
            padding: 24px 16px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .source-drop-zone:hover,
        .source-drop-zone.drag-over {
            border-color: var(--text-tertiary);
            background: rgba(255,255,255,0.02);
        }

        .source-drop-icon {
            font-size: 28px;
            margin-bottom: 8px;
        }

        .source-drop-text {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .source-drop-text small {
            display: block;
            color: var(--text-muted);
            font-size: 11px;
            margin-top: 4px;
        }

        .source-paste-btn {
            margin-top: 10px;
        }

        .source-schema-list {
            padding: 0;
        }

        .source-field {
            display: flex;
            align-items: center;
            padding: 8px 14px;
            border-bottom: 1px solid var(--border-primary);
            gap: 8px;
            cursor: pointer;
            transition: background 0.1s;
            user-select: none;
        }

        .source-field:hover {
            background: var(--bg-secondary);
        }

        .source-field.mapped {
            background: rgba(34, 197, 94, 0.05);
        }

        .source-field.selected {
            background: rgba(59, 130, 246, 0.12);
            border-left: 3px solid #3b82f6;
            padding-left: 11px;
        }

        .source-field.selected .source-field-name {
            color: #60a5fa;
        }

        .source-field-idx {
            font-size: 10px;
            font-family: var(--font-mono);
            color: var(--text-muted);
            min-width: 20px;
        }

        .source-field-name {
            font-size: 13px;
            font-family: var(--font-mono);
            font-weight: 500;
            color: var(--text-primary);
            flex: 1;
        }

        .source-field-type {
            font-size: 10px;
            font-family: var(--font-mono);
            color: var(--text-muted);
            background: var(--bg-tertiary);
            padding: 2px 6px;
            border-radius: 3px;
        }

        .source-field-sample {
            font-size: 11px;
            font-family: var(--font-mono);
            color: var(--text-tertiary);
            max-width: 100px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .source-file-info {
            padding: 8px 14px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .source-file-name {
            font-size: 12px;
            font-family: var(--font-mono);
            color: var(--text-secondary);
        }

        .source-file-stats {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* ─── Mapping Connections Panel (Center) ─── */
        .mapping-connections {
            padding: 12px;
        }

        .mapping-row {
            display: flex;
            align-items: center;
            padding: 8px 10px;
            margin-bottom: 6px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            gap: 8px;
            transition: border-color 0.15s;
        }

        .mapping-row:hover {
            border-color: var(--border-secondary);
        }

        .mapping-row.error {
            border-color: rgba(220, 38, 38, 0.3);
        }

        .mapping-source {
            font-size: 12px;
            font-family: var(--font-mono);
            color: var(--text-primary);
            font-weight: 500;
            min-width: 100px;
            max-width: 140px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .mapping-arrow {
            color: var(--text-muted);
            font-size: 14px;
            flex-shrink: 0;
        }

        .mapping-target-path {
            flex: 1;
            font-size: 11px;
            font-family: var(--font-mono);
            color: var(--text-secondary);
            background: var(--bg-primary);
            border: 1px solid var(--border-primary);
            border-radius: 3px;
            padding: 4px 8px;
        }

        .mapping-target-path:focus {
            outline: none;
            border-color: var(--text-tertiary);
            color: var(--text-primary);
        }

        .mapping-transform {
            font-size: 10px;
            font-family: var(--font-mono);
            color: var(--accent-primary);
            background: rgba(147, 130, 110, 0.1);
            padding: 2px 6px;
            border-radius: 3px;
            max-width: 100px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            cursor: pointer;
        }

        .mapping-transform:hover {
            background: rgba(147, 130, 110, 0.2);
        }

        .mapping-confidence {
            font-size: 10px;
            font-family: var(--font-mono);
            padding: 2px 5px;
            border-radius: 3px;
        }

        .mapping-confidence.high {
            color: #22c55e;
            background: rgba(34, 197, 94, 0.1);
        }

        .mapping-confidence.medium {
            color: #eab308;
            background: rgba(234, 179, 8, 0.1);
        }

        .mapping-confidence.low {
            color: #f87171;
            background: rgba(248, 113, 113, 0.1);
        }

        .mapping-remove-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 14px;
            padding: 0 4px;
            opacity: 0.5;
            transition: opacity 0.15s;
        }

        .mapping-remove-btn:hover {
            opacity: 1;
            color: #f87171;
        }

        .mapping-empty {
            text-align: center;
            padding: 32px 16px;
            color: var(--text-muted);
            font-size: 13px;
            line-height: 1.6;
        }

        .mapping-suggestion-bar {
            padding: 10px 12px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .mapping-stats {
            font-size: 11px;
            color: var(--text-muted);
            flex: 1;
        }

        /* ─── Target CDM Type Panel ─── */
        .target-type-tree {
            padding: 0;
        }

        .target-attr {
            display: flex;
            align-items: center;
            padding: 6px 14px;
            border-bottom: 1px solid var(--border-primary);
            gap: 6px;
            cursor: pointer;
            user-select: none;
            transition: background 0.1s;
        }

        .target-attr:hover {
            background: var(--bg-secondary);
        }

        .target-attr.mapped {
            background: rgba(34, 197, 94, 0.05);
        }

        .target-attr.clickable {
            cursor: pointer;
        }

        .target-attr.clickable:hover {
            background: rgba(59, 130, 246, 0.08);
        }

        .target-attr.clickable:hover .target-attr-name {
            color: #60a5fa;
        }

        .mapping-instruction {
            padding: 10px 14px;
            background: rgba(59, 130, 246, 0.08);
            border-bottom: 1px solid rgba(59, 130, 246, 0.2);
            font-size: 12px;
            color: #60a5fa;
            text-align: center;
            line-height: 1.5;
        }

        .mapping-instruction strong {
            color: #93bbfd;
        }

        .target-attr-indent {
            display: inline-block;
        }

        .target-attr-name {
            font-size: 12px;
            font-family: var(--font-mono);
            color: var(--text-primary);
        }

        .target-attr-type {
            font-size: 10px;
            font-family: var(--font-mono);
            color: var(--text-muted);
            margin-left: auto;
        }

        .target-attr-card {
            font-size: 10px;
            font-family: var(--font-mono);
            color: var(--text-muted);
        }

        /* ─── Mapping Results Footer ─── */
        .mapping-footer {
            padding: 10px 16px;
            background: var(--bg-secondary);
            border-top: 1px solid var(--border-primary);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .mapping-footer-stats {
            font-size: 12px;
            color: var(--text-muted);
            flex: 1;
        }

        @keyframes mapping-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        .mapping-loading {
            animation: mapping-pulse 1.5s ease-in-out infinite;
        }

        /* ═══════════════════════════════════════════════════════════════
           ABI TAB — SMART CONTRACT BINDING
           ═══════════════════════════════════════════════════════════════ */
        .abi-tab {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .abi-header {
            display: flex;
            align-items: center;
            padding: 12px 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            gap: 12px;
            flex-wrap: wrap;
        }

        .abi-header-row {
            display: flex;
            align-items: center;
            gap: 12px;
            width: 100%;
        }

        .abi-standard-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            background: var(--bg-elevated);
            border: 1px solid var(--border-secondary);
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
            letter-spacing: 0.03em;
        }

        .abi-body {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 1.4fr 1fr;
            overflow: hidden;
        }

        .abi-panel {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border-right: 1px solid var(--border-primary);
        }

        .abi-panel:last-child {
            border-right: none;
        }

        .abi-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 14px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
        }

        .abi-panel-title {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
        }

        .abi-panel-content {
            flex: 1;
            overflow: auto;
            padding: 0;
            background: var(--bg-primary);
        }

        .abi-empty {
            padding: 32px 16px;
            text-align: center;
            color: var(--text-muted);
            font-size: 13px;
            line-height: 1.8;
        }

        .abi-drop-zone {
            border: 2px dashed var(--border-secondary);
            border-radius: 8px;
            padding: 32px 24px;
            margin: 16px;
            text-align: center;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .abi-drop-zone:hover, .abi-drop-zone.dragover {
            border-color: var(--border-active);
            background: var(--bg-tertiary);
        }

        .abi-drop-icon {
            font-size: 28px;
            margin-bottom: 8px;
            opacity: 0.5;
        }

        .abi-drop-text {
            font-size: 13px;
            color: var(--text-muted);
            line-height: 1.6;
        }

        .abi-func-list {
            padding: 4px 0;
        }

        .abi-func-item {
            padding: 7px 14px;
            cursor: pointer;
            font-size: 13px;
            font-family: var(--font-mono);
            color: var(--text-secondary);
            border-left: 3px solid transparent;
            transition: all 0.12s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .abi-func-item:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .abi-func-item.selected {
            background: var(--bg-elevated);
            border-left-color: var(--accent);
            color: var(--text-primary);
        }

        .abi-func-item.mapped {
            color: var(--text-primary);
        }

        .abi-func-item.mapped::after {
            content: '✓';
            margin-left: auto;
            color: var(--text-muted);
            font-size: 11px;
        }

        .abi-func-badge {
            font-size: 9px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            padding: 2px 6px;
            border-radius: 3px;
            flex-shrink: 0;
        }

        .abi-func-badge.fn { background: var(--gray-700); color: var(--gray-300); }
        .abi-func-badge.ev { background: var(--gray-800); color: var(--gray-400); }
        .abi-func-badge.view { background: var(--gray-800); color: var(--gray-500); }
        .abi-func-badge.payable { background: var(--gray-700); color: var(--gray-200); }

        .abi-mapping-row {
            display: flex;
            align-items: center;
            padding: 6px 14px;
            border-bottom: 1px solid var(--border-primary);
            font-size: 12px;
            gap: 8px;
            transition: background 0.1s;
        }

        .abi-mapping-row:hover {
            background: var(--bg-tertiary);
        }

        .abi-mapping-sol {
            flex: 1;
            font-family: var(--font-mono);
            color: var(--text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .abi-mapping-sol .param-name {
            color: var(--text-primary);
            font-weight: 500;
        }

        .abi-mapping-sol .param-type {
            color: var(--text-muted);
            font-size: 11px;
        }

        .abi-mapping-arrow {
            color: var(--text-muted);
            flex-shrink: 0;
            font-size: 11px;
        }

        .abi-mapping-cdm {
            flex: 1;
            font-family: var(--font-mono);
            color: var(--text-secondary);
            font-size: 12px;
        }

        .abi-mapping-cdm select {
            width: 100%;
            background: var(--bg-tertiary);
            color: var(--text-primary);
            border: 1px solid var(--border-secondary);
            border-radius: 3px;
            padding: 4px 6px;
            font-family: var(--font-mono);
            font-size: 11px;
        }

        .abi-mapping-cdm input {
            width: 100%;
            background: var(--bg-tertiary);
            color: var(--text-primary);
            border: 1px solid var(--border-secondary);
            border-radius: 3px;
            padding: 4px 6px;
            font-family: var(--font-mono);
            font-size: 11px;
            outline: none;
        }

        .abi-mapping-cdm input:focus {
            border-color: var(--border-active);
        }

        .abi-mapping-conf {
            width: 42px;
            text-align: center;
            font-size: 11px;
            font-weight: 600;
            flex-shrink: 0;
            border-radius: 3px;
            padding: 2px 0;
        }

        .abi-mapping-conf.high { color: var(--gray-300); }
        .abi-mapping-conf.medium { color: var(--gray-400); }
        .abi-mapping-conf.low { color: var(--gray-500); }

        .abi-rosetta-type {
            padding: 7px 14px;
            font-size: 12px;
            font-family: var(--font-mono);
            color: var(--text-secondary);
            border-bottom: 1px solid var(--border-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .abi-rosetta-type .rtype-name {
            color: var(--text-primary);
            font-weight: 500;
        }

        .abi-rosetta-type .rtype-kind {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
            padding: 1px 5px;
            background: var(--bg-elevated);
            border-radius: 3px;
        }

        .abi-footer {
            display: flex;
            align-items: center;
            padding: 8px 16px;
            background: var(--bg-secondary);
            border-top: 1px solid var(--border-primary);
            gap: 8px;
        }

        .abi-footer-stats {
            font-size: 12px;
            color: var(--text-muted);
            flex: 1;
        }

        .abi-section-header {
            padding: 8px 14px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
        }

        @keyframes abi-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }
        .abi-loading {
            animation: abi-pulse 1.5s ease-in-out infinite;
        }

        /* ═══════════════════════════════════════════════════════════════
           PLUGINS TAB — INSTALLER
           ═══════════════════════════════════════════════════════════════ */
        .plugin-card {
            padding: 12px 14px;
            border-bottom: 1px solid var(--border-primary);
            cursor: pointer;
            transition: all 0.12s ease;
        }
        .plugin-card:hover { background: var(--bg-tertiary); }
        .plugin-card.selected { background: var(--bg-elevated); border-left: 3px solid var(--accent); }
        .plugin-card.installed {
            border-left: 3px solid var(--text-muted);
        }
        .plugin-card-title {
            font-size: 13px; font-weight: 600; color: var(--text-primary);
            display: flex; align-items: center; gap: 8px;
        }
        .plugin-card-desc {
            font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.5;
        }
        .plugin-card-meta {
            font-size: 10px; color: var(--text-muted); margin-top: 6px;
            display: flex; gap: 12px; flex-wrap: wrap;
        }
        .plugin-card-tag {
            padding: 1px 6px; background: var(--bg-elevated); border-radius: 3px;
            font-size: 10px; font-weight: 600; letter-spacing: 0.03em; color: var(--text-secondary);
        }
        .plugin-config-section {
            padding: 12px 14px; border-bottom: 1px solid var(--border-primary);
        }
        .plugin-config-section label {
            display: block; font-size: 11px; font-weight: 600; text-transform: uppercase;
            letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px;
        }
        .plugin-config-section select,
        .plugin-config-section input[type="text"] {
            width: 100%; background: var(--bg-tertiary); color: var(--text-primary);
            border: 1px solid var(--border-secondary); border-radius: 4px;
            padding: 7px 10px; font-family: var(--font-mono); font-size: 12px; outline: none;
        }
        .plugin-config-section select:focus,
        .plugin-config-section input:focus { border-color: var(--border-active); }
        .plugin-config-hint {
            font-size: 10px; color: var(--text-muted); margin-top: 4px; line-height: 1.5;
        }
        .plugin-wiring-option {
            padding: 10px 12px; border: 1px solid var(--border-primary); border-radius: 4px;
            margin-bottom: 6px; cursor: pointer; transition: all 0.12s ease;
        }
        .plugin-wiring-option:hover { border-color: var(--border-secondary); background: var(--bg-tertiary); }
        .plugin-wiring-option.selected { border-color: var(--accent); background: var(--bg-elevated); }
        .plugin-wiring-name {
            font-size: 12px; font-weight: 600; color: var(--text-primary);
            display: flex; align-items: center; gap: 6px;
        }
        .plugin-wiring-desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
        .plugin-file-preview {
            padding: 5px 14px; font-size: 12px; font-family: var(--font-mono);
            color: var(--text-secondary); border-bottom: 1px solid var(--border-primary);
            display: flex; align-items: center; gap: 8px; cursor: pointer; transition: background 0.1s;
        }
        .plugin-file-preview:hover { background: var(--bg-tertiary); }
        .plugin-file-icon { color: var(--text-muted); flex-shrink: 0; font-size: 11px; }
        .plugin-file-path { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .plugin-file-status { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }
        .plugin-install-progress {
            padding: 16px; font-size: 12px; color: var(--text-secondary); line-height: 2;
        }
        .plugin-install-step { display: flex; align-items: center; gap: 8px; }
        .plugin-install-step.done { color: var(--text-primary); }
        .plugin-install-step.active { color: var(--accent); }
        @keyframes plugin-spin { to { transform: rotate(360deg); } }

        /* ═══════════════════════════════════════════════════════════════
           CDM LOAD DROPDOWN
           ═══════════════════════════════════════════════════════════════ */

        .cdm-load-container {
            position: relative;
            display: inline-flex;
        }

        .cdm-load-container #loadCdmBtn {
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
            border-right: 1px solid rgba(255,255,255,0.1);
        }

        .cdm-load-arrow {
            border-top-left-radius: 0 !important;
            border-bottom-left-radius: 0 !important;
            padding: 6px 8px !important;
            min-width: 0 !important;
            font-size: 10px !important;
        }

        .cdm-load-dropdown {
            position: absolute;
            top: calc(100% + 4px);
            right: 0;
            width: 380px;
            max-height: 500px;
            overflow-y: auto;
            background: var(--bg-secondary);
            border: 1px solid var(--border-primary);
            border-radius: 8px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.5);
            z-index: 1000;
        }

        .cdm-load-dropdown.hidden { display: none; }

        .cdm-dropdown-section {
            padding: 10px 14px;
        }

        .cdm-dropdown-divider {
            border-top: 1px solid var(--border-primary);
        }

        .cdm-dropdown-header {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 10px;
            font-weight: 600;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        .cdm-dropdown-header .btn-small {
            margin-left: auto;
            padding: 2px 6px !important;
            font-size: 10px !important;
        }

        .cdm-dropdown-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 6px;
            cursor: pointer;
            transition: background 0.15s;
        }

        .cdm-dropdown-item:hover {
            background: var(--bg-tertiary);
        }

        .cdm-dropdown-icon {
            font-size: 14px;
            width: 20px;
            text-align: center;
            flex-shrink: 0;
        }

        .cdm-dropdown-label {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .cdm-dropdown-desc {
            font-size: 10px;
            color: var(--text-dim);
        }

        .cdm-maven-row {
            display: flex;
            gap: 6px;
            align-items: center;
        }

        .cdm-version-select {
            flex: 1;
            padding: 5px 8px;
            font-size: 11px;
            font-family: var(--font-mono);
            background: var(--bg-primary);
            color: var(--text-primary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            outline: none;
        }

        .cdm-download-status {
            font-size: 10px;
            font-family: var(--font-mono);
            color: var(--text-muted);
            margin-top: 6px;
            min-height: 14px;
            line-height: 1.5;
        }

        .cdm-download-status code {
            display: inline-block;
            margin-top: 2px;
            user-select: all;
        }

        .cdm-dropdown-footer {
            padding: 8px 14px;
            border-top: 1px solid var(--border-primary);
            background: var(--bg-primary);
        }

        .cdm-current-version {
            font-size: 10px;
            font-family: var(--font-mono);
            color: var(--text-dim);
        }

        .cdm-recent-item, .cdm-cached-item {
            padding: 5px 10px;
            font-size: 11px;
            font-family: var(--font-mono);
            color: var(--text-muted);
            cursor: pointer;
            border-radius: 4px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cdm-recent-item:hover, .cdm-cached-item:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .cdm-recent-item .recent-badge {
            font-size: 8px;
            padding: 1px 5px;
            border-radius: 3px;
            font-weight: 700;
        }

        .recent-badge.local { background: rgba(59,130,246,0.15); color: #3b82f6; }
        .recent-badge.maven { background: rgba(139,92,246,0.15); color: #8b5cf6; }

        /* ═══════════════════════════════════════════════════════════════
           RELEASES TAB
           ═══════════════════════════════════════════════════════════════ */

        .releases-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .releases-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            gap: 12px;
        }

        .releases-header-left {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .releases-header-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .releases-count {
            font-size: 10px;
            font-family: var(--font-mono);
            color: var(--text-dim);
        }

        .releases-search {
            width: 180px;
            padding: 5px 10px;
            font-size: 11px;
            font-family: var(--font-mono);
            background: var(--bg-primary);
            color: var(--text-primary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            outline: none;
        }

        .releases-search:focus { border-color: var(--accent); }

        .releases-filter-select {
            padding: 5px 8px;
            font-size: 11px;
            font-family: var(--font-mono);
            background: var(--bg-primary);
            color: var(--text-primary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
        }

        .releases-split {
            flex: 1;
            display: flex;
            overflow: hidden;
        }

        .releases-list-panel {
            width: 320px;
            min-width: 260px;
            border-right: 1px solid var(--border-primary);
            overflow-y: auto;
            background: var(--bg-secondary);
        }

        .releases-loading {
            padding: 40px 20px;
            text-align: center;
            color: var(--text-dim);
            font-size: 12px;
        }

        .release-card {
            padding: 10px 14px;
            border-bottom: 1px solid var(--border-primary);
            cursor: pointer;
            transition: background 0.15s;
        }

        .release-card:hover { background: var(--bg-tertiary); }
        .release-card.active { background: var(--active-bg); border-left: 3px solid var(--accent); }

        .release-card-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 3px;
        }

        .release-card-meta {
            font-size: 10px;
            font-family: var(--font-mono);
            color: var(--text-dim);
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .release-type-badge {
            font-size: 8px;
            padding: 1px 6px;
            border-radius: 3px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .release-type-badge.production { background: rgba(16,185,129,0.15); color: #10b981; }
        .release-type-badge.development { background: rgba(245,158,11,0.15); color: #f59e0b; }

        .releases-detail-panel {
            flex: 1;
            overflow-y: auto;
            padding: 20px 24px;
            background: var(--bg-primary);
        }

        .release-detail-header {
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border-primary);
        }

        .release-detail-title {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 6px;
        }

        .release-detail-meta {
            font-size: 11px;
            font-family: var(--font-mono);
            color: var(--text-dim);
            display: flex;
            gap: 12px;
            align-items: center;
            margin-bottom: 10px;
        }

        .release-detail-actions {
            display: flex;
            gap: 8px;
        }

        .release-body {
            font-size: 13px;
            line-height: 1.7;
            color: var(--text-muted);
        }

        .release-body h1, .release-body h2, .release-body h3 {
            color: var(--text-primary);
            margin-top: 20px;
            margin-bottom: 8px;
        }

        .release-body h2 { font-size: 16px; }
        .release-body h3 { font-size: 14px; }

        .release-body ul, .release-body ol {
            padding-left: 24px;
            margin: 8px 0;
        }

        .release-body li { margin-bottom: 4px; }

        .release-body code {
            background: var(--bg-tertiary);
            padding: 1px 5px;
            border-radius: 3px;
            font-family: var(--font-mono);
            font-size: 12px;
        }

        .release-body pre {
            background: var(--bg-tertiary);
            padding: 12px;
            border-radius: 6px;
            overflow-x: auto;
            font-family: var(--font-mono);
            font-size: 11px;
            margin: 10px 0;
        }

        .release-body a {
            color: var(--accent);
            text-decoration: none;
        }

        .release-body a:hover { text-decoration: underline; }

        /* ═══════════════════════════════════════════════════════════════
           REGRESSION TAB
           ═══════════════════════════════════════════════════════════════ */

        .regression-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .regression-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
            gap: 12px;
        }

        .regression-header-left,
        .regression-header-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .regression-filename {
            font-size: 12px;
            font-family: var(--font-mono);
            color: var(--text-muted);
            max-width: 400px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .regression-status {
            font-size: 11px;
            font-family: var(--font-mono);
            color: var(--accent);
        }

        .regression-split {
            flex: 1;
            display: flex;
            overflow: hidden;
        }

        /* File panel */
        .regression-file-panel {
            width: 260px;
            min-width: 200px;
            display: flex;
            flex-direction: column;
            border-right: 1px solid var(--border-primary);
            background: var(--bg-secondary);
        }

        .regression-file-header {
            padding: 8px 12px;
            border-bottom: 1px solid var(--border-primary);
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .regression-search {
            width: 120px;
            padding: 3px 8px;
            font-size: 11px;
            font-family: var(--font-mono);
            background: var(--bg-primary);
            color: var(--text-primary);
            border: 1px solid var(--border-primary);
            border-radius: 3px;
            outline: none;
        }

        .regression-search:focus {
            border-color: var(--accent);
        }

        .regression-file-list {
            flex: 1;
            overflow-y: auto;
            padding: 4px;
        }

        .regression-file-item {
            padding: 6px 10px;
            font-size: 11px;
            font-family: var(--font-mono);
            color: var(--text-muted);
            cursor: pointer;
            border-radius: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .regression-file-item:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .regression-file-item.active {
            background: var(--active-bg);
            color: var(--accent);
        }

        .regression-file-item .file-path {
            font-size: 9px;
            color: var(--text-dim);
            display: block;
            margin-top: 2px;
        }

        .regression-file-item .rekey-badge {
            display: inline-block;
            font-size: 8px;
            padding: 1px 5px;
            border-radius: 3px;
            margin-left: 6px;
            font-weight: 700;
        }

        .rekey-badge.changed { background: rgba(245,158,11,0.15); color: #f59e0b; }
        .rekey-badge.saved { background: rgba(16,185,129,0.15); color: #10b981; }

        /* Editor panel */
        .regression-editor-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        .regression-editor-header {
            padding: 8px 12px;
            border-bottom: 1px solid var(--border-primary);
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
        }

        .regression-editor-body {
            flex: 1;
            position: relative;
            overflow: hidden;
        }

        .regression-textarea {
            width: 100%;
            height: 100%;
            padding: 12px;
            font-family: var(--font-mono);
            font-size: 12px;
            line-height: 1.5;
            color: var(--text-primary);
            background: var(--bg-primary);
            border: none;
            outline: none;
            resize: none;
            tab-size: 2;
            white-space: pre;
            overflow: auto;
        }

        .regression-textarea.word-wrap {
            white-space: pre-wrap;
            word-break: break-all;
        }

        /* Result panel */
        .regression-result-panel {
            width: 45%;
            min-width: 300px;
            display: flex;
            flex-direction: column;
            border-left: 1px solid var(--border-primary);
        }

        .regression-result-header {
            padding: 8px 12px;
            border-bottom: 1px solid var(--border-primary);
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
        }

        .regression-result-body {
            flex: 1;
            overflow: auto;
            padding: 12px;
            font-family: var(--font-mono);
            font-size: 12px;
            line-height: 1.5;
            color: var(--text-primary);
            background: var(--bg-primary);
        }

        .regression-result-body pre {
            margin: 0;
            white-space: pre-wrap;
            word-break: break-all;
        }

        .diff-added { background: rgba(16,185,129,0.12); color: #10b981; }
        .diff-removed { background: rgba(239,68,68,0.12); color: #ef4444; }
        .diff-key-changed { background: rgba(245,158,11,0.1); }

        /* ═══════════════════════════════════════════════════════════════
           PRODUCT TEMPLATES SIDEBAR
           ═══════════════════════════════════════════════════════════════ */
        .product-templates {
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 320px;
            background: var(--bg-secondary);
            border-left: 1px solid var(--border-primary);
            display: flex;
            flex-direction: column;
            transition: transform 0.3s ease;
            z-index: 10;
        }

        .product-templates.collapsed {
            transform: translateX(320px);
        }

        .templates-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 14px;
            border-bottom: 1px solid var(--border-primary);
        }

        .templates-header h4 {
            margin: 0;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .templates-search {
            padding: 8px 12px;
            border-bottom: 1px solid var(--border-primary);
        }

        .templates-search input {
            width: 100%;
            padding: 6px 10px;
            font-size: 12px;
            font-family: var(--font-mono);
            background: var(--bg-primary);
            color: var(--text-primary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            outline: none;
        }

        .templates-search input:focus {
            border-color: var(--accent);
        }

        .templates-content {
            flex: 1;
            overflow-y: auto;
            padding: 8px;
        }

        .template-category {
            margin-bottom: 6px;
        }

        .template-category-header {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 8px;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.06em;
            cursor: pointer;
            border-radius: 4px;
            user-select: none;
        }

        .template-category-header:hover {
            background: var(--bg-tertiary);
            color: var(--text-secondary);
        }

        .template-category-toggle {
            font-size: 9px;
            transition: transform 0.2s;
        }

        .template-category-toggle.collapsed {
            transform: rotate(-90deg);
        }

        .template-category-count {
            font-size: 9px;
            background: var(--bg-primary);
            padding: 1px 6px;
            border-radius: 8px;
            margin-left: auto;
        }

        .template-category-items {
            padding-left: 4px;
        }

        .template-category-items.collapsed {
            display: none;
        }

        .template-item {
            display: flex;
            flex-direction: column;
            padding: 8px 10px;
            margin: 3px 0;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-secondary);
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.15s;
        }

        .template-item:hover {
            border-color: var(--accent);
            background: rgba(59, 130, 246, 0.06);
        }

        .template-item-name {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 2px;
        }

        .template-item-desc {
            font-size: 10px;
            color: var(--text-muted);
            line-height: 1.4;
        }

        .template-item-tags {
            display: flex;
            gap: 4px;
            margin-top: 5px;
            flex-wrap: wrap;
        }

        .template-tag {
            font-size: 9px;
            font-family: var(--font-mono);
            padding: 1px 6px;
            border-radius: 3px;
            background: var(--bg-primary);
            color: var(--text-muted);
            border: 1px solid var(--border-primary);
        }

        .object-library {
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 300px;
            background: var(--bg-secondary);
            border-left: 1px solid var(--border-primary);
            display: flex;
            flex-direction: column;
            transition: transform 0.3s ease;
            z-index: 10;
        }

        .object-library.collapsed {
            transform: translateX(300px);
        }

        .library-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-primary);
        }

        .library-header h4 {
            margin: 0;
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .library-content {
            flex: 1;
            overflow: auto;
            padding: 12px;
        }

        .library-item {
            padding: 12px;
            margin-bottom: 8px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-secondary);
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .library-item:hover {
            background: var(--bg-elevated);
            border-color: var(--border-active);
        }

        .library-item-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 4px;
        }

        .library-item-name {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
        }

        .library-item-type {
            font-size: 11px;
            color: var(--text-muted);
            padding: 2px 6px;
            background: var(--bg-primary);
            border-radius: 3px;
        }

        .library-item-actions {
            display: flex;
            gap: 4px;
            margin-top: 8px;
        }

        /* ═══════════════════════════════════════════════════════════════
           FOOTER
           ═══════════════════════════════════════════════════════════════ */
        .app-footer {
            grid-area: footer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 16px;
            background: var(--bg-secondary);
            border-top: 1px solid var(--border-primary);
            font-size: 11px;
            color: var(--text-muted);
        }

        .footer-left,
        .footer-right {
            display: flex;
            gap: 16px;
        }

        .footer-item {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        /* ═══════════════════════════════════════════════════════════════
           SCROLLBAR STYLING
           ═══════════════════════════════════════════════════════════════ */
        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-primary);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--gray-600);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--gray-500);
        }

        /* Firefox scrollbar */
        * {
            scrollbar-width: thin;
            scrollbar-color: var(--gray-600) var(--bg-primary);
        }

        /* ═══════════════════════════════════════════════════════════════
           UTILITY CLASSES
           ═══════════════════════════════════════════════════════════════ */
        .hidden {
            display: none !important;
        }

        .text-primary { color: var(--text-primary); }
        .text-secondary { color: var(--text-secondary); }
        .text-muted { color: var(--text-muted); }
        .mono { font-family: var(--font-mono); }

        /* ═══════════════════════════════════════════════════════════════
           MODAL & SERVER STATUS
           ═══════════════════════════════════════════════════════════════ */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
        }

        .modal-content {
            background: var(--bg-secondary);
            border: 1px solid var(--border-active);
            border-radius: 8px;
            max-width: 700px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            border-bottom: 1px solid var(--border-primary);
        }

        .modal-header h2 {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0;
        }

        .modal-close {
            background: transparent;
            border: none;
            color: var(--text-muted);
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.15s ease;
        }

        .modal-close:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }

        .modal-body {
            padding: 24px;
        }

        .server-status {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-primary);
            border-radius: 6px;
            margin-bottom: 24px;
        }

        .status-indicator {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 500;
        }

        .status-dot {
            font-size: 20px;
        }

        .status-dot.red { color: #ef4444; }
        .status-dot.green { color: #22c55e; }
        .status-dot.yellow { color: #eab308; }

        .server-instructions {
            color: var(--text-secondary);
        }

        .server-instructions h3 {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0 0 16px 0;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .server-instructions ol {
            margin: 0;
            padding-left: 20px;
        }

        .server-instructions li {
            margin-bottom: 20px;
            line-height: 1.6;
        }

        .server-instructions strong {
            color: var(--text-primary);
            font-weight: 600;
        }

        .code-block {
            background: var(--bg-primary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            padding: 12px;
            font-family: var(--font-mono);
            font-size: 12px;
            color: var(--text-secondary);
            overflow-x: auto;
            margin: 8px 0;
            white-space: pre;
        }

        .info-box {
            background: var(--bg-tertiary);
            border-left: 3px solid var(--accent);
            padding: 12px 16px;
            margin-top: 20px;
            border-radius: 4px;
            font-size: 13px;
            line-height: 1.5;
        }

        .settings-section {
            margin-bottom: 32px;
            padding-bottom: 24px;
            border-bottom: 1px solid var(--border-primary);
        }

        .settings-section:last-child {
            border-bottom: none;
        }

        .settings-section h3 {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0 0 8px 0;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .settings-description {
            color: var(--text-secondary);
            font-size: 13px;
            margin: 0 0 16px 0;
            line-height: 1.5;
        }

        .btn-small {
            padding: 4px 12px;
            font-size: 11px;
        }

        /* ═══════════════════════════════════════════════════════════════
           FORM FIELDS
           ═══════════════════════════════════════════════════════════════ */
        .form-container {
            padding: 20px;
        }

        .form-title h4 {
            margin: 0 0 4px 0;
            font-size: 18px;
            color: var(--text-primary);
        }

        .form-subtitle {
            font-size: 13px;
            color: var(--text-muted);
        }

        .form-field {
            margin: 16px 0;
        }

        .field-label {
            display: block;
            margin-bottom: 6px;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
        }

        .field-input {
            width: 100%;
            padding: 8px 12px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            color: var(--text-primary);
            font-size: 13px;
            font-family: var(--font-mono);
            transition: border-color 0.15s ease;
        }

        .field-input:focus {
            outline: none;
            border-color: var(--accent);
        }

        .nested-type {
            padding: 12px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            font-size: 12px;
            color: var(--text-muted);
        }

        .nested-type.circular-ref {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(234, 179, 8, 0.1);
            border-color: rgba(234, 179, 8, 0.3);
        }

        .nested-type.circular-ref em {
            color: #eab308;
        }

        .nested-fieldset {
            margin-top: 8px;
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            overflow: hidden;
        }

        .nested-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            background: var(--bg-tertiary);
            cursor: pointer;
            user-select: none;
            transition: background 0.15s ease;
        }

        .nested-header:hover {
            background: var(--bg-elevated);
        }

        .nested-toggle {
            font-size: 10px;
            color: var(--text-muted);
            transition: transform 0.15s ease;
        }

        .nested-title {
            font-weight: 500;
            color: var(--text-primary);
            font-size: 13px;
        }

        .nested-count {
            margin-left: auto;
            font-size: 11px;
            color: var(--text-muted);
        }

        .nested-content {
            padding: 12px;
            background: var(--bg-primary);
            border-top: 1px solid var(--border-primary);
        }

        .nested-content.collapsed {
            display: none;
        }

        .nested-empty {
            padding: 12px;
            text-align: center;
            color: var(--text-muted);
            font-size: 12px;
            font-style: italic;
        }

        .add-array-btn {
            background: var(--bg-tertiary);
            border: 1px dashed var(--border-active);
            color: var(--accent);
        }

        .add-array-btn:hover {
            background: var(--bg-elevated);
            border-color: var(--accent);
        }

        .array-items-container {
            margin-top: 12px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .array-item {
            border: 1px solid var(--border-primary);
            border-radius: 6px;
            overflow: hidden;
            background: var(--bg-secondary);
        }

        .array-item-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            background: var(--bg-tertiary);
            border-bottom: 1px solid var(--border-primary);
        }

        .array-item-title {
            font-weight: 500;
            font-size: 13px;
            color: var(--text-primary);
        }

        .array-item-content {
            padding: 12px;
        }

        .remove-array-btn {
            background: transparent;
            border: 1px solid var(--border-primary);
            color: #ef4444;
        }

        .remove-array-btn:hover {
            background: rgba(239, 68, 68, 0.1);
            border-color: #ef4444;
        }

        /* ═══════════════════════════════════════════════════════════════
           ROSETTA R-ICON
           ═══════════════════════════════════════════════════════════════ */
        .r-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--gray-200, #e5e5e5);
            color: var(--gray-900, #0a0a0a);
            font-size: 9px;
            font-weight: 700;
            font-family: var(--font-sans);
            line-height: 1;
            flex-shrink: 0;
        }
        .file-item.active .r-icon {
            background: var(--text-primary, #fafafa);
            color: var(--gray-900, #0a0a0a);
        }
        .plugin-file-icon .r-icon {
            width: 14px;
            height: 14px;
            font-size: 8px;
        }

        /* ═══════════════════════════════════════════════════════════════
           FIREBASE AUTH OVERLAY
           ═══════════════════════════════════════════════════════════════ */
        .auth-overlay {
            position: fixed;
            inset: 0;
            z-index: 10000;
            background: var(--gray-900, #0a0a0a);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.3s ease;
        }
        .auth-overlay.hidden {
            opacity: 0;
            pointer-events: none;
        }
        .auth-card {
            width: 400px;
            background: var(--bg-secondary, #171717);
            border: 1px solid var(--border-primary, #262626);
            border-radius: 8px;
            padding: 40px 32px;
        }
        .auth-brand {
            text-align: center;
            margin-bottom: 32px;
        }
        .auth-brand-name {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary, #fafafa);
            letter-spacing: 0.05em;
        }
        .auth-brand-sub {
            font-size: 13px;
            color: var(--text-muted, #525252);
            margin-top: 4px;
        }
        .auth-tier-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 3px;
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-top: 8px;
        }
        .auth-tier-badge.free { background: var(--gray-700); color: var(--gray-300); }
        .auth-tier-badge.pro { background: #1a3a2a; color: #4ade80; }
        .auth-tabs {
            display: flex;
            border-bottom: 1px solid var(--border-primary);
            margin-bottom: 24px;
        }
        .auth-tab {
            flex: 1;
            padding: 10px;
            text-align: center;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-muted);
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.15s;
        }
        .auth-tab.active {
            color: var(--text-primary);
            border-bottom-color: var(--text-primary);
        }
        .auth-tab:hover:not(.active) { color: var(--text-secondary); }
        .auth-field {
            margin-bottom: 16px;
        }
        .auth-field label {
            display: block;
            font-size: 11px;
            font-weight: 500;
            color: var(--text-tertiary);
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }
        .auth-field input {
            width: 100%;
            padding: 10px 12px;
            background: var(--bg-primary, #0a0a0a);
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            color: var(--text-primary);
            font-size: 14px;
            font-family: var(--font-sans);
            outline: none;
            transition: border-color 0.15s;
            box-sizing: border-box;
        }
        .auth-field input:focus { border-color: var(--border-active, #525252); }
        .auth-field input::placeholder { color: var(--text-muted); }
        .auth-btn {
            width: 100%;
            padding: 12px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s;
            margin-top: 8px;
        }
        .auth-btn-primary {
            background: var(--gray-200);
            color: var(--gray-900);
        }
        .auth-btn-primary:hover { background: var(--gray-100, #f5f5f5); }
        .auth-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
        .auth-error {
            background: #2d1b1b;
            border: 1px solid #5c2626;
            color: #f87171;
            padding: 10px 12px;
            border-radius: 4px;
            font-size: 12px;
            margin-bottom: 16px;
            display: none;
        }
        .auth-error.visible { display: block; }
        .auth-footer {
            text-align: center;
            margin-top: 20px;
            font-size: 11px;
            color: var(--text-muted);
        }
        .auth-footer a {
            color: var(--text-secondary);
            text-decoration: underline;
            cursor: pointer;
        }
        .auth-divider {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 20px 0;
            color: var(--text-muted);
            font-size: 11px;
        }
        .auth-divider::before, .auth-divider::after {
            content: '';
            flex: 1;
            border-top: 1px solid var(--border-primary);
        }
        .auth-google-btn {
            width: 100%;
            padding: 10px;
            border: 1px solid var(--border-primary);
            border-radius: 4px;
            background: transparent;
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s;
        }
        .auth-google-btn:hover {
            background: var(--bg-tertiary);
            border-color: var(--border-secondary);
        }

        /* ═══════════════════════════════════════════════════════════════
           USER MENU (header)
           ═══════════════════════════════════════════════════════════════ */
        .user-menu {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: 12px;
            padding-left: 12px;
            border-left: 1px solid var(--border-primary);
        }
        .user-avatar {
            width: 28px; height: 28px;
            border-radius: 50%;
            background: var(--gray-700);
            color: var(--gray-300);
            display: flex; align-items: center; justify-content: center;
            font-size: 12px; font-weight: 600;
        }
        .user-info {
            font-size: 11px;
            line-height: 1.3;
        }
        .user-name { color: var(--text-secondary); font-weight: 500; }
        .user-tier {
            font-size: 9px; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.06em;
        }
        .user-tier.free { color: var(--gray-500); }
        .user-tier.pro { color: #4ade80; }
        .user-logout {
            background: none; border: none;
            color: var(--text-muted); cursor: pointer;
            font-size: 11px; padding: 4px 8px;
        }
        .user-logout:hover { color: var(--text-secondary); }

        /* User dropdown menu */
        .user-menu { position: relative; }
        .user-menu-trigger {
            display: flex; align-items: center; gap: 8px;
            cursor: pointer; padding: 4px 8px;
            border-radius: 4px; transition: background 0.15s;
        }
        .user-menu-trigger:hover { background: var(--bg-tertiary, #262626); }
        .user-chevron {
            font-size: 10px; color: var(--text-muted);
            transition: transform 0.15s;
        }
        .user-dropdown {
            position: absolute; top: calc(100% + 6px); right: 0;
            width: 240px; background: var(--bg-secondary, #171717);
            border: 1px solid var(--border-primary, #262626);
            border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
            z-index: 1000; opacity: 0; visibility: hidden;
            transform: translateY(-4px);
            transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
        }
        .user-dropdown.open {
            opacity: 1; visibility: visible; transform: translateY(0);
        }
        .user-dropdown-header {
            padding: 14px 16px; border-bottom: none;
        }
        .user-dropdown-name {
            font-size: 13px; font-weight: 600; color: var(--text-primary);
        }
        .user-dropdown-email {
            font-size: 11px; color: var(--text-muted); margin-top: 2px;
            overflow: hidden; text-overflow: ellipsis;
        }
        .user-dropdown-tier {
            display: inline-block; margin-top: 6px;
            padding: 2px 8px; border-radius: 3px;
            font-size: 9px; font-weight: 700;
            text-transform: uppercase; letter-spacing: 0.08em;
        }
        .user-dropdown-tier.free { background: var(--gray-800); color: var(--gray-400); }
        .user-dropdown-tier.pro { background: #1a3a2a; color: #4ade80; }
        .user-dropdown-tier.admin { background: #3a2a1a; color: #f59e0b; }
        .user-dropdown-divider {
            height: 1px; background: var(--border-primary); margin: 0;
        }
        .user-dropdown-item {
            display: flex; align-items: center; gap: 8px;
            padding: 10px 16px; font-size: 13px;
            color: var(--text-secondary); cursor: pointer;
            transition: background 0.1s;
        }
        .user-dropdown-item:hover { background: var(--bg-tertiary, #262626); }
        .user-dropdown-item:last-child { border-radius: 0 0 6px 6px; }
        .user-dropdown-icon {
            font-size: 14px; width: 18px; text-align: center;
            color: var(--text-muted);
        }

        /* ═══════════════════════════════════════════════════════════════
           TIER GATING
           ═══════════════════════════════════════════════════════════════ */
        .pro-badge {
            display: inline-block;
            padding: 1px 5px;
            border-radius: 3px;
            font-size: 8px;
            font-weight: 700;
            background: #1a3a2a;
            color: #4ade80;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            margin-left: 4px;
            vertical-align: middle;
        }
        .pro-gated { position: relative; }
        .pro-gated.locked::after {
            content: 'PRO';
            position: absolute;
            top: 2px; right: 2px;
            padding: 1px 4px;
            border-radius: 2px;
            font-size: 7px;
            font-weight: 700;
            background: #1a3a2a;
            color: #4ade80;
        }

        /* ═══════════════════════════════════════════════════════════════
           EXAMPLE LIBRARY (Firestore)
           ═══════════════════════════════════════════════════════════════ */
        .example-submit-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: var(--bg-tertiary);
            border-top: 1px solid var(--border-primary);
            font-size: 11px;
        }
        .example-count {
            font-size: 10px;
            color: var(--text-muted);
        }

        /* ═══════════════════════════════════════════════════════════════
           WORKFLOW DESIGNER TAB
           ═══════════════════════════════════════════════════════════════ */
        /* ═══════════════════════════════════════════════════════════════
           CSS VARIABLES — Matches CDM Workbench grayscale palette
           ═══════════════════════════════════════════════════════════════ */

        /* ═══════════════════════════════════════════════════════════════
           LAYOUT: Header + 3-column body + footer
           ═══════════════════════════════════════════════════════════════ */
        .wf-container {
            display: grid;
            grid-template-rows: 52px 1fr 32px;
            grid-template-columns: 200px 1fr 320px;
            grid-template-areas:
                "header header header"
                "palette canvas properties"
                "footer footer footer";
            width: 100%; height: calc(100vh - 100px);
        }

        /* ─── HEADER ─── */
        .wf-header {
            grid-area: header;
            display: flex; align-items: center;
            padding: 0 16px; gap: 12px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
        }
        .wf-header-brand {
            font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
            color: var(--text-muted); text-transform: uppercase;
        }
        .wf-header-divider { width: 1px; height: 24px; background: var(--border-secondary); }
        .wf-header-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
        .wf-header-subtitle { font-size: 12px; color: var(--text-muted); }
        .wf-header-actions { margin-left: auto; display: flex; gap: 8px; }

        .wf-mode-toggle {
            display: flex; border: 1px solid var(--border-secondary); border-radius: 4px; overflow: hidden;
        }
        .wf-mode-btn {
            padding: 6px 14px; font-size: 12px; font-weight: 500;
            background: var(--bg-tertiary); color: var(--text-muted);
            border: none; cursor: pointer; transition: all 0.15s;
        }
        .wf-mode-btn:not(:last-child) { border-right: 1px solid var(--border-secondary); }
        .wf-mode-btn.active { background: var(--gray-600); color: var(--text-primary); }
        .wf-mode-btn:hover:not(.active) { color: var(--text-secondary); }

        .btn {
            padding: 6px 14px; border: 1px solid var(--border-secondary);
            background: var(--bg-tertiary); color: var(--text-secondary);
            font-family: var(--font-sans); font-size: 12px; font-weight: 500;
            cursor: pointer; border-radius: 4px; transition: all 0.15s;
        }
        .btn:hover { background: var(--bg-elevated); border-color: var(--border-active); color: var(--text-primary); }
        .btn-primary { background: var(--gray-100); color: var(--gray-900); border-color: var(--gray-100); }
        .btn-primary:hover { background: var(--gray-200); }

        /* ─── PALETTE (left) ─── */
        .wf-palette {
            grid-area: palette;
            display: flex; flex-direction: column;
            background: var(--bg-secondary);
            border-right: 1px solid var(--border-primary);
            overflow: hidden;
        }
        .wf-palette-header {
            padding: 10px 14px;
            border-bottom: 1px solid var(--border-primary);
            font-size: 11px; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.08em;
            color: var(--text-muted);
        }
        .wf-palette-section {
            padding: 8px 10px 4px;
            font-size: 10px; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.1em;
            color: var(--text-muted);
        }
        .wf-palette-list { flex: 1; overflow-y: auto; padding: 4px 0; }

        .wf-step-chip {
            display: flex; align-items: center; gap: 8px;
            padding: 7px 12px; margin: 2px 8px;
            border-radius: 4px; cursor: grab;
            font-size: 12px; font-weight: 500; color: var(--text-secondary);
            border: 1px solid transparent;
            transition: all 0.12s;
        }
        .wf-step-chip:hover { background: var(--bg-tertiary); border-color: var(--border-secondary); color: var(--text-primary); }
        .wf-step-chip:active { cursor: grabbing; }
        .wf-step-chip .chip-icon {
            width: 22px; height: 22px; border-radius: 4px;
            display: flex; align-items: center; justify-content: center;
            font-size: 11px; font-weight: 700; flex-shrink: 0;
        }
        .wf-step-chip .chip-label { font-size: 12px; }
        .wf-step-chip .chip-hint {
            margin-left: auto; font-size: 9px; color: var(--text-muted);
            text-transform: uppercase; letter-spacing: 0.05em;
        }

        /* Step type colors */
        .chip-propose .chip-icon { background: #1e3a5f; color: var(--accent-blue); }
        .chip-accept .chip-icon { background: #14532d; color: var(--accent-green); }
        .chip-reject .chip-icon { background: #451a1a; color: var(--accent-red); }
        .chip-trigger .chip-icon { background: #1e3a5f; color: var(--accent-cyan); }
        .chip-approve .chip-icon { background: #3b2f1a; color: var(--accent-amber); }
        .chip-validate .chip-icon { background: #3b2f1a; color: var(--accent-amber); }
        .chip-enrich .chip-icon { background: #2e1065; color: var(--accent-purple); }
        .chip-notify .chip-icon { background: #2e1065; color: var(--accent-purple); }
        .chip-wait .chip-icon { background: var(--gray-700); color: var(--text-tertiary); }
        .chip-gateway .chip-icon { background: #3b2f1a; color: var(--accent-amber); border-radius: 50%; }
        .chip-compose .chip-icon { background: #1e3a5f; color: var(--accent-cyan); }
        .chip-complete .chip-icon { background: #14532d; color: var(--accent-green); border-radius: 50%; }
        .chip-fail .chip-icon { background: #451a1a; color: var(--accent-red); border-radius: 50%; }
        .chip-compensate .chip-icon { background: #451a1a; color: var(--accent-red); }

        /* ─── CANVAS (center) ─── */
        .wf-canvas-area {
            grid-area: canvas;
            position: relative; overflow: hidden;
            background: var(--bg-primary);
        }
        .wf-canvas-area svg {
            width: 100%; height: 100%;
            cursor: default;
        }
        .wf-canvas-area svg .grid-line { stroke: var(--gray-800); stroke-width: 0.5; }

        /* SVG Step Nodes */
        .step-node { cursor: pointer; }
        .step-node rect.step-bg {
            rx: 6; ry: 6;
            stroke-width: 1.5;
            transition: stroke 0.15s, filter 0.15s;
        }
        .step-node:hover rect.step-bg { filter: brightness(1.2); }
        .step-node.selected rect.step-bg { stroke-width: 2.5; filter: brightness(1.3); }

        .step-node text.step-label {
            font-family: var(--font-sans); font-size: 11px; font-weight: 600;
            fill: var(--text-primary); text-anchor: middle; dominant-baseline: central;
            pointer-events: none;
        }
        .step-node text.step-type-label {
            font-family: var(--font-mono); font-size: 9px; font-weight: 500;
            fill: var(--text-muted); text-anchor: middle; dominant-baseline: central;
            pointer-events: none; text-transform: uppercase; letter-spacing: 0.08em;
        }
        .step-node text.step-event-badge {
            font-family: var(--font-mono); font-size: 8px; font-weight: 700;
            text-anchor: middle; dominant-baseline: central;
            pointer-events: none;
        }

        /* Gateway diamond */
        .step-node polygon.gateway-bg {
            stroke-width: 1.5;
            transition: stroke 0.15s;
        }
        .step-node.selected polygon.gateway-bg { stroke-width: 2.5; }

        /* Terminal circles */
        .step-node circle.terminal-bg {
            stroke-width: 1.5;
            transition: stroke 0.15s;
        }
        .step-node.selected circle.terminal-bg { stroke-width: 2.5; }

        /* Connection ports */
        .step-port-hit {
            cursor: crosshair;
            pointer-events: all;
        }
        .step-port-hit:hover + .step-port {
            r: 8;
            filter: brightness(1.5);
        }
        .step-port {
            cursor: crosshair;
            transition: r 0.1s, filter 0.1s;
            filter: drop-shadow(0 0 3px rgba(96, 165, 250, 0.4));
        }
        .step-port:hover { r: 8; filter: brightness(1.5); }

        /* Transition lines */
        .transition-line {
            fill: none; stroke: var(--gray-500); stroke-width: 1.5;
            marker-end: url(#arrowhead);
            transition: stroke 0.15s;
        }
        .transition-line:hover { stroke: var(--accent-blue); stroke-width: 2; cursor: pointer; }
        .transition-line.selected { stroke: var(--accent-blue); stroke-width: 2.5; }
        .transition-label {
            font-family: var(--font-mono); font-size: 9px;
            fill: var(--text-muted); text-anchor: middle;
        }

        /* Composition indicators */
        .compose-badge {
            font-family: var(--font-mono); font-size: 8px; font-weight: 600;
            fill: var(--accent-cyan);
            pointer-events: none;
        }

        /* Canvas toolbar */
        .wf-canvas-toolbar {
            position: absolute; top: 10px; right: 10px;
            display: flex; gap: 4px; z-index: 10;
        }
        .wf-canvas-toolbar .btn { padding: 4px 8px; font-size: 11px; }

        .wf-canvas-info {
            position: absolute; bottom: 10px; left: 10px;
            font-size: 11px; color: var(--text-muted);
            background: rgba(10,10,10,0.8); padding: 4px 10px;
            border-radius: 4px;
        }

        /* ─── PROPERTIES PANEL (right) ─── */
        .wf-properties {
            grid-area: properties;
            display: flex; flex-direction: column;
            background: var(--bg-secondary);
            border-left: 1px solid var(--border-primary);
            overflow: hidden;
        }
        .wf-props-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 10px 14px;
            border-bottom: 1px solid var(--border-primary);
        }
        .wf-props-title {
            font-size: 11px; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.08em;
            color: var(--text-muted);
        }
        .wf-props-body { flex: 1; overflow-y: auto; }
        .wf-props-empty {
            padding: 40px 16px; text-align: center;
            color: var(--text-muted); font-size: 13px; line-height: 1.8;
        }

        /* Property sections */
        .wf-prop-section {
            border-bottom: 1px solid var(--border-primary);
            padding: 12px 14px;
        }
        .wf-prop-section-title {
            font-size: 10px; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.1em;
            color: var(--text-muted); margin-bottom: 10px;
        }
        .wf-prop-row {
            display: flex; align-items: center; gap: 8px;
            margin-bottom: 8px;
        }
        .wf-prop-label {
            font-size: 11px; font-weight: 500; color: var(--text-tertiary);
            min-width: 70px; flex-shrink: 0;
        }
        .wf-prop-input {
            flex: 1; padding: 5px 8px;
            background: var(--bg-primary); border: 1px solid var(--border-primary);
            border-radius: 3px; color: var(--text-primary);
            font-family: var(--font-sans); font-size: 12px;
            outline: none; transition: border-color 0.15s;
        }
        .wf-prop-input:focus { border-color: var(--border-active); }
        .wf-prop-select {
            flex: 1; padding: 5px 8px;
            background: var(--bg-primary); border: 1px solid var(--border-primary);
            border-radius: 3px; color: var(--text-primary);
            font-family: var(--font-sans); font-size: 12px;
            outline: none; cursor: pointer;
        }
        .wf-prop-checkbox {
            display: flex; align-items: center; gap: 6px;
        }
        .wf-prop-checkbox input[type="checkbox"] {
            accent-color: var(--accent-blue); cursor: pointer;
        }
        .wf-prop-checkbox label {
            font-size: 12px; color: var(--text-secondary); cursor: pointer;
        }

        /* Mapping rows */
        .wf-mapping-row {
            display: grid; grid-template-columns: 1fr 24px 1fr 24px;
            gap: 4px; align-items: center;
            padding: 4px 0; font-size: 11px;
        }
        .wf-mapping-input {
            padding: 4px 6px;
            background: var(--bg-primary); border: 1px solid var(--border-primary);
            border-radius: 3px; color: var(--text-primary);
            font-family: var(--font-mono); font-size: 10px; outline: none;
        }
        .wf-mapping-input:focus { border-color: var(--border-active); }
        .wf-mapping-arrow { text-align: center; color: var(--text-muted); font-size: 12px; }
        .wf-mapping-delete {
            width: 20px; height: 20px; border: none;
            background: transparent; color: var(--text-muted);
            cursor: pointer; font-size: 14px; border-radius: 3px;
        }
        .wf-mapping-delete:hover { background: var(--bg-elevated); color: var(--accent-red); }

        .wf-add-btn {
            display: flex; align-items: center; gap: 4px;
            padding: 4px 8px; margin-top: 6px;
            background: transparent; border: 1px dashed var(--border-secondary);
            border-radius: 3px; color: var(--text-muted);
            font-size: 11px; cursor: pointer; transition: all 0.15s;
        }
        .wf-add-btn:hover { border-color: var(--border-active); color: var(--text-secondary); }

        /* Transition list */
        .wf-transition-item {
            display: flex; align-items: center; gap: 6px;
            padding: 6px 8px; margin-bottom: 4px;
            background: var(--bg-primary); border: 1px solid var(--border-primary);
            border-radius: 3px; font-size: 11px;
        }
        .wf-transition-target {
            font-weight: 600; color: var(--accent-blue);
            font-family: var(--font-mono); font-size: 10px;
        }
        .wf-transition-cond {
            flex: 1; color: var(--text-muted);
            font-family: var(--font-mono); font-size: 10px;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }

        /* ─── XML PANEL (overlay) ─── */
        .wf-xml-overlay {
            display: none;
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            z-index: 100;
            background: rgba(0,0,0,0.7);
        }
        .wf-xml-overlay.active { display: flex; align-items: center; justify-content: center; }
        .wf-xml-panel {
            width: 80%; height: 85%;
            background: var(--bg-secondary);
            border: 1px solid var(--border-secondary);
            border-radius: 8px;
            display: flex; flex-direction: column;
            overflow: hidden;
        }
        .wf-xml-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-primary);
        }
        .wf-xml-header h3 { font-size: 14px; font-weight: 600; }
        .wf-xml-body { flex: 1; overflow: hidden; display: flex; }
        .wf-xml-editor {
            flex: 1; padding: 12px; resize: none; border: none;
            background: var(--bg-primary); color: var(--accent-green);
            font-family: var(--font-mono); font-size: 12px;
            line-height: 1.6; outline: none; tab-size: 2;
        }
        .wf-xml-footer {
            display: flex; align-items: center; justify-content: flex-end;
            padding: 10px 16px; gap: 8px;
            border-top: 1px solid var(--border-primary);
        }

        /* ─── FOOTER ─── */
        .wf-footer {
            grid-area: footer;
            display: flex; align-items: center;
            padding: 0 16px; gap: 16px;
            background: var(--bg-secondary);
            border-top: 1px solid var(--border-primary);
            font-size: 11px; color: var(--text-muted);
        }
        .wf-footer-item { display: flex; gap: 4px; }
        .wf-footer-item span:last-child { color: var(--text-tertiary); }
        .wf-footer-right { margin-left: auto; display: flex; gap: 12px; }

        /* Scrollbar styling */
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--gray-700); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }

        /* Definition info bar */
        .wf-def-bar {
            padding: 8px 14px;
            background: var(--bg-tertiary);
            border-bottom: 1px solid var(--border-primary);
            display: flex; align-items: center; gap: 12px;
            font-size: 12px;
        }
        .wf-def-badge {
            padding: 2px 8px; border-radius: 3px;
            font-family: var(--font-mono); font-size: 10px;
            font-weight: 600; letter-spacing: 0.03em;
        }
        .wf-def-badge.id { background: #1e3a5f; color: var(--accent-blue); }
        .wf-def-badge.version { background: #14532d; color: var(--accent-green); }
        .wf-def-badge.activatedBy { background: #2e1065; color: var(--accent-purple); }
        .wf-def-name { font-weight: 600; color: var(--text-primary); }

        /* ═══════════════════════════════════════════════════════════════
           ENGINE TAB — Backend Connection & Instance Management
           ═══════════════════════════════════════════════════════════════ */

        .engine-container {
            display: grid;
            grid-template-rows: 52px 1fr 32px;
            width: 100%; height: calc(100vh - 100px);
        }

        /* ─── Header ─── */
        .engine-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 0 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
        }
        .engine-header-left { display: flex; align-items: center; gap: 16px; }
        .engine-header-right { display: flex; align-items: center; gap: 8px; }
        .engine-header-title { font-weight: 600; font-size: 14px; white-space: nowrap; }
        .engine-connection { display: flex; align-items: center; gap: 8px; }
        .engine-url-input {
            width: 220px; padding: 4px 10px;
            background: var(--bg-tertiary); border: 1px solid var(--border-primary);
            border-radius: 4px; color: var(--text-primary); font-family: var(--font-mono);
            font-size: 12px;
        }
        .engine-url-input:focus { border-color: var(--accent-blue); outline: none; }
        .engine-status {
            font-size: 12px; padding: 2px 10px;
            border-radius: 10px; white-space: nowrap;
        }
        .engine-status.connected { color: var(--accent-green); }
        .engine-status.disconnected { color: var(--gray-500); }
        .engine-status.error { color: var(--accent-red); }

        /* ─── Body: 3-column layout ─── */
        .engine-body {
            display: grid;
            grid-template-columns: 280px 1fr 320px;
            overflow: hidden;
        }

        /* ─── Left Panel (Definitions + Instances) ─── */
        .engine-left-panel {
            display: flex; flex-direction: column;
            border-right: 1px solid var(--border-primary);
            overflow: hidden;
        }
        .engine-section { flex: 1; display: flex; flex-direction: column; min-height: 0; }
        .engine-section:first-child { border-bottom: 1px solid var(--border-primary); }
        .engine-section-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 8px 12px;
            background: var(--bg-tertiary);
            border-bottom: 1px solid var(--border-primary);
            font-size: 12px; font-weight: 600; color: var(--text-secondary);
            text-transform: uppercase; letter-spacing: 0.5px;
        }
        .engine-section-body {
            flex: 1; overflow-y: auto; padding: 4px;
        }
        .engine-badge {
            background: var(--bg-elevated); color: var(--text-secondary);
            padding: 1px 8px; border-radius: 10px; font-size: 11px;
        }
        .engine-empty {
            padding: 24px 16px; text-align: center;
            color: var(--text-muted); font-size: 12px; line-height: 1.6;
        }

        /* Definition card */
        .engine-def-card {
            margin: 4px; padding: 10px 12px;
            background: var(--bg-tertiary); border: 1px solid var(--border-primary);
            border-radius: 6px; cursor: pointer; transition: all 0.15s;
        }
        .engine-def-card:hover { border-color: var(--border-secondary); background: var(--bg-elevated); }
        .engine-def-card.selected { border-color: var(--accent-blue); }
        .engine-def-card-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
        .engine-def-card-id { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
        .engine-def-card-stats {
            display: flex; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--text-secondary);
        }
        .engine-def-card-stat {
            background: var(--bg-primary); padding: 1px 6px; border-radius: 3px;
        }
        .engine-def-card-actions { margin-top: 8px; display: flex; gap: 6px; }

        /* Instance card */
        .engine-inst-card {
            margin: 4px; padding: 10px 12px;
            background: var(--bg-tertiary); border: 1px solid var(--border-primary);
            border-radius: 6px; cursor: pointer; transition: all 0.15s;
        }
        .engine-inst-card:hover { border-color: var(--border-secondary); }
        .engine-inst-card.selected { border-color: var(--accent-blue); }
        .engine-inst-card-id {
            font-size: 12px; font-family: var(--font-mono); font-weight: 600;
        }
        .engine-inst-card-def { font-size: 11px; color: var(--text-muted); }
        .engine-inst-card-status {
            display: inline-block; margin-top: 4px; padding: 1px 8px;
            border-radius: 10px; font-size: 10px; font-weight: 600;
            text-transform: uppercase; letter-spacing: 0.3px;
        }
        .engine-inst-card-status.active { background: #14532d; color: var(--accent-green); }
        .engine-inst-card-status.completed { background: #1e3a5f; color: var(--accent-blue); }
        .engine-inst-card-status.failed { background: #451a1a; color: var(--accent-red); }
        .engine-inst-card-status.waiting { background: #3b2f1a; color: var(--accent-amber); }

        /* ─── Center Panel (Detail View) ─── */
        .engine-center-panel {
            display: flex; flex-direction: column; overflow: hidden;
        }
        .engine-detail-tabs {
            display: flex; padding: 0 8px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-primary);
        }
        .engine-dtab {
            padding: 8px 14px; font-size: 12px;
            background: none; border: none; border-bottom: 2px solid transparent;
            color: var(--text-secondary); cursor: pointer;
        }
        .engine-dtab:hover { color: var(--text-primary); }
        .engine-dtab.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
        .engine-detail-body { flex: 1; overflow-y: auto; position: relative; }
        .engine-detail-content { display: none; height: 100%; overflow-y: auto; padding: 12px; }
        .engine-detail-content.active { display: block; }
        .engine-code-viewer {
            background: var(--bg-primary); border: 1px solid var(--border-primary);
            border-radius: 4px; padding: 12px; font-family: var(--font-mono);
            font-size: 12px; line-height: 1.5; color: var(--text-primary);
            overflow: auto; white-space: pre; max-height: 100%;
            tab-size: 2;
        }

        /* Steps Timeline */
        .step-timeline { padding: 8px 0; }
        .step-entry {
            display: flex; gap: 12px; padding: 10px 12px;
            border-left: 3px solid var(--border-primary);
            margin-left: 12px; position: relative;
        }
        .step-entry::before {
            content: ''; position: absolute; left: -8px; top: 14px;
            width: 12px; height: 12px; border-radius: 50%;
            background: var(--bg-elevated); border: 2px solid var(--border-secondary);
        }
        .step-entry.has-event::before { border-color: var(--accent-green); background: #14532d; }
        .step-entry.has-event { border-left-color: var(--accent-green); }
        .step-entry-body { flex: 1; min-width: 0; }
        .step-entry-header {
            display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
        }
        .step-entry-name { font-size: 13px; font-weight: 600; }
        .step-entry-type {
            font-size: 10px; padding: 1px 6px; border-radius: 3px;
            background: var(--bg-elevated); color: var(--text-secondary);
            font-family: var(--font-mono); text-transform: uppercase;
        }
        .step-entry-event-badge {
            font-size: 10px; padding: 1px 6px; border-radius: 3px;
            background: #14532d; color: var(--accent-green);
        }
        .step-entry-state {
            font-size: 12px; color: var(--text-secondary); margin-bottom: 2px;
        }
        .step-entry-time {
            font-size: 11px; color: var(--text-muted); font-family: var(--font-mono);
        }
        .step-entry-details {
            margin-top: 6px; padding: 6px 8px;
            background: var(--bg-primary); border-radius: 4px;
            font-size: 11px; font-family: var(--font-mono);
            color: var(--text-secondary); max-height: 120px; overflow: auto;
        }

        /* Active Tasks */
        .task-card {
            margin: 8px 0; padding: 12px;
            background: var(--bg-tertiary); border: 1px solid var(--border-primary);
            border-radius: 6px;
        }
        .task-card-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 8px;
        }
        .task-card-name { font-size: 13px; font-weight: 600; }
        .task-card-id { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
        .task-card-actions { display: flex; gap: 6px; margin-top: 8px; }

        /* ─── Right Panel (Console) ─── */
        .engine-right-panel {
            display: flex; flex-direction: column;
            border-left: 1px solid var(--border-primary);
            overflow: hidden;
        }
        .engine-console-header {
            padding: 8px 12px;
            background: var(--bg-tertiary);
            border-bottom: 1px solid var(--border-primary);
            font-size: 12px; font-weight: 600; color: var(--text-secondary);
            text-transform: uppercase; letter-spacing: 0.5px;
        }
        .engine-console {
            flex: 1; overflow-y: auto; padding: 8px;
            background: #0c0c0c; font-family: var(--font-mono);
            font-size: 11px; line-height: 1.6;
        }
        .console-line { padding: 1px 6px; border-radius: 2px; word-break: break-all; }
        .console-line.info { color: #60a5fa; }
        .console-line.success { color: #4ade80; }
        .console-line.warn { color: #fbbf24; }
        .console-line.error { color: #f87171; }
        .console-line.step { color: #c084fc; }
        .console-line.event { color: #34d399; font-weight: 600; }
        .console-line.data { color: #94a3b8; }
        .console-line .ts { color: #475569; margin-right: 6px; }

        /* ─── Footer ─── */
        .engine-footer {
            display: flex; align-items: center; gap: 24px;
            padding: 0 16px;
            background: var(--bg-secondary);
            border-top: 1px solid var(--border-primary);
            font-size: 11px; color: var(--text-muted);
        }
        .engine-footer-item { display: flex; gap: 4px; }
        .engine-footer-item span:last-child { color: var(--text-secondary); font-weight: 600; }
        .engine-footer-right { margin-left: auto; }

        /* ─── Modals ─── */
        .engine-modal-overlay {
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6); z-index: 100;
            display: flex; align-items: center; justify-content: center;
        }
        .engine-modal {
            width: 440px; background: var(--bg-secondary);
            border: 1px solid var(--border-primary);
            border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
        }
        .engine-modal-header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 16px; border-bottom: 1px solid var(--border-primary);
        }
        .engine-modal-header h3 { font-size: 14px; font-weight: 600; }
        .engine-modal-body { padding: 16px; }
        .engine-modal-footer {
            display: flex; justify-content: flex-end; gap: 8px;
            padding: 12px 16px; border-top: 1px solid var(--border-primary);
        }
        .engine-form-group { margin-bottom: 12px; }
        .engine-form-group label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
        .engine-form-group input, .engine-form-group select, .engine-form-group textarea {
            width: 100%; padding: 6px 10px;
            background: var(--bg-tertiary); border: 1px solid var(--border-primary);
            border-radius: 4px; color: var(--text-primary); font-size: 13px;
        }
        .engine-form-group textarea { font-family: var(--font-mono); font-size: 12px; resize: vertical; }
        .engine-form-row { display: flex; gap: 12px; }
        .engine-form-row .engine-form-group { flex: 1; }
        .engine-mono { font-family: var(--font-mono); color: var(--accent-blue); }

/* ─── UML / Tree View Toggle ─────────────────────────────── */
.tree-view-btn {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--text-muted) !important;
    transition: all 0.15s;
}
.tree-view-btn:hover {
    color: var(--text-primary) !important;
    background: var(--bg-secondary) !important;
}
.tree-view-btn.active {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
#umlContent .empty-state { padding: 60px 20px; }
#umlSvgContainer:active { cursor: grabbing; }
#umlSvgInner svg { max-width: none; }
