* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.workflow-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #0f0f0f;
    color: #e0e0e0;
}

 
.workflow-header {
    position: sticky;
    top: 0;
    height: 52px;
    padding: 0 16px;
 
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

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

.workflow-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.workflow-header-brand:hover {
    opacity: 0.92;
}

.workflow-header-brand .sidebar-brand {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
}

.workflow-header-brand .workflow-header-logo {
    flex-shrink: 0;
}

.workflow-title {
    font-size: 17px;
    font-weight: 500;
    color: #fff;
    margin: 0;
}

.workflow-header-btn {
    background: none;
    border: none;
   border-radius: 55px;
    padding: 8px 12px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workflow-header-btn:hover {
    background: #3a3a3a;
    border-color: #a855f7;
}

.workflow-header-right {
    gap: 16px;
}

/* «Поделиться» и блок «?» на канвасе — скрыты до класса chattix-auth-ui на <html> (нет мигания у гостя) */
#workflowShareBtn,
#aiWorkflowGenerator {
    display: none !important;
}

html.chattix-auth-ui #workflowShareBtn {
    display: flex !important;
}

html.chattix-auth-ui #aiWorkflowGenerator {
    display: flex !important;
}

/* «Войти» — видна сразу у гостя; скрыта при chattix-auth-ui (как localStorage + сессия) */
#userLoginBtn {
    display: flex !important;
}

html.chattix-auth-ui #userLoginBtn {
    display: none !important;
}

/* Кольцо лимитов в шапке воркфлоу — только для авторизованных (место в шапке сразу, без CLS до app-web.js) */
html:not(.chattix-auth-ui) #workflowLimitsIndicator {
    display: none !important;
}

html.chattix-auth-ui #workflowLimitsIndicator {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

body.workflow-view-only #workflowShareBtn,
body.workflow-view-only #aiWorkflowGenerator {
    display: none !important;
}

/* Режим просмотра: скрыть панель нодов и элементы запуска (в т.ч. до отработки applyViewOnlyUI) */
body.workflow-view-only .node-panel,
body.workflow-view-only #workflowExecuteGroup,
body.workflow-view-only #saveTemplateBtn,
body.workflow-view-only #clearWorkflowBtn,
body.workflow-view-only #workflowNewFlowBtn,
body.workflow-view-only #workflowMenuBtn,
body.workflow-view-only #workflowLimitsIndicator {
    display: none !important;
}

/* Баннер «только просмотр» над канвасом (не в шапке — не сдвигает «Войти» / аватар) */
.workflow-view-only-banner--canvas {
    display: none;
    box-sizing: border-box;
    align-self: center;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    width: calc(100% - 24px);
    max-width: min(720px, 96vw);
    margin: 10px auto 12px;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 35;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #c4b5fd;
    text-align: center;
}

body.workflow-view-only .workflow-view-only-banner--canvas {
    display: flex;
}

.workflow-view-only-banner--canvas a {
    color: #a78bfa;
    text-decoration: underline;
    cursor: pointer;
}

.workflow-header-right .workflow-header-share-btn {
    width: auto;
    flex-shrink: 0;
    gap: 8px;
    padding: 10px 24px 10px 24px;
}

.workflow-header-login-btn.user-login-btn {
    flex: 0 0 auto;
    padding: 8px 32px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.workflow-header-login-btn.user-login-btn:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.workflow-header-share-icon {
    flex-shrink: 0;
    display: block;
}

.workflow-limits-indicator {
    position: relative;
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}
.workflow-limits-indicator .progress-ring {
    transform: rotate(-90deg);
    width: 24px;
    height: 24px;
}
.workflow-limits-indicator .progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}
.workflow-limits-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
}
.workflow-limits-tooltip.show {
    opacity: 1;
    visibility: visible;
}

 
.node-panel-history-inner.workflow-history-panel-content {
    padding: 0;
    overflow: visible;
}
.node-panel-content > .workflow-new-flow-btn {
    margin: 0 0 8px 0;
}
.node-panel-content > .node-panel-tab-group {
    margin: 16px 0 12px 0;
}

 
.node-panel-tab-group {
    display: flex;
    width: 100%;
    padding: 2px;
    border-radius: 9px;
    background: none;
    gap: 0;
    box-sizing: border-box;
    border: 1px solid var(--border);
}
.node-panel-tab-btn {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 6px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.2;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.node-panel-tab-btn:hover {
    color: rgba(255, 255, 255, 0.85);
}
.node-panel-tab-btn.active {
    background: #3a3a3c;
    color: #fff;
}
.node-panel-tab-btn:focus-visible {
    outline: 2px solid rgba(168, 85, 247, 0.6);
    outline-offset: 2px;
}

.workflow-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid rgba(255, 255, 255, 0.12);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: workflow-spinner-rotate 0.65s linear infinite;
    flex-shrink: 0;
}
@keyframes workflow-spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}
.workflow-list-loading--spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 16px;
}
.workflow-list-loading-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
}
.node-panel-content .workflow-tab-content.node-panel-tab-pane {
    padding: 0;
}
.node-panel-content .workflow-tab-content.node-panel-tab-pane:not(.active) {
    display: none;
}
.node-panel-content .workflow-tab-content.node-panel-tab-pane.active {
    display: block;
}

/* Body */
.workflow-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.workflow-sidebar {
    width: 300px;
    background: var(--bg-primary);
display: none;
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
}

.workflow-sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.workflow-new-flow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: none;
    border-radius: 55px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.workflow-new-flow-btn::before {
    content: '';
    position: absolute;
    inset: 0;
 
    opacity: 1;
 
}

.workflow-new-flow-btn:hover {
    transform: translateY(-0.5px);
    background: rgba(255, 255, 255, 0.12);
}

