.sponsored-node .node-header {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95) 0%, rgba(0, 40, 60, 0.95) 100%) !important;
    border-bottom-color: var(--accent) !important;
    color: var(--accent);
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Visual AGI Node Editor Styles */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #0f1a0f 50%, #0a0a0a 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

/* Splash Overlay */
#splash-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000; /* fallback backdrop behind iframe */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}

#splash-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#splash-overlay iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: radial-gradient(ellipse at center, rgba(0, 20, 40, 0.95) 0%, rgba(0, 10, 20, 0.98) 100%);
    color: #e2fff2;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

/* Professional Toolbar Styles */
.app-toolbar {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.98) 0%, rgba(0, 40, 60, 0.98) 100%);
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

/* Menu Bar */
.menu-bar {
    display: flex;
    align-items: center;
    padding: 0 8px;
    height: 32px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    position: relative;
}

.menu-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
    transition: left 2s ease;
}

.menu-bar:hover::before {
    left: 100%;
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0; /* Allow shrinking */
}

.menu-left h1 {
    font-size: 16px;
    font-weight: 600;
    color: #00ffaa;
    margin: 0;
    text-shadow: 
        0 0 5px #00ffaa,
        0 0 10px #00ffaa,
        0 0 15px #00ffaa,
        0 0 20px #00ffaa,
        0 1px 0 rgba(255, 255, 255, 0.3),
        0 -1px 0 rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.6),
        0 3px 6px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    flex-shrink: 0;
    transform: perspective(100px) rotateX(5deg);
    transition: all 0.2s ease;
    filter: drop-shadow(0 0 8px rgba(0, 255, 170, 0.4));
}

.menu-left h1:hover {
    transform: perspective(100px) rotateX(8deg) translateY(-1px);
    color: #00ffcc;
    text-shadow: 
        0 0 8px #00ffcc,
        0 0 16px #00ffcc,
        0 0 24px #00ffcc,
        0 0 32px #00ffcc,
        0 1px 0 rgba(255, 255, 255, 0.4),
        0 -1px 0 rgba(0, 0, 0, 0.9),
        0 2px 3px rgba(0, 0, 0, 0.9),
        0 3px 6px rgba(0, 0, 0, 0.7),
        0 4px 8px rgba(0, 0, 0, 0.5);
    filter: drop-shadow(0 0 12px rgba(0, 255, 204, 0.6));
}

.menu-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0; /* Prevent shrinking */
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 255, 136, 0.4);
    color: rgba(0, 255, 136, 0.9);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(0, 255, 136, 0.6);
    color: rgba(0, 255, 136, 1);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 255, 136, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.8), rgba(0, 204, 102, 0.8));
    color: #000000;
    border-color: rgba(0, 255, 136, 0.8);
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.9), rgba(0, 204, 102, 0.9));
    box-shadow: 0 6px 16px rgba(0, 255, 136, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.ping-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    font-size: 12px;
}

.ping-unit {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    margin-left: 2px;
    user-select: none;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.status-indicator:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(0, 255, 136, 0.3);
    transform: translateY(-1px);
}

/* Menu Items */
.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.menu-item:hover {
    background: rgba(0, 255, 136, 0.1);
}

.menu-item.active {
    background: rgba(0, 255, 136, 0.15);
}

.menu-title {
    font-size: 13px;
    color: rgba(226, 255, 242, 0.9);
    font-weight: 500;
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: rgba(0, 30, 50, 0.95);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1001;
    padding: 4px 0;
}

.menu-item.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.menu-option:hover {
    background: rgba(0, 255, 136, 0.1);
}

.menu-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.menu-option.disabled:hover {
    background: transparent;
}

.menu-label {
    font-size: 13px;
    color: rgba(226, 255, 242, 0.9);
}

.menu-shortcut {
    font-size: 11px;
    color: rgba(226, 255, 242, 0.6);
    margin-left: 24px;
}

.menu-separator {
    height: 1px;
    background: rgba(0, 255, 136, 0.2);
    margin: 4px 8px;
}

/* Toolbar Buttons */
.toolbar-buttons {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    height: 44px;
}

.button-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 4px;
    color: rgba(226, 255, 242, 0.9);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.toolbar-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2);
}

.toolbar-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 255, 136, 0.3);
}

.toolbar-btn.execute-btn {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 200, 100, 0.2) 100%);
    border-color: rgba(0, 255, 136, 0.5);
    font-weight: 600;
}

.toolbar-btn.execute-btn:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3) 0%, rgba(0, 200, 100, 0.3) 100%);
    box-shadow: 0 6px 16px rgba(0, 255, 136, 0.3);
}

.btn-icon {
    font-size: 14px;
    filter: grayscale(0.2);
}

.btn-text {
    font-weight: 500;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: rgba(0, 255, 136, 0.3);
    margin: 0 8px;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 255, 136, 0.1);
    height: 28px;
}

.app-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 255, 136, 0.8);
    user-select: none;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.status-info {
    display: flex;
    align-items: center;
    gap: 24px;
}

.status-disconnected {
    color: #f85149;
    user-select: none;
}

.status-connected {
    color: #00ff88;
    user-select: none;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 60px - 200px); /* Account for menu bar and bottom panel */
}

/* Sidebars */
.sidebar-left, .sidebar-right {
    width: 280px;
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95) 0%, rgba(0, 40, 60, 0.95) 100%);
    border-right: 1px solid rgba(0, 255, 136, 0.3);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid rgba(0, 255, 136, 0.3);
}

.sidebar-left::before, .sidebar-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.08) 0%, transparent 100%);
    pointer-events: none;
    animation: sidebarPulse 3s ease-in-out infinite;
    will-change: opacity;
    transform: translateZ(0);
}

@keyframes sidebarPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
    transition: left 1.5s ease;
}

.sidebar-header:hover::before {
    left: 100%;
}

.sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: rgba(0, 255, 136, 0.9);
    user-select: none;
    margin: 0;
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.3);
    position: relative;
    z-index: 1;
}
.search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.search-input:focus {
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.4);
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    user-select: none;
}

/* Node Palette */
.node-palette {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.category {
    margin-bottom: 16px;
}

.category h4 {
    font-size: 12px;
    font-weight: 600;
    color: #cccccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding: 0 8px;
}

.node-item {
    padding: 8px;
    margin: 4px 0;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 6px;
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.node-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
    transition: left 0.5s ease;
}

.node-item:hover::before {
    left: 100%;
}

.node-item:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.2);
    transform: translateY(-2px);
}

.node-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.node-item.preview-active {
    background: rgba(0, 255, 170, 0.15);
    border-color: rgba(0, 255, 170, 0.6);
    box-shadow: 
        0 0 12px rgba(0, 255, 170, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.node-item.preview-active::after {
    content: '👁️';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 12px;
    opacity: 0.7;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    background-color: transparent;
    position: relative;
    overflow: hidden;
    min-width: 0; /* Allow shrinking */
}

.workflow-canvas {
    width: 100%;
    height: 100%;
    position: relative;
    /* Grid visuals moved to dedicated .grid-layer for easier editing */
    /* Optimize for smooth panning/zooming */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

/* Dedicated grid layer (world-space grid) */
.grid-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none; /* grid ignores mouse input */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Sunbeam light sweep overlay (matching splash) */
.sunbeam {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0; /* above grid (0 by DOM order), below nodes (2) */
    mix-blend-mode: screen;
    opacity: 0.28;
    background: none !important;
    animation: none !important;
    overflow: hidden;
}
.sunbeam::before {
    content: '';
    position: absolute;
    top: -60vh;
    left: -10vw;
    width: 120vw;
    height: 220vh;
    background: linear-gradient(90deg,
      rgba(0,255,140,0) 0%,
      rgba(0,255,140,0.10) 40%,
      rgba(0,255,140,0.22) 50%,
      rgba(0,255,140,0.10) 60%,
      rgba(0,255,140,0) 100%);
    filter: blur(28px) saturate(115%);
    transform: rotate(18deg) translateX(-20%);
    animation: sunbeamGlide 22s ease-in-out infinite alternate both;
    will-change: transform;
}
@keyframes sunbeamGlide {
    0%   { transform: rotate(18deg) translateX(-20%) translateZ(0); }
    100% { transform: rotate(18deg) translateX(20%) translateZ(0); }
}
@media (prefers-reduced-motion: reduce) {
    .sunbeam::before { animation: none; opacity: 0.18; }
}

/* Canvas Layers */
.connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    transform-origin: 0 0; /* ensure scale/translate math anchors at top-left */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.nodes-layer {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    transform-origin: 0 0; /* match connections layer for consistent transforms */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Small floating action button for canvas utilities (top-right)
   Matches the look of existing FABs/minimap buttons */
.canvas-fab {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 136, 0.45);
    background: radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.15), rgba(0, 50, 40, 0.5));
    color: #00ff88;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
    cursor: pointer;
    z-index: 120; /* above connections/nodes, near minimap */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    user-select: none;
    pointer-events: auto; /* parent overlay uses pointer-events:none */
    backdrop-filter: blur(4px);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.2s ease;
}
.canvas-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 255, 136, 0.25), inset 0 1px 0 rgba(255,255,255,0.1);
    background: radial-gradient(circle at 50% 50%, rgba(0, 255, 160, 0.2), rgba(0, 60, 48, 0.6));
}
.canvas-fab:active {
    transform: translateY(1px) scale(0.98);
}

