{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "default": 4,
      "description": "Schema version for compatibility / migration.",
      "type": "number"
    },
    "width": {
      "default": 1080,
      "description": "Canvas width in pixels.",
      "type": "number"
    },
    "height": {
      "default": 1080,
      "description": "Canvas height in pixels.",
      "type": "number"
    },
    "unit": {
      "default": "px",
      "description": "Unit type for print measurements.",
      "type": "string",
      "enum": [
        "px",
        "pt",
        "mm",
        "cm",
        "in"
      ]
    },
    "dpi": {
      "default": 72,
      "description": "Dots per inch for print calculations.",
      "type": "number"
    },
    "custom": {
      "description": "Custom data attached to the design."
    },
    "fonts": {
      "default": [],
      "description": "Fonts used in the design.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fontFamily": {
            "type": "string",
            "description": "Font family name."
          },
          "url": {
            "default": "",
            "description": "URL to load the font from (single-variant fonts).",
            "type": "string"
          },
          "styles": {
            "description": "Per-weight/style variants for multi-variant families.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "src": {
                  "type": "string",
                  "description": "Font source, typically in CSS url() form."
                },
                "fontStyle": {
                  "type": "string"
                },
                "fontWeight": {
                  "type": "string"
                }
              },
              "required": [
                "src"
              ]
            }
          }
        },
        "required": [
          "fontFamily"
        ]
      }
    },
    "pages": {
      "default": [],
      "description": "Pages in the design.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the page."
          },
          "width": {
            "default": "auto",
            "description": "Page width in pixels or 'auto'.",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "const": "auto"
              }
            ]
          },
          "height": {
            "default": "auto",
            "description": "Page height in pixels or 'auto'.",
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "const": "auto"
              }
            ]
          },
          "background": {
            "default": "white",
            "description": "Background color or image.",
            "type": "string"
          },
          "bleed": {
            "default": 0,
            "description": "Bleed area in pixels for print (all sides; base value for per-side overrides).",
            "type": "number"
          },
          "bleedTop": {
            "description": "Per-side bleed override (top), in pixels. Inherits `bleed` when omitted.",
            "type": "number"
          },
          "bleedRight": {
            "description": "Per-side bleed override (right), in pixels. Inherits `bleed` when omitted.",
            "type": "number"
          },
          "bleedBottom": {
            "description": "Per-side bleed override (bottom), in pixels. Inherits `bleed` when omitted.",
            "type": "number"
          },
          "bleedLeft": {
            "description": "Per-side bleed override (left), in pixels. Inherits `bleed` when omitted.",
            "type": "number"
          },
          "custom": {},
          "duration": {
            "default": 5000,
            "description": "Page duration in milliseconds.",
            "type": "number"
          },
          "children": {
            "default": [],
            "description": "Elements on this page.",
            "type": "array",
            "items": {
              "$ref": "#/$defs/__schema0"
            }
          }
        },
        "required": [
          "id"
        ]
      }
    },
    "audios": {
      "default": [],
      "description": "Audio tracks in the design.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the audio track."
          },
          "name": {
            "default": "",
            "description": "Display name shown on the timeline.",
            "type": "string"
          },
          "src": {
            "default": "",
            "description": "URL or data URI of the audio file.",
            "type": "string"
          },
          "duration": {
            "default": 0,
            "description": "Duration in milliseconds.",
            "type": "number"
          },
          "startTime": {
            "default": 0,
            "description": "Start offset (0-1).",
            "type": "number"
          },
          "endTime": {
            "default": 1,
            "description": "End offset (0-1).",
            "type": "number"
          },
          "volume": {
            "default": 1,
            "description": "Volume level (0-1).",
            "type": "number"
          },
          "delay": {
            "default": 0,
            "description": "Delay before playing, in milliseconds.",
            "type": "number"
          },
          "speed": {
            "default": 1,
            "description": "Playback speed multiplier (1 = normal).",
            "type": "number"
          },
          "custom": {}
        },
        "required": [
          "id"
        ]
      }
    }
  },
  "$defs": {
    "__schema0": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the element."
            },
            "type": {
              "type": "string",
              "const": "text"
            },
            "name": {
              "default": "",
              "description": "Display name for the element.",
              "type": "string"
            },
            "custom": {
              "description": "Custom data attached to the element."
            },
            "x": {
              "default": 0,
              "description": "X position in pixels.",
              "type": "number"
            },
            "y": {
              "default": 0,
              "description": "Y position in pixels.",
              "type": "number"
            },
            "width": {
              "default": 100,
              "description": "Width in pixels.",
              "type": "number"
            },
            "height": {
              "default": 0,
              "description": "Height in pixels (0 until measured/rendered).",
              "type": "number"
            },
            "rotation": {
              "default": 0,
              "description": "Rotation angle in degrees.",
              "type": "number"
            },
            "opacity": {
              "default": 1,
              "description": "Opacity level (0-1).",
              "type": "number"
            },
            "animations": {
              "default": [],
              "description": "Animation configurations.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "delay": {
                    "default": 0,
                    "description": "Delay before the animation starts, in milliseconds.",
                    "type": "number"
                  },
                  "duration": {
                    "default": 500,
                    "description": "Animation duration in milliseconds.",
                    "type": "number"
                  },
                  "enabled": {
                    "default": true,
                    "description": "Whether the animation is enabled.",
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "enter",
                      "exit",
                      "loop"
                    ],
                    "description": "Animation phase."
                  },
                  "name": {
                    "default": "none",
                    "description": "Animation name identifier.",
                    "type": "string"
                  },
                  "data": {
                    "default": {},
                    "description": "Animation-specific data."
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "blurEnabled": {
              "default": false,
              "description": "Whether blur effect is enabled.",
              "type": "boolean"
            },
            "blurRadius": {
              "default": 10,
              "description": "Blur radius in pixels.",
              "type": "number"
            },
            "brightnessEnabled": {
              "default": false,
              "description": "Whether brightness effect is enabled.",
              "type": "boolean"
            },
            "brightness": {
              "default": 0,
              "description": "Brightness level (-1 to 1).",
              "type": "number"
            },
            "sepiaEnabled": {
              "default": false,
              "description": "Whether sepia effect is enabled.",
              "type": "boolean"
            },
            "grayscaleEnabled": {
              "default": false,
              "description": "Whether grayscale effect is enabled.",
              "type": "boolean"
            },
            "filters": {
              "default": {},
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "intensity": {
                    "default": 1,
                    "description": "Filter intensity (-1 to 1).",
                    "type": "number"
                  }
                }
              },
              "description": "Applied image filters keyed by filter name."
            },
            "shadowEnabled": {
              "default": false,
              "description": "Whether shadow is enabled.",
              "type": "boolean"
            },
            "shadowBlur": {
              "default": 5,
              "description": "Shadow blur radius in pixels.",
              "type": "number"
            },
            "shadowOffsetX": {
              "default": 0,
              "description": "Shadow horizontal offset in pixels.",
              "type": "number"
            },
            "shadowOffsetY": {
              "default": 0,
              "description": "Shadow vertical offset in pixels.",
              "type": "number"
            },
            "shadowColor": {
              "default": "black",
              "description": "Shadow color.",
              "type": "string"
            },
            "shadowOpacity": {
              "default": 1,
              "description": "Shadow opacity (0-1).",
              "type": "number"
            },
            "visible": {
              "default": true,
              "description": "Whether the element is visible.",
              "type": "boolean"
            },
            "draggable": {
              "default": true,
              "description": "Whether the element can be dragged.",
              "type": "boolean"
            },
            "resizable": {
              "default": true,
              "description": "Whether the element can be resized.",
              "type": "boolean"
            },
            "selectable": {
              "default": true,
              "description": "Whether the element can be selected.",
              "type": "boolean"
            },
            "removable": {
              "default": true,
              "description": "Whether the element can be removed.",
              "type": "boolean"
            },
            "contentEditable": {
              "default": true,
              "description": "Whether the element content can be edited.",
              "type": "boolean"
            },
            "styleEditable": {
              "default": true,
              "description": "Whether the element style can be edited.",
              "type": "boolean"
            },
            "alwaysOnTop": {
              "default": false,
              "description": "Whether the element stays on top of others.",
              "type": "boolean"
            },
            "showInExport": {
              "default": true,
              "description": "Whether the element appears in exports.",
              "type": "boolean"
            },
            "text": {
              "default": "",
              "description": "Visible text shown on canvas.",
              "type": "string"
            },
            "placeholder": {
              "default": "",
              "description": "Placeholder text shown when empty.",
              "type": "string"
            },
            "fontSize": {
              "default": 14,
              "description": "Font size in pixels (minimum 1).",
              "type": "number"
            },
            "fontFamily": {
              "default": "Roboto",
              "description": "Font family name.",
              "type": "string"
            },
            "fontStyle": {
              "default": "normal",
              "description": "Font style: 'normal' or 'italic'.",
              "type": "string"
            },
            "fontWeight": {
              "default": "normal",
              "description": "Font weight: 'normal', 'bold', or numeric string.",
              "type": "string"
            },
            "textDecoration": {
              "default": "",
              "description": "Text decoration (e.g. underline, line-through).",
              "type": "string"
            },
            "textTransform": {
              "default": "none",
              "description": "Text transform: uppercase, lowercase, capitalize, none.",
              "type": "string"
            },
            "fill": {
              "default": "black",
              "description": "Text color.",
              "type": "string"
            },
            "align": {
              "default": "center",
              "description": "Horizontal alignment (commonly left | center | right | justify).",
              "type": "string"
            },
            "verticalAlign": {
              "default": "top",
              "description": "Vertical alignment: top, middle, bottom.",
              "type": "string"
            },
            "strokeWidth": {
              "default": 0,
              "description": "Stroke width in pixels.",
              "type": "number"
            },
            "stroke": {
              "default": "black",
              "description": "Stroke color.",
              "type": "string"
            },
            "strokeLineJoin": {
              "default": "round",
              "description": "Stroke corner join: round, miter, bevel.",
              "type": "string"
            },
            "lineHeight": {
              "default": 1.2,
              "description": "Line height multiplier or 'auto'.",
              "type": [
                "number",
                "string"
              ]
            },
            "letterSpacing": {
              "default": 0,
              "description": "Letter spacing as a fraction of font size.",
              "type": "number"
            },
            "backgroundEnabled": {
              "default": false,
              "description": "Whether the text background is enabled.",
              "type": "boolean"
            },
            "backgroundColor": {
              "default": "#7ED321",
              "description": "Text background color.",
              "type": "string"
            },
            "backgroundOpacity": {
              "default": 1,
              "description": "Text background opacity (0-1).",
              "type": "number"
            },
            "backgroundCornerRadius": {
              "default": 0.5,
              "description": "Text background corner radius.",
              "type": "number"
            },
            "backgroundPadding": {
              "default": 0.5,
              "description": "Text background padding.",
              "type": "number"
            },
            "curveEnabled": {
              "default": false,
              "description": "Whether the text curve effect is enabled.",
              "type": "boolean"
            },
            "curvePower": {
              "default": 0.5,
              "description": "Text curve power (-1 to 1, 0 = straight).",
              "type": "number"
            },
            "legacyBackground": {
              "description": "Internal compatibility flag stamped by the v2→v3 migration.",
              "type": "boolean"
            }
          },
          "required": [
            "id",
            "type"
          ]
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the element."
            },
            "type": {
              "type": "string",
              "const": "image"
            },
            "name": {
              "default": "",
              "description": "Display name for the element.",
              "type": "string"
            },
            "custom": {
              "description": "Custom data attached to the element."
            },
            "x": {
              "default": 0,
              "description": "X position in pixels.",
              "type": "number"
            },
            "y": {
              "default": 0,
              "description": "Y position in pixels.",
              "type": "number"
            },
            "width": {
              "default": 100,
              "description": "Width in pixels.",
              "type": "number"
            },
            "height": {
              "default": 100,
              "description": "Height in pixels.",
              "type": "number"
            },
            "rotation": {
              "default": 0,
              "description": "Rotation angle in degrees.",
              "type": "number"
            },
            "opacity": {
              "default": 1,
              "description": "Opacity level (0-1).",
              "type": "number"
            },
            "animations": {
              "default": [],
              "description": "Animation configurations.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "delay": {
                    "default": 0,
                    "description": "Delay before the animation starts, in milliseconds.",
                    "type": "number"
                  },
                  "duration": {
                    "default": 500,
                    "description": "Animation duration in milliseconds.",
                    "type": "number"
                  },
                  "enabled": {
                    "default": true,
                    "description": "Whether the animation is enabled.",
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "enter",
                      "exit",
                      "loop"
                    ],
                    "description": "Animation phase."
                  },
                  "name": {
                    "default": "none",
                    "description": "Animation name identifier.",
                    "type": "string"
                  },
                  "data": {
                    "default": {},
                    "description": "Animation-specific data."
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "blurEnabled": {
              "default": false,
              "description": "Whether blur effect is enabled.",
              "type": "boolean"
            },
            "blurRadius": {
              "default": 10,
              "description": "Blur radius in pixels.",
              "type": "number"
            },
            "brightnessEnabled": {
              "default": false,
              "description": "Whether brightness effect is enabled.",
              "type": "boolean"
            },
            "brightness": {
              "default": 0,
              "description": "Brightness level (-1 to 1).",
              "type": "number"
            },
            "sepiaEnabled": {
              "default": false,
              "description": "Whether sepia effect is enabled.",
              "type": "boolean"
            },
            "grayscaleEnabled": {
              "default": false,
              "description": "Whether grayscale effect is enabled.",
              "type": "boolean"
            },
            "filters": {
              "default": {},
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "intensity": {
                    "default": 1,
                    "description": "Filter intensity (-1 to 1).",
                    "type": "number"
                  }
                }
              },
              "description": "Applied image filters keyed by filter name."
            },
            "shadowEnabled": {
              "default": false,
              "description": "Whether shadow is enabled.",
              "type": "boolean"
            },
            "shadowBlur": {
              "default": 5,
              "description": "Shadow blur radius in pixels.",
              "type": "number"
            },
            "shadowOffsetX": {
              "default": 0,
              "description": "Shadow horizontal offset in pixels.",
              "type": "number"
            },
            "shadowOffsetY": {
              "default": 0,
              "description": "Shadow vertical offset in pixels.",
              "type": "number"
            },
            "shadowColor": {
              "default": "black",
              "description": "Shadow color.",
              "type": "string"
            },
            "shadowOpacity": {
              "default": 1,
              "description": "Shadow opacity (0-1).",
              "type": "number"
            },
            "visible": {
              "default": true,
              "description": "Whether the element is visible.",
              "type": "boolean"
            },
            "draggable": {
              "default": true,
              "description": "Whether the element can be dragged.",
              "type": "boolean"
            },
            "resizable": {
              "default": true,
              "description": "Whether the element can be resized.",
              "type": "boolean"
            },
            "selectable": {
              "default": true,
              "description": "Whether the element can be selected.",
              "type": "boolean"
            },
            "removable": {
              "default": true,
              "description": "Whether the element can be removed.",
              "type": "boolean"
            },
            "contentEditable": {
              "default": true,
              "description": "Whether the element content can be edited.",
              "type": "boolean"
            },
            "styleEditable": {
              "default": true,
              "description": "Whether the element style can be edited.",
              "type": "boolean"
            },
            "alwaysOnTop": {
              "default": false,
              "description": "Whether the element stays on top of others.",
              "type": "boolean"
            },
            "showInExport": {
              "default": true,
              "description": "Whether the element appears in exports.",
              "type": "boolean"
            },
            "src": {
              "default": "",
              "description": "URL or data URI of the image file.",
              "type": "string"
            },
            "cropX": {
              "default": 0,
              "description": "Crop X offset as a fraction (0-1).",
              "type": "number"
            },
            "cropY": {
              "default": 0,
              "description": "Crop Y offset as a fraction (0-1).",
              "type": "number"
            },
            "cropWidth": {
              "default": 1,
              "description": "Crop width as a fraction (0-1).",
              "type": "number"
            },
            "cropHeight": {
              "default": 1,
              "description": "Crop height as a fraction (0-1).",
              "type": "number"
            },
            "cornerRadius": {
              "default": 0,
              "description": "Corner radius in pixels.",
              "type": "number"
            },
            "flipX": {
              "default": false,
              "description": "Whether the image is flipped horizontally.",
              "type": "boolean"
            },
            "flipY": {
              "default": false,
              "description": "Whether the image is flipped vertically.",
              "type": "boolean"
            },
            "clipSrc": {
              "default": "",
              "description": "URL or data URI for a clipping mask.",
              "type": "string"
            },
            "borderColor": {
              "default": "black",
              "description": "Border color.",
              "type": "string"
            },
            "borderSize": {
              "default": 0,
              "description": "Border width in pixels.",
              "type": "number"
            },
            "keepRatio": {
              "default": false,
              "description": "Whether to maintain aspect ratio when resizing.",
              "type": "boolean"
            },
            "stretchEnabled": {
              "default": false,
              "description": "Whether stretch mode is enabled.",
              "type": "boolean"
            }
          },
          "required": [
            "id",
            "type"
          ]
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the element."
            },
            "type": {
              "type": "string",
              "const": "svg"
            },
            "name": {
              "default": "",
              "description": "Display name for the element.",
              "type": "string"
            },
            "custom": {
              "description": "Custom data attached to the element."
            },
            "x": {
              "default": 0,
              "description": "X position in pixels.",
              "type": "number"
            },
            "y": {
              "default": 0,
              "description": "Y position in pixels.",
              "type": "number"
            },
            "width": {
              "default": 100,
              "type": "number"
            },
            "height": {
              "default": 100,
              "type": "number"
            },
            "rotation": {
              "default": 0,
              "description": "Rotation angle in degrees.",
              "type": "number"
            },
            "opacity": {
              "default": 1,
              "description": "Opacity level (0-1).",
              "type": "number"
            },
            "animations": {
              "default": [],
              "description": "Animation configurations.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "delay": {
                    "default": 0,
                    "description": "Delay before the animation starts, in milliseconds.",
                    "type": "number"
                  },
                  "duration": {
                    "default": 500,
                    "description": "Animation duration in milliseconds.",
                    "type": "number"
                  },
                  "enabled": {
                    "default": true,
                    "description": "Whether the animation is enabled.",
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "enter",
                      "exit",
                      "loop"
                    ],
                    "description": "Animation phase."
                  },
                  "name": {
                    "default": "none",
                    "description": "Animation name identifier.",
                    "type": "string"
                  },
                  "data": {
                    "default": {},
                    "description": "Animation-specific data."
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "blurEnabled": {
              "default": false,
              "description": "Whether blur effect is enabled.",
              "type": "boolean"
            },
            "blurRadius": {
              "default": 10,
              "description": "Blur radius in pixels.",
              "type": "number"
            },
            "brightnessEnabled": {
              "default": false,
              "description": "Whether brightness effect is enabled.",
              "type": "boolean"
            },
            "brightness": {
              "default": 0,
              "description": "Brightness level (-1 to 1).",
              "type": "number"
            },
            "sepiaEnabled": {
              "default": false,
              "description": "Whether sepia effect is enabled.",
              "type": "boolean"
            },
            "grayscaleEnabled": {
              "default": false,
              "description": "Whether grayscale effect is enabled.",
              "type": "boolean"
            },
            "filters": {
              "default": {},
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "intensity": {
                    "default": 1,
                    "description": "Filter intensity (-1 to 1).",
                    "type": "number"
                  }
                }
              },
              "description": "Applied image filters keyed by filter name."
            },
            "shadowEnabled": {
              "default": false,
              "description": "Whether shadow is enabled.",
              "type": "boolean"
            },
            "shadowBlur": {
              "default": 5,
              "description": "Shadow blur radius in pixels.",
              "type": "number"
            },
            "shadowOffsetX": {
              "default": 0,
              "description": "Shadow horizontal offset in pixels.",
              "type": "number"
            },
            "shadowOffsetY": {
              "default": 0,
              "description": "Shadow vertical offset in pixels.",
              "type": "number"
            },
            "shadowColor": {
              "default": "black",
              "description": "Shadow color.",
              "type": "string"
            },
            "shadowOpacity": {
              "default": 1,
              "description": "Shadow opacity (0-1).",
              "type": "number"
            },
            "visible": {
              "default": true,
              "description": "Whether the element is visible.",
              "type": "boolean"
            },
            "draggable": {
              "default": true,
              "description": "Whether the element can be dragged.",
              "type": "boolean"
            },
            "resizable": {
              "default": true,
              "description": "Whether the element can be resized.",
              "type": "boolean"
            },
            "selectable": {
              "default": true,
              "description": "Whether the element can be selected.",
              "type": "boolean"
            },
            "removable": {
              "default": true,
              "description": "Whether the element can be removed.",
              "type": "boolean"
            },
            "contentEditable": {
              "default": true,
              "description": "Whether the element content can be edited.",
              "type": "boolean"
            },
            "styleEditable": {
              "default": true,
              "description": "Whether the element style can be edited.",
              "type": "boolean"
            },
            "alwaysOnTop": {
              "default": false,
              "description": "Whether the element stays on top of others.",
              "type": "boolean"
            },
            "showInExport": {
              "default": true,
              "description": "Whether the element appears in exports.",
              "type": "boolean"
            },
            "src": {
              "default": "",
              "description": "URL or data URI of the SVG.",
              "type": "string"
            },
            "maskSrc": {
              "default": "",
              "description": "URL or data URI for an SVG mask.",
              "type": "string"
            },
            "cropX": {
              "default": 0,
              "type": "number"
            },
            "cropY": {
              "default": 0,
              "type": "number"
            },
            "cropWidth": {
              "default": 1,
              "type": "number"
            },
            "cropHeight": {
              "default": 1,
              "type": "number"
            },
            "keepRatio": {
              "default": true,
              "description": "Whether to maintain aspect ratio when resizing.",
              "type": "boolean"
            },
            "stretchEnabled": {
              "default": true,
              "type": "boolean"
            },
            "flipX": {
              "default": false,
              "type": "boolean"
            },
            "flipY": {
              "default": false,
              "type": "boolean"
            },
            "borderColor": {
              "default": "black",
              "type": "string"
            },
            "borderSize": {
              "default": 0,
              "type": "number"
            },
            "cornerRadius": {
              "default": 0,
              "type": "number"
            },
            "colorsReplace": {
              "default": {},
              "description": "Color replacement mappings (original → replacement).",
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "required": [
            "id",
            "type"
          ]
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the element."
            },
            "type": {
              "type": "string",
              "const": "line"
            },
            "name": {
              "default": "",
              "description": "Display name for the element.",
              "type": "string"
            },
            "custom": {
              "description": "Custom data attached to the element."
            },
            "x": {
              "default": 0,
              "description": "X position in pixels.",
              "type": "number"
            },
            "y": {
              "default": 0,
              "description": "Y position in pixels.",
              "type": "number"
            },
            "width": {
              "default": 400,
              "type": "number"
            },
            "height": {
              "default": 10,
              "type": "number"
            },
            "rotation": {
              "default": 0,
              "description": "Rotation angle in degrees.",
              "type": "number"
            },
            "opacity": {
              "default": 1,
              "description": "Opacity level (0-1).",
              "type": "number"
            },
            "animations": {
              "default": [],
              "description": "Animation configurations.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "delay": {
                    "default": 0,
                    "description": "Delay before the animation starts, in milliseconds.",
                    "type": "number"
                  },
                  "duration": {
                    "default": 500,
                    "description": "Animation duration in milliseconds.",
                    "type": "number"
                  },
                  "enabled": {
                    "default": true,
                    "description": "Whether the animation is enabled.",
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "enter",
                      "exit",
                      "loop"
                    ],
                    "description": "Animation phase."
                  },
                  "name": {
                    "default": "none",
                    "description": "Animation name identifier.",
                    "type": "string"
                  },
                  "data": {
                    "default": {},
                    "description": "Animation-specific data."
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "blurEnabled": {
              "default": false,
              "description": "Whether blur effect is enabled.",
              "type": "boolean"
            },
            "blurRadius": {
              "default": 10,
              "description": "Blur radius in pixels.",
              "type": "number"
            },
            "brightnessEnabled": {
              "default": false,
              "description": "Whether brightness effect is enabled.",
              "type": "boolean"
            },
            "brightness": {
              "default": 0,
              "description": "Brightness level (-1 to 1).",
              "type": "number"
            },
            "sepiaEnabled": {
              "default": false,
              "description": "Whether sepia effect is enabled.",
              "type": "boolean"
            },
            "grayscaleEnabled": {
              "default": false,
              "description": "Whether grayscale effect is enabled.",
              "type": "boolean"
            },
            "filters": {
              "default": {},
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "intensity": {
                    "default": 1,
                    "description": "Filter intensity (-1 to 1).",
                    "type": "number"
                  }
                }
              },
              "description": "Applied image filters keyed by filter name."
            },
            "shadowEnabled": {
              "default": false,
              "description": "Whether shadow is enabled.",
              "type": "boolean"
            },
            "shadowBlur": {
              "default": 5,
              "description": "Shadow blur radius in pixels.",
              "type": "number"
            },
            "shadowOffsetX": {
              "default": 0,
              "description": "Shadow horizontal offset in pixels.",
              "type": "number"
            },
            "shadowOffsetY": {
              "default": 0,
              "description": "Shadow vertical offset in pixels.",
              "type": "number"
            },
            "shadowColor": {
              "default": "black",
              "description": "Shadow color.",
              "type": "string"
            },
            "shadowOpacity": {
              "default": 1,
              "description": "Shadow opacity (0-1).",
              "type": "number"
            },
            "visible": {
              "default": true,
              "description": "Whether the element is visible.",
              "type": "boolean"
            },
            "draggable": {
              "default": true,
              "description": "Whether the element can be dragged.",
              "type": "boolean"
            },
            "resizable": {
              "default": true,
              "description": "Whether the element can be resized.",
              "type": "boolean"
            },
            "selectable": {
              "default": true,
              "description": "Whether the element can be selected.",
              "type": "boolean"
            },
            "removable": {
              "default": true,
              "description": "Whether the element can be removed.",
              "type": "boolean"
            },
            "contentEditable": {
              "default": true,
              "description": "Whether the element content can be edited.",
              "type": "boolean"
            },
            "styleEditable": {
              "default": true,
              "description": "Whether the element style can be edited.",
              "type": "boolean"
            },
            "alwaysOnTop": {
              "default": false,
              "description": "Whether the element stays on top of others.",
              "type": "boolean"
            },
            "showInExport": {
              "default": true,
              "description": "Whether the element appears in exports.",
              "type": "boolean"
            },
            "color": {
              "default": "black",
              "description": "Line color.",
              "type": "string"
            },
            "dash": {
              "default": [],
              "description": "Dash pattern array.",
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "startHead": {
              "default": "",
              "description": "Start arrow head: empty, arrow, circle, square, bar.",
              "type": "string"
            },
            "endHead": {
              "default": "",
              "description": "End arrow head: empty, arrow, circle, square, bar.",
              "type": "string"
            }
          },
          "required": [
            "id",
            "type"
          ]
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the element."
            },
            "type": {
              "type": "string",
              "const": "figure"
            },
            "name": {
              "default": "",
              "description": "Display name for the element.",
              "type": "string"
            },
            "custom": {
              "description": "Custom data attached to the element."
            },
            "x": {
              "default": 0,
              "description": "X position in pixels.",
              "type": "number"
            },
            "y": {
              "default": 0,
              "description": "Y position in pixels.",
              "type": "number"
            },
            "width": {
              "default": 100,
              "description": "Width in pixels.",
              "type": "number"
            },
            "height": {
              "default": 100,
              "description": "Height in pixels.",
              "type": "number"
            },
            "rotation": {
              "default": 0,
              "description": "Rotation angle in degrees.",
              "type": "number"
            },
            "opacity": {
              "default": 1,
              "description": "Opacity level (0-1).",
              "type": "number"
            },
            "animations": {
              "default": [],
              "description": "Animation configurations.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "delay": {
                    "default": 0,
                    "description": "Delay before the animation starts, in milliseconds.",
                    "type": "number"
                  },
                  "duration": {
                    "default": 500,
                    "description": "Animation duration in milliseconds.",
                    "type": "number"
                  },
                  "enabled": {
                    "default": true,
                    "description": "Whether the animation is enabled.",
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "enter",
                      "exit",
                      "loop"
                    ],
                    "description": "Animation phase."
                  },
                  "name": {
                    "default": "none",
                    "description": "Animation name identifier.",
                    "type": "string"
                  },
                  "data": {
                    "default": {},
                    "description": "Animation-specific data."
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "blurEnabled": {
              "default": false,
              "description": "Whether blur effect is enabled.",
              "type": "boolean"
            },
            "blurRadius": {
              "default": 10,
              "description": "Blur radius in pixels.",
              "type": "number"
            },
            "brightnessEnabled": {
              "default": false,
              "description": "Whether brightness effect is enabled.",
              "type": "boolean"
            },
            "brightness": {
              "default": 0,
              "description": "Brightness level (-1 to 1).",
              "type": "number"
            },
            "sepiaEnabled": {
              "default": false,
              "description": "Whether sepia effect is enabled.",
              "type": "boolean"
            },
            "grayscaleEnabled": {
              "default": false,
              "description": "Whether grayscale effect is enabled.",
              "type": "boolean"
            },
            "filters": {
              "default": {},
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "intensity": {
                    "default": 1,
                    "description": "Filter intensity (-1 to 1).",
                    "type": "number"
                  }
                }
              },
              "description": "Applied image filters keyed by filter name."
            },
            "shadowEnabled": {
              "default": false,
              "description": "Whether shadow is enabled.",
              "type": "boolean"
            },
            "shadowBlur": {
              "default": 5,
              "description": "Shadow blur radius in pixels.",
              "type": "number"
            },
            "shadowOffsetX": {
              "default": 0,
              "description": "Shadow horizontal offset in pixels.",
              "type": "number"
            },
            "shadowOffsetY": {
              "default": 0,
              "description": "Shadow vertical offset in pixels.",
              "type": "number"
            },
            "shadowColor": {
              "default": "black",
              "description": "Shadow color.",
              "type": "string"
            },
            "shadowOpacity": {
              "default": 1,
              "description": "Shadow opacity (0-1).",
              "type": "number"
            },
            "visible": {
              "default": true,
              "description": "Whether the element is visible.",
              "type": "boolean"
            },
            "draggable": {
              "default": true,
              "description": "Whether the element can be dragged.",
              "type": "boolean"
            },
            "resizable": {
              "default": true,
              "description": "Whether the element can be resized.",
              "type": "boolean"
            },
            "selectable": {
              "default": true,
              "description": "Whether the element can be selected.",
              "type": "boolean"
            },
            "removable": {
              "default": true,
              "description": "Whether the element can be removed.",
              "type": "boolean"
            },
            "contentEditable": {
              "default": true,
              "description": "Whether the element content can be edited.",
              "type": "boolean"
            },
            "styleEditable": {
              "default": true,
              "description": "Whether the element style can be edited.",
              "type": "boolean"
            },
            "alwaysOnTop": {
              "default": false,
              "description": "Whether the element stays on top of others.",
              "type": "boolean"
            },
            "showInExport": {
              "default": true,
              "description": "Whether the element appears in exports.",
              "type": "boolean"
            },
            "subType": {
              "default": "rect",
              "description": "Figure subtype: rect, ellipse, triangle, etc.",
              "type": "string"
            },
            "fill": {
              "default": "rgb(0, 161, 255)",
              "description": "Fill color.",
              "type": "string"
            },
            "dash": {
              "default": [],
              "description": "Dash pattern array.",
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "strokeWidth": {
              "default": 0,
              "type": "number"
            },
            "stroke": {
              "default": "rgba(98, 197, 255, 1)",
              "type": "string"
            },
            "cornerRadius": {
              "default": 0,
              "type": "number"
            }
          },
          "required": [
            "id",
            "type"
          ]
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the element."
            },
            "type": {
              "type": "string",
              "const": "gif"
            },
            "name": {
              "default": "",
              "description": "Display name for the element.",
              "type": "string"
            },
            "custom": {
              "description": "Custom data attached to the element."
            },
            "x": {
              "default": 0,
              "description": "X position in pixels.",
              "type": "number"
            },
            "y": {
              "default": 0,
              "description": "Y position in pixels.",
              "type": "number"
            },
            "width": {
              "default": 100,
              "description": "Width in pixels.",
              "type": "number"
            },
            "height": {
              "default": 100,
              "description": "Height in pixels.",
              "type": "number"
            },
            "rotation": {
              "default": 0,
              "description": "Rotation angle in degrees.",
              "type": "number"
            },
            "opacity": {
              "default": 1,
              "description": "Opacity level (0-1).",
              "type": "number"
            },
            "animations": {
              "default": [],
              "description": "Animation configurations.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "delay": {
                    "default": 0,
                    "description": "Delay before the animation starts, in milliseconds.",
                    "type": "number"
                  },
                  "duration": {
                    "default": 500,
                    "description": "Animation duration in milliseconds.",
                    "type": "number"
                  },
                  "enabled": {
                    "default": true,
                    "description": "Whether the animation is enabled.",
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "enter",
                      "exit",
                      "loop"
                    ],
                    "description": "Animation phase."
                  },
                  "name": {
                    "default": "none",
                    "description": "Animation name identifier.",
                    "type": "string"
                  },
                  "data": {
                    "default": {},
                    "description": "Animation-specific data."
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "blurEnabled": {
              "default": false,
              "description": "Whether blur effect is enabled.",
              "type": "boolean"
            },
            "blurRadius": {
              "default": 10,
              "description": "Blur radius in pixels.",
              "type": "number"
            },
            "brightnessEnabled": {
              "default": false,
              "description": "Whether brightness effect is enabled.",
              "type": "boolean"
            },
            "brightness": {
              "default": 0,
              "description": "Brightness level (-1 to 1).",
              "type": "number"
            },
            "sepiaEnabled": {
              "default": false,
              "description": "Whether sepia effect is enabled.",
              "type": "boolean"
            },
            "grayscaleEnabled": {
              "default": false,
              "description": "Whether grayscale effect is enabled.",
              "type": "boolean"
            },
            "filters": {
              "default": {},
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "intensity": {
                    "default": 1,
                    "description": "Filter intensity (-1 to 1).",
                    "type": "number"
                  }
                }
              },
              "description": "Applied image filters keyed by filter name."
            },
            "shadowEnabled": {
              "default": false,
              "description": "Whether shadow is enabled.",
              "type": "boolean"
            },
            "shadowBlur": {
              "default": 5,
              "description": "Shadow blur radius in pixels.",
              "type": "number"
            },
            "shadowOffsetX": {
              "default": 0,
              "description": "Shadow horizontal offset in pixels.",
              "type": "number"
            },
            "shadowOffsetY": {
              "default": 0,
              "description": "Shadow vertical offset in pixels.",
              "type": "number"
            },
            "shadowColor": {
              "default": "black",
              "description": "Shadow color.",
              "type": "string"
            },
            "shadowOpacity": {
              "default": 1,
              "description": "Shadow opacity (0-1).",
              "type": "number"
            },
            "visible": {
              "default": true,
              "description": "Whether the element is visible.",
              "type": "boolean"
            },
            "draggable": {
              "default": true,
              "description": "Whether the element can be dragged.",
              "type": "boolean"
            },
            "resizable": {
              "default": true,
              "description": "Whether the element can be resized.",
              "type": "boolean"
            },
            "selectable": {
              "default": true,
              "description": "Whether the element can be selected.",
              "type": "boolean"
            },
            "removable": {
              "default": true,
              "description": "Whether the element can be removed.",
              "type": "boolean"
            },
            "contentEditable": {
              "default": true,
              "description": "Whether the element content can be edited.",
              "type": "boolean"
            },
            "styleEditable": {
              "default": true,
              "description": "Whether the element style can be edited.",
              "type": "boolean"
            },
            "alwaysOnTop": {
              "default": false,
              "description": "Whether the element stays on top of others.",
              "type": "boolean"
            },
            "showInExport": {
              "default": true,
              "description": "Whether the element appears in exports.",
              "type": "boolean"
            },
            "src": {
              "default": "",
              "description": "URL or data URI of the image file.",
              "type": "string"
            },
            "cropX": {
              "default": 0,
              "description": "Crop X offset as a fraction (0-1).",
              "type": "number"
            },
            "cropY": {
              "default": 0,
              "description": "Crop Y offset as a fraction (0-1).",
              "type": "number"
            },
            "cropWidth": {
              "default": 1,
              "description": "Crop width as a fraction (0-1).",
              "type": "number"
            },
            "cropHeight": {
              "default": 1,
              "description": "Crop height as a fraction (0-1).",
              "type": "number"
            },
            "cornerRadius": {
              "default": 0,
              "description": "Corner radius in pixels.",
              "type": "number"
            },
            "flipX": {
              "default": false,
              "description": "Whether the image is flipped horizontally.",
              "type": "boolean"
            },
            "flipY": {
              "default": false,
              "description": "Whether the image is flipped vertically.",
              "type": "boolean"
            },
            "clipSrc": {
              "default": "",
              "description": "URL or data URI for a clipping mask.",
              "type": "string"
            },
            "borderColor": {
              "default": "black",
              "description": "Border color.",
              "type": "string"
            },
            "borderSize": {
              "default": 0,
              "description": "Border width in pixels.",
              "type": "number"
            },
            "keepRatio": {
              "default": true,
              "type": "boolean"
            },
            "stretchEnabled": {
              "default": false,
              "description": "Whether stretch mode is enabled.",
              "type": "boolean"
            },
            "duration": {
              "default": 0,
              "description": "GIF duration in milliseconds.",
              "type": "number"
            }
          },
          "required": [
            "id",
            "type"
          ]
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the element."
            },
            "type": {
              "type": "string",
              "const": "video"
            },
            "name": {
              "default": "",
              "description": "Display name for the element.",
              "type": "string"
            },
            "custom": {
              "description": "Custom data attached to the element."
            },
            "x": {
              "default": 0,
              "description": "X position in pixels.",
              "type": "number"
            },
            "y": {
              "default": 0,
              "description": "Y position in pixels.",
              "type": "number"
            },
            "width": {
              "default": 100,
              "description": "Width in pixels.",
              "type": "number"
            },
            "height": {
              "default": 100,
              "description": "Height in pixels.",
              "type": "number"
            },
            "rotation": {
              "default": 0,
              "description": "Rotation angle in degrees.",
              "type": "number"
            },
            "opacity": {
              "default": 1,
              "description": "Opacity level (0-1).",
              "type": "number"
            },
            "animations": {
              "default": [],
              "description": "Animation configurations.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "delay": {
                    "default": 0,
                    "description": "Delay before the animation starts, in milliseconds.",
                    "type": "number"
                  },
                  "duration": {
                    "default": 500,
                    "description": "Animation duration in milliseconds.",
                    "type": "number"
                  },
                  "enabled": {
                    "default": true,
                    "description": "Whether the animation is enabled.",
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "enter",
                      "exit",
                      "loop"
                    ],
                    "description": "Animation phase."
                  },
                  "name": {
                    "default": "none",
                    "description": "Animation name identifier.",
                    "type": "string"
                  },
                  "data": {
                    "default": {},
                    "description": "Animation-specific data."
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "blurEnabled": {
              "default": false,
              "description": "Whether blur effect is enabled.",
              "type": "boolean"
            },
            "blurRadius": {
              "default": 10,
              "description": "Blur radius in pixels.",
              "type": "number"
            },
            "brightnessEnabled": {
              "default": false,
              "description": "Whether brightness effect is enabled.",
              "type": "boolean"
            },
            "brightness": {
              "default": 0,
              "description": "Brightness level (-1 to 1).",
              "type": "number"
            },
            "sepiaEnabled": {
              "default": false,
              "description": "Whether sepia effect is enabled.",
              "type": "boolean"
            },
            "grayscaleEnabled": {
              "default": false,
              "description": "Whether grayscale effect is enabled.",
              "type": "boolean"
            },
            "filters": {
              "default": {},
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "properties": {
                  "intensity": {
                    "default": 1,
                    "description": "Filter intensity (-1 to 1).",
                    "type": "number"
                  }
                }
              },
              "description": "Applied image filters keyed by filter name."
            },
            "shadowEnabled": {
              "default": false,
              "description": "Whether shadow is enabled.",
              "type": "boolean"
            },
            "shadowBlur": {
              "default": 5,
              "description": "Shadow blur radius in pixels.",
              "type": "number"
            },
            "shadowOffsetX": {
              "default": 0,
              "description": "Shadow horizontal offset in pixels.",
              "type": "number"
            },
            "shadowOffsetY": {
              "default": 0,
              "description": "Shadow vertical offset in pixels.",
              "type": "number"
            },
            "shadowColor": {
              "default": "black",
              "description": "Shadow color.",
              "type": "string"
            },
            "shadowOpacity": {
              "default": 1,
              "description": "Shadow opacity (0-1).",
              "type": "number"
            },
            "visible": {
              "default": true,
              "description": "Whether the element is visible.",
              "type": "boolean"
            },
            "draggable": {
              "default": true,
              "description": "Whether the element can be dragged.",
              "type": "boolean"
            },
            "resizable": {
              "default": true,
              "description": "Whether the element can be resized.",
              "type": "boolean"
            },
            "selectable": {
              "default": true,
              "description": "Whether the element can be selected.",
              "type": "boolean"
            },
            "removable": {
              "default": true,
              "description": "Whether the element can be removed.",
              "type": "boolean"
            },
            "contentEditable": {
              "default": true,
              "description": "Whether the element content can be edited.",
              "type": "boolean"
            },
            "styleEditable": {
              "default": true,
              "description": "Whether the element style can be edited.",
              "type": "boolean"
            },
            "alwaysOnTop": {
              "default": false,
              "description": "Whether the element stays on top of others.",
              "type": "boolean"
            },
            "showInExport": {
              "default": true,
              "description": "Whether the element appears in exports.",
              "type": "boolean"
            },
            "src": {
              "default": "",
              "description": "URL or data URI of the image file.",
              "type": "string"
            },
            "cropX": {
              "default": 0,
              "description": "Crop X offset as a fraction (0-1).",
              "type": "number"
            },
            "cropY": {
              "default": 0,
              "description": "Crop Y offset as a fraction (0-1).",
              "type": "number"
            },
            "cropWidth": {
              "default": 1,
              "description": "Crop width as a fraction (0-1).",
              "type": "number"
            },
            "cropHeight": {
              "default": 1,
              "description": "Crop height as a fraction (0-1).",
              "type": "number"
            },
            "cornerRadius": {
              "default": 0,
              "description": "Corner radius in pixels.",
              "type": "number"
            },
            "flipX": {
              "default": false,
              "description": "Whether the image is flipped horizontally.",
              "type": "boolean"
            },
            "flipY": {
              "default": false,
              "description": "Whether the image is flipped vertically.",
              "type": "boolean"
            },
            "clipSrc": {
              "default": "",
              "description": "URL or data URI for a clipping mask.",
              "type": "string"
            },
            "borderColor": {
              "default": "black",
              "description": "Border color.",
              "type": "string"
            },
            "borderSize": {
              "default": 0,
              "description": "Border width in pixels.",
              "type": "number"
            },
            "keepRatio": {
              "default": false,
              "description": "Whether to maintain aspect ratio when resizing.",
              "type": "boolean"
            },
            "stretchEnabled": {
              "default": false,
              "description": "Whether stretch mode is enabled.",
              "type": "boolean"
            },
            "duration": {
              "default": 0,
              "description": "Video duration in milliseconds.",
              "type": "number"
            },
            "startTime": {
              "default": 0,
              "description": "Start offset (0-1).",
              "type": "number"
            },
            "endTime": {
              "default": 1,
              "description": "End offset (0-1).",
              "type": "number"
            },
            "volume": {
              "default": 1,
              "description": "Volume (0-1).",
              "type": "number"
            },
            "speed": {
              "default": 1,
              "description": "Playback speed multiplier (1 = normal).",
              "type": "number"
            }
          },
          "required": [
            "id",
            "type"
          ]
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the element."
            },
            "type": {
              "type": "string",
              "const": "table",
              "description": "Element type identifier."
            },
            "name": {
              "default": "",
              "description": "Display name for the element.",
              "type": "string"
            },
            "custom": {
              "description": "Custom data attached to the element."
            },
            "x": {
              "default": 0,
              "description": "X position in pixels.",
              "type": "number"
            },
            "y": {
              "default": 0,
              "description": "Y position in pixels.",
              "type": "number"
            },
            "width": {
              "default": 300,
              "description": "Width in pixels.",
              "type": "number"
            },
            "height": {
              "default": 200,
              "description": "Height in pixels.",
              "type": "number"
            },
            "rotation": {
              "default": 0,
              "description": "Rotation angle in degrees.",
              "type": "number"
            },
            "opacity": {
              "default": 1,
              "description": "Opacity level (0-1).",
              "type": "number"
            },
            "animations": {
              "default": [],
              "description": "Animation configurations.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "delay": {
                    "default": 0,
                    "description": "Delay before the animation starts, in milliseconds.",
                    "type": "number"
                  },
                  "duration": {
                    "default": 500,
                    "description": "Animation duration in milliseconds.",
                    "type": "number"
                  },
                  "enabled": {
                    "default": true,
                    "description": "Whether the animation is enabled.",
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "enter",
                      "exit",
                      "loop"
                    ],
                    "description": "Animation phase."
                  },
                  "name": {
                    "default": "none",
                    "description": "Animation name identifier.",
                    "type": "string"
                  },
                  "data": {
                    "default": {},
                    "description": "Animation-specific data."
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "visible": {
              "default": true,
              "description": "Whether the element is visible.",
              "type": "boolean"
            },
            "draggable": {
              "default": true,
              "description": "Whether the element can be dragged.",
              "type": "boolean"
            },
            "resizable": {
              "default": true,
              "description": "Whether the element can be resized.",
              "type": "boolean"
            },
            "selectable": {
              "default": true,
              "description": "Whether the element can be selected.",
              "type": "boolean"
            },
            "removable": {
              "default": true,
              "description": "Whether the element can be removed.",
              "type": "boolean"
            },
            "contentEditable": {
              "default": true,
              "description": "Whether the element content can be edited.",
              "type": "boolean"
            },
            "styleEditable": {
              "default": true,
              "description": "Whether the element style can be edited.",
              "type": "boolean"
            },
            "alwaysOnTop": {
              "default": false,
              "description": "Whether the element stays on top of others.",
              "type": "boolean"
            },
            "showInExport": {
              "default": true,
              "description": "Whether the element appears in exports.",
              "type": "boolean"
            },
            "rows": {
              "default": 3,
              "description": "Number of rows.",
              "type": "number"
            },
            "cols": {
              "default": 3,
              "description": "Number of columns.",
              "type": "number"
            },
            "colWidths": {
              "default": [],
              "description": "Column width fractions (sum to 1).",
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "rowHeights": {
              "default": [],
              "description": "Row height fractions (sum to 1).",
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "cells": {
              "default": [],
              "description": "Flat cell array in row-major order.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Unique identifier for the cell."
                  },
                  "type": {
                    "default": "tablecell",
                    "description": "Cell type identifier.",
                    "type": "string",
                    "const": "tablecell"
                  },
                  "text": {
                    "default": "",
                    "description": "Visible text shown in the cell.",
                    "type": "string"
                  },
                  "opacity": {
                    "description": "Opacity level (0-1).",
                    "type": "number"
                  },
                  "rowSpan": {
                    "description": "Number of rows this cell spans.",
                    "type": "number"
                  },
                  "colSpan": {
                    "description": "Number of columns this cell spans.",
                    "type": "number"
                  },
                  "mergedInto": {
                    "description": "Id of the cell this one is merged into, if any.",
                    "type": "string"
                  },
                  "name": {
                    "description": "Display name for the cell.",
                    "type": "string"
                  },
                  "custom": {
                    "description": "Custom data attached to the cell."
                  },
                  "borders": {
                    "description": "Per-side border overrides for this cell.",
                    "type": "object",
                    "properties": {
                      "top": {
                        "description": "Top border override for this cell.",
                        "type": "object",
                        "properties": {
                          "color": {
                            "description": "Border color for this side.",
                            "type": "string"
                          },
                          "width": {
                            "description": "Border width in pixels for this side.",
                            "type": "number"
                          },
                          "style": {
                            "description": "Border style for this side.",
                            "type": "string",
                            "enum": [
                              "solid",
                              "dashed",
                              "dotted",
                              "none"
                            ]
                          }
                        }
                      },
                      "right": {
                        "description": "Right border override for this cell.",
                        "type": "object",
                        "properties": {
                          "color": {
                            "description": "Border color for this side.",
                            "type": "string"
                          },
                          "width": {
                            "description": "Border width in pixels for this side.",
                            "type": "number"
                          },
                          "style": {
                            "description": "Border style for this side.",
                            "type": "string",
                            "enum": [
                              "solid",
                              "dashed",
                              "dotted",
                              "none"
                            ]
                          }
                        }
                      },
                      "bottom": {
                        "description": "Bottom border override for this cell.",
                        "type": "object",
                        "properties": {
                          "color": {
                            "description": "Border color for this side.",
                            "type": "string"
                          },
                          "width": {
                            "description": "Border width in pixels for this side.",
                            "type": "number"
                          },
                          "style": {
                            "description": "Border style for this side.",
                            "type": "string",
                            "enum": [
                              "solid",
                              "dashed",
                              "dotted",
                              "none"
                            ]
                          }
                        }
                      },
                      "left": {
                        "description": "Left border override for this cell.",
                        "type": "object",
                        "properties": {
                          "color": {
                            "description": "Border color for this side.",
                            "type": "string"
                          },
                          "width": {
                            "description": "Border width in pixels for this side.",
                            "type": "number"
                          },
                          "style": {
                            "description": "Border style for this side.",
                            "type": "string",
                            "enum": [
                              "solid",
                              "dashed",
                              "dotted",
                              "none"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "fontSize": {
                    "description": "Font size in pixels (inherits from the table when omitted, minimum 1).",
                    "type": "number"
                  },
                  "fontFamily": {
                    "description": "Font family name (inherits from the table when omitted).",
                    "type": "string"
                  },
                  "fontWeight": {
                    "description": "Font weight: 'normal', 'bold', or numeric string (inherits from the table when omitted).",
                    "type": "string"
                  },
                  "fontStyle": {
                    "description": "Font style: 'normal' or 'italic' (inherits from the table when omitted).",
                    "type": "string"
                  },
                  "textDecoration": {
                    "description": "Text decoration, e.g. underline, line-through (inherits from the table when omitted).",
                    "type": "string"
                  },
                  "textTransform": {
                    "description": "Text transform: uppercase, lowercase, capitalize, none (inherits from the table when omitted).",
                    "type": "string"
                  },
                  "fill": {
                    "description": "Text color (inherits from the table when omitted).",
                    "type": "string"
                  },
                  "align": {
                    "description": "Horizontal alignment: left, center, right, justify (inherits from the table when omitted).",
                    "type": "string"
                  },
                  "verticalAlign": {
                    "description": "Vertical alignment: top, middle, bottom (inherits from the table when omitted).",
                    "type": "string"
                  },
                  "lineHeight": {
                    "description": "Line height multiplier or 'auto' (inherits from the table when omitted).",
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "letterSpacing": {
                    "description": "Letter spacing as a fraction of font size (inherits from the table when omitted).",
                    "type": "number"
                  },
                  "strokeWidth": {
                    "description": "Stroke width in pixels (inherits from the table when omitted).",
                    "type": "number"
                  },
                  "stroke": {
                    "description": "Stroke color (inherits from the table when omitted).",
                    "type": "string"
                  },
                  "cellBackground": {
                    "description": "Cell background color (inherits from the table when omitted).",
                    "type": "string"
                  },
                  "cellPadding": {
                    "description": "Cell padding in pixels (inherits from the table when omitted).",
                    "type": "number"
                  }
                },
                "required": [
                  "id"
                ]
              }
            },
            "borderColor": {
              "default": "#000000",
              "description": "Default border color for the table grid.",
              "type": "string"
            },
            "borderWidth": {
              "default": 1,
              "description": "Default border width in pixels.",
              "type": "number"
            },
            "borderStyle": {
              "default": "solid",
              "description": "Default border style.",
              "type": "string",
              "enum": [
                "solid",
                "dashed",
                "dotted",
                "none"
              ]
            },
            "fontSize": {
              "default": 30,
              "description": "Default font size in pixels for cells (minimum 1).",
              "type": "number"
            },
            "fontFamily": {
              "default": "Roboto",
              "description": "Default font family name for cells.",
              "type": "string"
            },
            "fontWeight": {
              "default": "normal",
              "description": "Default font weight: 'normal', 'bold', or numeric string.",
              "type": "string"
            },
            "fontStyle": {
              "default": "normal",
              "description": "Default font style: 'normal' or 'italic'.",
              "type": "string"
            },
            "textDecoration": {
              "default": "",
              "description": "Default text decoration (e.g. underline, line-through).",
              "type": "string"
            },
            "textTransform": {
              "default": "none",
              "description": "Default text transform: uppercase, lowercase, capitalize, none.",
              "type": "string"
            },
            "fill": {
              "default": "black",
              "description": "Default text color for cells.",
              "type": "string"
            },
            "align": {
              "default": "center",
              "description": "Default horizontal alignment: left, center, right, justify.",
              "type": "string"
            },
            "verticalAlign": {
              "default": "middle",
              "description": "Default vertical alignment: top, middle, bottom.",
              "type": "string"
            },
            "lineHeight": {
              "default": 1.2,
              "description": "Default line height multiplier or 'auto'.",
              "type": [
                "number",
                "string"
              ]
            },
            "letterSpacing": {
              "default": 0,
              "description": "Default letter spacing as a fraction of font size.",
              "type": "number"
            },
            "strokeWidth": {
              "default": 0,
              "description": "Default stroke width in pixels.",
              "type": "number"
            },
            "stroke": {
              "default": "black",
              "description": "Default stroke color.",
              "type": "string"
            },
            "cellBackground": {
              "default": "transparent",
              "description": "Default cell background color.",
              "type": "string"
            },
            "cellPadding": {
              "default": 4,
              "description": "Default cell padding in pixels.",
              "type": "number"
            }
          },
          "required": [
            "id",
            "type"
          ]
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "const": "group"
            },
            "name": {
              "default": "",
              "type": "string"
            },
            "custom": {},
            "opacity": {
              "default": 1,
              "type": "number"
            },
            "visible": {
              "default": true,
              "type": "boolean"
            },
            "selectable": {
              "default": true,
              "type": "boolean"
            },
            "removable": {
              "default": true,
              "type": "boolean"
            },
            "alwaysOnTop": {
              "default": false,
              "type": "boolean"
            },
            "showInExport": {
              "default": true,
              "type": "boolean"
            },
            "animations": {
              "default": [],
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "delay": {
                    "default": 0,
                    "description": "Delay before the animation starts, in milliseconds.",
                    "type": "number"
                  },
                  "duration": {
                    "default": 500,
                    "description": "Animation duration in milliseconds.",
                    "type": "number"
                  },
                  "enabled": {
                    "default": true,
                    "description": "Whether the animation is enabled.",
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "enter",
                      "exit",
                      "loop"
                    ],
                    "description": "Animation phase."
                  },
                  "name": {
                    "default": "none",
                    "description": "Animation name identifier.",
                    "type": "string"
                  },
                  "data": {
                    "default": {},
                    "description": "Animation-specific data."
                  }
                },
                "required": [
                  "type"
                ]
              }
            },
            "children": {
              "default": [],
              "description": "Child elements in this group.",
              "type": "array",
              "items": {
                "$ref": "#/$defs/__schema0"
              }
            }
          },
          "required": [
            "id",
            "type"
          ]
        }
      ]
    }
  },
  "$id": "https://schema.polotno.com/v1/design.schema.json",
  "title": "Polotno Design"
}