.workflow-new-flow-btn:hover::before {
    opacity: 1;
}

.workflow-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #2a2a2a;
}

.workflow-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}

.workflow-tab:hover {
    background: #2a2a2a;
    color: #fff;
}

.workflow-tab.active {
    color: #a855f7;
    border-bottom: 2px solid #a855f7;
}

.workflow-sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.workflow-tab-content {
    display: none;
    padding: 16px;
}

.workflow-tab-content.active {
    display: block;
}

.workflow-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workflow-list-loading {
    text-align: center;
    color: #888;
    padding: 20px;
}

.workflow-list-item {
    border-radius: 8px;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.workflow-list-item-main {
    flex: 1;
    min-width: 0;
}

.workflow-list-item-delete {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 55px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    color: #888;
    padding: 0;
}

.workflow-list-item:hover .workflow-list-item-delete {
    opacity: 1;
}

.workflow-list-item-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Единый список «История» в node panel: строка + иконки по hover */
.workflow-history-unified-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.workflow-history-unified-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-history-unified-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.workflow-history-unified-icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    flex-shrink: 0;
}

.workflow-history-unified-icon-badge svg {
    display: block;
}

.workflow-history-row-action {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 55px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
    color: #888;
    padding: 0;
}

.workflow-list-item:hover .workflow-history-row-action {
    opacity: 1;
}

.workflow-history-row-action--copy:hover {
    background: rgba(168, 85, 247, 0.15);
    color: #c4b5fd;
}

.workflow-list-item-delete.workflow-history-row-action:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.workflow-list-item-name:hover {
    color: #a855f7;
}

.workflow-list-item-name {
    font-weight: 500;
    color: #fff;
    font-size: 14px;
}

.workflow-list-item-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workflow-list-item-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.workflow-list-item-status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.workflow-list-item-status.running {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.workflow-list-item-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.workflow-history-combined {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workflow-history-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    margin-top: 4px;
}

.workflow-process-link-item {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 10px 10px 8px;
    margin-bottom: 4px;
}

.workflow-process-link-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.workflow-process-link-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
}

.workflow-process-link-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.2);
    color: #c4b5fd;
}

.workflow-process-link-badge--private {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.workflow-process-link-badge--view {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.workflow-process-link-badge--collab {
    background: rgba(168, 85, 247, 0.2);
    color: #c4b5fd;
}

.workflow-process-link-date {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
}

.workflow-process-link-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}

.workflow-process-link-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.workflow-process-link-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.35);
    color: #ccc;
}

.workflow-process-link-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.workflow-process-link-btn {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #a855f7;
    color: #fff;
    font-weight: 500;
}

.workflow-process-link-btn--ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
}

.workflow-process-link-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

.workflow-process-link-btn--danger {
    background: transparent;
    color: #888;
}

.workflow-process-link-btn--danger:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.workflow-process-link-job {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

 
.workflow-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

 
.node-panel {
    width: 280px;
    background: #1b1b1b;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    margin: 0px 0px 4px 4px;
    border-radius: 24px;
    
}

.node-panel-header {
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #2a2a2a;
}

.node-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    
}

.node-category {
    margin-bottom: 24px;
}

.node-category-title {
    font-size: 12px;
    font-weight: 500;
    color: #888;
    margin-bottom: 12px;
}

.node-btn {
    width: 100%;
    background: none;
    border: 1px solid #2b2b2b;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    color: #fff;
    font-size: 14px;
    cursor: grab;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.node-btn-label {
    flex: 1;
}

.node-btn-drag-icon {
    opacity: 0.4;
    transition: opacity 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.node-btn:hover {
    background: #1b1b1b;
}

.node-btn:hover .node-btn-drag-icon {
    opacity: 0.8;
}

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

/* Canvas */
.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0f0f0f;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    border-radius: 24px;
    border: 2px solid #1b1b1b;
    margin: 0px 0px 4px 4px;
    cursor: grab;
}

/* Лоадер поверх канваса до отрисовки нод (шаринг / черновик) */
.workflow-canvas-loader {
    position: absolute;
    inset: 0;
    z-index: 1005;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(15, 15, 15, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto;
}

.workflow-canvas-loader.is-visible {
    display: flex;
}

.workflow-canvas-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 280px;
    text-align: center;
}

.workflow-canvas-loader-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: #a855f7;
    animation: workflow-canvas-loader-spin 0.75s linear infinite;
}

@keyframes workflow-canvas-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

.workflow-canvas-loader-text {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.4;
}

.canvas-controls {
    position: absolute;
    bottom: 16px;
    right: 40%;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
}
.canvas-controls .execute-btn {
    padding: 8px 16px;
    flex-shrink: 0;
}

.workflow-execute-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.workflow-run-cost-hint {
    font-size: 11px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    max-width: 140px;
    white-space: normal;
    pointer-events: auto;
}

.canvas-btn {
    background: #101010;
    border-radius: 12px;
    padding: 8px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2a2a2a;
}

.canvas-btn:hover {
    background: #2a2a2a;
    transform: translateY(-2px);
}

.canvas {
    width: 100%;
    height: 100%;
    position: relative;
    transform-origin: 0 0;
}

.connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

 
.node {
    position: absolute;
    min-width: 280px;
    background: #1b1b1b;
    border-radius: 16px;
    padding: 0;
    cursor: move;
    transition: border-color 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2;
    max-width: 280px;
    box-shadow: 0 4px 44px rgba(0, 0, 0, 0.2), inset 0 0.1px 5px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.node.selected {
    border-color: #a855f7;
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 1);
}

.node.executing,
.node.running {
    border-color: #10b981;
    animation: pulse 2s infinite;
}