/* Respect mobile constraints: keep visible but not overlapping minimap */
@media (max-width: 900px) {
  .canvas-fab { top: 10px; right: 10px; width: 34px; height: 34px; font-size: 15px; }
}

/* Connection Lines */
.connection-line {
    fill: none;
    stroke: #00ff88;
    stroke-width: 2px;
    pointer-events: stroke;
    cursor: pointer;
}

.connection-line:hover {
    stroke: #00ffaa;
    stroke-width: 3px;
}

.connection-line.selected {
    stroke: #00ffcc;
    stroke-width: 3;
}

.connection-line.highlight {
    stroke: #00ff88;
    stroke-width: 4px;
    filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.6));
}

.connection-preview {
    stroke: #00ffaa;
    stroke-width: 2px;
    stroke-dasharray: 5,5;
    fill: none;
    pointer-events: none;
    opacity: 0.8;
}

/* Node Styles */
.workflow-node {
    position: absolute;
    background-color: #2d2d30;
    border: 2px solid #464647;
    border-radius: 6px;
    min-width: 160px;
    cursor: move;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    contain: layout style paint; /* Isolate node rendering from rest of page */
    content-visibility: auto; /* Skip rendering off-screen nodes */
    will-change: transform; /* Hint for GPU acceleration */
}

.workflow-node.selected {
    border-color: #00ff88;
    /* Selected glow is also exposed as a CSS variable for 3D composition */
    --fx-selected-glow: 0 0 0 2px rgba(0, 255, 136, 0.3);
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.3);
}

.workflow-node.executing {
    border-color: #ffd700;
    animation: pulse 1s infinite;
    will-change: opacity;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.node-header {
    background-color: #37373d;
    padding: 8px 12px;
    border-bottom: 1px solid #464647;
    border-radius: 4px 4px 0 0;
    font-size: 13px;
    font-weight: 600;
}

.node-body {
    padding: 12px;
}

.node-input, .node-output {
    display: flex;
    align-items: center;
    margin: 4px 0;
    font-size: 12px;
}

.node-input {
    justify-content: flex-start;
}

.node-output {
    justify-content: flex-end;
}

.connection-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #666666;
    border: 2px solid #cccccc;
    cursor: crosshair;
    margin: 0 8px;
    position: relative;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
    .connection-point:hover {
        background-color: #00cc88;
        transform: scale(1.2);
    }
}

.connection-point.connected {
    background-color: #3fb950;
}

/* Touch-friendly ports: enlarge hit area but keep visual dot centered */
.is-touch .connection-point {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
}
.is-touch .connection-point::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #666666;
    border: 2px solid #cccccc;
    transition: transform 0.12s ease, background-color 0.12s ease;
}
.is-touch .connection-point:hover { transform: none; }
.is-touch .connection-point:hover::after {
    background-color: #00cc88;
    transform: translate(-50%, -50%);
}
.is-touch .connection-point.connected::after {
    background-color: #3fb950;
}

/* Accessibility override: always use larger port targets regardless of device */
.force-large-ports .connection-point {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
}
.force-large-ports .connection-point::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #666666;
    border: 2px solid #cccccc;
    transition: transform 0.12s ease, background-color 0.12s ease;
}
.force-large-ports .connection-point:hover { transform: none; }
.force-large-ports .connection-point:hover::after {
    background-color: #00cc88;
    transform: translate(-50%, -50%);
}
.force-large-ports .connection-point.connected::after {
    background-color: #3fb950;
}

/* Port compatibility highlight guidance */
.connection-point.port-candidate {
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.25);
}
.connection-point.port-dimmed {
    opacity: 0.4;
}

/* Port name and type badges */
.port-name {
    margin: 0 4px;
}

.port-badge {
    display: inline-block;
    padding: 1px 6px;
    margin-left: 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.6;
    color: #ffffff;
    background-color: #555555;
    border: 1px solid rgba(255,255,255,0.15);
    user-select: none;
}

