"use client"; import "./globals.css"; import "@copilotkit/react-core/v2/styles.css"; import { CopilotKit } from "@copilotkit/react-core/v2"; import { ThemeProvider } from "@/hooks/use-theme"; // A2UI catalog: definitions + renderers in ./declarative-generative-ui/ import { demonstrationCatalog } from "./declarative-generative-ui/renderers"; export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode }>) { return ( CopilotKit {/* Set the theme class BEFORE first paint to avoid a white→dark flash. ThemeProvider applies the theme in a useEffect (post-hydration), so without this the page paints unthemed (light) first, then flips. This blocking inline script matches ThemeProvider's "system" default so there's no flash and no class mismatch when the provider re-applies. */}