.node.pending {
    border-color: #6b7280;
}

.node.completed {
    border-color: #10b981;
}

.node.error {
    border-color: #ef4444;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.1); }
}

.node-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 6px 6px 12px;
  
    border-radius: 16spx 16px 0 0;
    height: 42px;
}

.node-title {
    font-weight: 500;
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.1px;
}

.node-delete,
.node-duplicate-btn,
.node-run-btn {
    background: none;
    border: none;
    border-radius: 55px;
    color: #fff;
    cursor: pointer;
    padding: 8px 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.node-delete svg,
.node-duplicate-btn svg,
.node-run-btn svg {
    display: block;
}

.node-delete:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.node-duplicate-btn:hover {
    background: #3a3a3a;
}

.node-run-btn:hover {
    background: #3a3a3a;
    border-color: #10b981;
}

.node-run-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.connection-point {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background:#fff;
    border: 2px solid #0f0f0f;
    cursor: crosshair;
    z-index: 20;
    transition: all 0.2s;
    box-shadow: 0 0 0 1px #fff;
}

.connection-point:hover {
    background: #a855f7;
    transform: scale(1.2);
}

.connection-point.input {
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
}

.connection-point.output {
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
}

.node-body {
    padding: 14px 12px 0px 12px;
    overflow-y: auto;
}

.node-field {
    margin-bottom: 12px;
}

/* Подсказки в нодах без отдельных полей ввода (last-frame, merge, output) */
.node-field-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #888;
    font-weight: 500;
}

.node-field-input,
.node-field-select {
    width: 100%;
    background: #2a2a2a;
    border-bottom: 1px solid #464646;
    border-right: none;
    border-radius: 8px;
    border-top: none;
    padding: 8px 10px;
    color: #fff;
    font-size: 13px;
    transition: all 0.2s;
    letter-spacing: -0.1px;
    font-family: inherit;
    border-left: none;
}

textarea.node-field-input {
    resize: none;
}

.node-field-input::placeholder {
    color: #6b6b6b;
}

.node-field-input:focus,
.node-field-select:focus {
    outline: none;
    background: #343434;
}
 
.node-field-file-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.node-field-file-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

 
.node-field-file {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.node-field-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #2b2b2b;
    border-radius: 55px;
    color: #FFF;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing:  -0.3px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex: 1 1 0;
    white-space: nowrap;
}

.node-field-file-label:hover {
    background: #2d2d2d;
    transform: translateY(-0.5px);

}

.node-field-file-label:active {
    background: rgba(168, 85, 247, 0.4);
}

.node-field-file-label-secondary {
    background: #2b2b2b;
    border: none;
    padding: 10px 16px;
    font-size: 13px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex: 1 1 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.node-image-preview {
    width: 100%;
    border-radius: 8px;
    margin-top: 8px;
    max-height: 200px;
    object-fit: cover;
}

 
input.node-field-checkbox,
.node-field-checkbox {
    width: 14px;
    height: 14px;
    margin: 0;
    padding: 0;
    accent-color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
}

 
.node-field-image-preview {
    width: 100%;
    border-radius: 8px;
    margin-top: 8px;
    max-height: 200px;
    object-fit: cover;
}


.crop-editor-wrap {
    margin-top: 8px;
}
.crop-editor-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #1a1a1a;
}
.crop-editor-img {
    display: block;
    max-width: 256px;
    width: auto;
    height: auto;
    vertical-align: top;
}
.crop-editor-shade {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    pointer-events: none;
    z-index: 1;
}
.crop-editor-shade-t { top: 0; }
.crop-editor-shade-b { top: 0; }
.crop-editor-shade-l { top: 0; }
.crop-editor-shade-r { top: 0; }
.crop-editor-box {
    position: absolute;
    border: 2px dashed #a855f7;
    cursor: move;
    box-sizing: border-box;
    pointer-events: all;
    z-index: 2;
}
.crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #a855f7;
    border: 1px solid #fff;
    border-radius: 2px;
    cursor: nwse-resize;
}
.crop-handle-tl { top: -4px; left: -4px; cursor: nwse-resize; }
.crop-handle-tr { top: -4px; right: -4px; cursor: nesw-resize; }
.crop-handle-bl { bottom: -4px; left: -4px; cursor: nesw-resize; }
.crop-handle-br { bottom: -4px; right: -4px; cursor: nwse-resize; }
.crop-editor-hint {
    font-size: 11px;
    color: #888;
    margin-top: 6px;
}

.node.sticky-note .node-body {
    padding: 12px;
    min-width: 180px;
}
.sticky-note-field {
    
}
.sticky-note-text {
    color: #ffffff !important;
    font-size: 13px;
    line-height: 1.4;
}
.sticky-note-text::placeholder {
    color: #666;
}

.node-result {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #3a3a3a;
}

.node-result-title {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    font-weight: 500;
}

.node-result-content img {
    width: 100%;
    border-radius: 6px;
    margin-top: 8px;
}

.node-result-content video {
    width: 100%;
    border-radius: 6px;
    margin-top: 8px;
}

.node-result-content pre {
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 12px;
    color: #e0e0e0;
    font-size: 12px;
    overflow-x: auto;
    margin-top: 8px;
}

 
.canvas-result {
    position: absolute;
    min-width: 320px;
    max-width: 320px;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 3;
    overflow: hidden;
}

.canvas-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 4px 12px;
    background: #252525;
    border-radius: 16px 16px 0 0;
    height: 42px;
}

.canvas-result-title {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    letter-spacing: -0.1px;
}