/* Type-specific badge colors */
.port-badge-string { background-color: #6a5acd; }
.port-badge-number { background-color: #1aa3ff; }
.port-badge-boolean { background-color: #00b894; }
.port-badge-object { background-color: #a55eea; }
.port-badge-json { background-color: #a55eea; }
.port-badge-audio_stream { background-color: #ff7f50; }
.port-badge-audio { background-color: #ff7f50; }
.port-badge-image { background-color: #f39c12; }
.port-badge-video { background-color: #e67e22; }
.port-badge-text { background-color: #6a5acd; }
.port-badge-any { background-color: #7f8c8d; }

/* Mismatch warnings */
.connection-point.mismatch {
    border-color: #ff4d4f;
    background-color: #7f1d1d;
    box-shadow: 0 0 6px rgba(255, 77, 79, 0.6);
}

.connection-line.type-mismatch {
    stroke: #ff4d4f !important;
    stroke-width: 3 !important;
    stroke-dasharray: 6,4 !important;
    filter: drop-shadow(0 0 4px rgba(255, 77, 79, 0.6));
}

/* Properties Panel */
.properties-panel {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.no-selection {
    color: #8c8c8c;
    text-align: center;
    padding: 32px 16px;
    font-style: italic;
}

.property-group {
    margin-bottom: 20px;
}

.property-group h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #cccccc;
}

.property-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: #aaaaaa;
    margin-bottom: 6px;
}

.property-item {
    margin-bottom: 12px;
}

.property-label {
    display: block;
    font-size: 12px;
    color: #cccccc;
    margin-bottom: 4px;
}

.property-input {
    width: 100%;
    background-color: #3c3c3c;
    border: 1px solid #464647;
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 3px;
    font-size: 13px;
}

.property-input:focus {
    outline: none;
    border-color: #00ff88;
}

/* Bottom Panel */
.bottom-panel {
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95) 0%, rgba(0, 40, 60, 0.95) 100%);
    border-top: 1px solid rgba(0, 255, 136, 0.3);
    height: 200px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

.bottom-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.4), transparent);
    animation: bottomPanelPulse 4s ease-in-out infinite;
    will-change: opacity;
    transform: translateZ(0);
}

@keyframes bottomPanelPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.6; }
}

.panel-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    backdrop-filter: blur(12px);
}

.tab-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    user-select: none;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
    transition: left 0.4s ease;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button:hover {
    background: rgba(0, 255, 136, 0.05);
    color: rgba(0, 255, 136, 0.9);
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
}

.tab-button.active {
    color: rgba(0, 255, 136, 1);
    border-bottom-color: rgba(0, 255, 136, 0.8);
    background: rgba(0, 255, 136, 0.08);
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
}

.panel-content {
    flex: 1;
    position: relative;
}

.log-panel {
    position: absolute;
    top: 0;
    left: 0;
    min-height: 100px; /* Reserve minimum space to prevent layout shift */
    contain: layout;
    width: 100%;
    height: calc(100% - 50px);
    overflow-y: auto;
    padding: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.4;
    box-sizing: border-box;
    display: none;
}

.log-panel.active {
    display: block;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    margin-bottom: 4px;
    user-select: none;
    padding: 2px 0;
    border-left: 3px solid transparent;
    padding-left: 6px;
}

.log-entry.log-error {
    border-left-color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
}

.log-entry.log-warn {
    border-left-color: #ffd93d;
    background-color: rgba(255, 217, 61, 0.1);
}

.log-entry.log-info {
    border-left-color: #6bcf7f;
    background-color: rgba(107, 207, 127, 0.05);
}

.log-entry.log-debug {
    border-left-color: #4dabf7;
    background-color: rgba(77, 171, 247, 0.05);
}

.timestamp {
    color: #666666;
    margin-right: 8px;
    font-weight: 500;
    user-select: none;
    min-width: 60px;
    flex-shrink: 0;
}

.log-info {
    color: #6bcf7f;
    user-select: none;
}

.log-error {
    color: #ff6b6b;
    font-weight: 600;
    user-select: none;
}

.log-warn {
    color: #ffd93d;
    font-weight: 500;
    user-select: none;
}

.log-debug {
    color: #4dabf7;
    user-select: none;
}

.log-data {
    margin-top: 4px;
    margin-left: 68px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    padding: 4px 6px;
    font-size: 11px;
    color: #cccccc;
    white-space: pre-wrap;
    max-height: 100px;
    overflow-y: auto;
}

.log-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    border-top: 1px solid #3e3e42;
    background-color: #2d2d30;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.log-btn {
    background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
    color: #00ff88;
    border: 1px solid #00ff88;
    user-select: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.log-btn:hover {
    background: linear-gradient(135deg, #001a00, #002a00);
}

/* Performance Metrics */
.performance-metrics {
    display: flex;
    gap: 24px;
    padding: 16px;
    user-select: none;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-label {
    font-size: 11px;
    color: #8c8c8c;
    text-transform: uppercase;
    user-select: none;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-top: 4px;
    user-select: none;
}

/* Context Menus */
.context-menu {
    position: absolute;
    background-color: #2d2d30;
    border: 1px solid #464647;
    border-radius: 3px;
    padding: 4px 0;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
}

.context-item {
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    color: #cccccc;
}

.context-item:hover {
    background-color: #37373d;
    color: #ffffff;
}

.context-divider {
    height: 1px;
    background-color: #464647;
    margin: 4px 0;
}

/* Node color palette in context menu */
.context-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: #aaaaaa;
    padding: 6px 16px 4px 16px;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(9, 18px);
    gap: 8px;
    padding: 6px 12px 10px 12px;
    justify-content: center;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid rgba(255,255,255,0.7);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
    cursor: pointer;
}

.color-swatch:hover {
    transform: scale(1.05);
    border-color: #ffffff;
}

/* Connection Lines */
.connection-line {
    stroke: #00ff88;
    stroke-width: 2;
    fill: none;
    pointer-events: stroke;
    cursor: pointer;
}

.connection-line:hover {
    stroke: #00ffaa;
    stroke-width: 3;
}

.connection-line.selected {
    stroke: #00ffcc;
    stroke-width: 3;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #2d2d30;
}

::-webkit-scrollbar-thumb {
    background: #464647;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar-left, .sidebar-right {
        width: 240px;
    }
}

@media (max-width: 900px) {
    .sidebar-left, .sidebar-right {
        width: 200px;
    }
    
    .bottom-panel {
        height: 150px;
    }
}

/* ======================= */
/* 3D Node Effects (FX 3D) */
/* ======================= */

/* Base 3D variables and transforms */
.workflow-node.node-3d {
    /* Default FX variables */
    --fx-selected-glow: 0 0 0 0 rgba(0,0,0,0);
    --fx-color-outer-glow: 0 0 0 0 rgba(0,0,0,0);
    --fx-color-inner-stroke: inset 0 0 0 0 rgba(0,0,0,0);
    --tilt-x: 0deg;  /* rotateX */
    --tilt-y: 0deg;  /* rotateY */
    --gloss-x: 50%;
    --gloss-y: 0%;
    /* Base/drag shadow stacks */
    --node-shadow-base: 0 8px 16px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.04), inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -2px 6px rgba(0,0,0,0.45);
    --node-shadow-base-drag: 0 16px 32px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.04), inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -2px 8px rgba(0,0,0,0.55);

    transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transform-origin: center center;
    will-change: transform, box-shadow, filter;
    /* Compose base 3D shadow with dynamic FX glows */
    box-shadow: var(--node-shadow-base), var(--fx-selected-glow), var(--fx-color-outer-glow), var(--fx-color-inner-stroke);
}

.workflow-node.node-3d.dragging {
    /* Stabilize during drag and elevate */
    transform: perspective(800px) rotateX(0deg) rotateY(0deg) translateZ(2px);
    box-shadow: var(--node-shadow-base-drag), var(--fx-selected-glow), var(--fx-color-outer-glow), var(--fx-color-inner-stroke);
    /* Disable hardware acceleration and smooth transitions to prevent motion blur */
    will-change: auto !important;
    transform-style: flat !important;
    backface-visibility: hidden !important;
    /* Disable any transitions during drag */
    transition: none !important;
    animation: none !important;
}

/* General dragging class to prevent motion blur on any dragged element */
.dragging {
    /* Force disable hardware acceleration and smooth rendering */
    will-change: auto !important;
    transform-style: flat !important;
    backface-visibility: hidden !important;
    transition: none !important;
    animation: none !important;
    /* Ensure crisp rendering during drag */
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
}

/* Prevent motion blur on canvas during any drag operation */
.canvas-container.drag-active .workflow-node {
    /* Only target workflow nodes during drag to prevent motion blur */
    will-change: auto !important;
    /* Disable smooth transitions that cause blur */
    transition: none !important;
}

/* Ensure minimap remains visible and functional during drag operations */
.canvas-container.drag-active .minimap-container {
    /* Restore normal behavior for minimap */
    will-change: transform !important;
    transition: all 0.2s ease !important;
    /* Ensure it stays visible */
    opacity: 1 !important;
    visibility: visible !important;
}

/* Specular highlight that follows the mouse (uses --gloss-x/--gloss-y) */
.workflow-node.node-3d::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 6px;
    background: radial-gradient(
        80% 50% at var(--gloss-x) var(--gloss-y),
        rgba(255,255,255,0.12) 0%,
        rgba(255,255,255,0.06) 20%,
        rgba(255,255,255,0.02) 40%,
        rgba(255,255,255,0.0) 60%
    );
    mix-blend-mode: screen;
}

/* Subtle inner vignette for depth */
.workflow-node.node-3d::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 6px;
    box-shadow: inset 0 0 24px rgba(0,0,0,0.35);
}

/* Header top sheen and body soft gradient depth */
.workflow-node.node-3d .node-header {
    position: relative;
    overflow: hidden;
}

.workflow-node.node-3d .node-header::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 35%, rgba(0,0,0,0.15) 100%);
}

.workflow-node.node-3d .node-body {
    background-image: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.015) 30%, rgba(0,0,0,0.12) 100%);
}

/* 3D connection points (ports) with rim lighting */
.workflow-node.node-3d .connection-point {
    position: relative;
    background: radial-gradient(65% 65% at 40% 40%, rgba(255,255,255,0.8) 0%, rgba(200,200,200,0.7) 30%, rgba(120,120,120,0.6) 60%, rgba(90,90,90,0.9) 100%);
    border: 2px solid rgba(255,255,255,0.75);
    box-shadow: 0 1px 1px rgba(0,0,0,0.6), 0 0 8px rgba(0, 120, 212, 0.25), inset 0 0 4px rgba(0,0,0,0.4);
}

.workflow-node.node-3d .connection-point:hover {
    box-shadow: 0 2px 3px rgba(0,0,0,0.7), 0 0 10px rgba(0, 120, 212, 0.45), inset 0 0 4px rgba(0,0,0,0.4);
}

.workflow-node.node-3d .connection-point.connected {
    box-shadow: 0 2px 3px rgba(0,0,0,0.7), 0 0 12px rgba(63, 185, 80, 0.55), inset 0 0 4px rgba(0,0,0,0.4);
}

/* Sponsored node placeholder - reserves space to prevent layout shift */
.sponsored-node-placeholder {
    position: absolute;
    width: 336px;
    height: 324px; /* 280px body + 44px header */
    opacity: 0;
    pointer-events: none;
    z-index: 4;
    /* Position at viewport coordinates where node will appear */
    /* Will be positioned via JS to match exact node location */
}

