/* ============================================================
   FLOW OVERLAY
   ============================================================ */

.flow-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    flex-direction: column;
    background: #060818;
}

.flow-overlay.active {
    display: flex;
}

/* ============================================================
   TOOLBAR
   ============================================================ */

.flow-toolbar {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(8, 10, 24, 0.95);
    gap: 16px;
    flex-shrink: 0;
}

.flow-toolbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Close button */
.flow-btn-close {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: var(--font-sans);
    padding: 0;
}

.flow-btn-close:hover {
    background: rgba(255, 100, 100, 0.1);
    color: #ff6b6b;
}

/* ============================================================
   FLOW CONTENT AREA
   ============================================================ */

.flow-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.flow-canvas-inner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ============================================================
   FLOW MODAL (click on node)
   ============================================================ */

.flow-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.flow-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.flow-modal-card {
    position: relative;
    max-width: min(720px, 92vw);
    max-height: 75vh;
    width: 680px;
    background: var(--bg-elevated, rgba(18, 21, 45, 0.98));
    border: 1px solid var(--border-medium, rgba(100, 120, 180, 0.25));
    border-radius: var(--radius-md, 14px);
    padding: 20px;
    box-shadow: var(--shadow-lg, 0 16px 48px rgba(0, 0, 0, 0.5));
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1;
}

.flow-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flow-modal-ai {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #e4eaf6);
}

.flow-modal-body {
    font-size: 13px;
    color: var(--text-primary, #e4eaf6);
    overflow: auto;
    white-space: pre-wrap;
    line-height: 1.6;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
    .flow-toolbar {
        padding: 10px 14px;
        gap: 10px;
    }

    .flow-modal-card {
        max-width: 96vw;
        padding: 16px;
    }
}