.canvas-result-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.canvas-result-btn {
    background: none;
    border: none;
    border-radius: 55px;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.canvas-result-btn svg {
    display: block;
}

.canvas-result-download:hover {
    background: #3a3a3a;
    color: #10b981;
}

.canvas-result-copy:hover {
    background: #3a3a3a;
    color: #a855f7;
    
}

.canvas-result-close:hover {
    background: #ef4444;
    color: #fff;
}

.canvas-result-image,
.canvas-result-video {
    width: 100%;
    border-radius: 0 0 10px 10px;
    display: block;
   
}

.canvas-result-text {
    padding: 12px 14px 14px;
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.55;
    max-height: 380px;
    min-height: 40px;
    overflow-y: scroll;
    overflow-x: hidden;
    word-break: break-word;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
    overscroll-behavior: contain;
    pointer-events: all;
}

.canvas-result-text::-webkit-scrollbar {
    width: 6px;
}

.canvas-result-text::-webkit-scrollbar-track {
    background: transparent;
}

.canvas-result-text::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
}

.canvas-result-text::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.45);
}

.canvas-result-text > *:first-child {
    margin-top: 0;
}

.canvas-result-text > *:last-child {
    margin-bottom: 0;
}

.canvas-result-text p {
    margin: 0 0 10px;
}

.canvas-result-text h1,
.canvas-result-text h2,
.canvas-result-text h3,
.canvas-result-text h4 {
    margin: 12px 0 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #fff;
}

.canvas-result-text ul,
.canvas-result-text ol {
    margin: 0 0 10px 18px;
    padding: 0;
}

.canvas-result-text li {
    margin: 4px 0;
}

.canvas-result-text strong {
    color: #fff;
    font-weight: 600;
}

.canvas-result-text code {
    background: #2d2d2d;
    border-radius: 6px;
    padding: 1px 5px;
    font-size: 12px;
}

.canvas-result-text pre {
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
    overflow-x: auto;
    margin: 8px 0 12px;
}

.canvas-result-video-placeholder {
    padding: 20px 16px;
    text-align: center;
    color: #a0a0a0;
    font-size: 12px;
    backdrop-filter: blur(4px);
}

.canvas-result-video-placeholder p {
    margin: 12px 0 0;
}

.canvas-result-spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto;
    border: 3px solid #3a3a3a;
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: canvas-spin 0.8s linear infinite;
}

@keyframes canvas-spin {
    to { transform: rotate(360deg); }
}

.download-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.download-btn:hover {
    color: #10b981;
}

.execute-btn {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 10px 32px;
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}


.execute-btn:hover {
    background: #FFF;
    transform: translateY(-0.5px);
 
}

.execute-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

 
/* Превью новой связи (вне .workflow-connection-group) */
svg.connection-line.connection-line-preview {
    opacity: 0.9;
}

