        

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-dark);
            color: var(--text-light);
            height: 100vh;
            max-height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            /* Prevent body scroll, use inner scrolling */
        }

        /* Top Navigation Bar */
        .top-nav {
            background: rgba(30, 41, 59, 0.8);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid var(--border);
            padding: 0.5rem 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 48px;
            z-index: 100;
        }

        .nav-brand {
            font-family: 'Outfit', sans-serif;
            font-size: 1rem;
            font-weight: 700;
            background: linear-gradient(135deg, #1e293b, #0f172a);
            -webkit-background-clip: padding-box;
            background-clip: padding-box;
            -webkit-text-fill-color: transparent;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            text-decoration: none;
            margin-right: 1rem;
        }

        /* Mode Switcher */
        .mode-switcher {
            display: flex;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 8px;
            padding: 4px;
            border: 1px solid var(--border);
        }

        .mode-btn {
            background: transparent;
            color: var(--text-muted);
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .mode-btn.active {
            background: var(--bg-panel);
            color: var(--text-light);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.05);
        }

        .nav-actions {
            display: flex;
            gap: 0.5rem;
        }

        .btn {
            background: var(--bg-panel);
            color: var(--text-light);
            border: 1px solid var(--border);
            padding: 0.6rem 1.2rem;
            border-radius: 8px;
            font-family: 'Inter', sans-serif;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .btn:hover {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(255, 255, 255, 0.2);
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--accent-1));
            border: none;
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, var(--primary-hover), #7c3aed);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
        }

        .btn-success {
            background: linear-gradient(135deg, #059669, #10b981);
            border: none;
        }

        .btn-success:hover {
            background: linear-gradient(135deg, #047857, #059669);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        }

        /* Main Workspace */
        .workspace {
            display: flex;
            flex: 1;
            height: calc(100vh - 70px);
            min-height: 0;
            overflow: hidden;
        }

        /* Sidebar Styles */
        .sidebar {
            width: 280px;
            background: rgba(15, 23, 42, 0.6);
            border-right: 1px solid var(--border);
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            z-index: 10;
        }

        .sidebar-title {
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--text-muted);
            margin-bottom: 0.5rem;
            font-weight: 600;
        }

        .node-templates {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            flex-shrink: 0;
        }

        /* Action Stream (Log) Styles */
        .action-stream-container {
            display: flex;
            flex-direction: column;
            flex-grow: 1;
            /* Take up remaining space */
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            padding-top: 1.5rem;
            margin-top: 0.5rem;
            min-height: 200px;
        }

        .action-stream {
            flex-grow: 1;
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            padding: 0.75rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            /* newest at top will be handled by JS insertBefore */
            gap: 0.5rem;
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 0.8rem;
        }

        .stream-entry {
            padding: 0.5rem;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.03);
            border-left: 2px solid transparent;
            animation: slideInLeft 0.3s ease-out forwards;
            word-wrap: break-word;
        }

        @keyframes slideInLeft {
            from {
                opacity: 0;
                transform: translateX(-10px);
            }

            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .stream-entry.info {
            border-left-color: var(--primary);
            color: #94a3b8;
        }

        .stream-entry.info strong {
            color: #cbd5e1;
        }

        .stream-entry.success {
            border-left-color: var(--success);
            color: rgba(74, 222, 128, 0.9);
        }

        .stream-entry.warning {
            border-left-color: var(--warning);
            color: rgba(250, 204, 21, 0.9);
        }

        .stream-entry.error {
            border-left-color: var(--danger);
            color: rgba(248, 113, 113, 0.9);
        }

        .stream-time {
            font-size: 0.65rem;
            opacity: 0.5;
            display: block;
            margin-bottom: 0.2rem;
        }

        .node-template {
            background: rgba(15, 23, 42, 0.6);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 1rem;
            cursor: grab;
            transition: all 0.2s;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .node-template:hover {
            transform: translateY(-2px);
            border-color: var(--primary);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
        }

        .node-template:active {
            cursor: grabbing;
        }

        .node-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.05);
        }

        .node-type-input .node-icon {
            color: var(--success);
            background: rgba(16, 185, 129, 0.1);
        }

        .node-type-agent .node-icon {
            color: var(--primary);
            background: rgba(59, 130, 246, 0.1);
        }

        .node-type-meta .node-icon {
            color: var(--accent-1);
            background: rgba(139, 92, 246, 0.1);
        }

        .node-type-board .node-icon {
            color: #ec4899;
            background: rgba(236, 72, 153, 0.1);
        }

        .node-type-while .node-icon {
            color: #ef4444;
            background: rgba(239, 68, 68, 0.1);
        }

        .node-type-output .node-icon {
            color: var(--warning);
            background: rgba(245, 158, 11, 0.1);
        }

        .node-title {
            font-weight: 600;
            font-size: 0.95rem;
        }

        .node-desc {
            font-size: 0.8rem;
            color: var(--text-muted);
            line-height: 1.4;
        }

        .canvas-area {
            flex: 1;
            position: relative;
            background-color: var(--bg-canvas);
            background-image:
                linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
            background-size: 30px 30px;
            overflow: auto;
            /* ENABLE 2D SCROLLING FOR HUGE FREEFORM CANVAS */
            display: none;
            /* standard hide */
        }

        /* Custom Scrollbar to force visibility on Mac */
        .canvas-area::-webkit-scrollbar {
            width: 14px;
            height: 14px;
        }

        .canvas-area::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2);
            border-left: 1px solid var(--border);
        }

        .canvas-area::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border: 3px solid rgba(0, 0, 0, 0);
            background-clip: padding-box;
            border-radius: 9999px;
        }

        .canvas-area::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.4);
            border: 3px solid rgba(0, 0, 0, 0);
            background-clip: padding-box;
        }

        .canvas-area.active {
            display: block;
        }

        /* Vertical Canvas Content */
        #canvasVertical {
            padding: 2rem;
            width: 100%;
            /* Ensure it spans the full horizontal space to center inner items */
        }

        /* Freeform Canvas Content */
        #canvasFreeform {
            display: none;
            /* managed by active class */
            position: relative;
            cursor: grab;
        }

        #canvasFreeform.active {
            display: block;
        }

        #canvasFreeform:active {
            cursor: grabbing;
        }

        /* SVG layer for freeform arrows */
        #svgLayer {
            position: absolute;
            top: 0;
            left: 0;
            width: 3000px;
            height: 3000px;
            pointer-events: none;
            z-index: 10;
        }

        /* Flow Container blocks (Vertical Only) */
        .flow-container {
            width: 100%;
            max-width: 600px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1.5rem;
            padding-bottom: 5rem;
            margin: 0 auto;
            /* Center horizontal block */
        }

        .flow-node {
            width: 100%;
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.5rem;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
            position: relative;
            animation: slideIn 0.3s ease-out;
            transition: all 0.2s;
        }

        /* Freeform Node Modifier */
        .flow-node.freeform {
            position: absolute;
            width: 300px;
            animation: fadeIn 0.3s ease-out;
            cursor: move;
            z-index: 20;
        }

        .flow-node:hover {
            border-color: rgba(255, 255, 255, 0.2);
        }

        .flow-node.active-config {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3), 0 4px 20px rgba(0, 0, 0, 0.2);
        }

        .flow-node.running {
            border-color: var(--warning);
            box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
        }

        .flow-node.completed {
            border-color: var(--success);
        }

        .flow-node.error {
            border-color: var(--danger);
        }

        .node-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            padding-bottom: 0.8rem;
        }

        .node-badge {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .node-actions {
            display: flex;
            gap: 0.5rem;
        }

        .icon-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 0.3rem;
            border-radius: 4px;
            transition: all 0.15s;
        }

        .icon-btn:hover {
            color: var(--text-light);
            background: rgba(255, 255, 255, 0.1);
        }

        .icon-btn.delete:hover {
            color: var(--danger);
            background: rgba(239, 68, 68, 0.1);
        }

        /* Flow Arrow */
        .flow-arrow {
            color: var(--text-muted);
            opacity: 0.5;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 30px;
        }

        .flow-arrow.connection-line path {
            stroke: var(--primary);
            stroke-width: 2;
            fill: none;
            stroke-dasharray: 4;
            animation: dash 20s linear infinite;
        }

        @keyframes dash {
            to {
                stroke-dashoffset: -1000;
            }
        }

        .flow-arrow::before {
            content: '';
            width: 2px;
            height: 20px;
            background: var(--text-muted);
        }

        .flow-arrow svg {
            margin-top: -2px;
        }

        /* Empty State */
        .empty-canvas {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: var(--text-muted);
            text-align: center;
            max-width: 400px;
            margin: 0 auto;
            border: 2px dashed rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            padding: 3rem;
        }

        /* Settings Panel - Right Sidebar */
        .settings-panel {
            width: 320px;
            background: var(--bg-panel);
            border-left: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            transform: translateX(100%);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: absolute;
            right: 0;
            top: 70px;
            bottom: 0;
            z-index: 50;
            box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
        }

        .settings-panel.open {
            transform: translateX(0);
        }

        .settings-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .settings-body {
            padding: 1.5rem;
            overflow-y: auto;
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 1.2rem;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .form-label {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-muted);
        }

        .form-control {
            background: var(--bg-dark);
            border: 1px solid var(--border);
            color: var(--text-light);
            padding: 0.8rem 1rem;
            border-radius: 8px;
            font-family: 'Inter', sans-serif;
            font-size: 0.9rem;
            width: 100%;
            transition: border-color 0.2s;
        }

        .form-control:focus {
            outline: none;
            border-color: var(--primary);
        }

        textarea.form-control {
            min-height: 150px;
            resize: vertical;
            line-height: 1.5;
        }

        /* Node Content Preview */
        .node-preview {
            font-size: 0.9rem;
            color: #cbd5e1;
        }

        .node-preview-title {
            font-weight: 600;
            color: #e2e8f0;
            margin-bottom: 0.3rem;
        }

        .node-preview-desc {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: var(--text-muted);
            font-size: 0.85rem;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Toast Notifications */
        .toast-container {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            z-index: 10000;
        }

        .toast {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-left: 4px solid var(--primary);
            color: var(--text-primary);
            padding: 1rem 1.5rem;
            border-radius: 8px;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            min-width: 300px;
            max-width: 400px;
            animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            opacity: 0;
            transform: translateX(100%);
        }

        .toast.warning {
            border-left-color: var(--warning);
        }

        .toast.success {
            border-left-color: var(--success);
        }

        .toast.error {
            border-left-color: var(--danger);
        }

        .toast.fadeOut {
            animation: fadeOutRight 0.3s forwards;
        }

        @keyframes slideInRight {
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes fadeOutRight {
            to {
                opacity: 0;
                transform: translateX(100%);
            }
        }

/* === Pulse Animasyon === */
@keyframes pulseStatus {
            from {
                opacity: 0.4;
            }

            to {
                opacity: 1;
                transform: scale(1.2);
            }
        }

/* --- Mobil Responsive --- */
@media (max-width: 768px) {
    body {
        overflow: auto !important;
        height: auto !important;
        max-height: none !important;
    }

    .page-toolbar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .page-toolbar .mode-switcher {
        width: 100%;
    }

    .page-toolbar .mode-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }

    .page-toolbar .nav-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .page-toolbar .nav-actions .btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        min-height: 36px;
    }

    .workspace {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 120px);
        overflow: visible;
    }

    .sidebar {
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem;
    }

    .node-templates {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .node-template {
        flex: 1;
        min-width: 140px;
        padding: 0.75rem;
    }

    .node-desc {
        display: none;
    }

    .action-stream-container {
        display: none;
    }

    .canvas-area {
        min-height: 400px;
        height: auto;
    }

    .settings-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
    }

    .flow-container {
        max-width: 100%;
        padding: 1rem;
    }

    .flow-node {
        padding: 1rem;
    }

    .flow-node.freeform {
        width: 240px;
    }

    .toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