/* Sponsored node (Ad card styled like a node) */
.sponsored-node {
    pointer-events: auto; /* allow clicks inside ad */
    user-select: none;
    z-index: 5; /* above regular nodes but under menus */
    transition: opacity 0.4s ease, transform 0.4s ease;
    overflow: hidden;
    cursor: default; /* override .workflow-node move cursor */
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95) 0%, rgba(0, 40, 60, 0.95) 100%) !important;
    border-color: var(--accent) !important;
    backdrop-filter: blur(12px);
    box-shadow: 
        0 0 12px rgba(0, 255, 136, 0.3),
        0 2px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    /* CRITICAL: Reserve exact space to prevent layout shift */
    width: 336px !important;
    min-width: 336px !important;
    max-width: 336px !important;
    contain: layout size style;
}

.sponsored-body {
    position: relative;
    padding: 0;
    margin: 0;
    background: transparent;
    border-radius: 0 0 var(--node-border-radius, 6px) var(--node-border-radius, 6px);
    overflow: hidden;
    width: 336px;
    height: 280px;
    min-width: 336px;
    max-width: 336px;
    min-height: 280px;
    max-height: 280px;
    contain: layout size style;
}

/* AdSense iframe container - prevent layout shift */
.sponsored-body .adsbygoogle {
    display: block !important;
    width: 336px !important;
    height: 280px !important;
    min-width: 336px !important;
    min-height: 280px !important;
    max-width: 336px !important;
    max-height: 280px !important;
    aspect-ratio: 336 / 280 !important;
    contain: layout size;
    position: relative;
}

/* Ensure AdSense iframes inside also respect dimensions */
.sponsored-body .adsbygoogle iframe {
    max-width: 336px !important;
    max-height: 280px !important;
    display: block !important;
    margin: 0 auto !important;
}

.sponsored-close {
    margin-left: auto;
    appearance: none;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(0, 255, 136, 0.8);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-right: 2px;
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sponsored-close:hover {
    color: #ffffff;
    border-color: var(--accent);
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
}

.sponsored-fade-out {
    opacity: 0 !important;
    transform: scale(0.96);
}

/* Ad Demo/Preview content inside sponsored node */
.ad-preview-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px dashed var(--accent);
    border-radius: 4px;
    background:
      radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.04) 0%, rgba(0,0,0,0.12) 100%),
      repeating-linear-gradient(135deg,
        rgba(0,255,136,0.06) 0px,
        rgba(0,255,136,0.06) 12px,
        rgba(0,0,0,0.0) 12px,
        rgba(0,0,0,0.0) 24px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    text-align: center;
    box-shadow: 
        inset 0 0 0 1px rgba(0,255,136,0.18),
        0 0 8px rgba(0, 255, 136, 0.2);
}

.ad-preview-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.8px;
    background: rgba(0,255,136,0.18);
    border: 1px solid var(--accent);
    color: var(--accent-light);
    padding: 2px 6px;
    border-radius: 3px;
    user-select: none;
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.2);
}

.ad-preview-caption {
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
    color: var(--accent-light);
    text-shadow: 0 0 8px rgba(0,255,136,0.4);
}

.ad-preview-sub {
    font-size: 12px;
    margin-top: 6px;
    color: var(--accent);
    opacity: 0.85;
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.2);
}

/* ==================================================== */
/* THEME: Matrix Neon — late overrides and theme tokens */
/* ==================================================== */
/* ================================
   DUBTITLES PROMO STYLES
   ================================ */

/* Dubtitles Promo Container */
.dubtitles-promo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    border-radius: 0 0 6px 6px;
}

/* Animated background gradients */
.promo-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2f5f 0%, #0f1f3f 50%, #1a0f3f 100%);
    animation: gradientShift 6s ease infinite;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% { background: linear-gradient(135deg, #1a2f5f 0%, #0f1f3f 50%, #1a0f3f 100%); }
    50% { background: linear-gradient(135deg, #1a0f3f 0%, #2f1f5f 50%, #0f1f3f 100%); }
}

/* Floating particles */
.promo-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.promo-particle {
    position: absolute;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.8), rgba(0, 255, 136, 0));
    border-radius: 50%;
    pointer-events: none;
}

.promo-particle:nth-child(1) {
    width: 60px;
    height: 60px;
    top: -10px;
    left: 20%;
    animation: float 8s ease-in-out infinite;
    opacity: 0.3;
}

.promo-particle:nth-child(2) {
    width: 40px;
    height: 40px;
    top: 50%;
    right: -20px;
    animation: float 10s ease-in-out infinite reverse;
    opacity: 0.2;
}

.promo-particle:nth-child(3) {
    width: 50px;
    height: 50px;
    bottom: 10%;
    left: 50%;
    animation: float 12s ease-in-out infinite;
    opacity: 0.25;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    50% { transform: translateY(-30px) translateX(10px); }
}

/* Promo content */
.promo-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    z-index: 2;
}

.promo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.promo-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #00ff88;
    text-transform: uppercase;
    background: rgba(0, 255, 136, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 136, 0.3); }
    50% { box-shadow: 0 0 16px rgba(0, 255, 136, 0.6); }
}

.promo-middle {
    text-align: center;
    animation: bounce-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounce-in {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.promo-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #00ff88, #00d9ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    animation: glow-text 3s ease-in-out infinite;
}

@keyframes glow-text {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.8)); }
}

.promo-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.promo-cta-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

.promo-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4444;
    animation: blink 1.5s ease-in-out infinite;
}

.promo-status-indicator.online {
    background: #00ff88;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 6px rgba(0, 255, 136, 0.8); }
    50% { box-shadow: 0 0 12px rgba(0, 255, 136, 1); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.promo-status-text {
    font-size: 10px;
    font-weight: 600;
    color: #00ff88;
    text-transform: uppercase;
}

.promo-status-text.offline {
    color: #ff4444;
}

.promo-cta-button {
    flex: 1;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3), rgba(0, 212, 255, 0.3));
    border: 1.5px solid #00ff88;
    color: #00ff88;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
}

.promo-cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.promo-cta-button:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.4), rgba(0, 212, 255, 0.4));
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
    transform: scale(1.05);
}

.promo-cta-button:active {
    transform: scale(0.98);
}

/* ================================
   END DUBTITLES PROMO STYLES
   ================================ */

/* We define CSS variables and re-declare key rules here so
   the nodes and wires match the splash/sunbeam theme.
   This section intentionally appears at the end to override
   earlier defaults non-destructively. */

:root {
  /* Core palette */
  --theme-bg-start: #0a0a0a;
  --theme-bg-mid: #0f1a0f;
  --theme-bg-end: #0a0a0a;

  --color-text: #ffffff;
  --color-muted: #cccccc;

  --color-panel: #252526;
  --color-panel-2: #2d2d30;
  --color-border: #3e3e42;

  /* Accents */
  --accent: #00ff88;
  --accent-weak: #00ffaa;
  --accent-strong: #00ffcc;

  /* Nodes */
  --node-bg: #2d2d30;
  --node-border: #464647;
  --node-header-bg: #37373d;
  --node-separator: #464647;

  /* Ports */
  --port-fill: #666666;
  --port-ring: #cccccc;
  --port-hover: #00cc88;

  /* Wires */
  --connection: var(--accent);
  --connection-hover: #00ffaa;
  --connection-selected: #00ffcc;

  /* States */
  --warn: #ffd700;
  --danger: #ff4d4f;

  /* Inputs (properties panel) */
  --input-bg: #3c3c3c;
  --input-border: #464647;
}

/* Buttons and status indicators: accent-aligned */
.btn {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-primary {
  border-color: var(--accent);
  color: var(--accent);
}
.status-connected {
  color: var(--accent);
}

/* Node card — base appearance tuned to theme */
.workflow-node {
  background-color: var(--node-bg);
  border-color: var(--node-border);
  /* subtle neon wash for depth */
  background-image:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 30%, rgba(0,0,0,0.10) 100%);
}
.workflow-node .node-header {
  background-color: var(--node-header-bg);
  border-bottom-color: var(--node-separator);
}

/* Selected/Executing states use theme tokens */
.workflow-node.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent), var(--fx-color-outer-glow, 0 0 0 0 rgba(0,0,0,0));
}
.workflow-node.executing {
  border-color: var(--warn);
}

/* Default 3D FX color hints (fx.js inline styles will override when set) */
.workflow-node.node-3d {
  --fx-color-outer-glow: 0 0 12px rgba(0,255,136,0.14);
  --fx-color-inner-stroke: inset 0 0 0 1px rgba(0,255,136,0.08);
}