.workflow-connection-group .connection-line {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.workflow-connection-group:hover .connection-line {
    opacity: 1;
}

.workflow-connection-group path[data-from] {
    transition: stroke-width 0.15s ease;
}

.workflow-connection-group:hover path[data-from] {
    stroke-width: 3px;
}

.workflow-connection-delete-wrap {
    position: absolute;
    z-index: 6;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.workflow-connection-delete-wrap.is-visible {
    opacity: 1;
    visibility: visible;
}

.workflow-connection-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #111111;
    cursor: pointer;
    pointer-events: none;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.workflow-connection-delete-wrap.is-visible .workflow-connection-delete-btn {
    pointer-events: auto;
}

.workflow-connection-delete-btn:hover {
    background: #111111;
    transform: scale(1.06);
}

.workflow-connection-delete-btn:active {
    transform: scale(0.96);
}

.workflow-connection-delete-btn svg {
    display: block;
}

 
.workflow-sidebar-content::-webkit-scrollbar,
.node-panel-content::-webkit-scrollbar {
    width: 4px;
}

.workflow-sidebar-content::-webkit-scrollbar-track,
.node-panel-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.workflow-sidebar-content::-webkit-scrollbar-thumb,
.node-panel-content::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}

.workflow-sidebar-content::-webkit-scrollbar-thumb:hover,
.node-panel-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Режим «только просмотр» (расшаренная ссылка без авторизации) */
body.workflow-view-only .node .node-body input,
body.workflow-view-only .node .node-body textarea,
body.workflow-view-only .node .node-body select,
body.workflow-view-only .node .node-body [contenteditable="true"] {
    pointer-events: none;
    cursor: default;
}

body.workflow-view-only .node .node-field-file-label {
    pointer-events: none;
    cursor: default;
    opacity: 0.8;
}

.workflow-view-only-banner:not(.workflow-view-only-banner--canvas) {
    margin-left: 12px;
    padding: 6px 12px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 8px;
    font-size: 13px;
    color: #c4b5fd;
    back-drop-filter: blur(4px);
}

.workflow-view-only-banner:not(.workflow-view-only-banner--canvas) a {
    color: #a78bfa;
    text-decoration: underline;
}

.workflow-share-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.workflow-share-modal[data-open="true"] {
    opacity: 1;
    visibility: visible;
}
.workflow-share-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.workflow-share-modal-content {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    background: #1b1b1b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    padding: 20px 24px 24px;
    transition: min-height 0.2s ease;
    min-height: 430px;
}
.workflow-share-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.workflow-share-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}
.workflow-share-modal-title {
    margin: 0 0 26px 0;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    text-align: center;
}
.workflow-share-modal-inner {
    padding: 0 0 0 0;
}
.workflow-share-modal-warning {
    margin: 0 0 24px 0;
    font-size: 14px;
    font-weight: 400;
    color: #e5e5e5;
    line-height: 1.45;
}
.workflow-share-modal-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    min-height: 24px;
}
.workflow-share-modal-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e5e5;
}
.workflow-share-toggle {
    position: relative;
    display: inline-block;
    width: 33px;
    height: 20px;
    flex-shrink: 0;
}
.workflow-share-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.workflow-share-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #3d3d3d;
    border-radius: 555px;
    transition: background 0.2s;
}
.workflow-share-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 1px;
    top: 1px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.workflow-share-toggle input:checked + .workflow-share-toggle-slider {
    background: rgba(110, 45, 252, 1);
}
.workflow-share-toggle input:checked + .workflow-share-toggle-slider::before {
    transform: translateX(13px);
}
.workflow-share-toggle-loading .workflow-share-toggle-slider,
.workflow-share-toggle-loading .workflow-share-toggle-slider::before {
    transition: none !important;
}
.workflow-share-modal-link-block {
    margin-top: 24px;
}
.workflow-share-modal-link-wrap {
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
    background: #252525;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0 8px 0 4px;
}
.workflow-share-modal-link-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 48px 0 8px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 400;
    color: #e5e5e5;
    outline: none;
}
.workflow-share-modal-link-input::placeholder {
    color: #6e6e73;
}
.workflow-share-modal-link-input:disabled {
    color: rgba(255, 255, 255, 0.45);
    cursor: not-allowed;
}
.workflow-share-modal-copy-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, background 0.2s;
}
.workflow-share-modal-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.9;
}
.workflow-share-modal-copy-btn.is-disabled,
.workflow-share-modal-copy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.workflow-share-modal-copy-btn svg {
    width: 18px;
    height: 18px;
}

 
.workflow-share-copy-tooltip {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: #3d3d3d;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}
.workflow-share-copy-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
}

 
.workflow-share-expired {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0f0f0f;
    padding: 24px;
}
.workflow-share-expired-header {
    position: absolute;
    left: 16px;
    top: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.workflow-share-expired-header .sidebar-logo-img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.workflow-share-expired-header .sidebar-brand {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: #fff;
}
.workflow-share-expired-content {
    text-align: center;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.workflow-share-expired-icon {
    margin-bottom: 16px;
    line-height: 0;
}
.workflow-share-expired-icon svg {
    width: 52px;
    height: 52px;
}
.workflow-share-expired-text {
    font-size: 14px;
    color: rgba(229, 229, 229, 1);
    margin: 0 0 28px 0;
    line-height: 1.4;
}
.workflow-share-expired-btn {
    display: inline-block;
    min-width: 180px;
    padding: 10px 32px;
    background: #fff;
    color: #111;
    font-size: 14px;
    font-weight: 500;
    border-radius: 55px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.workflow-share-expired-btn:hover {
    opacity: 0.9;
}

 
.ai-workflow-generator {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
}

.ai-workflow-generator-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

.workflow-onboarding-help-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    background: #101010;
    color: #fff;
    line-height: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.workflow-onboarding-help-btn:hover {
    transform: translateY(-2px);
    background: #2a2a2a;
    border-color: #3a3a3a;
}

.workflow-onboarding-help-btn:focus {
    outline: none;
}

.workflow-onboarding-help-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.workflow-onboarding-help-icon {
    display: block;
    flex-shrink: 0;
}

.ai-workflow-toggle {
    background: #101010;
    border-radius: 12px;
    padding: 9px 16px 9px 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: 1px solid #2a2a2a;
}

.ai-workflow-toggle:hover {
    transform: translateY(-2px);
    background: #2a2a2a;
 
}

.ai-workflow-toggle:focus {
    outline: none;
}

.ai-workflow-toggle:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.ai-workflow-toggle svg {
    width: 18px;
    height: 18px;
}

.ai-workflow-input-container {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    left: auto;
    transform: none;
    z-index: 120;
    background: #1b1b1b;
    border-radius: 14px;
    min-width: 360px;
    max-width: 600px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: wfAiPanelIn 0.2s ease-out;
}

@keyframes wfAiPanelIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-workflow-input-wrap {
    background: #1b1b1b;
    border: 1px solid #2b2b2b;
    border-radius: 12px;
    padding: 8px;
    transition: border-color 0.2s ease;
}

.ai-workflow-input-field {
    position: relative;
}

.ai-workflow-input-wrap:focus-within {
    border-color: #FFF;
}

.ai-workflow-input-wrap:focus-within .send-btn:not(:disabled) {
    transform: scale(1.08);
}

.ai-workflow-input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px 48px 46px 8px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 88px;
    max-height: 200px;
    margin: 0;
}

.ai-workflow-input:focus {
    outline: none;
}

.ai-workflow-input::placeholder {
    color: #666;
}

.ai-workflow-send-btn {
    position: absolute;
    right: 4px;
    bottom: 4px;
    margin: 0;
    z-index: 2;
}

.ai-workflow-send-btn #aiWorkflowBtnLoader svg {
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .ai-workflow-input-container {
        min-width: unset;
        width: min(92vw, 560px);
    }
}

/* ================================
   NEW UI LAYOUT STYLES
   ================================ */

/* User Avatar & Menu */
.workflow-user-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.workflow-user-avatar:hover {
    background: rgba(255, 255, 255, 0.15);
}

.user-avatar-img {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn-wrapper {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1b1b1b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 220px;
    max-width: min(92vw, 280px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    padding: 8px;
    z-index: 1000;
}

.settings-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #e0e0e0;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.settings-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.settings-menu-item svg {
    flex-shrink: 0;
}

.settings-menu-item--danger {
    color: #ff6b6b;
}

.settings-menu-item--danger:hover {
    background: rgba(255, 107, 107, 0.12);
}

.settings-menu-item.settings-menu-item--danger svg {
    color: #ff6b6b;
}

a.settings-menu-item {
    text-decoration: none;
    display: flex;
}

.settings-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.user-menu-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 6px;
}

.user-menu-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-menu-details {
    min-width: 0;
    flex: 1;
}

.user-menu-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.user-menu-name {
    font-size: 13px;
    font-weight: 600;
    color: #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.copy-user-id-btn--workflow-menu {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.copy-user-id-btn--workflow-menu:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.user-menu-tariff {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Workflow Body - New Layout */
.workflow-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Node Panel - Collapsible */
.node-panel {
    width: 280px;
    min-width: 280px;
    background: #1b1b1b;
    display: flex;
    flex-direction: column;
    margin: 0px 0px 4px 4px;
    border-radius: 24px;
    z-index: 10;
 
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.workflow-right-wrap {
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    align-items: stretch;
    min-height: 0;
    min-width: 0;
}

.workflow-side-panels {
    display: flex;
    flex-direction: column;
    min-width: 300px;
    max-width: 600px;
    width: 400px;
    min-height: 0;
    flex: 0 0 400px;
    transition: opacity 0.2s ease, min-width 0.2s ease, width 0.2s ease;
}

.workflow-side-panels .chat-panel {
    width: 100%;
    max-width: none;
    flex: 1;
    min-height: 0;
}

.workflow-side-panels--collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    flex: 0 0 0 !important;
    overflow: hidden !important;
    opacity: 0;
    pointer-events: none;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.workflow-media-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
    background: #1b1b1b;
    border-radius: 24px;
    margin: 8px 0;
    overflow: hidden;
}

.workflow-media-panel[hidden] {
    display: none !important;
}

.workflow-media-panel-title {
    padding: 12px 16px 8px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    flex-shrink: 0;
}

.workflow-embed-images,
.workflow-embed-video {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.workflow-embed-images .image-list,
.workflow-embed-video .video-list {
    padding: 0 12px 12px;
}

/* Resizer */
.workflow-resizer {
    width: 4px;
    background: transparent;
    cursor: col-resize;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
    z-index: 20;
}

.workflow-resizer:hover {
    background: rgba(168, 85, 247, 0.3);
}

.workflow-resizer::after {
    content: '';
    position: absolute;
    left: -4px;
    right: -4px;
    top: 0;
    bottom: 0;
}

.workflow-resizer.resizing {
    background: rgba(168, 85, 247, 0.6);
}

.workflow-resizer.workflow-resizer--hidden {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    cursor: default !important;
}

/* Chat Panel */
.chat-panel {
    width: 400px;
    min-width: 300px;
    max-width: 600px;
    background: #1b1b1b;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    margin: 8px 0px 8px 0px;
}

.chat-panel-header {
    display: flex;
    align-items: center;
    padding: 14px 16px 8px;
    flex-shrink: 0;
}

.chat-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}


.chat-tab:hover .close-tab {
    opacity: 1;
}

.chat-tab-new {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px 8px 0 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
}

.chat-tab-new:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

/* Chat Messages Area */
.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-panel-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-panel-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-panel-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.chat-panel-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.empty-state-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

.empty-state-chat h3 {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state-chat p {
    font-size: 14px;
    margin: 0;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message.user {
    align-items: flex-end;
}

.chat-message.assistant {
    align-items: flex-start;
}

.chat-message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-message-bubble p {
    margin: 0 0 8px 0;
}

.chat-message-bubble p:last-child {
    margin-bottom: 0;
}

.chat-message-bubble code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.chat-message-bubble pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.chat-message-bubble pre code {
    background: none;
    padding: 0;
}

.chat-message.user .chat-message-bubble {
    background: #a855f7;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant {
    max-width: 100%;
    min-width: 0;
    align-self: stretch;
}

.chat-message.assistant .chat-message-bubble {
    background: #252525;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-message-bubble table {
    border-collapse: collapse;
    font-size: 13px;
    margin: 8px 0;
    width: 100%;
    table-layout: fixed;
}

.chat-message-bubble th,
.chat-message-bubble td {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.chat-message-bubble th {
    background: rgba(0, 0, 0, 0.25);
    font-weight: 600;
}

/* Контекст выбранной ноды в чате процессов */
.chat-node-context {
    margin: 0 16px 10px;
    padding: 10px 12px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 12px;
    flex-shrink: 0;
}

.chat-node-context-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.chat-node-context-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(168, 85, 247, 0.95);
    flex-shrink: 0;
}

.chat-node-context-title {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.chat-node-context-clear {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.chat-node-context-clear:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.chat-node-context-hint {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.45);
}

/* Chat Input */
.chat-panel-input {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.model-selector {
    position: relative;
}

/* .model-selector--inline: removed (no model selector in chat panel) */

/* .chat-input-wrapper--with-model: removed */

/* .chat-input-wrapper--with-model .model-selector--inline: removed */

.model-selector-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #252525;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.model-selector-btn--inline {
    width: auto;
    max-width: 140px;
    padding: 6px 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.model-selector--inline .model-type-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 104px;
}

.model-selector-btn:hover {
    background: #2a2a2a;
}

.model-type-label {
    flex: 1;
    text-align: left;
}

.dropdown-icon {
    opacity: 0.6;
    transition: transform 0.2s;
}

.model-selector.open .dropdown-icon {
    transform: rotate(180deg);
}

.model-selector-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 100%;
    width: max-content;
    background: #1b1b1b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

.dropdown-list {
    padding: 8px;
}

.model-option {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
    color: #e0e0e0;
}

.model-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.model-option.active {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #252525;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    transition: border-color 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: rgba(168, 85, 247, 0.5);
}

.chat-input-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    padding: 4px;
}

.chat-input-wrapper textarea:focus {
    outline: none;
}

.chat-input-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-input-wrapper .send-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-input-wrapper .send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input-wrapper .send-btn:not(:disabled):hover {
    transform: scale(1.05);
}

/* Media Sidebar */
.media-sidebar {
    width: 56px;
    background: #1b1b1b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    margin: 0px 4px 4px 4px;
    border-radius: 20px;
    align-self: stretch;
    min-height: 0;
    box-shadow: 0 4px 44px rgba(0, 0, 0, 0.2), inset 0 0.1px 5px rgba(255, 255, 255, 0.05);
}

.media-tab {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 55px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 55px;
}

.media-tab.active {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border-radius: 55px;
}

.media-sidebar-divider {
    align-self: stretch;
    height: 1px;
    margin: 6px 2px;
    background: rgba(255, 255, 255, 0.14);
    border: 0;
    flex-shrink: 0;
}

.media-tool-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-tool-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
}

.media-tool-btn:active {
    transform: scale(0.96);
}

.media-sidebar-spacer {
    flex: 1;
    min-height: 12px;
    width: 100%;
    flex-shrink: 0;
}

.media-hotkeys-btn .media-hotkeys-icon {
    font-size: 17px;
    font-weight: 600;
    line-height: 1;
    color: inherit;
    font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.media-hotkeys-btn.active {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

/* Горячие клавиши — внутри .workflow-media-panel (как Изображения / Видео) */
.workflow-hotkeys-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-right: 8px;
}

.workflow-hotkeys-close-inline {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.workflow-hotkeys-close-inline:hover {
    background: rgba(255, 255, 255, 0.18);
}

.workflow-hotkeys-body--embedded {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 12px 16px;
    -webkit-overflow-scrolling: touch;
}

.workflow-hotkeys-label-note {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    text-align: right;
    line-height: 1.3;
    max-width: 11rem;
}

.workflow-hotkeys-section {
    margin-bottom: 22px;
}

.workflow-hotkeys-section:last-child {
    margin-bottom: 0;
}

.workflow-hotkeys-section-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #c026d3;
}

.workflow-hotkeys-hint {
    margin: -4px 0 10px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.45);
}

.workflow-hotkeys-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.workflow-hotkeys-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
}

.workflow-hotkeys-section .workflow-hotkeys-list .workflow-hotkeys-row:last-child {
    border-bottom: none;
}

.workflow-hotkeys-label {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.workflow-hotkeys-keys {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    max-width: 52%;
}

.workflow-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.workflow-kbd-plus,
.workflow-kbd-or {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 1px;
}

.remove-bg-submit-row {
    padding-top: 16px;
}

.remove-bg-submit-row .remove-object-primary-btn {
    flex: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .node-panel {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        margin: 16px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }
    
    .chat-panel {
        width: 350px;
    }
    
    .media-sidebar {
        width: 48px;
    }
}

@media (max-width: 768px) {
    .node-panel {
        width: 100%;
        max-width: 320px;
    }
    
    .chat-panel {
        width: 100%;
        max-width: none;
    }
}

/* ================================
   ANIMATIONS & TRANSITIONS
   ================================ */

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

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.chat-message {
    animation: fadeIn 0.3s ease-out;
}

.settings-btn-wrapper {
    animation: fadeIn 0.2s ease-out;
}

.model-selector-dropdown {
    animation: fadeIn 0.2s ease-out;
}

/* Loading States */
.chat-message-bubble.loading {
    position: relative;
    overflow: hidden;
}

.chat-message-bubble.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* Focus States */
.chat-input-wrapper:focus-within {
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.3);
}

.model-selector-btn:focus,
.media-tab:focus,
.chat-tab:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.5);
}

