:root {
    /* Panel sizes - updated by JS, never by Blazor */
    --vibe-explorer-width: 220px;
    --vibe-ai-chat-width: 280px;
    --vibe-terminal-height: 200px;
    --bg-main: #0c0c0e;
    --bg-side: #18181b;
    --bg-header: #202023;
    --bg-active: #2d2d30;
    --border-dim: #333338;
    --accent-yellow: #eab308;
    --accent-purple: #a855f7;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-dim: #64748b;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333338; border: 2px solid transparent; background-clip: content-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #44444a; }

body { margin: 0; padding: 0; background-color: var(--bg-main); color: var(--text-primary); font-family: 'Segoe UI', sans-serif; height: 100vh; overflow: hidden; }
body.vibe-dragging { user-select: none !important; cursor: inherit !important; }

.vibe-ide-container { display: flex; flex-direction: column; height: 100vh; }

/* Activity Bar */
.vibe-activity-bar {
    width: 50px; background-color: #1e1e1e; border-right: 1px solid var(--border-dim);
    display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 20px;
}
.vibe-activity-icon {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-dim); transition: color 0.2s;
}
.vibe-activity-icon.active { color: var(--text-primary); border-left: 2px solid var(--accent-yellow); }

/* Menu & Tool Bar */
.vibe-menu-bar { height: 30px; background-color: var(--bg-header); border-bottom: 1px solid var(--border-dim); display: flex; align-items: center; padding: 0 12px; gap: 20px; font-size: 12px; }
.vibe-tool-bar { height: 40px; background-color: var(--bg-side); border-bottom: 1px solid var(--border-dim); display: flex; align-items: center; padding: 0 12px; justify-content: space-between; }

/* Main Layout */
.vibe-main-layout { flex: 1; display: flex; overflow: hidden; position: relative; }

/* ULTIMATE Splitters with Massive Invisible Hitboxes */
.vibe-resizer-h {
    width: 1px;
    background-color: var(--border-dim);
    cursor: col-resize;
    z-index: 1000;
    position: relative;
    transition: background-color 0.2s;
}
.vibe-resizer-h::after {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    width: 21px;
    height: 100%;
    background: transparent;
}
.vibe-resizer-h:hover, .vibe-resizer-h.active {
    background-color: var(--accent-yellow);
    width: 2px;
}

.vibe-resizer-v {
    height: 1px;
    background-color: var(--border-dim);
    cursor: row-resize;
    z-index: 1000;
    position: relative;
    transition: background-color 0.2s;
}
.vibe-resizer-v::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 21px;
    background: transparent;
}
.vibe-resizer-v:hover, .vibe-resizer-v.active {
    background-color: var(--accent-yellow);
    height: 2px;
}