/* Ports match accent on hover/connected */
.connection-point {
  background-color: var(--port-fill);
  border-color: var(--port-ring);
}
.connection-point:hover {
  background-color: var(--port-hover);
}
.connection-point.connected {
  background-color: #3fb950; /* keep success hue, blends with neon grid */
}

/* Wires adopt accent palette */
.connection-line {
  stroke: var(--connection);
}
.connection-line:hover {
  stroke: var(--connection-hover);
}
.connection-line.selected {
  stroke: var(--connection-selected);
  stroke-width: 4 !important;
  filter: drop-shadow(0 0 8px rgba(0, 255, 204, 0.8)) drop-shadow(0 0 4px rgba(0, 255, 204, 0.6));
  animation: connectionPulse 2s ease-in-out infinite alternate;
}

@keyframes connectionPulse {
  0% { 
    filter: drop-shadow(0 0 8px rgba(0, 255, 204, 0.8)) drop-shadow(0 0 4px rgba(0, 255, 204, 0.6));
  }
  100% { 
    filter: drop-shadow(0 0 12px rgba(0, 255, 204, 1.0)) drop-shadow(0 0 8px rgba(0, 255, 204, 0.8));
  }
}
.connection-preview {
  stroke: var(--accent-weak);
}

/* Palette hover (left sidebar) */
.node-item:hover {
  border-color: var(--accent);
}

/* ------------------------------- */
/* Theme: Port Badges (Neon unify) */
/* ------------------------------- */

.port-badge {
  color: #e9fff7;
  background-color: rgba(0,255,136,0.12) !important;
  border-color: rgba(0,255,136,0.35) !important;
}
.port-badge:hover {
  background-color: rgba(0,255,136,0.18) !important;
}

/* Normalize all type-specific badges to neon theme */
.port-badge-string,
.port-badge-number,
.port-badge-boolean,
.port-badge-object,
.port-badge-json,
.port-badge-audio_stream,
.port-badge-audio,
.port-badge-image,
.port-badge-video,
.port-badge-text,
.port-badge-any {
  background-color: rgba(0,255,136,0.12) !important;
  border-color: rgba(0,255,136,0.35) !important;
}

/* Property Input Styling */
.property-input {
  opacity: 0.8;
  border-left: 2px solid rgba(255, 165, 0, 0.3);
  padding-left: 4px;
  margin-left: 2px;
}

.property-input:hover {
  opacity: 1;
  border-left-color: rgba(255, 165, 0, 0.6);
}

.property-point {
  border: 2px dashed rgba(255, 165, 0, 0.5) !important;
  background: radial-gradient(circle, rgba(255, 165, 0, 0.1) 0%, transparent 70%) !important;
}

.property-point:hover {
  border-color: rgba(255, 165, 0, 0.8) !important;
  background: radial-gradient(circle, rgba(255, 165, 0, 0.2) 0%, transparent 70%) !important;
  box-shadow: 0 0 8px rgba(255, 165, 0, 0.4);
}

.property-badge {
  background-color: rgba(255, 165, 0, 0.15) !important;
  border-color: rgba(255, 165, 0, 0.4) !important;
  color: #ffb366 !important;
}

/* ----------------------------------------------- */
/* Theme: Properties Panel (typography + borders)  */
/* ----------------------------------------------- */
.properties-panel {
  color: var(--color-text);
}

.property-group h4,
.property-subtitle {
  color: var(--color-muted);
}

.property-label {
  color: var(--color-muted);
}

.property-input {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--color-text);
}
.property-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,255,136,0.15);
}

/* Connection info styling inside properties panel */
.connection-info .connection-type {
  color: var(--accent);
  font-weight: 600;
}

.connection-info .connection-desc {
  color: var(--color-muted);
}

/* ========================================
   MINIMAP & COMPASS STYLES
   ======================================== */

/* Canvas Overlays Container */
.canvas-overlays {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 30;
}

/* Minimap Styles */
.minimap-container {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 220px;
    height: 160px;
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95) 0%, rgba(0, 40, 60, 0.95) 100%);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-bottom: none;
    border-right: none;
    border-radius: 12px 0 0 0;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    backdrop-filter: blur(12px);
    pointer-events: auto;
    user-select: none;
    transition: all 0.3s ease;
    /* 3D effects matching node style */
    transform-style: preserve-3d;
    z-index: 100;
}

.minimap-container.minimized {
    width: 40px;
    height: 32px;
}

.minimap-container:hover:not(.minimized) {
    transform: translateY(-2px) rotateX(2deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

#minimap-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: crisp-edges;
    background: radial-gradient(ellipse at center, rgba(0, 20, 40, 0.95) 0%, rgba(0, 10, 20, 0.98) 100%);
    cursor: pointer;
    border-radius: 12px 0 0 0;
    transition: opacity 0.3s ease;
}

.minimap-container.minimized #minimap-canvas {
    display: none;
}

.minimap-viewport {
    position: absolute;
    top: 0;
    left: 0;
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.35);
    will-change: transform;
    transform: translateZ(0);
    border-radius: 6px;
    pointer-events: none;
    transition: all 0.1s ease;
}

/* Minimap Controls */
.minimap-minimize-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(0, 255, 136, 0.8);
    transition: all 0.2s ease;
    z-index: 101;
    user-select: none;
}

.minimap-minimize-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.5);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.3);
}

.minimap-container.minimized .minimap-minimize-btn {
    width: 24px;
    height: 24px;
    top: 4px;
    left: 8px;
}

.minimap-hint {
    position: absolute;
    left: 12px;
    bottom: 10px;
    font-size: 11px;
    color: rgba(226, 255, 242, 0.82);
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.35);
    background: rgba(0, 0, 0, 0.45);
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    transition: opacity 0.3s ease;
    pointer-events: none;
    user-select: none;
}

.minimap-container.minimized .minimap-hint {
    display: none;
}

.minimap-container.minimized .minimap-viewport {
    display: none;
}

/* Canvas Spirit System Styles */
.compass-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    /* Ensure no mouse interaction at all */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.canvas-spirits {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

/* Canvas Spirit Orbs */
.canvas-spirit {
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    pointer-events: none;
    transform-origin: center;
    animation: spiritFloat 4s ease-in-out infinite;
    transition: all 0.5s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.canvas-spirit.input {
    background: radial-gradient(circle, #3b82f6 20%, rgba(59, 130, 246, 0.8) 60%, rgba(59, 130, 246, 0.3) 100%);
    box-shadow: 
        0 0 20px rgba(59, 130, 246, 0.9),
        0 0 40px rgba(59, 130, 246, 0.5),
        0 0 60px rgba(59, 130, 246, 0.3);
}

.canvas-spirit.processing {
    background: radial-gradient(circle, #10b981 20%, rgba(16, 185, 129, 0.8) 60%, rgba(16, 185, 129, 0.3) 100%);
    box-shadow: 
        0 0 20px rgba(16, 185, 129, 0.9),
        0 0 40px rgba(16, 185, 129, 0.5),
        0 0 60px rgba(16, 185, 129, 0.3);
}

.canvas-spirit.output {
    background: radial-gradient(circle, #f59e0b 20%, rgba(245, 158, 11, 0.8) 60%, rgba(245, 158, 11, 0.3) 100%);
    box-shadow: 
        0 0 20px rgba(245, 158, 11, 0.9),
        0 0 40px rgba(245, 158, 11, 0.5),
        0 0 60px rgba(245, 158, 11, 0.3);
}

.canvas-spirit.utility {
    background: radial-gradient(circle, #8b5cf6 20%, rgba(139, 92, 246, 0.8) 60%, rgba(139, 92, 246, 0.3) 100%);
    box-shadow: 
        0 0 20px rgba(139, 92, 246, 0.9),
        0 0 40px rgba(139, 92, 246, 0.5),
        0 0 60px rgba(139, 92, 246, 0.3);
}

/* Spirit Trails */
.spirit-trail {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 3px;
    pointer-events: none;
    transform-origin: left center;
    opacity: 0.8;
    animation: trailPulse 3s ease-in-out infinite;
    border-radius: 1.5px;
    will-change: transform;
}

.spirit-trail.input { 
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.9) 0%, rgba(59, 130, 246, 0.4) 70%, transparent 100%);
}
.spirit-trail.processing { 
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.9) 0%, rgba(16, 185, 129, 0.4) 70%, transparent 100%);
}
.spirit-trail.output { 
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.9) 0%, rgba(245, 158, 11, 0.4) 70%, transparent 100%);
}
.spirit-trail.utility { 
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.9) 0%, rgba(139, 92, 246, 0.4) 70%, transparent 100%);
}