/* Smooth scrolling for chat */
.chat-panel-messages {
    scroll-behavior: smooth;
}

/* Improved hover effects */
.workflow-header-btn,
.settings-menu-item,
.model-option,
.canvas-btn {
    position: relative;
    overflow: hidden;
}

.workflow-header-btn::before,
.settings-menu-item::before,
.model-option::before,
.canvas-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.workflow-header-btn:hover::before,
.settings-menu-item:hover::before,
.model-option:hover::before,
.canvas-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Selection highlight */
::selection {
    background: rgba(168, 85, 247, 0.3);
    color: #fff;
}

/* Disabled state improvements */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Backdrop blur for modals */
.workflow-share-modal-overlay {
    backdrop-filter: blur(8px);
}

/* Better scrollbars for canvas */
.canvas-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.canvas-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.canvas-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.canvas-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Accessibility improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    .workflow-container {
        color-scheme: dark;
    }
}

/* Print styles */
@media print {
    .workflow-header,
    .node-panel,
    .chat-panel,
    .media-sidebar,
    .canvas-controls {
        display: none !important;
    }
    
    .canvas-area {
        margin: 0 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   COLLABORATIVE MODE STYLES
   ═══════════════════════════════════════════════════════════════ */

/* ── Collab cursor overlay ────────────────────────────────────── */
.collab-cursor {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    transform-origin: top left;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    transition: transform 80ms linear;
    will-change: transform;
}

.collab-cursor svg {
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

.collab-cursor-label {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    letter-spacing: 0.01em;
    margin-left: 8px;
    margin-top: 1px;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Avatar stack next to share button ───────────────────────── */
.collab-avatar-stack {
    display: flex;
    align-items: center;
    flex-direction: row;
}

.collab-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    cursor: default;
    flex-shrink: 0;
    position: relative;
}

.collab-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.collab-avatar--initial {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.collab-avatar--count {
    background: rgba(255,255,255,.12) !important;
    color: rgba(255,255,255,.7);
    font-size: 10px;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,.12);
}

/* ── Share modal — collab section ────────────────────────────── */
.workflow-share-collab-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 14px 0 12px;
}

.workflow-share-collab-section {
    margin-top: 2px;
}

.workflow-share-collab-label-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.workflow-share-collab-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .05em;
    color: #a855f7;
    background: rgba(168,85,247,.15);
    border: 1px solid rgba(168,85,247,.3);
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}

.workflow-share-collab-hint {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    margin: 6px 0 10px;
    line-height: 1.45;
}

.workflow-share-collab-link-block {
    margin-top: 10px;
}

/* ── Access selector (dropdown вместо toggle) ──────────────────── */
.workflow-share-access-selector {
    margin-top: 18px;
    margin-bottom: 16px;
}
.workflow-share-access-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.6);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.workflow-share-access-dropdown {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: #252525;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    color: rgba(255,255,255,.85);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='7' viewBox='0 0 12 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='rgba(255,255,255,.5)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.workflow-share-access-dropdown:hover {
    border-color: rgba(255,255,255,.15);
    background-color: #2a2a2a;
}
.workflow-share-access-dropdown:focus {
    outline: none;
    border-color: rgba(168,85,247,.5);
}
.workflow-share-access-dropdown.is-disabled,
.workflow-share-access-dropdown:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.workflow-share-access-hint {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    margin-top: 6px;
    line-height: 1.45;
}