/* Sidebar & AI - sizes driven by CSS vars on :root, never by Blazor inline styles */
.vibe-sidebar {
    width: var(--vibe-explorer-width) !important;
    flex: none !important;
    background-color: var(--bg-side);
    border-right: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.vibe-ai-chat {
    width: var(--vibe-ai-chat-width) !important;
    flex: none !important;
    background-color: var(--bg-side);
    border-left: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.vibe-terminal-container {
    height: var(--vibe-terminal-height) !important;
    flex: none !important;
}

/* AI Prompt Widget */
.vibe-ai-messages { 
    flex: 1; 
    min-height: 0; /* Critical for flexbox overflow scrolling */
    padding: 12px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Premium Scrollbar */
.vibe-ai-messages::-webkit-scrollbar {
    width: 10px;
}
.vibe-ai-messages::-webkit-scrollbar-track {
    background: transparent;
}
.vibe-ai-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: padding-box;
}
.vibe-ai-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(234, 179, 8, 0.6);
    background-clip: padding-box;
}

.vibe-ai-block { border-radius: 8px; padding: 12px; font-size: 13px; line-height: 1.6; border: 1px solid var(--border-dim); }
.vibe-ai-block-header { padding: 4px 10px; font-size: 10px; font-weight: bold; background-color: #252526; border-bottom: 1px solid var(--border-dim); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin: -12px -12px 10px -12px; border-radius: 8px 8px 0 0; }
.vibe-ai-block-content { color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }

/* Role Specific Styles */
.vibe-ai-block.user { background: #1e1e22; border-right: 3px solid var(--accent-yellow); align-self: flex-end; max-width: 85%; }
.vibe-ai-block.agent { background: #161618; border-left: 3px solid var(--accent-purple); }
.vibe-ai-block.thought { background: transparent; border: none; font-style: italic; color: #64748b; font-size: 11px; padding: 0 8px; margin-top: -6px; }
.vibe-ai-block.action { background: rgba(168, 85, 247, 0.08); border: 1px dashed rgba(168, 85, 247, 0.3); color: #c084fc; font-size: 11px; padding: 8px 12px; margin: 4px 0; }
.vibe-ai-block.system { background: #1a1a1d; border: 1px solid #333; color: var(--accent-yellow); font-size: 11px; text-align: center; }

.vibe-ai-input-area { padding: 12px; border-top: 1px solid var(--border-dim); display: flex; flex-direction: column; gap: 10px; }
.vibe-ai-model-selector { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-dim); position: relative; }
.vibe-model-dropdown { position: absolute; bottom: 100%; left: 0; width: 220px; background: #1a1a1d; border: 1px solid var(--border-dim); border-radius: 8px; box-shadow: 0 -10px 25px rgba(0,0,0,0.5); z-index: 2000; margin-bottom: 8px; overflow: hidden; }
.vibe-model-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.03); transition: background 0.2s; color: var(--text-secondary); }
.vibe-model-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.vibe-model-item.active { background: rgba(168, 85, 247, 0.1); color: var(--accent-purple); }

.vibe-ai-input-wrapper { background-color: #252526; border: 1px solid var(--border-dim); border-radius: 6px; display: flex; flex-direction: column; overflow: hidden; }
.vibe-ai-input { background: none; border: none; color: var(--text-primary); font-size: 13px; outline: none; resize: none; min-height: 100px; width: 100%; box-sizing: border-box; padding: 10px 12px; line-height: 1.5; }
.vibe-ai-input-header { border-bottom: 1px solid rgba(255,255,255,0.05); width: 100%; box-sizing: border-box; }

/* Status Bar */
.vibe-status-bar { height: 25px; background-color: #007acc; color: white; display: flex; align-items: center; padding: 0 12px; font-size: 11px; gap: 20px; }
.vibe-status-led { width: 8px; height: 8px; border-radius: 50%; background-color: #4ade80; box-shadow: 0 0 5px #4ade80; }

/* Terminal */
.vibe-terminal-container { background-color: var(--bg-main); border-top: 1px solid var(--border-dim); display: flex; flex-direction: column; overflow: hidden; }
.vibe-terminal-header { height: 35px; background-color: var(--bg-side); border-bottom: 1px solid var(--border-dim); display: flex; align-items: center; padding: 0 4px 0 0; justify-content: space-between; }
.vibe-terminal-tabs { display: flex; align-items: stretch; height: 100%; }
.vibe-terminal-tab { padding: 0 14px; font-size: 11px; cursor: pointer; color: var(--text-dim); display: flex; align-items: center; border-bottom: 2px solid transparent; transition: color 0.15s; white-space: nowrap; }
.vibe-terminal-tab:hover { color: var(--text-primary); }
.vibe-terminal-tab.active { color: var(--text-primary); border-bottom-color: var(--accent-yellow); }
.vibe-terminal-body { flex: 1; display: flex; overflow: hidden; }
.vibe-terminal-content { flex: 1; padding: 10px 14px; font-family: 'Consolas', monospace; font-size: 12px; color: #4ade80; background-color: #0a0a0c; overflow-y: auto; }
.vibe-terminal-sessions { width: 140px; border-left: 1px solid var(--border-dim); background: #111113; overflow-y: auto; display: flex; flex-direction: column; padding: 4px; gap: 2px; }
.vibe-session-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 3px; font-size: 11px; cursor: pointer; color: var(--text-dim); }
.vibe-session-item:hover { background: var(--bg-active); color: var(--text-primary); }
.vibe-session-item.active { background: var(--bg-active); color: var(--text-primary); }
.vibe-cursor-block { display: inline-block; width: 8px; height: 13px; background-color: #4ade80; vertical-align: middle; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Workspace Explorer Tree */
.vibe-sidebar-header { height: 36px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-dim); flex-shrink: 0; }
.vibe-explorer-tree { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 0; }
.vibe-ws-root { margin-bottom: 4px; }
.vibe-ws-root-header { display: flex; align-items: center; gap: 5px; padding: 4px 8px; cursor: pointer; font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; position: relative; }
.vibe-ws-root-header:hover { background: rgba(255,255,255,0.04); }
.vibe-ws-chevron { font-size: 9px; color: var(--text-dim); width: 10px; }
.vibe-ws-root-icon { font-size: 13px; }
.vibe-ws-root-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vibe-ws-remove { color: #ef4444; opacity: 0; font-size: 14px; padding: 0 2px; transition: opacity 0.15s; }
.vibe-ws-root-header:hover .vibe-ws-remove { opacity: 1; }
.vibe-ws-children { padding-left: 8px; }

/* Tree Nodes */
.vibe-tree-node { display: flex; align-items: center; gap: 4px; padding: 2px 8px; cursor: pointer; font-size: 12px; color: var(--text-secondary); border-radius: 2px; user-select: none; }
.vibe-tree-node:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.vibe-tree-node.active-file { background: rgba(234,179,8,0.12); color: var(--accent-yellow); }
.vibe-node-chevron { font-size: 9px; color: var(--text-dim); width: 12px; flex-shrink: 0; }
.vibe-node-icon { font-size: 12px; flex-shrink: 0; }
.vibe-node-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vibe-node-label.dir { font-weight: 600; color: var(--text-primary); }
.vibe-node-children { padding-left: 12px; }

/* Editor */
.vibe-center-pane { display: flex; flex-direction: column; flex: 1; min-width: 400px; overflow: hidden; position: relative; }
.vibe-editor-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.vibe-tabs-bar { height: 35px; background: var(--bg-header); border-bottom: 1px solid var(--border-dim); display: flex; align-items: stretch; overflow-x: auto; flex-shrink: 0; }
.vibe-tabs-bar::-webkit-scrollbar { height: 3px; }
.vibe-tab { display: flex; align-items: center; gap: 8px; padding: 0 14px; font-size: 12px; color: var(--text-dim); cursor: pointer; border-right: 1px solid var(--border-dim); white-space: nowrap; border-bottom: 2px solid transparent; transition: all 0.15s; flex-shrink: 0; }
.vibe-tab:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.vibe-tab.active { background: var(--bg-main); color: var(--text-primary); border-bottom-color: var(--accent-yellow); }
.vibe-tab-close { color: var(--text-dim); font-size: 14px; line-height: 1; opacity: 0; transition: opacity 0.15s; }
.vibe-tab:hover .vibe-tab-close { opacity: 1; }
.vibe-tab-close:hover { color: #ef4444; }
.vibe-breadcrumbs { height: 22px; background: var(--bg-side); border-bottom: 1px solid var(--border-dim); padding: 0 12px; font-size: 11px; color: var(--text-dim); display: flex; align-items: center; flex-shrink: 0; overflow: hidden; }
.vibe-editor-content { flex: 1; overflow: hidden; overflow-y: auto; background: var(--bg-main); display: flex; flex-direction: column; min-height: 0; }

/* Code View with Line Numbers */
.vibe-code-view { font-family: 'Consolas', 'Courier New', monospace; font-size: 13px; line-height: 1.5; }
.vibe-code-line { display: flex; align-items: baseline; min-height: 20px; }
.vibe-code-line:hover { background: rgba(255,255,255,0.025); }
.vibe-line-num { min-width: 48px; padding: 0 12px 0 8px; color: #4a4a52; text-align: right; user-select: none; font-size: 12px; flex-shrink: 0; border-right: 1px solid #1e1e22; }
.vibe-line-code { padding: 0 16px; color: var(--text-primary); white-space: pre; word-break: break-all; }

/* Welcome Screen */
.vibe-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 16px; padding: 40px; }
.vibe-welcome-badge { background: linear-gradient(135deg, #eab308 0%, #f59e0b 100%); color: #0a0a0a; font-size: 11px; font-weight: 800; letter-spacing: 2px; padding: 4px 14px; border-radius: 20px; }
.vibe-welcome-headline { font-size: 28px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; text-align: center; }
.vibe-welcome-sub { font-size: 13px; color: var(--text-dim); text-align: center; max-width: 380px; line-height: 1.6; }
.vibe-welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; max-width: 480px; width: 100%; }
.vibe-welcome-card { background: #1a1a1d; border: 1px solid var(--border-dim); border-radius: 8px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-secondary); transition: border-color 0.2s, background 0.2s; }
.vibe-welcome-card:hover { border-color: #eab30850; background: #1e1e22; }
.vibe-welcome-card span:first-child { font-size: 20px; }
.vibe-welcome-footer { font-size: 11px; color: var(--text-dim); margin-top: 8px; opacity: 0.6; }

/* AI Action Buttons */
.vibe-ai-action-btn { cursor: pointer; color: var(--text-dim); display: flex; align-items: center; padding: 2px; border-radius: 3px; transition: color 0.15s; }
.vibe-ai-action-btn:hover { color: var(--text-primary); }

/* Status bar item */
.vibe-status-item { display: flex; align-items: center; gap: 6px; padding-right: 16px; border-right: 1px solid rgba(255,255,255,0.15); }

/* Menu items */
.vibe-menu-item { cursor: pointer; padding: 2px 6px; border-radius: 3px; font-size: 12px; color: var(--text-secondary); }
.vibe-menu-item:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

/* AI Actions Styling */
.vibe-ai-actions-container { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 12px; }
.vibe-ai-action-item { background: #1a1a1d; border-radius: 6px; border: 1px solid var(--border-dim); overflow: hidden; }
.vibe-ai-action-info { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 11px; }
.vibe-ai-action-icon { font-size: 14px; opacity: 0.8; }
.vibe-ai-status-badge { font-size: 9px; padding: 2px 6px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: bold; }
.vibe-ai-action-item.pending { border-color: var(--accent-yellow); box-shadow: 0 0 15px rgba(234, 179, 8, 0.15); animation: vibe-pulse-yellow 2s infinite; }
.vibe-ai-action-item.pending .vibe-ai-status-badge { background: var(--accent-yellow); color: #000; font-weight: 900; }
.vibe-ai-action-item.approved .vibe-ai-status-badge { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.vibe-ai-action-item.rejected .vibe-ai-status-badge { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.vibe-ai-action-buttons { display: flex; border-top: 1px solid var(--border-dim); }
.vibe-ai-btn { flex: 1; border: none; background: none; color: var(--text-dim); padding: 8px; font-size: 10px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.vibe-ai-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.vibe-ai-btn.approve { color: #4ade80; border-right: 1px solid var(--border-dim); }
.vibe-ai-btn.approve:hover { background: rgba(34, 197, 94, 0.1); }
.vibe-ai-btn.reject:hover { background: rgba(239, 68, 68, 0.1); color: #f87171; }

/* Extension Market */
.vibe-extension-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: rgba(255,255,255,0.02); border-radius: 6px; border: 1px solid transparent; transition: all 0.2s; cursor: pointer; }
.vibe-extension-item:hover { background: rgba(255,255,255,0.05); border-color: var(--border-dim); }
.vibe-extension-icon { width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; color: white; flex-shrink: 0; }
.vibe-extension-info { flex: 1; overflow: hidden; }
.vibe-extension-name { font-size: 12px; font-weight: bold; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vibe-extension-author { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.vibe-ext-btn { background: var(--bg-active); border: 1px solid var(--border-dim); color: var(--text-primary); font-size: 10px; padding: 4px 8px; border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.vibe-ext-btn:hover { background: var(--accent-purple); border-color: var(--accent-purple); }
.vibe-ext-btn.installed { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.2); color: #4ade80; }

/* Terminal Styling */
.vibe-terminal-line { color: #e2e8f0; font-size: 11.5px; white-space: pre-wrap; line-height: 1.4; }
.vibe-terminal-prompt { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.vibe-terminal-input { background: none; border: none; color: #fff; font-family: 'Consolas', monospace; font-size: 12px; outline: none; flex: 1; padding: 0; }
.vibe-terminal-input:focus { outline: none; }
.vibe-terminal-content { user-select: text !important; }

/* Session History Items */
.vibe-session-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #1a1a1d;
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}
.vibe-session-history-item:hover {
    background: #252526;
    border-color: var(--accent-purple);
}
.vibe-archive-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
}

/* Animations */
.vibe-loading-spin { display: inline-block; animation: vibe-spin 1s linear infinite; }
@keyframes vibe-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   HMI DESIGNER  –  Full-Screen Three-Panel Layout
   (c) 2026 VibeCode Industrial
══════════════════════════════════════════════════════════ */
.hmi-root {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    width: 100%;
    background: #0a0a0d;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

/* ── Palette ── */
.hmi-palette {
    width: 170px;
    min-width: 170px;
    background: var(--bg-side);
    border-right: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    padding-bottom: 16px;
}
.hmi-panel-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    padding: 14px 12px 8px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-dim);
    margin-bottom: 8px;
}
.hmi-palette-section {
    font-size: 9px;
    color: var(--text-dim);
    padding: 10px 12px 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.hmi-palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: grab;
    font-size: 11px;
    color: var(--text-secondary);
    border-radius: 6px;
    margin: 2px 8px;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.hmi-palette-item:hover { background: rgba(168,85,247,0.12); color: var(--text-primary); }
.hmi-palette-item:active { cursor: grabbing; }
.hmi-palette-icon { font-size: 18px; width: 22px; text-align: center; }

/* ── Canvas wrapper ── */
.hmi-canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.hmi-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-active);
    border-bottom: 1px solid var(--border-dim);
    min-height: 42px;
}
.hmi-toolbar-label { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.hmi-toolbar-tag   { font-size: 10px; color: var(--accent-purple); background: rgba(168,85,247,0.1); border-radius: 4px; padding: 2px 8px; }
.hmi-btn {
    font-size: 10px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid var(--border-dim);
    background: var(--bg-active);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.5px;
}
.hmi-btn:hover    { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.hmi-btn.primary  { background: var(--accent-purple); border-color: transparent; color: white; }
.hmi-btn.primary:hover { background: #9333ea; }
.hmi-btn.danger   { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.2); color: #f87171; }
.hmi-btn.danger:hover  { background: rgba(239,68,68,0.2); }

.hmi-canvas {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #0a0a0d;
    background-image: radial-gradient(var(--border-dim) 1px, transparent 1px);
    background-size: 22px 22px;
}
.hmi-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    overflow: visible;
}
.hmi-empty-hint {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    pointer-events: none;
}
.hmi-empty-hint span { font-size: 48px; display: block; margin-bottom: 12px; opacity: 0.3; }

/* ── Blocks ── */
.hmi-block {
    position: absolute;
    width: 180px;
    background: var(--bg-active);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    user-select: none;
}
.hmi-block:hover { border-color: rgba(168,85,247,0.4); }
.hmi-block.selected { border-color: var(--accent-purple); box-shadow: 0 0 0 2px rgba(168,85,247,0.3), 0 8px 24px rgba(0,0,0,0.5); }
.hmi-block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.hmi-block-type   { font-size: 9px; font-weight: 700; color: var(--accent-purple); letter-spacing: 1px; }
.hmi-block-id     { font-size: 11px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
.hmi-led          { width: 8px; height: 8px; border-radius: 50%; }

/* Tank */
.hmi-tank-body  { height: 70px; background: #000; border-radius: 6px; position: relative; overflow: hidden; border: 1px solid #2a2a2a; }
.hmi-tank-fill  { position: absolute; bottom: 0; width: 100%; transition: height 0.6s ease; opacity: 0.85; }
.hmi-tank-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-family: 'Consolas', monospace; font-size: 15px; font-weight: 700; color: white; text-shadow: 0 1px 4px rgba(0,0,0,0.9); white-space: nowrap; }

/* Pump */
.hmi-pump-body  { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.2); padding: 8px; border-radius: 6px; }
.hmi-pump-icon  { font-size: 26px; color: #4ade80; }
.hmi-pump-value { font-family: 'Consolas', monospace; font-size: 15px; color: #4ade80; font-weight: 700; }
.hmi-pump-value small { font-size: 9px; opacity: 0.6; }

/* Indicator */
.hmi-indicator-body   { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,0.2); padding: 8px; border-radius: 6px; }
.hmi-pilot-light      { width: 24px; height: 24px; border-radius: 50%; transition: background 0.3s, box-shadow 0.3s; border: 2px solid #222; }

/* ── Inspector ── */
.hmi-inspector {
    width: 230px;
    min-width: 230px;
    background: var(--bg-side);
    border-left: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-bottom: 16px;
}
.hmi-prop-group { padding: 0 12px 12px; }
.hmi-prop-label { display: block; font-size: 9px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px; margin-top: 12px; }
.hmi-prop-value { font-size: 12px; color: var(--text-primary); font-weight: 600; }
.hmi-prop-input {
    width: 100%;
    background: var(--bg-active);
    border: 1px solid var(--border-dim);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 11px;
    padding: 5px 8px;
    box-sizing: border-box;
    outline: none;
}
.hmi-prop-input:focus { border-color: var(--accent-purple); }

.hmi-live-value {
    font-family: 'Consolas', monospace;
    font-size: 20px;
    font-weight: 700;
    color: #4ade80;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}
.hmi-inspector-hint { padding: 40px 16px; text-align: center; color: var(--text-dim); font-size: 11px; line-height: 1.6; }

/* Terminal Prompt Redesign */
.vibe-terminal-prompt-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Custom Creation Modal */
.vibe-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.vibe-creation-modal {
    background: #18181b;
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.vibe-modal-header {
    background: #202023;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-dim);
}

.vibe-modal-close {
    background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px;
}

.vibe-modal-body {
    padding: 20px;
}

.vibe-modal-input {
    width: 100%;
    background: #0c0c0e;
    border: 1px solid var(--accent-purple);
    border-radius: 6px;
    padding: 10px 14px;
    color: white;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    outline: none;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.vibe-modal-footer {
    padding: 14px 18px;
    background: #202023;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-dim);
}

.vibe-modal-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.vibe-modal-btn.cancel {
    background: transparent; border: 1px solid var(--border-dim); color: var(--text-dim);
}
.vibe-modal-btn.cancel:hover {
    background: rgba(255,255,255,0.05); color: var(--text-primary);
}

.vibe-modal-btn.confirm {
    background: var(--accent-purple); border: none; color: white;
}
.vibe-modal-btn.confirm:hover {
    background: #9333ea; transform: translateY(-1px);
}

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

.vibe-ws-root-header:hover .vibe-node-actions { display: flex; }

/* Dropdown Menu Styles */
.vibe-menu-item.active { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.vibe-dropdown {
    position: absolute;
    top: 100%; left: 0;
    background: #252526;
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 10000;
    padding: 4px 0;
    min-width: 220px;
    animation: dropdownFadeIn 0.1s ease-out;
}

.vibe-dropdown-item {
    padding: 6px 12px;
    font-size: 11px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vibe-dropdown-item:hover {
    background: var(--bg-active);
    color: white;
}

.vibe-dropdown-divider {
    height: 1px;
    background: var(--border-dim);
    margin: 4px 0;
}

@keyframes dropdownFadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* Context Menu Styles */
.vibe-context-menu {
    position: fixed;
    background: #252526;
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 10001;
    padding: 4px 0;
    min-width: 180px;
    animation: contextFadeIn 0.1s ease-out;
}

@keyframes contextFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Vibe Auth Styles */
.vibe-auth-container {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #09090b;
    display: flex; align-items: center; justify-content: center;
    z-index: 20000;
    overflow: hidden;
}

.vibe-auth-card {
    background: rgba(24, 24, 27, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 24px;
    width: 420px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 2;
    animation: authSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.vibe-auth-header {
    display: flex; align-items: center; gap: 20px; margin-bottom: 40px;
}

.vibe-auth-logo {
    width: 50px; height: 50px; background: var(--accent-purple);
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 900; color: white;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.vibe-auth-field {
    margin-bottom: 20px;
}

.vibe-auth-field label {
    display: block; font-size: 10px; font-weight: 800; color: var(--text-dim);
    margin-bottom: 8px; letter-spacing: 1px;
}

.vibe-auth-field input {
    width: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 12px 16px; color: white; font-size: 14px;
    outline: none; transition: border-color 0.2s;
}

.vibe-auth-field input:focus {
    border-color: var(--accent-purple);
}

.vibe-auth-btn {
    width: 100%; background: var(--accent-purple); border: none;
    border-radius: 8px; padding: 14px; color: white; font-weight: 800;
    font-size: 13px; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; margin-top: 30px;
}

.vibe-auth-btn:hover {
    background: #9333ea; transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.2);
}

.vibe-auth-footer {
    margin-top: 30px; text-align: center; font-size: 13px; color: var(--text-dim);
}

.vibe-auth-error {
    background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444; padding: 10px; border-radius: 8px; font-size: 12px; margin-top: 10px;
}

.vibe-auth-bg-decor {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 800px; height: 800px; background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
    z-index: 1; pointer-events: none;
}

@keyframes authSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes vibe-pulse-yellow {
    0% { border-color: rgba(234, 179, 8, 0.4); box-shadow: 0 0 5px rgba(234, 179, 8, 0.1); }
    50% { border-color: rgba(234, 179, 8, 1); box-shadow: 0 0 20px rgba(234, 179, 8, 0.3); }
    100% { border-color: rgba(234, 179, 8, 0.4); box-shadow: 0 0 5px rgba(234, 179, 8, 0.1); }
}