/* Edge Indicators */
.edge-indicator {
    position: absolute;
    pointer-events: none;
    opacity: 0.9;
    border-radius: 2px;
    animation: edgePulse 2s ease-in-out infinite;
}

.edge-indicator.top, .edge-indicator.bottom {
    width: 4px;
    height: 30px;
}

.edge-indicator.left, .edge-indicator.right {
    width: 30px;
    height: 4px;
}

.edge-indicator.top { top: 5px; }
.edge-indicator.bottom { bottom: 5px; }
.edge-indicator.left { left: 5px; }
.edge-indicator.right { right: 5px; }

.edge-indicator.input { background: linear-gradient(45deg, #3b82f6, rgba(59, 130, 246, 0.6)); }
.edge-indicator.processing { background: linear-gradient(45deg, #10b981, rgba(16, 185, 129, 0.6)); }
.edge-indicator.output { background: linear-gradient(45deg, #f59e0b, rgba(245, 158, 11, 0.6)); }
.edge-indicator.utility { background: linear-gradient(45deg, #8b5cf6, rgba(139, 92, 246, 0.6)); }

/* Spirit Tooltips */
.spirit-tooltip {
    position: absolute;
    font-size: 10px;
    color: rgba(226, 255, 242, 0.95);
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
    white-space: nowrap;
    letter-spacing: 0.04em;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    backdrop-filter: blur(4px);
    pointer-events: none;
    user-select: none;
    transform: translateX(-50%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes spiritFloat {
    0%, 100% { 
        transform: translateY(0px) scale(1);
        opacity: 0.9;
    }
    25% { 
        transform: translateY(-8px) translateX(4px) scale(1.1);
        opacity: 1;
    }
    50% { 
        transform: translateY(-4px) translateX(-2px) scale(0.95);
        opacity: 0.8;
    }
    75% { 
        transform: translateY(-12px) translateX(6px) scale(1.05);
        opacity: 1;
    }
}

@keyframes trailPulse {
    0%, 100% { opacity: 0.5; transform: scaleX(1); }
    50% { opacity: 0.9; transform: scaleX(1.3); }
}

@keyframes edgePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Background Logo Watermark */
.background-logo {
    position: absolute;
    top: 50000px;
    left: 50000px;
    transform: translate(-50%, -50%);
    width: 1200px;
    height: 400px;
    opacity: 0.8;
    pointer-events: none;
    z-index: -1;
    user-select: none;
    mix-blend-mode: screen;
}

.background-logo .logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-family: 'Courier New', monospace;
    text-align: center;
}

.background-logo .main-title {
    font-size: 96px;
    font-weight: bold;
    letter-spacing: 16px;
    margin-bottom: 20px;
    text-transform: uppercase;
    color: #00ffaa;
    user-select: none;
    text-shadow: 
        0 0 15px #00ffaa,
        0 0 30px #00ffaa,
        0 0 45px #00ffaa,
        0 0 60px #00ffaa,
        0 0 75px #00ffaa,
        0 0 90px #00ffaa;
}

.background-logo .sub-title {
    font-size: 36px;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: #00ffaa;
    opacity: 0.9;
    user-select: none;
    text-shadow: 
        0 0 15px #00ffaa,
        0 0 30px #00ffaa,
        0 0 45px #00ffaa,
        0 0 60px #00ffaa,
        0 0 75px #00ffaa,
        0 0 90px #00ffaa;
}

/* Hide logo when zoomed out too far */
@media (max-width: 768px) {
    .background-logo {
        width: 400px;
        height: 300px;
        opacity: 0.06;
    }
}

/* Viewport Info Display */
.viewport-info {
    font-size: 13px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 20px;
}

.info-label {
    color: #00ffaa;
    font-weight: 600;
    margin-right: 6px;
    user-select: none;
    text-shadow: 
        0 0 3px #00ffaa,
        0 0 6px #00ffaa,
        0 0 9px #00ffaa,
        0 0 12px #00ffaa,
        0 1px 0 rgba(255, 255, 255, 0.2),
        0 -1px 0 rgba(0, 0, 0, 0.7),
        0 1px 2px rgba(0, 0, 0, 0.6),
        0 2px 3px rgba(0, 0, 0, 0.4);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transform: perspective(50px) rotateX(3deg);
    transition: all 0.2s ease;
    filter: drop-shadow(0 0 4px rgba(0, 255, 170, 0.3));
}

.info-label:hover {
    transform: perspective(50px) rotateX(6deg) translateY(-0.5px);
    color: #00ffcc;
    text-shadow: 
        0 0 4px #00ffcc,
        0 0 8px #00ffcc,
        0 0 12px #00ffcc,
        0 0 16px #00ffcc,
        0 1px 0 rgba(255, 255, 255, 0.3),
        0 -1px 0 rgba(0, 0, 0, 0.8),
        0 1px 2px rgba(0, 0, 0, 0.8),
        0 2px 3px rgba(0, 0, 0, 0.6);
    filter: drop-shadow(0 0 6px rgba(0, 255, 204, 0.5));
}

.info-value {
    color: #ffffff;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    user-select: none;
    margin-right: 0;
    min-width: 55px;
    text-align: right;
    display: inline-block;
    background: rgba(0, 255, 136, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    text-shadow: 
        0 0 4px rgba(255, 255, 255, 0.6),
        0 0 8px rgba(0, 255, 170, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.2),
        0 -1px 0 rgba(0, 0, 0, 0.8),
        0 1px 2px rgba(0, 0, 0, 0.7),
        0 2px 3px rgba(0, 0, 0, 0.5);
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    transform: perspective(80px) rotateX(4deg);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.info-value::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.3), transparent);
    transition: left 0.5s ease;
}

.info-value:hover::before {
    left: 100%;
}

.info-value:hover {
    background: rgba(0, 255, 136, 0.15);
    border-color: rgba(0, 255, 136, 0.4);
    text-shadow: 
        0 0 6px rgba(255, 255, 255, 0.8),
        0 0 12px rgba(0, 255, 170, 0.5),
        0 0 18px rgba(0, 255, 170, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.3),
        0 -1px 0 rgba(0, 0, 0, 0.9),
        0 1px 3px rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.6);
    transform: perspective(80px) rotateX(6deg) scale(1.05) translateY(-1px);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        0 0 12px rgba(0, 255, 136, 0.3),
        0 0 20px rgba(0, 255, 170, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.zoom-indicator,
.coordinates-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.zoom-indicator:hover,
.coordinates-indicator:hover {
    background: rgba(0, 255, 136, 0.08);
    transform: translateY(-1px);
}

/* Value change animations */
@keyframes valueFlash {
    0% { 
        background: rgba(0, 255, 136, 0.1);
        transform: scale(1);
    }
    50% { 
        background: rgba(0, 255, 136, 0.4);
        transform: scale(1.08);
        text-shadow: 0 0 12px rgba(0, 255, 136, 0.8);
        box-shadow: 0 0 16px rgba(0, 255, 136, 0.4);
    }
    100% { 
        background: rgba(0, 255, 136, 0.1);
        transform: scale(1);
    }
}

.info-value.value-updating {
    background: rgba(0, 255, 136, 0.2) !important;
    border-color: rgba(0, 255, 136, 0.5) !important;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.6) !important;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.3) !important;
}

/* Pulsing effect for the entire viewport info when values change */
.viewport-info.updating {
    animation: infoPulse 0.4s ease;
    will-change: box-shadow;
}

@keyframes infoPulse {
    0% { 
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 0 6px 20px rgba(0, 255, 136, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
        border-color: rgba(0, 255, 136, 0.6);
    }
    100% { 
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

/* Edge Compass - Game-style navigation indicator */
.edge-compass {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(0, 255, 136, 0.7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 100;
    pointer-events: none;
    backdrop-filter: blur(6px);
    user-select: none;
    box-shadow: 
        0 0 16px rgba(0, 255, 136, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.15),
        inset 0 -1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    animation: compassPulse 2s ease-in-out infinite;
    color: #00ffaa;
    text-shadow: 0 0 8px rgba(0, 255, 170, 0.6);
}


.edge-compass::before {
    content: attr(data-distance);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #00ffaa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(0, 255, 136, 0.3);
    text-shadow: 0 0 4px rgba(0, 255, 136, 0.5);
}

.edge-compass::after {
    content: attr(data-node-name);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes compassPulse {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(0, 255, 136, 0.4),
            inset 0 2px 4px rgba(255, 255, 255, 0.1),
            inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    }
    50% { 
        box-shadow: 
            0 0 30px rgba(0, 255, 136, 0.6),
            0 0 40px rgba(0, 255, 136, 0.3),
            inset 0 2px 4px rgba(255, 255, 255, 0.15),
            inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    }
}

/* Prevent text selection in sidebars and UI elements */
.sidebar-left,
.sidebar-right,
.node-palette,
.properties-panel,
.menu-bar,
.bottom-panel {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Allow text selection in specific input areas */
input[type="text"],
input[type="number"],
textarea,
.log-panel {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .menu-bar {
        padding: 10px 16px;
        height: 56px;
    }
    
    .main-content {
        height: calc(100vh - 56px - 200px);
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .viewport-info {
        gap: 12px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .info-value {
        min-width: 45px;
        padding: 3px 6px;
        font-size: 11px;
    }
}

@media (max-width: 1200px) {
    .menu-bar {
        padding: 8px 12px;
        height: 52px;
    }
    
    .main-content {
        height: calc(100vh - 52px - 200px);
    }
    
    .menu-left h1 {
        font-size: 14px;
    }
    
    .btn {
        padding: 5px 10px;
        font-size: 10px;
    }
    
    .viewport-info {
        gap: 8px;
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .info-value {
        min-width: 40px;
        padding: 2px 5px;
        font-size: 10px;
    }
    
    .info-label {
        font-size: 9px;
    }
    
    .status-indicator {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .minimap-container {
        width: 180px;
        height: 130px;
        bottom: 16px;
        right: 16px;
    }
    
    .compass-arrow {
        width: 64px;
        height: 64px;
    }
    
    .compass-arrow-head {
        border-left-width: 12px;
        border-right-width: 12px;
        border-bottom-width: 24px;
    }
    
    .compass-arrow-tail {
        width: 10px;
        height: 28px;
        top: 24px;
    }
}

@media (max-width: 768px) {
    .menu-bar {
        padding: 6px 10px;
        height: 48px;
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .main-content {
        height: calc(100vh - 48px - 150px);
    }
    
    .menu-left {
        gap: 8px;
        order: 1;
        flex: 1 1 auto;
    }
    
    .menu-left h1 {
        font-size: 12px;
    }
    
    .menu-right {
        gap: 6px;
        order: 2;
        flex: 0 0 auto;
    }
    
    .btn {
        padding: 4px 8px;
        font-size: 9px;
        border-radius: 4px;
    }
    
    .viewport-info {
        gap: 6px;
        padding: 4px 6px;
        font-size: 10px;
        flex-wrap: wrap;
    }
    
    .info-value {
        min-width: 35px;
        padding: 2px 4px;
        font-size: 9px;
    }
    
    .info-label {
        font-size: 8px;
    }
    
    .status-indicator {
        padding: 3px 6px;
        font-size: 9px;
    }
    
    .minimap-container {
        width: 160px;
        height: 110px;
        bottom: 12px;
        right: 12px;
    }
    
    .compass-arrow {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .menu-bar {
        height: auto;
        min-height: 36px;
        padding: 4px 6px;
    }
    
    .menu-left h1 {
        font-size: 11px;
    }
    
    .btn {
        padding: 3px 6px;
        font-size: 8px;
    }
    
    .viewport-info {
        padding: 3px 5px;
        font-size: 9px;
        gap: 4px;
    }
    
    .info-value {
        min-width: 30px;
        padding: 1px 3px;
        font-size: 8px;
    }
    
    .coordinates-indicator {
        flex-wrap: wrap;
    }
    
    .minimap-container {
        width: 140px;
        height: 100px;
        bottom: 8px;
        right: 8px;
    }
}

/* Help Button Styling */
.help-button {
    border-left: 1px solid rgba(0, 255, 136, 0.2);
    padding-left: 12px !important;
    margin-left: 8px; /* Small spacing from previous menu item */
}

.help-button .menu-title {
    font-size: 18px;
    font-weight: bold;
    color: rgba(0, 255, 136, 0.9);
    padding: 4px 8px;
    border-radius: 50%;
    background: rgba(0, 255, 136, 0.1);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.help-button:hover .menu-title {
    background: rgba(0, 255, 136, 0.2);
    color: rgba(0, 255, 136, 1);
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.help-button.active .menu-title {
    background: rgba(0, 255, 136, 0.3);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.4);
}

/* Help Modal Styling */
.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.help-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-modal-content {
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95) 0%, rgba(0, 40, 60, 0.95) 100%);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 255, 136, 0.2);
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    display: flex;
    flex-direction: column;
    animation: slideInUp 0.3s ease;
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

.help-modal-header h2 {
    margin: 0;
    color: rgba(0, 255, 136, 0.9);
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.help-modal-close {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    user-select: none;
}

.help-modal-close:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.1);
}

.help-modal-body {
    padding: 20px 24px 24px 24px;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

/* About Me Styling */
.about-info {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.about-section {
    margin-bottom: 24px;
}

.about-section h3 {
    color: rgba(0, 255, 136, 0.9);
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
}

.about-section h4 {
    color: rgba(0, 255, 136, 0.8);
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
}

.about-section ul {
    margin: 8px 0;
    padding-left: 20px;
}

.about-section li {
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.8);
}

.system-info {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 255, 136, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .info-label {
    color: rgba(0, 255, 136, 0.7);
    font-weight: 500;
}

.info-row .info-value {
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Changelog Styling */
.changelog-content {
    color: rgba(255, 255, 255, 0.9);
}

.loading-message {
    text-align: center;
    color: rgba(0, 255, 136, 0.7);
    font-style: italic;
    padding: 20px;
}

.error-message {
    text-align: center;
    color: #ff6b6b;
    padding: 20px;
}

/* Markdown-rendered content styling */
.changelog-content h1 {
    color: rgba(0, 255, 136, 0.9);
    font-size: 24px;
    margin: 0 0 16px 0;
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.changelog-content h2 {
    color: rgba(0, 255, 136, 0.9);
    font-size: 20px;
    margin: 24px 0 12px 0;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    padding-bottom: 4px;
}

.changelog-content h3 {
    color: rgba(0, 255, 136, 0.8);
    font-size: 18px;
    margin: 20px 0 8px 0;
}

.changelog-content h4 {
    color: rgba(0, 255, 136, 0.7);
    font-size: 16px;
    margin: 16px 0 8px 0;
}

.changelog-content p {
    line-height: 1.6;
    margin: 8px 0;
}

.changelog-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.changelog-content li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.changelog-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: rgba(0, 255, 136, 0.8);
}

.changelog-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    border-left: 3px solid rgba(0, 255, 136, 0.3);
}

.changelog-content hr {
    border: none;
    height: 1px;
    background: rgba(0, 255, 136, 0.2);
    margin: 24px 0;
}

.changelog-content strong {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

.changelog-content em {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.changelog-entry {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
}

.changelog-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.changelog-version {
    color: rgba(0, 255, 136, 0.9);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.changelog-description h4 {
    color: rgba(0, 255, 136, 0.8);
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 500;
}

.changelog-description ul {
    margin: 12px 0;
    padding-left: 20px;
}

.changelog-description li {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.changelog-description li strong {
    color: rgba(255, 255, 255, 0.95);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design for Help Modals */
@media (max-width: 768px) {
    .help-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }
    
    .help-modal-header,
    .help-modal-body {
        padding: 16px 20px;
    }
    
    .help-modal-header h2 {
        font-size: 20px;
    }
    
    .about-section h3 {
        font-size: 18px;
    }
    
    .changelog-version {
        font-size: 16px;
    }
}

/* ============================= */
/* Mobile-Responsive Enhancements */
/* ============================= */

/* Base layout adjustments for mobile */
body.mobile .main-content {
  height: calc(100vh - 48px - 56px); /* menu ~48px, bottom sheet collapsed 56px */
}

/* Off-canvas side drawers (left: palette, right: properties) */
body.mobile .sidebar-left,
body.tablet .sidebar-left,
body.mobile .sidebar-right,
body.tablet .sidebar-right {
  position: fixed;
  top: 48px; /* below menu bar */
  bottom: 56px; /* above bottom sheet */
  width: 84%;
  max-width: 360px;
  z-index: 2000;
  transition: transform 0.25s ease, opacity 0.25s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

body.mobile .sidebar-left, body.tablet .sidebar-left { left: 0; transform: translateX(-102%); }
body.mobile.drawer-left-open .sidebar-left, body.tablet.drawer-left-open .sidebar-left { transform: translateX(0); }

body.mobile .sidebar-right, body.tablet .sidebar-right { right: 0; transform: translateX(102%); }
body.mobile.drawer-right-open .sidebar-right, body.tablet.drawer-right-open .sidebar-right { transform: translateX(0); }

/* Bottom panel as slide-up sheet (animated) */
body.mobile .bottom-panel, body.tablet .bottom-panel {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 60vh;
  max-height: 60vh;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
  z-index: 1500;
}
body.mobile.bottom-open .bottom-panel, body.tablet.bottom-open .bottom-panel {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Bottom mobile toolbar inside bottom panel (hidden on mobile as per UX) */
.bottom-mobile-toolbar { display: none; }
body.mobile .bottom-panel .bottom-mobile-toolbar, body.tablet .bottom-panel .bottom-mobile-toolbar { display: none !important; }
.bottom-btn {
  appearance: none;
  border: 1px solid rgba(0,255,136,0.3);
  background: rgba(0, 255, 136, 0.08);
  color: #eafff7;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}
.bottom-btn.active {
  border-color: var(--accent);
  background: rgba(0, 255, 136, 0.18);
}

/* Mobile bottom hosts area */
.bottom-mobile-hosts { display: none; height: 100%; }
body.mobile.bottom-open .bottom-mobile-hosts, body.tablet.bottom-open .bottom-mobile-hosts { display: block; }
.bottom-host { display: none; height: 100%; overflow: auto; padding: 8px; }
.bottom-host.active { display: block; }

/* When bottom sheet is open for mobile content, hide desktop tabs */
body.mobile.bottom-open .bottom-panel .panel-tabs, body.tablet.bottom-open .bottom-panel .panel-tabs { display: none; }
body.mobile.bottom-open.show-logs .bottom-panel .panel-tabs, body.tablet.bottom-open.show-logs .bottom-panel .panel-tabs { display: flex; }
/* When not in logs view, force-hide log panels so they don't cover hosts */
body.mobile.bottom-open:not(.show-logs) #execution-log,
body.mobile.bottom-open:not(.show-logs) #debug-panel,
body.mobile.bottom-open:not(.show-logs) #performance-panel,
body.tablet.bottom-open:not(.show-logs) #execution-log,
body.tablet.bottom-open:not(.show-logs) #debug-panel,
body.tablet.bottom-open:not(.show-logs) #performance-panel { display: none !important; }
/* When in logs view, hide the mobile hosts entirely */
body.mobile.bottom-open.show-logs .bottom-mobile-hosts, body.tablet.bottom-open.show-logs .bottom-mobile-hosts { display: none !important; }

/* Constrain bottom sheet content area heights on mobile */
/* Use full height for content when toolbar is hidden; keep deduction for tabs in logs view */
body.mobile.bottom-open:not(.show-logs) .bottom-panel .panel-content,
body.tablet.bottom-open:not(.show-logs) .bottom-panel .panel-content {
  max-height: 100%;
  overflow: auto;
}
body.mobile.bottom-open.show-logs .bottom-panel .panel-content,
body.tablet.bottom-open.show-logs .bottom-panel .panel-content {
  max-height: calc(100% - 40px); /* tabs */
  overflow: auto;
}
/* Hide legacy log controls on mobile */
body.mobile .log-controls, body.tablet .log-controls { display: none !important; }

/* Mobile Dock button (single entry point) */
.mobile-dock { display: none; }
body.mobile #mobile-dock, body.tablet #mobile-dock {
  display: block;
  position: fixed;
  left: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 2100;
  opacity: 1;
  transition: opacity 180ms ease, transform 180ms ease;
}
/* Fade dock button while sheet is open to avoid overlap */
body.mobile.bottom-open #mobile-dock, body.tablet.bottom-open #mobile-dock { opacity: 0; transform: translateY(6px) scale(0.96); pointer-events: none; }
.dock-btn {
  width: 48px; height: 48px; border-radius: 24px;
  border: 1px solid rgba(0,255,136,0.35);
  background: radial-gradient(120% 120% at 50% 0%, rgba(0,255,136,0.20), rgba(0, 80, 60, 0.35));
  color: #eafff7; font-size: 20px; line-height: 48px; text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35), 0 0 10px rgba(0,255,136,0.25);
  backdrop-filter: blur(8px);
}
.dock-btn:active { transform: translateY(1px) scale(0.98); }

/* Mobile backdrop under the bottom sheet */
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 1400; /* under sheet (1500), above canvas */
}
body.mobile.bottom-open .mobile-backdrop, body.tablet.bottom-open .mobile-backdrop {
  display: block;
  opacity: 1;
}

/* Prefer dock over floating FABs on mobile */
body.mobile .mobile-fabs, body.tablet .mobile-fabs { display: none !important; }

/* Hide the desktop minimap entirely on mobile */
body.mobile .minimap-container, body.tablet .minimap-container { display: none !important; }

/* Mobile Map button (zoom-to-fit) */
.mobile-map { display: none; }
body.mobile #mobile-map, body.tablet #mobile-map {
  display: block;
  position: fixed;
  right: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 2100;
  opacity: 1;
  transition: opacity 180ms ease, transform 180ms ease;
}
body.mobile.bottom-open #mobile-map, body.tablet.bottom-open #mobile-map { opacity: 0; transform: translateY(6px) scale(0.96); pointer-events: none; }
.map-btn {
  width: 48px; height: 48px; border-radius: 24px;
  border: 1px solid rgba(0,255,136,0.35);
  background: radial-gradient(120% 120% at 50% 0%, rgba(0,255,136,0.20), rgba(0, 80, 60, 0.35));
  color: #eafff7; font-size: 20px; line-height: 48px; text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35), 0 0 10px rgba(0,255,136,0.25);
  backdrop-filter: blur(8px);
}
.map-btn:active { transform: translateY(1px) scale(0.98); }

/* Floating Action Buttons (mobile only) */
.mobile-fabs { display: none; }
body.mobile .mobile-fabs {
  position: fixed;
  right: 16px;
  bottom: 76px; /* sit above collapsed bottom sheet */
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2100;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 28px;
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 56px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35), 0 0 10px rgba(0,255,136,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.fab:active { transform: translateY(1px) scale(0.98); }

.fab-primary { 
  background: linear-gradient(135deg, rgba(0,255,136,0.9), rgba(0,204,102,0.9));
  color: #06140e;
}
.fab-secondary {
  background: linear-gradient(135deg, rgba(0,255,204,0.9), rgba(0,200,180,0.9));
  color: #05201c;
}
.fab-primary:hover, .fab-secondary:hover {
  box-shadow: 0 10px 26px rgba(0,0,0,0.45), 0 0 14px rgba(0,255,170,0.35);
}

/* Backdrop when a drawer is open */
body.mobile.drawer-left-open::after,
body.mobile.drawer-right-open::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1800;
}

/* Mobile: place minimap at bottom-right unobstructed */
body.mobile #mobile-fab-exec { display: none !important; }
body.mobile .mobile-fabs { left: 16px; right: auto; }

/* Ensure minimap sits at bottom-right, above bottom sheet height */
body.mobile .minimap-container {
  bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 12px);
  right: 12px;
}
body.mobile .minimap-hint { display: none !important; }

/* Raise FAB above bottom sheet and make it slightly smaller on mobile */
body.mobile .mobile-fabs {
  bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 32px);
}
body.mobile .fab {
  width: 52px;
  height: 52px;
  line-height: 52px;
  font-size: 20px;
}
@media (max-width: 480px) {
  body.mobile .fab {
    width: 48px;
    height: 48px;
    line-height: 48px;
    font-size: 18px;
  }
}