/* ── Members block (всегда показан) ────────────────────────────── */
.workflow-share-members-block {
    margin-top: 16px;
    padding-top: 16px;
}

.workflow-share-members-title {
    flex: 1;
}
.workflow-share-members-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
}
/* Переиспользуем .collab-member-row и остальные стили */

/* ── Members list ─────────────────────────────────────────────── */
.workflow-share-collab-members {
    margin-top: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 14px;
}

.collab-members-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}

.collab-members-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
}

.collab-member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background .15s;
}

.collab-member-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.collab-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.collab-member-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.collab-member-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collab-member-badge {
    font-size: 10px;
    color: rgba(255,255,255,.4);
    background: rgba(255,255,255,.08);
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.collab-member-online {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(16,185,129,.5);
}

.collab-member-remove {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.3);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.collab-member-remove:hover {
    color: #ef4444;
    background: rgba(239,68,68,.12);
}

.collab-members-empty {
    font-size: 12px;
    color: rgba(255,255,255,.3);
    text-align: center;
    padding: 10px 0;
    font-style: italic;
}

/* ——— Collaba: главный экран (история процессов) ——— */
.collaba-home-screen {
    display: flex;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: #0a0a0c;
    color: rgba(255,255,255,.9);
}

.collaba-home-sidebar {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    padding: 20px 16px 16px;
    background: rgba(0,0,0,.35);
}

.collaba-home-sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 28px;
}

