html, body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0; padding: 0;
}
a, .btn-link { color: #006bb7; }
.btn-primary { color:#fff; background-color:#1b6ec2; border-color:#1861ac; }
.btn:focus,.form-control:focus,.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #258cfb;
}
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem; color: white;
}
.blazor-error-boundary::after { content: "An error has occurred." }
.cursor-pointer { cursor: pointer; }
.min-width-0 { min-width: 0; }

/* ════════════════════════════════════════════════════════
   WORKFLOW DESIGNER — WHITE THEME
   ════════════════════════════════════════════════════════ */

.designer-container {
    display: flex; flex-direction: column;
    height: 100vh; background: #fff; color: #0f172a; overflow: hidden;
}

/* ─── TOOLBAR ─────────────────────────────────────────── */
.workflow-identity-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.28rem 0.65rem;
    max-width: 380px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: default;
    transition: all 0.15s ease-in-out;
}
.workflow-identity-chip:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}
.workflow-identity-chip .chip-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.84rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: all;
    cursor: default;
}
.workflow-identity-chip .chip-badge {
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
    font-size: 0.60rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.45rem;
    border-radius: 9999px;
    white-space: nowrap;
    text-transform: uppercase;
}
.workflow-identity-chip .chip-copy-icon,
.workflow-identity-chip .chip-edit-icon {
    font-size: 0.78rem;
    opacity: 0.70;
    cursor: pointer;
    padding: 2px 3px;
    border-radius: 4px;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.workflow-identity-chip:hover .chip-copy-icon,
.workflow-identity-chip:hover .chip-edit-icon {
    opacity: 0.95;
}
.workflow-identity-chip .chip-edit-icon:hover {
    background: #e0e7ff;
    transform: scale(1.15);
    opacity: 1;
}
.workflow-identity-chip .chip-copy-icon:hover {
    background: #e2e8f0;
    transform: scale(1.15);
    opacity: 1;
}
.workflow-identity-chip .chip-divider {
    display: inline-block;
    width: 1px;
    height: 13px;
    background: #cbd5e1;
    margin: 0 1px;
}
.designer-toolbar {
    background: #f8fafc; border-bottom: 1px solid #e2e8f0;
    padding: 0.45rem 0.9rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; flex-shrink: 0; min-height: 52px; z-index: 20;
}

/* ─── BODY ────────────────────────────────────────────── */
.designer-body {
    display: flex; flex: 1; overflow: hidden; position: relative;
}

/* ─── LEFT TOOLBOX ────────────────────────────────────── */
.designer-toolbox {
    min-width: 180px; max-width: 550px;
    background: #fff; border-right: 1px solid #e2e8f0;
    display: flex; flex-direction: column;
    overflow-y: auto; flex-shrink: 0; z-index: 5;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.designer-toolbox::-webkit-scrollbar { width: 4px; }
.designer-toolbox::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.toolbox-header {
    padding: 0.55rem 0.65rem; border-bottom: 1px solid #e2e8f0;
    background: #f8fafc; flex-shrink: 0;
}

.toolbox-category {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.42rem 0.7rem;
    font-size: 0.72rem; letter-spacing: 0.03em;
    background: #f1f5f9; border-bottom: 1px solid #e2e8f0;
    cursor: pointer; user-select: none;
    transition: background 0.1s;
}
.toolbox-category:hover { background: #e8edf4; }

.toolbox-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.48rem 0.65rem; margin: 0.18rem 0.45rem;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 7px;
    cursor: grab; user-select: none;
    transition: all 0.12s ease;
}
.toolbox-item:hover {
    background: #faf5ff; border-color: #a78bfa;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(139,92,246,0.12);
}
.toolbox-item:active { cursor: grabbing; }

.toolbox-item.toolbox-item-disabled {
    opacity: 0.5;
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}
.toolbox-item.toolbox-item-disabled:hover {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.toolbox-icon {
    width: 24px; height: 24px; border-radius: 4px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
}

/* ─── CANVAS ──────────────────────────────────────────── */
.designer-canvas-area {
    flex: 1; overflow: hidden; position: relative;
    background: #fafbfc;
    background-image: radial-gradient(circle, #d1d5db 1.1px, transparent 1.1px);
    background-size: 28px 28px;
    user-select: none;
}

.diagram-canvas-element {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* ─── CANVAS VERTICAL SCROLLBAR ───────────────────────── */
.canvas-vertical-scrollbar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 14px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    z-index: 28;
    display: flex;
    flex-direction: column;
    user-select: none;
    box-sizing: border-box;
}

.canvas-vertical-scrollbar.scrollbar-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.canvas-scrollbar-btn {
    width: 100%;
    height: 16px;
    padding: 0;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 7px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    user-select: none;
}

.canvas-scrollbar-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.canvas-scrollbar-btn:active {
    background: #cbd5e1;
    color: #0f172a;
}

.canvas-scrollbar-track {
    flex: 1;
    position: relative;
    width: 100%;
    background: #f8fafc;
    cursor: pointer;
}

.canvas-scrollbar-thumb {
    position: absolute;
    left: 2px;
    right: 2px;
    background: #cbd5e1;
    border-radius: 4px;
    cursor: grab;
    transition: background 0.12s ease;
    min-height: 20px;
}

.canvas-scrollbar-thumb:hover {
    background: #94a3b8;
}

.canvas-scrollbar-thumb:active,
.canvas-scrollbar-thumb.dragging {
    background: #64748b;
    cursor: grabbing;
}

/* ─── FLOATING CANVAS CONTROLS ────────────────────────── */
.canvas-floating-controls {
    position: absolute;
    bottom: 22px;
    right: 22px;
    z-index: 30;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    padding: 3px;
    gap: 2px;
    user-select: none;
}

.canvas-floating-controls .ctrl-btn {
    border: none;
    background: transparent;
    color: #334155;
    font-weight: 700;
    font-size: 0.92rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.12s;
}

.canvas-floating-controls .ctrl-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.canvas-floating-controls .ctrl-zoom-badge {
    min-width: 44px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    padding: 0 4px;
}

.canvas-floating-controls .ctrl-zoom-slider {
    width: 80px;
    height: 4px;
    accent-color: #8b5cf6;
    cursor: pointer;
    margin: 0 4px;
    vertical-align: middle;
}

.canvas-floating-controls .ctrl-divider {
    width: 1px;
    height: 18px;
    background: #e2e8f0;
    margin: 0 3px;
}

.canvas-floating-controls .ctrl-btn-text {
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.12s;
    white-space: nowrap;
}

.canvas-floating-controls .ctrl-btn-text:hover {
    background: #f1f5f9;
    color: #8b5cf6;
}

.designer-canvas-area.drag-over {
    outline: 3px dashed #8b5cf6; outline-offset: -3px;
    background-color: #faf5ff;
}

.canvas-svg {
    min-width: 2800px; min-height: 2400px; display: block;
}

.canvas-hint {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    pointer-events: none; opacity: 0.4;
    font-size: 1rem; font-weight: 600; color: #64748b;
}

/* ─── SIDEBAR SPLITTER RESIZERS (DRAGGABLE SLIDERS) ─────── */
.designer-body.resizing-active {
    user-select: none !important;
    cursor: col-resize !important;
}
.designer-body.resizing-active * {
    user-select: none !important;
    pointer-events: none !important;
}
.designer-body.resizing-active .sidebar-resizer {
    pointer-events: auto !important;
}

.sidebar-resizer {
    width: 6px;
    background: transparent;
    cursor: col-resize;
    position: relative;
    z-index: 25;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease;
    user-select: none;
}

.sidebar-resizer:hover, .sidebar-resizer.resizing {
    background: #8b5cf6 !important;
}

.sidebar-resizer .resizer-handle-line {
    width: 2px;
    height: 28px;
    border-radius: 1px;
    background: #cbd5e1;
    pointer-events: none;
    transition: background 0.12s ease;
}

.sidebar-resizer:hover .resizer-handle-line, .sidebar-resizer.resizing .resizer-handle-line {
    background: #ffffff;
}

.inspector-resizer {
    border-left: 1px solid #e2e8f0;
}

.toolbox-resizer {
    border-right: 1px solid #e2e8f0;
}

/* ─── RIGHT INSPECTOR ─────────────────────────────────── */
.designer-inspector {
    min-width: 240px; max-width: 850px;
    background: #fff;
    display: flex; flex-direction: column;
    overflow: hidden; flex-shrink: 0; z-index: 5;
}

/* Tab strip */
.tab-strip {
    display: flex; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
    flex-shrink: 0;
}
.tab-btn {
    flex: 1; background: none; border: none; border-bottom: 2.5px solid transparent;
    padding: 0.5rem 0.2rem; font-size: 0.7rem; font-weight: 600;
    color: #94a3b8; cursor: pointer; transition: all 0.12s;
    white-space: nowrap;
}
.tab-btn:hover { color: #475569; background: #f1f5f9; }
.tab-btn.tab-active { color: #8b5cf6; border-bottom-color: #8b5cf6; background: #fff; }
.tab-badge {
    display: inline-block; color: #fff; border-radius: 20px;
    padding: 0 5px; font-size: 0.58rem; font-weight: 700; line-height: 1.5;
}

/* Tab panels — flex column, hidden unless active */
.tab-panel {
    flex-direction: column; flex: 1; overflow: hidden;
    /* display set inline via Blazor */
}
.tab-header {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0.85rem; border-bottom: 1px solid #e2e8f0;
    background: #f8fafc; flex-shrink: 0;
}
.tab-body {
    flex: 1; overflow-y: auto; padding: 0.7rem;
    display: flex; flex-direction: column; gap: 0.6rem;
    scrollbar-width: thin; scrollbar-color: #e2e8f0 transparent;
}
.tab-body::-webkit-scrollbar { width: 4px; }
.tab-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

/* Fields */
.field-group { display: flex; flex-direction: column; gap: 3px; }
.field-label {
    font-size: 0.69rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: #64748b; margin-bottom: 1px;
}
.info-pill { padding: 0.35rem 0.6rem; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.82rem; }

/* Connect box */
.connect-box {
    padding: 0.6rem; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc;
}

/* Params box */
.params-box {
    padding: 0.6rem; border: 1px solid #dbeafe; border-radius: 8px; background: #eff6ff;
}

/* Stats / tips box */
.stats-box {
    padding: 0.6rem; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc;
}

/* Variable card */
.var-card {
    padding: 0.55rem; border: 1px solid #e2e8f0; border-radius: 8px; background: #fafbfc;
}

/* IO row */
.io-row {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 0.5rem; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 4px;
}

/* Library card */
.lib-card {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.65rem; border: 1px solid #e2e8f0; border-radius: 8px;
    background: #fff; cursor: pointer; margin-bottom: 4px;
    transition: all 0.12s; user-select: none;
}
.lib-card:hover { background: #f8fafc; border-color: #a78bfa; }
.lib-card.lib-active { background: #faf5ff; border-color: #8b5cf6; }

/* Empty state */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 2rem 1rem;
    color: #64748b;
}

/* ─── Z.BLAZOR.DIAGRAMS CUSTOM NODES & PORTS ─────────────── */
.dapr-node-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.03);
    padding: 0.6rem 0.85rem;
    min-width: 210px;
    max-width: 260px;
    position: relative;
    user-select: none;
    cursor: grab;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.dapr-node-card:active { cursor: grabbing; }
.dapr-node-card:hover {
    box-shadow: 0 8px 15px -3px rgba(0,0,0,0.1);
    border-color: #cbd5e1;
}
.dapr-node-card.node-selected {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 2px rgba(139,92,246,0.3), 0 8px 15px -3px rgba(139,92,246,0.15) !important;
}
.dapr-node-card.has-multi-ports {
    padding-right: 3.8rem !important;
    min-width: 250px !important;
    max-width: 290px !important;
}

.node-header-row {
    display: flex; align-items: center; gap: 0.4rem;
    margin-bottom: 0.35rem;
}
.node-icon { font-size: 1rem; }
.node-category {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em;
}
.node-title {
    font-size: 0.84rem; font-weight: 700; color: #0f172a;
    line-height: 1.25; margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.node-type {
    font-size: 0.66rem; color: #64748b; font-family: monospace;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Ports */
.port-wrapper {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 10;
}
.port-left { left: -7px; }
.ports-right-container {
    position: absolute; right: -7px; top: 0; bottom: 0;
    display: flex; flex-direction: column; justify-content: space-around;
    z-index: 10;
}
.port-right-row {
    display: flex; align-items: center; gap: 4px;
}
.port-label {
    font-size: 0.6rem; font-weight: 700;
    position: absolute; right: 12px; pointer-events: none;
}
.dapr-port {
    width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: crosshair; transition: transform 0.15s, background-color 0.15s;
}
.dapr-port:hover { transform: scale(1.3); }
.in-port { background-color: #3b82f6 !important; }
.out-port { background-color: #10b981 !important; }
.out-port-false { background-color: #ef4444 !important; }

/* ─── WF STYLE FLOWCHART CONTAINER NODE (Image 2 Match) ─── */
.wf-container-box {
    background: #ffffff;
    border: 1px solid #d97706;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    min-width: 200px;
    max-width: 240px;
    position: relative;
    user-select: none;
    cursor: pointer;
    overflow: visible;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wf-container-box:hover {
    border-color: #b45309;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.22);
}
.wf-container-box.wf-selected {
    border-color: #d97706 !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.5), 0 4px 10px rgba(0,0,0,0.12) !important;
}

.wf-header-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: #fde68a;
    border-bottom: 1px solid #f59e0b;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}
.wf-header-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-body-area {
    padding: 10px 8px;
    background: #ffffff;
    text-align: center;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
}
.wf-body-hint {
    font-size: 0.82rem;
    font-style: italic;
    color: #64748b;
    font-family: Georgia, serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: color 0.15s;
}
.wf-container-box:hover .wf-body-hint {
    color: #2563eb;
}

/* Ports for Flowchart */
.port-top {
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}
.port-bottom {
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

/* Breadcrumb Bar */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.82rem;
    z-index: 10;
    flex-shrink: 0;
}
.crumb-trail {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-grow: 1;
    overflow-x: auto;
}
.crumb-item {
    cursor: pointer;
    color: #3b82f6;
    font-weight: 600;
    transition: color 0.12s;
    display: flex;
    align-items: center;
    gap: 3px;
}
.crumb-item:hover {
    color: #1d4ed8;
    text-decoration: underline;
}
.crumb-sep {
    color: #94a3b8;
    font-size: 0.75rem;
}
.crumb-active {
    color: #0f172a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
}


/* ─── JSON MODAL ──────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.42);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
    background: #fff; border-radius: 10px;
    width: 82%; max-width: 960px; height: 82vh;
    display: flex; flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
}
.json-code {
    background: #f8fafc; color: #0f172a;
    padding: 1rem; flex: 1; overflow: auto; margin: 0;
    font-family: 'Consolas','Cascadia Code','Courier New',monospace;
    font-size: 0.82rem; border-bottom: 1px solid #e2e8f0;
}

/* ─── CANVAS LOADING OVERLAY ──────────────────────────── */
.canvas-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeInOverlay 0.15s ease-in-out;
}

.canvas-loading-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.65rem 1.15rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@keyframes fadeInOverlay {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* ─── DYNAMIC EXPRESSION & PARAMETER BOX ──────────────── */
.dynamic-expression-box {
    font-family: 'Consolas', 'Cascadia Code', 'Fira Code', ui-monospace, monospace !important;
    font-size: 0.82rem !important;
    line-height: 1.45 !important;
    color: #0f172a !important;
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 0.45rem 0.6rem !important;
    width: 100% !important;
    min-height: 46px !important;
    max-height: 280px !important;
    resize: vertical !important;
    overflow-y: auto !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    field-sizing: content;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s !important;
}

.dynamic-expression-box:focus {
    background-color: #ffffff !important;
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18) !important;
    outline: none !important;
}

.dynamic-expression-box.is-invalid-condition {
    border-color: #ef4444 !important;
    background-color: #fffafb !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25) !important;
}

.dynamic-expression-box.is-invalid-condition:focus {
    border-color: #dc2626 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

.var-quick-chip {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.64rem;
    font-family: monospace;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
    white-space: nowrap;
}

.var-quick-chip:hover {
    background: #6366f1;
    color: #ffffff;
    border-color: #4f46e5;
}

.condition-val-badge {
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 5px;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.35;
    transition: all 0.15s ease;
}

.condition-val-badge.val-valid {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.condition-val-badge.val-invalid {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.condition-val-badge .val-text {
    word-break: break-word;
}

/* ─── Classic Flowchart Diamond Decision Node (♢) ─── */
.wf-diamond-node-box {
    width: 130px;
    height: 130px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: pointer;
    overflow: visible !important;
}

.wf-diamond-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.wf-diamond-polygon {
    fill: #ffffff;
    stroke: #f59e0b; /* Amber decision outline */
    stroke-width: 2px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.08));
    transition: stroke 0.15s, stroke-width 0.15s, filter 0.15s;
}

.wf-diamond-node-box:hover .wf-diamond-polygon {
    stroke: #d97706;
    stroke-width: 2.5px;
    filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.25));
}

.wf-diamond-node-box.diamond-selected .wf-diamond-polygon {
    stroke: #2563eb;
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 0 3px rgba(37, 99, 235, 0.35));
}

.wf-diamond-content {
    position: relative;
    z-index: 10;
    max-width: 82px;
    text-align: center;
    padding: 2px;
}

.wf-diamond-title {
    font-size: 0.76rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.25;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Diamond Port Vertices */
.port-diamond-top {
    position: absolute !important;
    top: -7px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 20 !important;
}

.port-diamond-left {
    position: absolute !important;
    left: -7px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 20 !important;
}

.port-diamond-right {
    position: absolute !important;
    right: -7px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 20 !important;
}

/* Floating Link Badges for True / False */
.diagram-link-label {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    padding: 1px 8px !important;
    font-size: 0.72rem !important;
    color: #334155 !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}





/* ─── WF FLOWCHART START & END ROUND NODES (Circle / Stadium) ─── */
.wf-round-node-box {
    min-width: 68px !important;
    height: 68px !important;
    border-radius: 34px !important;
    padding: 6px 14px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    user-select: none !important;
    cursor: pointer !important;
    overflow: visible !important;
    background: #ffffff !important;
    transition: all 0.15s ease !important;
}

/* START NODE (Green Circular / Rounded Pill) */
.wf-start-node {
    border: 2.5px solid #10b981 !important;
    background: #f0fdf4 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.18) !important;
}
.wf-start-node:hover {
    border-color: #059669 !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
    transform: translateY(-1px) !important;
}
.wf-start-node.start-selected {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.45), 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}
.wf-start-node .wf-round-icon {
    font-size: 1.15rem !important;
    line-height: 1 !important;
    color: #10b981 !important;
    margin-bottom: 2px !important;
}
.wf-start-node .wf-round-label {
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    color: #065f46 !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* END NODE (Red Circular / Rounded Pill) */
.wf-end-node {
    border: 2.5px solid #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.18) !important;
}
.wf-end-node:hover {
    border-color: #dc2626 !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35) !important;
    transform: translateY(-1px) !important;
}
.wf-end-node.end-selected {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.45), 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}
.wf-end-node .wf-round-icon {
    font-size: 1.05rem !important;
    line-height: 1 !important;
    color: #ef4444 !important;
    margin-bottom: 2px !important;
}
.wf-end-node .wf-round-label {
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    color: #991b1b !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Round Node Port Positions */
.port-round-left {
    position: absolute !important;
    left: -7px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 20 !important;
}
.port-round-right {
    position: absolute !important;
    right: -7px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 20 !important;
}
.port-round-top {
    position: absolute !important;
    top: -7px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 20 !important;
}
.port-round-bottom {
    position: absolute !important;
    bottom: -7px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 20 !important;
}

