{
  "Type": "Window",
  "Id": "combat_engagement",
  "Title": "Engagement",
  "Icon": "⚔",
  "DisplayLocation": "Both",
  "WindowGroup": "static_menu",
  "IsRestorable": true,
  "IsMinimizable": true,
  "IsMaximizable": true,
  "Width": "1100px",
  "Height": "680px",
  "Left": "10%",
  "Top": "8%",
  "Background": "rgba(0,0,0,0.85)",
  "Padding": "40px 12px 12px 12px",
  "Children": [
    {
      "Type": "Grid",
      "Id": "engagement_layout",
      "RowDefinitions": ["auto", "1fr"],
      "Width": "100%",
      "Height": "100%",
      "Children": [
        {
          "Type": "Label",
          "Id": "engagement_title",
          "Grid.Row": 0,
          "Text": "Engagement",
          "Style": "H2",
          "Width": "100%"
        },
        {
          "Type": "Grid",
          "Id": "engagement_body",
          "Grid.Row": 1,          "Width": "100%",
          "Height": "100%",
          "ColumnDefinitions": ["300px", "1fr"],
          "Gap": 8,
          "Children": [
            {
              "Type": "StackPanel",
              "Grid.Column": 0,
              "Orientation": "Vertical",
              "Width": "100%",
              "Height": "100%",
              "Gap": 6,
              "Children": [
                {
                  "Type": "Input",
                  "Id": "engagement_search",
                  "Placeholder": "Search ships…",
                  "Width": "100%",
                  "CommitOnInput": true,
                  "ShowClearButton": true,
                  "Command": "core.engagement.set_search"
                },
                {
                  "Type": "Checkbox",
                  "Id": "engagement_engaged_only",
                  "Label": "Engaged only",
                  "Command": "core.engagement.toggle_engaged_only"
                },
                {
                  "Type": "Tree",
                  "Id": "engagement_rail",
                  "Nodes": [],
                  "EnableVerticalScroll": true,
                  "DragDropEnabled": false,
                  "AllowReparenting": false,
                  "Width": "100%",
                  "Height": "100%"
                }
              ]
            },
            {
              "Type": "StackPanel",
              "Grid.Column": 1,
              "Orientation": "Vertical",
              "Width": "100%",
              "Height": "100%",
              "Gap": 6,
              "Children": [
                {
                  "Type": "Label",
                  "Id": "engagement_detail_title",
                  "Text": "Select a ship",
                  "Style": "H4"
                },
                {
                  "Type": "Grid",
                  "Id": "engagement_detail_grid",
                  "Width": "100%",
                  "Height": "100%",
                  "ColumnDefinitions": ["1fr", "1fr"],
                  "Gap": 8,
                  "Children": [
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 0,
                      "Orientation": "Vertical",
                      "Width": "100%",
                      "Height": "100%",
                      "Gap": 4,
                      "Children": [
                        {
                          "Type": "Tree",
                          "Id": "engagement_assignment_tree",
                          "Nodes": [],
                          "EnableVerticalScroll": true,
                          "DragDropEnabled": true,
                          "AllowReparenting": true,
                          "DropGroupId": "ship_combat_fc",
                          "DropMatrix": {
                            "BeamWeapon": ["BeamFC", "Unassigned"],
                            "MissileWeapon": ["MissileFC", "Unassigned"],
                            "Target": ["BeamFC", "MissileFC"],
                            "PdMode": ["BeamFC", "MissileFC"],
                            "PdPriority": ["BeamFC"],
                            "PdConcentration": ["BeamFC"]
                          },
                          "OnNodeMoved": "core.naval_org.ship_combat_drag_target",
                          "Width": "100%",
                          "Height": "100%"
                        }
                      ]
                    },
                    {
                      "Type": "StackPanel",
                      "Grid.Column": 1,
                      "Orientation": "Vertical",
                      "Width": "100%",
                      "Height": "100%",
                      "Gap": 4,
                      "Children": [
                        { "Type": "Label", "Text": "Targets", "Classes": ["ps-section-title"] },
                        {
                          "Type": "Tree",
                          "Id": "engagement_targets_tree",
                          "Nodes": [],
                          "EnableVerticalScroll": true,
                          "DragDropEnabled": true,
                          "DropGroupId": "ship_combat_fc",
                          "OnNodeMoved": "core.naval_org.ship_combat_drag_target",
                          "Width": "100%",
                          "Height": "100%"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