.collaba-home-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    font-size: 15px;
}

.collaba-home-brand-text {
    letter-spacing: -0.02em;
}

.collaba-home-product {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    padding-left: 34px;
}

.collaba-home-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.collaba-home-nav-item {
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.75);
    font-size: 14px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.collaba-home-nav-item:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.collaba-home-nav-item.is-active {
    background: rgba(168,85,247,.18);
    color: #e9d5ff;
}

a.collaba-home-nav-item {
    display: block;
    text-decoration: none;
}

.collaba-home-sidebar-user {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.collaba-home-sidebar-user .user-info-content {
    flex-wrap: wrap;
    gap: 8px;
}

.collaba-home-main {
    flex: 1;
    min-width: 0;
    padding: 24px 28px 40px;
    overflow-y: auto;
}

.collaba-home-hero {
    margin-bottom: 28px;
}

.collaba-home-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #061016;
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 50%, #6366f1 100%);
    box-shadow: 0 8px 32px rgba(34,211,238,.25);
    transition: transform .12s, box-shadow .12s;
}

.collaba-home-create-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 40px rgba(34,211,238,.32);
}

.collaba-home-create-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0,0,0,.15);
    font-size: 22px;
    line-height: 1;
}

.collaba-home-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,.4);
    margin: 0 0 14px;
}

.collaba-home-tools {
    margin-bottom: 36px;
}

.collaba-home-tools-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.collaba-home-tool-btn {
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.88);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.collaba-home-tool-btn:hover {
    background: rgba(168,85,247,.12);
    border-color: rgba(168,85,247,.35);
}

.collaba-home-projects-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.collaba-home-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.collaba-home-projects-grid.workflow-history-combined {
    display: grid;
}

.collaba-home-projects-grid .workflow-history-unified-row {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    position: relative;
    min-height: 88px;
}

.collaba-home-projects-grid .workflow-list-item-main {
    flex: 1;
    cursor: pointer;
}

.collaba-home-projects-grid .workflow-history-row-action {
    position: absolute;
    top: 10px;
    opacity: 0;
    transition: opacity .15s;
}

.collaba-home-projects-grid .workflow-history-unified-row:hover .workflow-history-row-action {
    opacity: 1;
}

.collaba-home-projects-grid .workflow-history-row-action--copy {
    right: 40px;
}

.collaba-home-projects-grid .workflow-list-item-delete.workflow-history-row-action {
    right: 10px;
}

.collaba-home-projects-grid .workflow-history-unified-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.collaba-home-projects-grid .workflow-history-unified-name {
    font-size: 15px;
    font-weight: 600;
}

@media (max-width: 720px) {
    .collaba-home-screen {
        flex-direction: column;
    }
    .collaba-home-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        padding: 14px;
    }
    .collaba-home-nav {
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1 1 auto;
    }
    .collaba-home-sidebar-user {
        width: 100%;
        margin-top: 0;
        padding-top: 12px;
        border-top: 1px solid rgba(255,255,255,.08);
    }
}
