{
  "schemaVersion": "0.1",
  "scene": {
    "id": "compliance-pii-flow",
    "title": "KYC onboarding - PII data flow with trust boundary",
    "units": "px",
    "canvas": {
      "width": 1200,
      "height": 820,
      "background": "#1a1a22"
    }
  },
  "diagramFamily": "architecture",
  "layoutStrategy": {
    "algorithm": "hierarchical",
    "direction": "LR",
    "nodeSpacing": 40,
    "rankSpacing": 120
  },
  "palette": {
    "background": "#1a1a22",
    "foreground": "#ece8dc",
    "nodeFill": "#222230",
    "nodeStroke": "#d4a843",
    "edgeStroke": "#96918a",
    "mutedForeground": "#96918a",
    "containerFill": "#1f1f28",
    "containerStroke": "#c0544e",
    "accentPrimary": "#c0544e",
    "accentSecondary": "#4db89a"
  },
  "styles": {
    "safe": {
      "fill": "#222230",
      "stroke": "#4db89a",
      "strokeWidth": 2
    },
    "unsafe": {
      "fill": "#222230",
      "stroke": "#c0544e",
      "strokeWidth": 2,
      "textColor": "#c0544e",
      "dash": [
        6,
        4
      ]
    },
    "internal": {
      "fill": "#222230",
      "stroke": "#d4a843",
      "strokeWidth": 1.5
    },
    "vendorNode": {
      "fill": "#222230",
      "stroke": "#c0544e",
      "strokeWidth": 2,
      "textColor": "#ece8dc"
    },
    "safeStorage": {
      "fill": "#222230",
      "stroke": "#4db89a",
      "strokeWidth": 2,
      "textColor": "#ece8dc"
    },
    "boundary": {
      "fill": "#1f1f28",
      "stroke": "#c0544e",
      "strokeWidth": 1,
      "dash": [
        4,
        4
      ],
      "textColor": "#ece8dc"
    },
    "plainEdge": {
      "stroke": "#96918a",
      "strokeWidth": 1.5,
      "textColor": "#ece8dc"
    }
  },
  "elements": [
    {
      "id": "customer",
      "kind": "node",
      "nodeType": "actor",
      "shape": "roundedRect",
      "label": "Customer",
      "icon": "lucide:user",
      "style": "internal"
    },
    {
      "id": "webapp",
      "kind": "node",
      "nodeType": "service",
      "shape": "roundedRect",
      "label": "Onboarding\nWeb App",
      "icon": "lucide:globe",
      "style": "internal"
    },
    {
      "id": "orch",
      "kind": "node",
      "nodeType": "service",
      "shape": "roundedRect",
      "label": "KYC\nOrchestrator",
      "icon": "lucide:shield",
      "style": "internal"
    },
    {
      "id": "vendor",
      "kind": "node",
      "nodeType": "service",
      "shape": "cloud",
      "label": "KYC Vendor\n3rd party (DPA)",
      "icon": "lucide:cloud",
      "style": "vendorNode"
    },
    {
      "id": "trust-frame",
      "kind": "frame",
      "children": [
        "vendor"
      ],
      "title": "External trust boundary",
      "containerType": "boundary",
      "style": "boundary"
    },
    {
      "id": "iddocs",
      "kind": "node",
      "nodeType": "database",
      "shape": "cylinder",
      "label": "ID Document Store\nS3 + KMS",
      "icon": "lucide:file-lock",
      "style": "internal"
    },
    {
      "id": "vault",
      "kind": "node",
      "nodeType": "database",
      "shape": "cylinder",
      "label": "Customer Vault\ntokenized PII",
      "icon": "lucide:key",
      "style": "safeStorage"
    },
    {
      "id": "audit",
      "kind": "node",
      "nodeType": "database",
      "shape": "cylinder",
      "label": "Audit Log\nhashed events (immutable)",
      "icon": "lucide:scroll-text",
      "style": "safeStorage"
    },
    {
      "id": "e1",
      "kind": "edge",
      "from": {
        "elementId": "customer"
      },
      "to": {
        "elementId": "webapp"
      },
      "router": "orthogonal",
      "label": "submit KYC",
      "style": "plainEdge"
    },
    {
      "id": "e2",
      "kind": "edge",
      "from": {
        "elementId": "webapp"
      },
      "to": {
        "elementId": "orch"
      },
      "router": "orthogonal",
      "label": "full PII",
      "style": "plainEdge"
    },
    {
      "id": "e3",
      "kind": "edge",
      "from": {
        "elementId": "orch"
      },
      "to": {
        "elementId": "vendor"
      },
      "router": "orthogonal",
      "label": "full PII (DPA)",
      "style": "unsafe"
    },
    {
      "id": "e4",
      "kind": "edge",
      "from": {
        "elementId": "orch"
      },
      "to": {
        "elementId": "iddocs"
      },
      "router": "orthogonal",
      "label": "ID photo",
      "style": "unsafe"
    },
    {
      "id": "e5",
      "kind": "edge",
      "from": {
        "elementId": "orch"
      },
      "to": {
        "elementId": "vault"
      },
      "router": "orthogonal",
      "label": "tokenized",
      "style": "safe"
    },
    {
      "id": "e6",
      "kind": "edge",
      "from": {
        "elementId": "orch"
      },
      "to": {
        "elementId": "audit"
      },
      "router": "orthogonal",
      "label": "hashed events",
      "style": "safe"
    }
  ],
  "constraints": [
    {
      "type": "order",
      "source": "vendor",
      "target": "iddocs",
      "relation": "above"
    },
    {
      "type": "order",
      "source": "iddocs",
      "target": "vault",
      "relation": "above"
    },
    {
      "type": "order",
      "source": "vault",
      "target": "audit",
      "relation": "above"
    }
  ]
}