---
title: "Side Nav Shell · UI SDK — StyleX Blocks"
description: "Left-rail application shell pairing a full-height collapsible sidebar (workspace switcher, quick actions, grouped route navigation, collapsible pinned collections with row menus, and user footer menu) with a mobile drawer fallback and interactive creative workspace views."
url: "https://stylexblocks.com/block/ui-sdk/shell-side-nav/"
agent:
  instructions: "Use this search API to find relevant components and blocks across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://stylexblocks.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Side Nav Shell block

Left-rail application shell pairing a full-height collapsible sidebar (workspace switcher, quick actions, grouped route navigation, collapsible pinned collections with row menus, and user footer menu) with a mobile drawer fallback and interactive creative workspace views.

- Behavior engine: UI SDK
- Category: [App shells](https://stylexblocks.com/blocks/app-shells.md)
- Built with: [Alert Dialog](https://stylexblocks.com/components/ui-sdk/alert-dialog.md), [App Shell](https://stylexblocks.com/components/ui-sdk/app-shell.md), [Avatar](https://stylexblocks.com/components/ui-sdk/avatar.md), [Badge](https://stylexblocks.com/components/ui-sdk/badge.md), [Button](https://stylexblocks.com/components/ui-sdk/button.md), [Card](https://stylexblocks.com/components/ui-sdk/card.md), [Code](https://stylexblocks.com/components/ui-sdk/code.md), [Collapsible](https://stylexblocks.com/components/ui-sdk/collapsible.md), [Color Swatch](https://stylexblocks.com/components/ui-sdk/color-swatch.md), [Dialog](https://stylexblocks.com/components/ui-sdk/dialog.md), [Drawer](https://stylexblocks.com/components/ui-sdk/drawer.md), [Grid](https://stylexblocks.com/components/ui-sdk/grid.md), [Heading](https://stylexblocks.com/components/ui-sdk/heading.md), [Icon](https://stylexblocks.com/components/ui-sdk/icon.md), [Icon Button](https://stylexblocks.com/components/ui-sdk/icon-button.md), [Input](https://stylexblocks.com/components/ui-sdk/input.md), [Kbd](https://stylexblocks.com/components/ui-sdk/kbd.md), [Menu](https://stylexblocks.com/components/ui-sdk/menu.md), [Progress](https://stylexblocks.com/components/ui-sdk/progress.md), [Separator](https://stylexblocks.com/components/ui-sdk/separator.md), [Sidebar](https://stylexblocks.com/components/ui-sdk/sidebar.md), [Sidebar Nav Item](https://stylexblocks.com/components/ui-sdk/sidebar-nav-item.md), [Stack](https://stylexblocks.com/components/ui-sdk/stack.md), [Stat](https://stylexblocks.com/components/ui-sdk/stat.md), [Status](https://stylexblocks.com/components/ui-sdk/status.md), [Switch](https://stylexblocks.com/components/ui-sdk/switch.md), [Table](https://stylexblocks.com/components/ui-sdk/table.md), [Text](https://stylexblocks.com/components/ui-sdk/text.md), [Toast](https://stylexblocks.com/components/ui-sdk/toast.md)
- HTML page: https://stylexblocks.com/block/ui-sdk/shell-side-nav/

## Install

Configure the project once (sets the behavior engine and import aliases):

```sh
npx stylexblocks init --style ui-sdk
```

Then add the item as source you own:

```sh
npx stylexblocks add shell-side-nav
```

Equivalent: `npx shadcn add @stylexblocks/shell-side-nav`. Registry item JSON: https://stylexblocks.com/r/ui-sdk/shell-side-nav.json

## Usage

```tsx
import { ShellSideNav } from "#components/blocks/ui-sdk/shell-side-nav.tsx";

export function Example() {
  return (
    <div style={{ height: "100dvh" }}>
      <ShellSideNav />
    </div>
  );
}
```

## Source

`components/blocks/ui-sdk/shell-side-nav.tsx`

```tsx
import * as stylex from "@stylexjs/stylex";
import { useCallback, useEffect, useMemo, useState } from "react";
import { AlertDialog } from "#components/ui/ui-sdk/alert-dialog.tsx";
import { AppShell } from "#components/ui/ui-sdk/app-shell.tsx";
import { Avatar } from "#components/ui/ui-sdk/avatar.tsx";
import { Badge } from "#components/ui/ui-sdk/badge.tsx";
import { Button } from "#components/ui/ui-sdk/button.tsx";
import { Card } from "#components/ui/ui-sdk/card.tsx";
import { Code } from "#components/ui/ui-sdk/code.tsx";
import { Collapsible } from "#components/ui/ui-sdk/collapsible.tsx";
import { ColorSwatch } from "#components/ui/ui-sdk/color-swatch.tsx";
import { Dialog } from "#components/ui/ui-sdk/dialog.tsx";
import { Drawer } from "#components/ui/ui-sdk/drawer.tsx";
import { Grid } from "#components/ui/ui-sdk/grid.tsx";
import { Heading } from "#components/ui/ui-sdk/heading.tsx";
import { Icon } from "#components/ui/ui-sdk/icon.tsx";
import { IconButton } from "#components/ui/ui-sdk/icon-button.tsx";
import { Input } from "#components/ui/ui-sdk/input.tsx";
import { Kbd } from "#components/ui/ui-sdk/kbd.tsx";
import { Menu } from "#components/ui/ui-sdk/menu.tsx";
import { Progress } from "#components/ui/ui-sdk/progress.tsx";
import { Separator } from "#components/ui/ui-sdk/separator.tsx";
import { Sidebar } from "#components/ui/ui-sdk/sidebar.tsx";
import {
  SidebarNavItem,
  sidebarNavItemActive,
} from "#components/ui/ui-sdk/sidebar-nav-item.tsx";
import { HStack, VStack } from "#components/ui/ui-sdk/stack.tsx";
import { Stat } from "#components/ui/ui-sdk/stat.tsx";
import { Status } from "#components/ui/ui-sdk/status.tsx";
import { Switch } from "#components/ui/ui-sdk/switch.tsx";
import { Table } from "#components/ui/ui-sdk/table.tsx";
import { Text } from "#components/ui/ui-sdk/text.tsx";
import { Toast, Toaster } from "#components/ui/ui-sdk/toast.tsx";
import { semanticColors } from "@stylexblocks/ui/semantic-tokens/colors.stylex.ts";
import { semanticRadii } from "@stylexblocks/ui/semantic-tokens/radii.stylex.ts";
import {
  accentPalette,
  amberPalette,
  bluePalette,
  greenPalette,
  redPalette,
  violetPalette,
} from "@stylexblocks/ui/themes/palettes.ts";
import { fontSizes } from "@stylexblocks/ui/tokens/font-sizes.stylex.ts";
import { fontWeights } from "@stylexblocks/ui/tokens/font-weights.stylex.ts";
import { fonts } from "@stylexblocks/ui/tokens/fonts.stylex.ts";
import { lineHeights } from "@stylexblocks/ui/tokens/line-heights.stylex.ts";
import { sizes } from "@stylexblocks/ui/tokens/sizes.stylex.ts";
import { spacing } from "@stylexblocks/ui/tokens/spacing.stylex.ts";
import type { StyleOverrideProps } from "#lib/recipe-props.ts";

export type ShellSideNavRoute =
  | "projects"
  | "reviews"
  | "releases"
  | "brand-kit"
  | "members"
  | "billing";

interface StudioWorkspace {
  id: string;
  name: string;
  tier: string;
  season: string;
  storageUsed: string;
  assetCount: string;
  palette: "accent" | "violet" | "green";
}

interface CreativeProject {
  id: string;
  workspaceId: string;
  name: string;
  collection: string;
  stage: "active" | "in-review" | "draft" | "blocked";
  assets: number;
  readiness: number;
  owner: string;
  ownerInitials: string;
  updatedAt: string;
  pinned: boolean;
}

interface ReviewItem {
  id: string;
  assetName: string;
  projectName: string;
  format: string;
  version: string;
  reviewer: string;
  reviewerInitials: string;
  note: string;
  status: "pending" | "changes" | "approved";
  submittedAt: string;
}

interface ReleaseBundle {
  id: string;
  version: string;
  title: string;
  channel: "Web" | "Retail" | "Social" | "Print";
  assetCount: number;
  publishedBy: string;
  status: "published" | "scheduled";
  publishedAt: string;
}

interface MemberItem {
  id: string;
  name: string;
  email: string;
  initials: string;
  role: "Admin" | "Editor" | "Reviewer";
  status: "active" | "invited";
  lastActive: string;
}

interface BrandColorToken {
  id: string;
  name: string;
  token: string;
  hex: string;
  usage: string;
  swatchKey:
    | "terracotta"
    | "obsidian"
    | "linen"
    | "sage"
    | "cobalt"
    | "ochre";
}

const NARROW = "@container shell-side-nav (max-width: 768px)";
const COMPACT = "@container shell-side-nav (max-width: 560px)";
const MEDIUM = "@container shell-side-nav (max-width: 1024px)";

const WORKSPACES: StudioWorkspace[] = [
  {
    id: "looma-core",
    name: "Looma Core",
    tier: "Studio Pro",
    season: "Q4 Campaigns",
    storageUsed: "1.42 TB",
    assetCount: "1,284",
    palette: "accent",
  },
  {
    id: "solstice-26",
    name: "Solstice '26",
    tier: "Client Space",
    season: "Spring Launch",
    storageUsed: "640 GB",
    assetCount: "518",
    palette: "violet",
  },
  {
    id: "editorial-lab",
    name: "Editorial Lab",
    tier: "Archive & R&D",
    season: "Evergreen",
    storageUsed: "310 GB",
    assetCount: "296",
    palette: "green",
  },
];

const INITIAL_PROJECTS: CreativeProject[] = [
  {
    id: "proj-1",
    workspaceId: "looma-core",
    name: "Autumn Lookbook",
    collection: "Editorial",
    stage: "active",
    assets: 148,
    readiness: 86,
    owner: "Mina Castillo",
    ownerInitials: "MC",
    updatedAt: "18m ago",
    pinned: true,
  },
  {
    id: "proj-2",
    workspaceId: "looma-core",
    name: "Packaging System v3",
    collection: "Print & 3D",
    stage: "in-review",
    assets: 94,
    readiness: 72,
    owner: "Soren Lind",
    ownerInitials: "SL",
    updatedAt: "1h ago",
    pinned: true,
  },
  {
    id: "proj-3",
    workspaceId: "looma-core",
    name: "Motion Reels · Social",
    collection: "Video",
    stage: "active",
    assets: 62,
    readiness: 91,
    owner: "Priya Nair",
    ownerInitials: "PN",
    updatedAt: "3h ago",
    pinned: true,
  },
  {
    id: "proj-4",
    workspaceId: "looma-core",
    name: "Retail Signage Kit",
    collection: "Environmental",
    stage: "blocked",
    assets: 37,
    readiness: 44,
    owner: "Darius Cole",
    ownerInitials: "DC",
    updatedAt: "Yesterday",
    pinned: true,
  },
  {
    id: "proj-5",
    workspaceId: "solstice-26",
    name: "Solstice Hero Stills",
    collection: "Photography",
    stage: "in-review",
    assets: 215,
    readiness: 78,
    owner: "Mina Castillo",
    ownerInitials: "MC",
    updatedAt: "4h ago",
    pinned: false,
  },
  {
    id: "proj-6",
    workspaceId: "editorial-lab",
    name: "Type Specimen Posters",
    collection: "Typography",
    stage: "draft",
    assets: 28,
    readiness: 35,
    owner: "Hana Okafor",
    ownerInitials: "HO",
    updatedAt: "2d ago",
    pinned: false,
  },
];

const INITIAL_REVIEWS: ReviewItem[] = [
  {
    id: "rev-1",
    assetName: "hero-key-visual-master.tif",
    projectName: "Autumn Lookbook",
    format: "TIFF · 64MP CMYK",
    version: "v3.2",
    reviewer: "Soren Lind",
    reviewerInitials: "SL",
    note: "Check shadow lift on warm linen backdrop before sign-off.",
    status: "pending",
    submittedAt: "24m ago",
  },
  {
    id: "rev-2",
    assetName: "carton-dieline-outer-box.ai",
    projectName: "Packaging System v3",
    format: "AI + PDF/X-4",
    version: "v2.4",
    reviewer: "Darius Cole",
    reviewerInitials: "DC",
    note: "Bleed margin on left flap needs an extra 2mm for foil stamping.",
    status: "changes",
    submittedAt: "2h ago",
  },
  {
    id: "rev-3",
    assetName: "launch-teaser-cut-15s.mov",
    projectName: "Motion Reels · Social",
    format: "4K ProRes · 9:16",
    version: "v4.0",
    reviewer: "Priya Nair",
    reviewerInitials: "PN",
    note: "Audio ducking and end-card lockup match brand timing guidelines.",
    status: "approved",
    submittedAt: "5h ago",
  },
  {
    id: "rev-4",
    assetName: "storefront-vinyl-banner.pdf",
    projectName: "Retail Signage Kit",
    format: "PDF · 300 DPI",
    version: "v1.6",
    reviewer: "Hana Okafor",
    reviewerInitials: "HO",
    note: "Awaiting final store window measurements from flagship team.",
    status: "pending",
    submittedAt: "Yesterday",
  },
];

const INITIAL_RELEASES: ReleaseBundle[] = [
  {
    id: "rel-1",
    version: "bundle-2.14",
    title: "Autumn Lookbook — Web & Press Delivery",
    channel: "Web",
    assetCount: 84,
    publishedBy: "Mina Castillo",
    status: "published",
    publishedAt: "Today · 11:20",
  },
  {
    id: "rel-2",
    version: "bundle-2.13",
    title: "Paid Social Vertical Cuts (Wave 1)",
    channel: "Social",
    assetCount: 36,
    publishedBy: "Priya Nair",
    status: "published",
    publishedAt: "Yesterday",
  },
  {
    id: "rel-3",
    version: "bundle-2.12",
    title: "Flagship Window Graphics & Look Cards",
    channel: "Retail",
    assetCount: 52,
    publishedBy: "Darius Cole",
    status: "scheduled",
    publishedAt: "Dec 5 · 09:00",
  },
  {
    id: "rel-4",
    version: "bundle-2.11",
    title: "Wholesale Catalog Print Masters",
    channel: "Print",
    assetCount: 118,
    publishedBy: "Soren Lind",
    status: "published",
    publishedAt: "Nov 26",
  },
];

const BRAND_COLORS: BrandColorToken[] = [
  {
    id: "clr-1",
    name: "Studio Terracotta",
    token: "--brand-primary",
    hex: "#C85A32",
    usage: "Primary accent & editorial callouts",
    swatchKey: "terracotta",
  },
  {
    id: "clr-2",
    name: "Obsidian Ink",
    token: "--brand-ink",
    hex: "#1B1B1F",
    usage: "Display headlines & packaging marks",
    swatchKey: "obsidian",
  },
  {
    id: "clr-3",
    name: "Warm Linen",
    token: "--brand-canvas",
    hex: "#F4EFE6",
    usage: "Lookbook backdrops & print stock",
    swatchKey: "linen",
  },
  {
    id: "clr-4",
    name: "Sage Leaf",
    token: "--brand-secondary",
    hex: "#5E7C68",
    usage: "Botanical series & packaging seals",
    swatchKey: "sage",
  },
  {
    id: "clr-5",
    name: "Cobalt Signal",
    token: "--brand-highlight",
    hex: "#2F5CE0",
    usage: "Digital interactive states & badges",
    swatchKey: "cobalt",
  },
  {
    id: "clr-6",
    name: "Ochre Brass",
    token: "--brand-warm",
    hex: "#D49B35",
    usage: "Foil accents & limited edition stamps",
    swatchKey: "ochre",
  },
];

const INITIAL_MEMBERS: MemberItem[] = [
  {
    id: "mem-1",
    name: "Mina Castillo",
    email: "mina@looma.studio",
    initials: "MC",
    role: "Admin",
    status: "active",
    lastActive: "Online now",
  },
  {
    id: "mem-2",
    name: "Soren Lind",
    email: "soren@looma.studio",
    initials: "SL",
    role: "Editor",
    status: "active",
    lastActive: "12m ago",
  },
  {
    id: "mem-3",
    name: "Priya Nair",
    email: "priya@looma.studio",
    initials: "PN",
    role: "Editor",
    status: "active",
    lastActive: "42m ago",
  },
  {
    id: "mem-4",
    name: "Darius Cole",
    email: "darius@looma.studio",
    initials: "DC",
    role: "Reviewer",
    status: "active",
    lastActive: "3h ago",
  },
  {
    id: "mem-5",
    name: "Hana Okafor",
    email: "hana@looma.studio",
    initials: "HO",
    role: "Reviewer",
    status: "invited",
    lastActive: "Invite sent 1d ago",
  },
];

const BILLING_QUOTAS = [
  { label: "Asset Storage", used: "1.42 TB", limit: "2.00 TB", percent: 71 },
  {
    label: "Video Transcode",
    used: "680 min",
    limit: "1,000 min",
    percent: 68,
  },
  { label: "Studio Seats", used: "8 seats", limit: "12 seats", percent: 67 },
  { label: "CDN Delivery", used: "820 GB", limit: "1.00 TB", percent: 82 },
] as const;

const INVOICES = [
  { id: "LM-2026-11", period: "Nov 2026", amount: "$89.00", status: "Paid" },
  { id: "LM-2026-10", period: "Oct 2026", amount: "$89.00", status: "Paid" },
  { id: "LM-2026-09", period: "Sep 2026", amount: "$79.00", status: "Paid" },
] as const;

const ROUTE_META: Record<
  ShellSideNavRoute,
  { label: string; group: "Workspace" | "Studio"; description: string }
> = {
  projects: {
    label: "Projects",
    group: "Workspace",
    description:
      "Organize campaign libraries, track asset readiness, and pin active collections to the rail.",
  },
  reviews: {
    label: "Reviews",
    group: "Workspace",
    description:
      "Approve master stills, motion cuts, and print mechanicals before bundle publication.",
  },
  releases: {
    label: "Releases",
    group: "Workspace",
    description:
      "Versioned asset bundles delivered to web, retail, print, and social distribution channels.",
  },
  "brand-kit": {
    label: "Brand Kit",
    group: "Studio",
    description:
      "Canonical studio color tokens, typographic scales, and automated export guardrails.",
  },
  members: {
    label: "Members",
    group: "Studio",
    description:
      "Manage creative seats, review permissions, and external collaborator invitations.",
  },
  billing: {
    label: "Billing",
    group: "Studio",
    description:
      "Studio Pro subscription, monthly storage & transcode quotas, and downloadable receipts.",
  },
};

const WORKSPACE_ROUTES: ShellSideNavRoute[] = [
  "projects",
  "reviews",
  "releases",
];
const STUDIO_ROUTES: ShellSideNavRoute[] = ["brand-kit", "members", "billing"];

function RouteGlyph({ route }: { route: ShellSideNavRoute }) {
  switch (route) {
    case "projects":
      return (
        <>
          <path d="M3 5.5a1.5 1.5 0 0 1 1.5-1.5h3.25l1.5 1.75h6.25A1.5 1.5 0 0 1 17 7.25v7.25A1.5 1.5 0 0 1 15.5 16h-11A1.5 1.5 0 0 1 3 14.5v-9Z" />
        </>
      );
    case "reviews":
      return (
        <>
          <circle cx="10" cy="10" r="6.75" />
          <path d="m7.25 10.25 2 2 3.75-4.25" />
        </>
      );
    case "releases":
      return (
        <>
          <path d="M10 3.25 16.5 6.75v6.5L10 16.75 3.5 13.25v-6.5L10 3.25Z" />
          <path d="M10 10v6.75" />
          <path d="M16.5 6.75 10 10 3.5 6.75" />
        </>
      );
    case "brand-kit":
      return (
        <>
          <circle cx="7" cy="7" r="3.25" />
          <circle cx="13" cy="7" r="3.25" />
          <circle cx="10" cy="12.75" r="3.25" />
        </>
      );
    case "members":
      return (
        <>
          <circle cx="8" cy="7" r="2.75" />
          <path d="M3.25 15.75c.5-2.5 2.25-3.75 4.75-3.75s4.25 1.25 4.75 3.75" />
          <circle cx="13.75" cy="8" r="2" />
          <path d="M14 12.25c1.5.25 2.5 1.25 2.75 3.25" />
        </>
      );
    case "billing":
      return (
        <>
          <rect x="2.75" y="4.5" width="14.5" height="11" rx="2" />
          <path d="M2.75 8.5h14.5" />
          <path d="M6 12.25h3.5" />
        </>
      );
  }
}

function LoomaMark() {
  return (
    <svg
      width="22"
      height="22"
      viewBox="0 0 22 22"
      fill="none"
      aria-hidden="true"
    >
      <rect width="22" height="22" rx="6" fill="currentColor" />
      <circle
        cx="8.25"
        cy="8.25"
        r="2.75"
        fill="var(--sui-colors-bg, #ffffff)"
      />
      <rect
        x="11.75"
        y="5.5"
        width="4.75"
        height="11"
        rx="2.375"
        fill="var(--sui-colors-bg, #ffffff)"
        fillOpacity="0.86"
      />
      <circle
        cx="8.25"
        cy="14.25"
        r="2.25"
        fill="var(--sui-colors-bg, #ffffff)"
        fillOpacity="0.55"
      />
    </svg>
  );
}

const swatchColors = stylex.create({
  terracotta: { "--color": "#C85A32" },
  obsidian: { "--color": "#1B1B1F" },
  linen: { "--color": "#F4EFE6" },
  sage: { "--color": "#5E7C68" },
  cobalt: { "--color": "#2F5CE0" },
  ochre: { "--color": "#D49B35" },
});

const styles = stylex.create({
  root: {
    backgroundColor: semanticColors.bg,
    color: semanticColors.fg,
    containerName: "shell-side-nav",
    containerType: "inline-size",
    fontFamily: fonts.body,
    height: "100%",
    minHeight: 0,
    overflow: "hidden",
    width: "100%",
  },
  textStart: {
    textAlign: "start",
  },
  tightLine: {
    lineHeight: lineHeights.xs,
  },
  sidebar: {
    "--sidebar-width": "16.5rem",
    "--sidebar-min-width": "16.5rem",
    borderRightStyle: "solid",
    display: {
      default: "flex",
      [NARROW]: "none",
    },
    flexShrink: 0,
    transitionDuration: "180ms",
    transitionProperty: "width, min-width",
  },
  sidebarCollapsed: {
    "--sidebar-width": "4rem",
    "--sidebar-min-width": "4rem",
  },
  sidebarHeader: {
    alignItems: "center",
    borderBottomColor: semanticColors.sidebarBorder,
    borderBottomStyle: "solid",
    borderBottomWidth: "1px",
    gap: spacing._1_5,
    justifyContent: "space-between",
    minHeight: "3.5rem",
    paddingBlock: spacing._2,
    paddingInline: spacing._2_5,
  },
  sidebarHeaderCollapsed: {
    justifyContent: "center",
    paddingInline: spacing._2,
  },
  workspaceTrigger: {
    flexGrow: 1,
    gap: spacing._2,
    height: "auto",
    justifyContent: "flex-start",
    minWidth: 0,
    paddingBlock: spacing._1_5,
    paddingInline: spacing._1_5,
  },
  workspaceChevron: {
    color: semanticColors.fgSubtle,
    marginInlineStart: "auto",
  },
  brandMark: {
    alignItems: "center",
    color: semanticColors.accentSolid,
    display: "inline-flex",
    flexShrink: 0,
  },
  sidebarBodyCollapsed: {
    paddingInline: spacing._2,
  },
  newProjectBtn: {
    justifyContent: "flex-start",
    width: "100%",
  },
  newProjectBtnCollapsed: {
    justifyContent: "center",
    paddingInline: 0,
    width: sizes.controlSm,
  },
  searchTrigger: {
    alignItems: "center",
    backgroundColor: {
      default: semanticColors.bgPanel,
      ":hover": semanticColors.bgSubtle,
    },
    borderColor: semanticColors.border,
    borderRadius: semanticRadii.control,
    borderStyle: "solid",
    borderWidth: "1px",
    color: semanticColors.fgMuted,
    cursor: "pointer",
    display: "inline-flex",
    fontSize: fontSizes.sm,
    gap: spacing._2,
    height: sizes.controlSm,
    justifyContent: "space-between",
    paddingInline: spacing._2_5,
    width: "100%",
  },
  searchTriggerCollapsed: {
    justifyContent: "center",
    paddingInline: 0,
    width: sizes.controlSm,
  },
  searchTriggerLabel: {
    alignItems: "center",
    display: "inline-flex",
    gap: spacing._2,
    minWidth: 0,
    overflow: "hidden",
    textOverflow: "ellipsis",
    whiteSpace: "nowrap",
  },
  navList: {
    listStyle: "none",
    marginBlock: 0,
    marginInline: 0,
    paddingBlock: 0,
    paddingInline: 0,
  },
  navButtonCollapsed: {
    justifyContent: "center",
    paddingInline: 0,
  },
  collapsibleTriggerBtn: {
    alignItems: "center",
    backgroundColor: {
      default: "transparent",
      ":hover": semanticColors.bgSubtle,
    },
    borderRadius: semanticRadii.control,
    borderStyle: "none",
    color: semanticColors.fgMuted,
    cursor: "pointer",
    display: "flex",
    fontSize: fontSizes.xs,
    fontWeight: fontWeights.medium,
    gap: spacing._1_5,
    height: sizes._6,
    justifyContent: "space-between",
    paddingInline: spacing._2,
    textAlign: "start",
    width: "100%",
  },
  chevronRotated: {
    transform: "rotate(90deg)",
  },
  chevronIcon: {
    transitionDuration: "150ms",
    transitionProperty: "transform",
  },
  pinnedItemWrap: {
    flexGrow: 1,
    minWidth: 0,
  },
  pinnedMoreBtn: {
    color: semanticColors.fgSubtle,
  },
  sidebarFooter: {
    borderTopColor: semanticColors.sidebarBorder,
    borderTopStyle: "solid",
    borderTopWidth: "1px",
    paddingBlock: spacing._2,
    paddingInline: spacing._2_5,
  },
  sidebarFooterCollapsed: {
    alignItems: "center",
    paddingInline: spacing._2,
  },
  userFooterTrigger: {
    gap: spacing._2_5,
    height: "auto",
    justifyContent: "flex-start",
    paddingBlock: spacing._1_5,
    paddingInline: spacing._1_5,
    width: "100%",
  },
  userFooterTriggerCollapsed: {
    justifyContent: "center",
    paddingInline: 0,
    width: sizes.controlMd,
  },
  mobileTopBar: {
    backgroundColor: semanticColors.bgPanel,
    borderBottomColor: semanticColors.border,
    borderBottomStyle: "solid",
    borderBottomWidth: "1px",
    display: {
      default: "none",
      [NARROW]: "flex",
    },
    flexShrink: 0,
    height: "3.25rem",
    paddingInline: spacing._3,
  },
  main: {
    backgroundColor: semanticColors.bgContent,
    overflowY: "auto",
  },
  mainInner: {
    marginInline: "auto",
    maxWidth: "70rem",
    paddingBlock: spacing._6,
    paddingInline: {
      default: spacing._6,
      [NARROW]: spacing._4,
    },
    width: "100%",
  },
  pageHeader: {
    alignItems: {
      default: "flex-end",
      [NARROW]: "flex-start",
    },
    flexDirection: {
      default: "row",
      [NARROW]: "column",
    },
  },
  breadcrumbRow: {
    color: semanticColors.fgMuted,
    fontSize: fontSizes.xs,
  },
  pageTitle: {
    marginBlock: 0,
  },
  statGrid: {
    gridTemplateColumns: {
      default: "repeat(4, minmax(0, 1fr))",
      [MEDIUM]: "repeat(2, minmax(0, 1fr))",
      [COMPACT]: "minmax(0, 1fr)",
    },
  },
  inlineSearch: {
    flexGrow: 1,
    maxWidth: "18rem",
    minWidth: "12rem",
  },
  tableWrap: {
    overflowX: "auto",
    width: "100%",
  },
  progressCell: {
    minWidth: "7rem",
  },
  cardHeaderRow: {
    alignItems: "center",
    display: "flex",
    flexDirection: "row",
    gap: spacing._3,
    justifyContent: "space-between",
  },
  cardTitleReset: {
    marginBlock: 0,
  },
  cardDescReset: {
    marginBlock: 0,
  },
  reviewCardBody: {
    alignItems: {
      default: "center",
      [MEDIUM]: "flex-start",
    },
    flexDirection: {
      default: "row",
      [MEDIUM]: "column",
    },
  },
  swatchGrid: {
    gridTemplateColumns: {
      default: "repeat(3, minmax(0, 1fr))",
      [MEDIUM]: "repeat(2, minmax(0, 1fr))",
      [COMPACT]: "minmax(0, 1fr)",
    },
  },
  swatchButton: {
    alignItems: "center",
    backgroundColor: {
      default: semanticColors.bg,
      ":hover": semanticColors.bgSubtle,
    },
    borderColor: semanticColors.border,
    borderRadius: semanticRadii.control,
    borderStyle: "solid",
    borderWidth: "1px",
    color: semanticColors.fg,
    cursor: "pointer",
    display: "flex",
    gap: spacing._3,
    paddingBlock: spacing._3,
    paddingInline: spacing._3,
    textAlign: "start",
    width: "100%",
  },
  typeSpecimenGrid: {
    gridTemplateColumns: {
      default: "repeat(2, minmax(0, 1fr))",
      [NARROW]: "minmax(0, 1fr)",
    },
  },
  specimenBox: {
    backgroundColor: semanticColors.bgMuted,
    borderColor: semanticColors.border,
    borderRadius: semanticRadii.control,
    borderStyle: "solid",
    borderWidth: "1px",
    paddingBlock: spacing._4,
    paddingInline: spacing._4,
  },
  specimenDisplay: {
    fontFamily: fonts.heading,
    fontSize: fontSizes._2xl,
    fontWeight: fontWeights.semibold,
    letterSpacing: "-0.02em",
    lineHeight: lineHeights._2xl,
  },
  inlineInput: {
    flexGrow: 1,
    minWidth: "12rem",
  },
  quotaGrid: {
    gridTemplateColumns: {
      default: "repeat(2, minmax(0, 1fr))",
      [COMPACT]: "minmax(0, 1fr)",
    },
  },
  planPrice: {
    letterSpacing: "-0.02em",
  },
  menuWidth: {
    minWidth: "14rem",
  },
  userMenuHeader: {
    paddingBlock: spacing._1_5,
    paddingInline: spacing._2,
  },
  drawerBody: {
    display: "flex",
    flexDirection: "column",
    gap: spacing._4,
    paddingInline: spacing._3,
  },
  drawerFooter: {
    borderTopColor: semanticColors.border,
    borderTopStyle: "solid",
    borderTopWidth: "1px",
    justifyContent: "flex-start",
    paddingBlock: spacing._3,
    paddingInline: spacing._3,
  },
  dialogFormBody: {
    display: "flex",
    flexDirection: "column",
    gap: spacing._3,
    paddingBlock: spacing._4,
  },
  paletteResults: {
    maxHeight: "18rem",
    overflowY: "auto",
  },
  paletteItem: {
    alignItems: "center",
    backgroundColor: {
      default: "transparent",
      ":hover": semanticColors.bgSubtle,
    },
    borderRadius: semanticRadii.control,
    borderStyle: "none",
    color: semanticColors.fg,
    cursor: "pointer",
    display: "flex",
    gap: spacing._2_5,
    justifyContent: "space-between",
    paddingBlock: spacing._2,
    paddingInline: spacing._2_5,
    textAlign: "start",
    width: "100%",
  },
  emptyStateText: {
    paddingBlock: spacing._6,
  },
});

export interface ShellSideNavProps extends StyleOverrideProps {
  /** Initial active route (`projects` | `reviews` | `releases` | `brand-kit` | `members` | `billing`). */
  defaultRoute?: ShellSideNavRoute;
  /** Initial active workspace id (`looma-core` | `solstice-26` | `editorial-lab`). */
  defaultWorkspaceId?: string;
  /** Start with the left sidebar collapsed to an icon rail on desktop. */
  defaultSidebarCollapsed?: boolean;
  /** Called whenever the user navigates to a different route. */
  onRouteChange?: (route: ShellSideNavRoute) => void;
  /** Called whenever the user switches studio workspaces. */
  onWorkspaceChange?: (workspaceId: string) => void;
}

/**
 * ShellSideNav — full-height left-rail application shell for Looma Studio
 * (Creative Asset Workspace). Pairs a collapsible sidebar (workspace switcher,
 * quick actions, grouped route sections, collapsible pinned collections with
 * status dots & row menus, and anchored user footer menu) with a mobile
 * slide-over drawer fallback and interactive route views.
 */
export function ShellSideNav({
  defaultRoute = "projects",
  defaultWorkspaceId = "looma-core",
  defaultSidebarCollapsed = false,
  onRouteChange,
  onWorkspaceChange,
  palette,
  style,
}: ShellSideNavProps) {
  const queue = useMemo(() => Toast.createToaster(), []);

  const [activeRoute, setActiveRoute] =
    useState<ShellSideNavRoute>(defaultRoute);
  const [workspaceId, setWorkspaceId] = useState<string>(defaultWorkspaceId);
  const [sidebarCollapsed, setSidebarCollapsed] = useState<boolean>(
    defaultSidebarCollapsed,
  );
  const [collectionsOpen, setCollectionsOpen] = useState(true);
  const [mobileNavOpen, setMobileNavOpen] = useState(false);

  const [searchOpen, setSearchOpen] = useState(false);
  const [searchQuery, setSearchQuery] = useState("");

  const [newProjectOpen, setNewProjectOpen] = useState(false);
  const [newProjectName, setNewProjectName] = useState("");
  const [newProjectCollection, setNewProjectCollection] = useState("Editorial");

  const [pendingDelete, setPendingDelete] = useState<CreativeProject | null>(
    null,
  );

  const [projects, setProjects] = useState<CreativeProject[]>(INITIAL_PROJECTS);
  const [focusedProjectId, setFocusedProjectId] = useState<string | null>(null);
  const [projectStageFilter, setProjectStageFilter] = useState<
    "all" | "active" | "in-review" | "draft" | "blocked"
  >("all");
  const [projectSearch, setProjectSearch] = useState("");

  const [reviews, setReviews] = useState<ReviewItem[]>(INITIAL_REVIEWS);
  const [reviewFilter, setReviewFilter] = useState<
    "all" | "pending" | "changes" | "approved"
  >("all");

  const [releases, setReleases] = useState<ReleaseBundle[]>(INITIAL_RELEASES);

  const [autoWebp, setAutoWebp] = useState(true);
  const [watermarkExternal, setWatermarkExternal] = useState(true);
  const [strictColorProfile, setStrictColorProfile] = useState(false);

  const [members, setMembers] = useState<MemberItem[]>(INITIAL_MEMBERS);
  const [inviteEmail, setInviteEmail] = useState("");
  const [inviteRole, setInviteRole] = useState<"Editor" | "Reviewer" | "Admin">(
    "Editor",
  );

  const activeWorkspace = useMemo(
    () => WORKSPACES.find((w) => w.id === workspaceId) ?? WORKSPACES[0],
    [workspaceId],
  );

  const workspacePalette =
    activeWorkspace.palette === "violet"
      ? violetPalette
      : activeWorkspace.palette === "green"
        ? greenPalette
        : accentPalette;

  const pinnedProjects = useMemo(
    () => projects.filter((p) => p.pinned),
    [projects],
  );

  const pendingReviewsCount = useMemo(
    () => reviews.filter((r) => r.status === "pending").length,
    [reviews],
  );

  const navigateTo = useCallback(
    (route: ShellSideNavRoute) => {
      setActiveRoute(route);
      setMobileNavOpen(false);
      onRouteChange?.(route);
    },
    [onRouteChange],
  );

  const selectWorkspace = useCallback(
    (nextId: string) => {
      const target = WORKSPACES.find((w) => w.id === nextId);
      if (!target) return;
      setWorkspaceId(nextId);
      setFocusedProjectId(null);
      onWorkspaceChange?.(nextId);
      queue.info(`Switched to ${target.name}`, {
        description: `${target.tier} · ${target.season} (${target.assetCount} assets)`,
      });
    },
    [onWorkspaceChange, queue],
  );

  useEffect(() => {
    const onKeyDown = (event: KeyboardEvent) => {
      if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
        event.preventDefault();
        setSearchOpen((prev) => !prev);
      }
    };
    window.addEventListener("keydown", onKeyDown);
    return () => window.removeEventListener("keydown", onKeyDown);
  }, []);

  const handleCreateProject = (event: React.FormEvent) => {
    event.preventDefault();
    const trimmed = newProjectName.trim();
    if (!trimmed) {
      queue.warning("Enter a project title to create it");
      return;
    }
    const created: CreativeProject = {
      id: `proj-${Date.now()}`,
      workspaceId: activeWorkspace.id,
      name: trimmed,
      collection: newProjectCollection.trim() || "Editorial",
      stage: "draft",
      assets: 0,
      readiness: 10,
      owner: "Mina Castillo",
      ownerInitials: "MC",
      updatedAt: "Just now",
      pinned: true,
    };
    setProjects((prev) => [created, ...prev]);
    setNewProjectName("");
    setNewProjectOpen(false);
    setFocusedProjectId(created.id);
    navigateTo("projects");
    queue.success(`Created "${created.name}"`, {
      description: `Pinned to ${activeWorkspace.name} sidebar.`,
    });
  };

  const handleDuplicateProject = useCallback(
    (project: CreativeProject) => {
      const copy: CreativeProject = {
        ...project,
        id: `proj-${Date.now()}`,
        name: `${project.name} (Copy)`,
        stage: "draft",
        updatedAt: "Just now",
      };
      setProjects((prev) => [copy, ...prev]);
      queue.info(`Duplicated "${project.name}"`, {
        description: "Saved as a draft in your studio library.",
      });
    },
    [queue],
  );

  const handleTogglePin = useCallback(
    (project: CreativeProject) => {
      setProjects((prev) =>
        prev.map((item) =>
          item.id === project.id ? { ...item, pinned: !item.pinned } : item,
        ),
      );
      queue.info(
        project.pinned
          ? `Unpinned "${project.name}"`
          : `Pinned "${project.name}"`,
        {
          description: project.pinned
            ? "Removed from the sidebar rail."
            : "Added to Pinned Collections in the sidebar.",
        },
      );
    },
    [queue],
  );

  const handleConfirmDelete = () => {
    if (!pendingDelete) return;
    const deleted = pendingDelete;
    setProjects((prev) => prev.filter((item) => item.id !== deleted.id));
    if (focusedProjectId === deleted.id) {
      setFocusedProjectId(null);
    }
    setPendingDelete(null);
    queue.success(`Deleted "${deleted.name}"`, {
      description: "Removed project and unlinked its sidebar shortcut.",
    });
  };

  const handleUpdateReview = (
    review: ReviewItem,
    nextStatus: "approved" | "changes",
  ) => {
    setReviews((prev) =>
      prev.map((item) =>
        item.id === review.id ? { ...item, status: nextStatus } : item,
      ),
    );
    if (nextStatus === "approved") {
      queue.success(`Approved ${review.assetName}`, {
        description: `Ready to include in the next ${review.projectName} release.`,
      });
    } else {
      queue.warning(`Requested changes on ${review.assetName}`, {
        description: `Notified ${review.reviewer} with review status update.`,
      });
    }
  };

  const handlePublishBundle = useCallback(() => {
    const nextMinor = 15 + (releases.length - INITIAL_RELEASES.length);
    const nextBundle: ReleaseBundle = {
      id: `rel-${Date.now()}`,
      version: `bundle-2.${nextMinor}`,
      title: `${activeWorkspace.name} — Approved Masters`,
      channel: "Web",
      assetCount: 42,
      publishedBy: "Mina Castillo",
      status: "published",
      publishedAt: "Just now",
    };
    setReleases((prev) => [nextBundle, ...prev]);
    queue.success(`Published ${nextBundle.version}`, {
      description: `42 assets synced to CDN for ${activeWorkspace.name}.`,
    });
  }, [activeWorkspace.name, queue, releases.length]);

  const handleInviteMember = (event: React.FormEvent) => {
    event.preventDefault();
    const cleaned = inviteEmail.trim().toLowerCase();
    if (!cleaned || !cleaned.includes("@")) {
      queue.warning("Enter a valid studio email address");
      return;
    }
    if (members.some((m) => m.email === cleaned)) {
      queue.warning(`${cleaned} is already in this workspace`);
      return;
    }
    const localName = cleaned
      .split("@")[0]
      .split(/[._-]/)
      .filter(Boolean)
      .map((part) => part[0].toUpperCase() + part.slice(1))
      .join(" ");
    const initials = localName
      .split(" ")
      .map((p) => p[0])
      .join("")
      .slice(0, 2)
      .toUpperCase();
    setMembers((prev) => [
      {
        id: `mem-${Date.now()}`,
        name: localName || cleaned,
        email: cleaned,
        initials: initials || "ST",
        role: inviteRole,
        status: "invited",
        lastActive: "Invite sent just now",
      },
      ...prev,
    ]);
    setInviteEmail("");
    queue.success(`Invited ${cleaned}`, {
      description: `Assigned ${inviteRole} access to ${activeWorkspace.name}.`,
    });
  };

  const filteredProjects = useMemo(() => {
    const q = projectSearch.trim().toLowerCase();
    return projects.filter((proj) => {
      if (focusedProjectId && proj.id !== focusedProjectId) return false;
      if (projectStageFilter !== "all" && proj.stage !== projectStageFilter) {
        return false;
      }
      if (!q) return true;
      return (
        proj.name.toLowerCase().includes(q) ||
        proj.collection.toLowerCase().includes(q) ||
        proj.owner.toLowerCase().includes(q)
      );
    });
  }, [focusedProjectId, projectSearch, projectStageFilter, projects]);

  const filteredReviews = useMemo(() => {
    if (reviewFilter === "all") return reviews;
    return reviews.filter((item) => item.status === reviewFilter);
  }, [reviewFilter, reviews]);

  const paletteCommands = useMemo(() => {
    const items: Array<{
      id: string;
      label: string;
      category: string;
      hint?: string;
      run: () => void;
    }> = [
      ...(Object.keys(ROUTE_META) as ShellSideNavRoute[]).map((route) => ({
        id: `route-${route}`,
        label: ROUTE_META[route].label,
        category: "Route",
        hint: ROUTE_META[route].group,
        run: () => navigateTo(route),
      })),
      ...WORKSPACES.map((ws) => ({
        id: `ws-${ws.id}`,
        label: `Switch workspace: ${ws.name}`,
        category: "Workspace",
        hint: ws.tier,
        run: () => selectWorkspace(ws.id),
      })),
      ...pinnedProjects.map((proj) => ({
        id: `pin-${proj.id}`,
        label: `Open collection: ${proj.name}`,
        category: "Pinned",
        hint: proj.collection,
        run: () => {
          setFocusedProjectId(proj.id);
          navigateTo("projects");
        },
      })),
      {
        id: "action-new-project",
        label: "Create new studio project",
        category: "Action",
        hint: activeWorkspace.name,
        run: () => setNewProjectOpen(true),
      },
      {
        id: "action-publish",
        label: "Publish approved asset bundle",
        category: "Action",
        hint: "Releases",
        run: () => {
          navigateTo("releases");
          handlePublishBundle();
        },
      },
      {
        id: "action-toggle-sidebar",
        label: sidebarCollapsed
          ? "Expand left sidebar"
          : "Collapse left sidebar",
        category: "View",
        hint: "Layout",
        run: () => setSidebarCollapsed((prev) => !prev),
      },
    ];
    const q = searchQuery.trim().toLowerCase();
    if (!q) return items;
    return items.filter(
      (item) =>
        item.label.toLowerCase().includes(q) ||
        item.category.toLowerCase().includes(q) ||
        (item.hint?.toLowerCase().includes(q) ?? false),
    );
  }, [
    activeWorkspace.name,
    handlePublishBundle,
    navigateTo,
    pinnedProjects,
    searchQuery,
    selectWorkspace,
    sidebarCollapsed,
  ]);

  const stagePalette = (stage: CreativeProject["stage"]) => {
    switch (stage) {
      case "active":
        return greenPalette;
      case "in-review":
        return amberPalette;
      case "blocked":
        return redPalette;
      case "draft":
        return bluePalette;
    }
  };

  const stageLabel = (stage: CreativeProject["stage"]) => {
    switch (stage) {
      case "active":
        return "Active";
      case "in-review":
        return "In review";
      case "blocked":
        return "Blocked";
      case "draft":
        return "Draft";
    }
  };

  const renderWorkspaceSwitcher = (collapsed: boolean) => (
    <Menu.Root size="md">
      <Menu.Trigger
        render={
          <Button
            variant="ghost"
            size="sm"
            aria-label="Switch studio workspace"
            style={styles.workspaceTrigger}
          />
        }
      >
        <span {...stylex.props(styles.brandMark)}>
          <LoomaMark />
        </span>
        {!collapsed ? (
          <>
            <VStack render={<span />} gap="0" style={styles.textStart}>
              <Text
                render={<span />}
                size="sm"
                weight="semibold"
                truncate="true"
                style={styles.tightLine}
              >
                {activeWorkspace.name}
              </Text>
              <Text render={<span />} size="xs" tone="muted" truncate="true">
                Looma Studio · {activeWorkspace.tier}
              </Text>
            </VStack>
            <Icon
              size="xs"
              viewBox="0 0 16 16"
              fill="none"
              stroke="currentColor"
              strokeWidth="1.6"
              strokeLinecap="round"
              strokeLinejoin="round"
              aria-hidden="true"
              style={styles.workspaceChevron}
            >
              <path d="m5 6 3-3 3 3" />
              <path d="m5 10 3 3 3-3" />
            </Icon>
          </>
        ) : null}
      </Menu.Trigger>
      <Menu.Content align="start" style={styles.menuWidth}>
        <Menu.Group>
          <Menu.GroupLabel>Studio Workspaces</Menu.GroupLabel>
          <Menu.RadioGroup
            value={workspaceId}
            onValueChange={(next) => selectWorkspace(next)}
          >
            {WORKSPACES.map((ws) => (
              <Menu.RadioItem key={ws.id} value={ws.id}>
                <Menu.ItemIndicator />
                <Menu.ItemText>{ws.name}</Menu.ItemText>
                <Menu.ItemCommand>{ws.season}</Menu.ItemCommand>
              </Menu.RadioItem>
            ))}
          </Menu.RadioGroup>
        </Menu.Group>
        <Menu.Separator />
        <Menu.Item
          onSelect={() => {
            setMobileNavOpen(false);
            setNewProjectOpen(true);
          }}
        >
          <Menu.ItemText>New project…</Menu.ItemText>
        </Menu.Item>
      </Menu.Content>
    </Menu.Root>
  );

  const renderSidebarNavigation = (collapsed: boolean) => (
    <>
      <VStack gap="1.5" align={collapsed ? "center" : "stretch"}>
        <Button
          variant="solid"
          size="sm"
          palette={accentPalette}
          aria-label="New project"
          title={collapsed ? "New project" : undefined}
          style={[
            styles.newProjectBtn,
            collapsed && styles.newProjectBtnCollapsed,
          ]}
          onClick={() => {
            setMobileNavOpen(false);
            setNewProjectOpen(true);
          }}
        >
          <Icon
            size="sm"
            viewBox="0 0 16 16"
            fill="none"
            stroke="currentColor"
            strokeWidth="1.75"
            strokeLinecap="round"
            aria-hidden="true"
          >
            <path d="M8 3.25v9.5" />
            <path d="M3.25 8h9.5" />
          </Icon>
          {!collapsed ? <span>New project</span> : null}
        </Button>

        <button
          type="button"
          aria-label="Quick search"
          title={collapsed ? "Search workspace (⌘K)" : undefined}
          onClick={() => {
            setMobileNavOpen(false);
            setSearchOpen(true);
          }}
          {...stylex.props(
            styles.searchTrigger,
            collapsed && styles.searchTriggerCollapsed,
          )}
        >
          <span {...stylex.props(styles.searchTriggerLabel)}>
            <Icon
              size="xs"
              viewBox="0 0 16 16"
              fill="none"
              stroke="currentColor"
              strokeWidth="1.5"
              strokeLinecap="round"
              aria-hidden="true"
            >
              <circle cx="7.25" cy="7.25" r="4.5" />
              <path d="m10.75 10.75 2.75 2.75" />
            </Icon>
            {!collapsed ? <span>Search assets…</span> : null}
          </span>
          {!collapsed ? (
            <Kbd size="xs" variant="outline">
              ⌘K
            </Kbd>
          ) : null}
        </button>
      </VStack>

      <Separator />

      <Sidebar.Group>
        {!collapsed ? (
          <Sidebar.GroupHeader>
            <Sidebar.GroupTitle>Workspace</Sidebar.GroupTitle>
          </Sidebar.GroupHeader>
        ) : null}
        <Sidebar.GroupContent>
          <VStack render={<ul />} gap="0.5" style={styles.navList}>
            {WORKSPACE_ROUTES.map((route) => {
              const active =
                activeRoute === route &&
                !(route === "projects" && focusedProjectId !== null);
              const meta = ROUTE_META[route];
              return (
                <SidebarNavItem.Item key={route} variant="muted" size="md">
                  <SidebarNavItem.Button
                    type="button"
                    aria-current={active ? "page" : undefined}
                    aria-label={collapsed ? meta.label : undefined}
                    title={collapsed ? meta.label : undefined}
                    style={[
                      active && sidebarNavItemActive,
                      collapsed && styles.navButtonCollapsed,
                    ]}
                    onClick={() => {
                      if (route === "projects") setFocusedProjectId(null);
                      navigateTo(route);
                    }}
                  >
                    <SidebarNavItem.Icon
                      viewBox="0 0 20 20"
                      fill="none"
                      stroke="currentColor"
                      strokeWidth="1.5"
                      strokeLinecap="round"
                      strokeLinejoin="round"
                      aria-hidden="true"
                    >
                      <RouteGlyph route={route} />
                    </SidebarNavItem.Icon>
                    {!collapsed ? (
                      <>
                        <Text render={<span />} size="sm" truncate="true">
                          {meta.label}
                        </Text>
                        {route === "projects" ? (
                          <SidebarNavItem.EndElement>
                            <Badge variant="subtle" size="xs">
                              {projects.length}
                            </Badge>
                          </SidebarNavItem.EndElement>
                        ) : null}
                        {route === "reviews" && pendingReviewsCount > 0 ? (
                          <SidebarNavItem.EndElement>
                            <Badge
                              variant="subtle"
                              size="xs"
                              palette={amberPalette}
                            >
                              {pendingReviewsCount}
                            </Badge>
                          </SidebarNavItem.EndElement>
                        ) : null}
                      </>
                    ) : null}
                  </SidebarNavItem.Button>
                </SidebarNavItem.Item>
              );
            })}
          </VStack>
        </Sidebar.GroupContent>
      </Sidebar.Group>

      <Sidebar.Group>
        {!collapsed ? (
          <Sidebar.GroupHeader>
            <Sidebar.GroupTitle>Studio</Sidebar.GroupTitle>
          </Sidebar.GroupHeader>
        ) : null}
        <Sidebar.GroupContent>
          <VStack render={<ul />} gap="0.5" style={styles.navList}>
            {STUDIO_ROUTES.map((route) => {
              const active = activeRoute === route;
              const meta = ROUTE_META[route];
              return (
                <SidebarNavItem.Item key={route} variant="muted" size="md">
                  <SidebarNavItem.Button
                    type="button"
                    aria-current={active ? "page" : undefined}
                    aria-label={collapsed ? meta.label : undefined}
                    title={collapsed ? meta.label : undefined}
                    style={[
                      active && sidebarNavItemActive,
                      collapsed && styles.navButtonCollapsed,
                    ]}
                    onClick={() => navigateTo(route)}
                  >
                    <SidebarNavItem.Icon
                      viewBox="0 0 20 20"
                      fill="none"
                      stroke="currentColor"
                      strokeWidth="1.5"
                      strokeLinecap="round"
                      strokeLinejoin="round"
                      aria-hidden="true"
                    >
                      <RouteGlyph route={route} />
                    </SidebarNavItem.Icon>
                    {!collapsed ? (
                      <Text render={<span />} size="sm" truncate="true">
                        {meta.label}
                      </Text>
                    ) : null}
                  </SidebarNavItem.Button>
                </SidebarNavItem.Item>
              );
            })}
          </VStack>
        </Sidebar.GroupContent>
      </Sidebar.Group>

      {!collapsed && pinnedProjects.length > 0 ? (
        <>
          <Separator />
          <Sidebar.Group>
            <Collapsible.Root
              open={collectionsOpen}
              onOpenChange={setCollectionsOpen}
            >
              <Collapsible.Trigger
                render={
                  <button
                    type="button"
                    {...stylex.props(styles.collapsibleTriggerBtn)}
                  />
                }
              >
                <HStack render={<span />} gap="1.5">
                  <Icon
                    size="xs"
                    viewBox="0 0 16 16"
                    fill="none"
                    stroke="currentColor"
                    strokeWidth="1.6"
                    strokeLinecap="round"
                    strokeLinejoin="round"
                    aria-hidden="true"
                    style={[
                      styles.chevronIcon,
                      collectionsOpen && styles.chevronRotated,
                    ]}
                  >
                    <path d="m6 4 4 4-4 4" />
                  </Icon>
                  <span>Pinned Collections</span>
                </HStack>
                <Badge variant="plain" size="xs">
                  {pinnedProjects.length}
                </Badge>
              </Collapsible.Trigger>
              <Collapsible.Panel>
                <Sidebar.GroupContent>
                  <VStack render={<ul />} gap="0.5" style={styles.navList}>
                    {pinnedProjects.map((proj) => {
                      const isSelected =
                        activeRoute === "projects" &&
                        focusedProjectId === proj.id;
                      return (
                        <HStack key={proj.id} render={<li />} gap="0.5">
                          <div {...stylex.props(styles.pinnedItemWrap)}>
                            <SidebarNavItem.Item
                              render={<div />}
                              variant="muted"
                              size="sm"
                            >
                              <SidebarNavItem.Button
                                type="button"
                                aria-current={isSelected ? "page" : undefined}
                                style={
                                  isSelected ? sidebarNavItemActive : undefined
                                }
                                onClick={() => {
                                  setFocusedProjectId(proj.id);
                                  navigateTo("projects");
                                }}
                              >
                                <Status.Root
                                  size="sm"
                                  palette={stagePalette(proj.stage)}
                                  aria-label={stageLabel(proj.stage)}
                                >
                                  <Status.Indicator />
                                </Status.Root>
                                <Text
                                  render={<span />}
                                  size="sm"
                                  truncate="true"
                                >
                                  {proj.name}
                                </Text>
                              </SidebarNavItem.Button>
                            </SidebarNavItem.Item>
                          </div>

                          <Menu.Root size="sm">
                            <Menu.Trigger
                              render={
                                <IconButton
                                  variant="ghost"
                                  size="xs"
                                  aria-label={`Options for ${proj.name}`}
                                  style={styles.pinnedMoreBtn}
                                />
                              }
                            >
                              <Icon
                                size="xs"
                                viewBox="0 0 16 16"
                                fill="currentColor"
                                aria-hidden="true"
                              >
                                <circle cx="3.5" cy="8" r="1.25" />
                                <circle cx="8" cy="8" r="1.25" />
                                <circle cx="12.5" cy="8" r="1.25" />
                              </Icon>
                            </Menu.Trigger>
                            <Menu.Content align="end">
                              <Menu.Item
                                onSelect={() => {
                                  setFocusedProjectId(proj.id);
                                  navigateTo("projects");
                                }}
                              >
                                <Menu.ItemText>Open collection</Menu.ItemText>
                              </Menu.Item>
                              <Menu.Item
                                onSelect={() => handleDuplicateProject(proj)}
                              >
                                <Menu.ItemText>Duplicate</Menu.ItemText>
                              </Menu.Item>
                              <Menu.Item
                                onSelect={() => handleTogglePin(proj)}
                              >
                                <Menu.ItemText>Unpin from rail</Menu.ItemText>
                              </Menu.Item>
                              <Menu.Separator />
                              <Menu.Item
                                destructive
                                onSelect={() => setPendingDelete(proj)}
                              >
                                <Menu.ItemText>Delete</Menu.ItemText>
                              </Menu.Item>
                            </Menu.Content>
                          </Menu.Root>
                        </HStack>
                      );
                    })}
                  </VStack>
                </Sidebar.GroupContent>
              </Collapsible.Panel>
            </Collapsible.Root>
          </Sidebar.Group>
        </>
      ) : null}
    </>
  );

  const renderUserFooterMenu = (collapsed: boolean) => (
    <Menu.Root size="md">
      <Menu.Trigger
        render={
          <Button
            variant="ghost"
            size="sm"
            aria-label="Account menu"
            style={[
              styles.userFooterTrigger,
              collapsed && styles.userFooterTriggerCollapsed,
            ]}
          />
        }
      >
        <Avatar.Root size="sm" variant="subtle" palette={accentPalette}>
          <Avatar.Fallback>MC</Avatar.Fallback>
        </Avatar.Root>
        {!collapsed ? (
          <>
            <VStack render={<span />} gap="0" style={styles.textStart}>
              <Text
                render={<span />}
                size="sm"
                weight="medium"
                truncate="true"
                style={styles.tightLine}
              >
                Mina Castillo
              </Text>
              <Text render={<span />} size="xs" tone="muted" truncate="true">
                Creative Director
              </Text>
            </VStack>
            <Icon
              size="xs"
              viewBox="0 0 16 16"
              fill="none"
              stroke="currentColor"
              strokeWidth="1.6"
              strokeLinecap="round"
              strokeLinejoin="round"
              aria-hidden="true"
              style={styles.workspaceChevron}
            >
              <path d="m5 6 3-3 3 3" />
              <path d="m5 10 3 3 3-3" />
            </Icon>
          </>
        ) : null}
      </Menu.Trigger>
      <Menu.Content side="top" align="start" style={styles.menuWidth}>
        <VStack gap="0.5" style={styles.userMenuHeader}>
          <Text render={<span />} size="sm" weight="medium">
            Mina Castillo
          </Text>
          <Text render={<span />} size="xs" tone="muted">
            mina@looma.studio
          </Text>
        </VStack>
        <Menu.Separator />
        <Menu.Item onSelect={() => navigateTo("brand-kit")}>
          <Menu.ItemText>Brand Kit &amp; tokens</Menu.ItemText>
        </Menu.Item>
        <Menu.Item onSelect={() => navigateTo("members")}>
          <Menu.ItemText>Team &amp; permissions</Menu.ItemText>
        </Menu.Item>
        <Menu.Item onSelect={() => navigateTo("billing")}>
          <Menu.ItemText>Billing &amp; storage</Menu.ItemText>
        </Menu.Item>
        <Menu.Item onSelect={() => setSearchOpen(true)}>
          <Menu.ItemText>Command palette</Menu.ItemText>
          <Menu.ItemCommand>⌘K</Menu.ItemCommand>
        </Menu.Item>
        <Menu.Separator />
        <Menu.Item
          destructive
          onSelect={() =>
            queue.info("Signed out of Looma Studio", {
              description: "Creative session ended on this device.",
            })
          }
        >
          <Menu.ItemText>Sign out</Menu.ItemText>
        </Menu.Item>
      </Menu.Content>
    </Menu.Root>
  );

  const focusedProject = useMemo(
    () => projects.find((p) => p.id === focusedProjectId) ?? null,
    [focusedProjectId, projects],
  );

  return (
    <AppShell.Root palette={palette} style={[styles.root, style]}>
      <AppShell.Content>
        <Sidebar.Root
          variant="sidebar"
          mode="collapsible"
          size="md"
          aria-label="Looma Studio navigation"
          style={[styles.sidebar, sidebarCollapsed && styles.sidebarCollapsed]}
        >
          <Sidebar.Header
            style={[
              styles.sidebarHeader,
              sidebarCollapsed && styles.sidebarHeaderCollapsed,
            ]}
          >
            {sidebarCollapsed ? (
              <IconButton
                variant="ghost"
                size="sm"
                aria-label="Expand navigation sidebar"
                aria-expanded={false}
                onClick={() => setSidebarCollapsed(false)}
              >
                <span {...stylex.props(styles.brandMark)}>
                  <LoomaMark />
                </span>
              </IconButton>
            ) : (
              <>
                {renderWorkspaceSwitcher(false)}
                <IconButton
                  variant="ghost"
                  size="xs"
                  aria-label="Collapse navigation sidebar"
                  aria-expanded={true}
                  onClick={() => setSidebarCollapsed(true)}
                >
                  <Icon
                    size="sm"
                    viewBox="0 0 20 20"
                    fill="none"
                    stroke="currentColor"
                    strokeWidth="1.5"
                    strokeLinecap="round"
                    strokeLinejoin="round"
                    aria-hidden="true"
                  >
                    <rect x="3" y="3.5" width="14" height="13" rx="2" />
                    <path d="M7.5 3.5v13" />
                  </Icon>
                </IconButton>
              </>
            )}
          </Sidebar.Header>

          <Sidebar.Body
            style={sidebarCollapsed ? styles.sidebarBodyCollapsed : undefined}
          >
            {renderSidebarNavigation(sidebarCollapsed)}
          </Sidebar.Body>

          <Sidebar.Footer
            style={[
              styles.sidebarFooter,
              sidebarCollapsed && styles.sidebarFooterCollapsed,
            ]}
          >
            {renderUserFooterMenu(sidebarCollapsed)}
          </Sidebar.Footer>
        </Sidebar.Root>

        <AppShell.Main style={styles.main}>
          <HStack gap="2" justify="between" style={styles.mobileTopBar}>
            <HStack gap="2">
              <IconButton
                variant="ghost"
                size="sm"
                aria-label="Open navigation drawer"
                onClick={() => setMobileNavOpen(true)}
              >
                <Icon
                  size="sm"
                  viewBox="0 0 20 20"
                  fill="none"
                  stroke="currentColor"
                  strokeWidth="1.6"
                  strokeLinecap="round"
                  aria-hidden="true"
                >
                  <path d="M3.5 5.5h13" />
                  <path d="M3.5 10h13" />
                  <path d="M3.5 14.5h13" />
                </Icon>
              </IconButton>
              <span {...stylex.props(styles.brandMark)}>
                <LoomaMark />
              </span>
              <Text render={<span />} size="sm" weight="semibold" truncate="true">
                {activeWorkspace.name} · {ROUTE_META[activeRoute].label}
              </Text>
            </HStack>

            <IconButton
              variant="ghost"
              size="sm"
              aria-label="Open quick search"
              onClick={() => setSearchOpen(true)}
            >
              <Icon
                size="sm"
                viewBox="0 0 16 16"
                fill="none"
                stroke="currentColor"
                strokeWidth="1.5"
                strokeLinecap="round"
                aria-hidden="true"
              >
                <circle cx="7.25" cy="7.25" r="4.5" />
                <path d="m10.75 10.75 2.75 2.75" />
              </Icon>
            </IconButton>
          </HStack>

          <VStack gap="6" style={styles.mainInner}>
            <HStack
              render={<header />}
              gap="4"
              justify="between"
              style={styles.pageHeader}
            >
              <VStack gap="1">
                <HStack gap="1.5" style={styles.breadcrumbRow}>
                  <span>{activeWorkspace.name}</span>
                  <Badge
                    variant="subtle"
                    size="xs"
                    palette={workspacePalette}
                  >
                    {activeWorkspace.tier}
                  </Badge>
                  <span aria-hidden="true">/</span>
                  <span>{ROUTE_META[activeRoute].group}</span>
                  <span aria-hidden="true">/</span>
                  <span>{ROUTE_META[activeRoute].label}</span>
                  {focusedProject && activeRoute === "projects" ? (
                    <>
                      <span aria-hidden="true">/</span>
                      <span>{focusedProject.name}</span>
                    </>
                  ) : null}
                </HStack>
                <Heading render={<h1 />} size="2xl" style={styles.pageTitle}>
                  {focusedProject && activeRoute === "projects"
                    ? focusedProject.name
                    : ROUTE_META[activeRoute].label}
                </Heading>
                <Text size="sm" tone="muted">
                  {ROUTE_META[activeRoute].description}
                </Text>
              </VStack>

              <HStack gap="2" wrap="wrap">
                {activeRoute === "projects" ? (
                  <>
                    {focusedProject ? (
                      <Button
                        variant="surface"
                        size="sm"
                        onClick={() => setFocusedProjectId(null)}
                      >
                        Show all projects
                      </Button>
                    ) : null}
                    <Button
                      variant="solid"
                      size="sm"
                      palette={accentPalette}
                      onClick={() => setNewProjectOpen(true)}
                    >
                      New project
                    </Button>
                  </>
                ) : null}

                {activeRoute === "reviews" ? (
                  <Button
                    variant="surface"
                    size="sm"
                    onClick={() =>
                      queue.info("Shareable proof link copied", {
                        description: `External reviewers can comment on ${pendingReviewsCount} pending files.`,
                      })
                    }
                  >
                    Copy review link
                  </Button>
                ) : null}

                {activeRoute === "releases" ? (
                  <Button
                    variant="solid"
                    size="sm"
                    palette={accentPalette}
                    onClick={handlePublishBundle}
                  >
                    Publish bundle
                  </Button>
                ) : null}

                {activeRoute === "brand-kit" ? (
                  <Button
                    variant="surface"
                    size="sm"
                    onClick={() =>
                      queue.success("Exported brand-tokens.json", {
                        description:
                          "Includes 6 color tokens and typography scales.",
                      })
                    }
                  >
                    Export tokens
                  </Button>
                ) : null}
              </HStack>
            </HStack>

            {activeRoute === "projects" ? (
              <>
                <Grid gap="4" style={styles.statGrid}>
                  <Card.Root variant="outline" size="md">
                    <Card.Body>
                      <Stat.Root size="md">
                        <Stat.Label>Active Projects</Stat.Label>
                        <Stat.ValueText>{projects.length}</Stat.ValueText>
                        <Stat.HelpText>
                          {pinnedProjects.length} pinned to sidebar
                        </Stat.HelpText>
                      </Stat.Root>
                    </Card.Body>
                  </Card.Root>

                  <Card.Root variant="outline" size="md">
                    <Card.Body>
                      <Stat.Root size="md">
                        <Stat.Label>Assets in Library</Stat.Label>
                        <Stat.ValueText>
                          {activeWorkspace.assetCount}
                        </Stat.ValueText>
                        <Stat.HelpText>{activeWorkspace.season}</Stat.HelpText>
                      </Stat.Root>
                    </Card.Body>
                  </Card.Root>

                  <Card.Root variant="outline" size="md">
                    <Card.Body>
                      <Stat.Root size="md">
                        <Stat.Label>Pending Reviews</Stat.Label>
                        <Stat.ValueText>{pendingReviewsCount}</Stat.ValueText>
                        <Stat.HelpText>
                          Awaiting creative sign-off
                        </Stat.HelpText>
                      </Stat.Root>
                    </Card.Body>
                  </Card.Root>

                  <Card.Root variant="outline" size="md">
                    <Card.Body>
                      <Stat.Root size="md">
                        <Stat.Label>Storage Used</Stat.Label>
                        <Stat.ValueText>
                          {activeWorkspace.storageUsed}
                        </Stat.ValueText>
                        <Stat.HelpText>Of 2.00 TB Studio Pro</Stat.HelpText>
                      </Stat.Root>
                    </Card.Body>
                  </Card.Root>
                </Grid>

                <Card.Root variant="outline" size="md">
                  <Card.Header>
                    <HStack gap="3" wrap="wrap" justify="between">
                      <HStack gap="1.5" wrap="wrap">
                        {(
                          [
                            "all",
                            "active",
                            "in-review",
                            "draft",
                            "blocked",
                          ] as const
                        ).map((stage) => (
                          <Button
                            key={stage}
                            variant={
                              projectStageFilter === stage ? "solid" : "surface"
                            }
                            size="xs"
                            palette={
                              projectStageFilter === stage
                                ? accentPalette
                                : undefined
                            }
                            onClick={() => setProjectStageFilter(stage)}
                          >
                            {stage === "all" ? "All" : stageLabel(stage)}
                          </Button>
                        ))}
                      </HStack>
                      <div {...stylex.props(styles.inlineSearch)}>
                        <Input
                          size="sm"
                          placeholder="Filter projects or owners…"
                          value={projectSearch}
                          onChange={(event) =>
                            setProjectSearch(event.target.value)
                          }
                        />
                      </div>
                    </HStack>
                  </Card.Header>
                  <Card.Body>
                    <div {...stylex.props(styles.tableWrap)}>
                      <Table.Root variant="line" size="md">
                        <Table.Header>
                          <Table.Row>
                            <Table.ColumnHeader>Project</Table.ColumnHeader>
                            <Table.ColumnHeader>Stage</Table.ColumnHeader>
                            <Table.ColumnHeader>Assets</Table.ColumnHeader>
                            <Table.ColumnHeader>Readiness</Table.ColumnHeader>
                            <Table.ColumnHeader>Owner</Table.ColumnHeader>
                            <Table.ColumnHeader>Actions</Table.ColumnHeader>
                          </Table.Row>
                        </Table.Header>
                        <Table.Body>
                          {filteredProjects.map((proj) => (
                            <Table.Row key={proj.id}>
                              <Table.Cell>
                                <VStack gap="0.5">
                                  <Text
                                    render={<span />}
                                    size="sm"
                                    weight="medium"
                                  >
                                    {proj.name}
                                  </Text>
                                  <Text render={<span />} size="xs" tone="muted">
                                    {proj.collection} · Updated {proj.updatedAt}
                                  </Text>
                                </VStack>
                              </Table.Cell>
                              <Table.Cell>
                                <Status.Root
                                  size="sm"
                                  palette={stagePalette(proj.stage)}
                                >
                                  <Status.Indicator />
                                  {stageLabel(proj.stage)}
                                </Status.Root>
                              </Table.Cell>
                              <Table.Cell>{proj.assets}</Table.Cell>
                              <Table.Cell>
                                <VStack gap="1" style={styles.progressCell}>
                                  <Progress.Root
                                    value={proj.readiness}
                                    variant="subtle"
                                    size="xs"
                                    shape="full"
                                    palette={stagePalette(proj.stage)}
                                  >
                                    <Progress.Track>
                                      <Progress.Range />
                                    </Progress.Track>
                                  </Progress.Root>
                                  <Text render={<span />} size="xs" tone="muted">
                                    {proj.readiness}% ready
                                  </Text>
                                </VStack>
                              </Table.Cell>
                              <Table.Cell>
                                <HStack render={<span />} gap="2">
                                  <Avatar.Root size="xs" variant="subtle">
                                    <Avatar.Fallback>
                                      {proj.ownerInitials}
                                    </Avatar.Fallback>
                                  </Avatar.Root>
                                  <span>{proj.owner}</span>
                                </HStack>
                              </Table.Cell>
                              <Table.Cell>
                                <HStack gap="1.5" wrap="wrap">
                                  <Button
                                    variant="ghost"
                                    size="xs"
                                    onClick={() => handleTogglePin(proj)}
                                  >
                                    {proj.pinned ? "Unpin" : "Pin"}
                                  </Button>
                                  <Button
                                    variant="ghost"
                                    size="xs"
                                    palette={redPalette}
                                    onClick={() => setPendingDelete(proj)}
                                  >
                                    Delete
                                  </Button>
                                </HStack>
                              </Table.Cell>
                            </Table.Row>
                          ))}
                        </Table.Body>
                      </Table.Root>
                      {filteredProjects.length === 0 ? (
                        <Text
                          size="sm"
                          tone="muted"
                          align="center"
                          style={styles.emptyStateText}
                        >
                          No projects match the current filter.
                        </Text>
                      ) : null}
                    </div>
                  </Card.Body>
                </Card.Root>
              </>
            ) : null}

            {activeRoute === "reviews" ? (
              <>
                <HStack gap="1.5" wrap="wrap">
                  {(
                    [
                      { id: "all", label: "All proofs" },
                      { id: "pending", label: "Pending" },
                      { id: "changes", label: "Changes requested" },
                      { id: "approved", label: "Approved" },
                    ] as const
                  ).map((tab) => (
                    <Button
                      key={tab.id}
                      variant={reviewFilter === tab.id ? "solid" : "surface"}
                      size="xs"
                      palette={
                        reviewFilter === tab.id ? accentPalette : undefined
                      }
                      onClick={() => setReviewFilter(tab.id)}
                    >
                      {tab.label}
                    </Button>
                  ))}
                </HStack>

                <VStack gap="3">
                  {filteredReviews.map((review) => (
                    <Card.Root key={review.id} variant="outline" size="md">
                      <Card.Body>
                        <HStack
                          gap="4"
                          justify="between"
                          style={styles.reviewCardBody}
                        >
                          <VStack gap="1.5">
                            <HStack gap="1.5" wrap="wrap">
                              <Text
                                render={<span />}
                                size="sm"
                                weight="medium"
                              >
                                {review.assetName}
                              </Text>
                              <Code size="xs">{review.version}</Code>
                              <Badge variant="subtle" size="xs">
                                {review.format}
                              </Badge>
                              <Status.Root
                                size="sm"
                                palette={
                                  review.status === "approved"
                                    ? greenPalette
                                    : review.status === "changes"
                                      ? redPalette
                                      : amberPalette
                                }
                              >
                                <Status.Indicator />
                                {review.status === "approved"
                                  ? "Approved"
                                  : review.status === "changes"
                                    ? "Changes requested"
                                    : "Pending review"}
                              </Status.Root>
                            </HStack>
                            <Text size="sm" tone="muted">
                              {review.note}
                            </Text>
                            <HStack render={<span />} gap="2">
                              <Avatar.Root size="xs" variant="subtle">
                                <Avatar.Fallback>
                                  {review.reviewerInitials}
                                </Avatar.Fallback>
                              </Avatar.Root>
                              <Text render={<span />} size="xs" tone="muted">
                                {review.reviewer} · {review.projectName} ·{" "}
                                {review.submittedAt}
                              </Text>
                            </HStack>
                          </VStack>

                          <HStack gap="1.5" wrap="wrap">
                            {review.status !== "approved" ? (
                              <Button
                                variant="solid"
                                size="xs"
                                palette={greenPalette}
                                onClick={() =>
                                  handleUpdateReview(review, "approved")
                                }
                              >
                                Approve
                              </Button>
                            ) : null}
                            {review.status !== "changes" ? (
                              <Button
                                variant="surface"
                                size="xs"
                                onClick={() =>
                                  handleUpdateReview(review, "changes")
                                }
                              >
                                Request changes
                              </Button>
                            ) : null}
                          </HStack>
                        </HStack>
                      </Card.Body>
                    </Card.Root>
                  ))}
                </VStack>
              </>
            ) : null}

            {activeRoute === "releases" ? (
              <Card.Root variant="outline" size="md">
                <Card.Header>
                  <Card.Title style={styles.cardTitleReset}>
                    Asset Delivery Bundles
                  </Card.Title>
                  <Card.Description style={styles.cardDescReset}>
                    Immutable release snapshots distributed from{" "}
                    {activeWorkspace.name}
                  </Card.Description>
                </Card.Header>
                <Card.Body>
                  <div {...stylex.props(styles.tableWrap)}>
                    <Table.Root variant="line" size="md">
                      <Table.Header>
                        <Table.Row>
                          <Table.ColumnHeader>Bundle</Table.ColumnHeader>
                          <Table.ColumnHeader>Delivery</Table.ColumnHeader>
                          <Table.ColumnHeader>Channel</Table.ColumnHeader>
                          <Table.ColumnHeader>Assets</Table.ColumnHeader>
                          <Table.ColumnHeader>Status</Table.ColumnHeader>
                          <Table.ColumnHeader>Action</Table.ColumnHeader>
                        </Table.Row>
                      </Table.Header>
                      <Table.Body>
                        {releases.map((rel) => (
                          <Table.Row key={rel.id}>
                            <Table.Cell>
                              <Code size="xs">{rel.version}</Code>
                            </Table.Cell>
                            <Table.Cell>
                              <VStack gap="0.5">
                                <Text
                                  render={<span />}
                                  size="sm"
                                  weight="medium"
                                >
                                  {rel.title}
                                </Text>
                                <Text render={<span />} size="xs" tone="muted">
                                  {rel.publishedBy} · {rel.publishedAt}
                                </Text>
                              </VStack>
                            </Table.Cell>
                            <Table.Cell>
                              <Badge variant="subtle" size="xs">
                                {rel.channel}
                              </Badge>
                            </Table.Cell>
                            <Table.Cell>{rel.assetCount}</Table.Cell>
                            <Table.Cell>
                              <Status.Root
                                size="sm"
                                palette={
                                  rel.status === "published"
                                    ? greenPalette
                                    : bluePalette
                                }
                              >
                                <Status.Indicator />
                                {rel.status === "published"
                                  ? "Published"
                                  : "Scheduled"}
                              </Status.Root>
                            </Table.Cell>
                            <Table.Cell>
                              <Button
                                variant="ghost"
                                size="xs"
                                onClick={() =>
                                  queue.info(
                                    `Copied CDN link for ${rel.version}`,
                                    {
                                      description: `https://cdn.looma.studio/${rel.version}/manifest.json`,
                                    },
                                  )
                                }
                              >
                                Copy manifest
                              </Button>
                            </Table.Cell>
                          </Table.Row>
                        ))}
                      </Table.Body>
                    </Table.Root>
                  </div>
                </Card.Body>
              </Card.Root>
            ) : null}

            {activeRoute === "brand-kit" ? (
              <>
                <Card.Root variant="outline" size="md">
                  <Card.Header>
                    <Card.Title style={styles.cardTitleReset}>
                      Color Palette Tokens
                    </Card.Title>
                    <Card.Description style={styles.cardDescReset}>
                      Click any swatch to copy its canonical hex value
                    </Card.Description>
                  </Card.Header>
                  <Card.Body>
                    <Grid gap="3" style={styles.swatchGrid}>
                      {BRAND_COLORS.map((color) => (
                        <button
                          key={color.id}
                          type="button"
                          onClick={() =>
                            queue.info(`Copied ${color.name} (${color.hex})`, {
                              description: `CSS variable: ${color.token}`,
                            })
                          }
                          {...stylex.props(styles.swatchButton)}
                        >
                          <ColorSwatch
                            size="2xl"
                            shape="rounded"
                            style={swatchColors[color.swatchKey]}
                          />
                          <VStack gap="0.5">
                            <Text render={<span />} size="sm" weight="medium">
                              {color.name}
                            </Text>
                            <HStack gap="1.5" wrap="wrap">
                              <Code size="xs">{color.hex}</Code>
                              <Text render={<span />} size="xs" tone="muted">
                                {color.token}
                              </Text>
                            </HStack>
                            <Text render={<span />} size="xs" tone="muted">
                              {color.usage}
                            </Text>
                          </VStack>
                        </button>
                      ))}
                    </Grid>
                  </Card.Body>
                </Card.Root>

                <Card.Root variant="outline" size="md">
                  <Card.Header>
                    <Card.Title style={styles.cardTitleReset}>
                      Typography Specimens
                    </Card.Title>
                    <Card.Description style={styles.cardDescReset}>
                      Display and interface pairing across web and editorial
                      deliverables
                    </Card.Description>
                  </Card.Header>
                  <Card.Body>
                    <Grid gap="4" style={styles.typeSpecimenGrid}>
                      <VStack gap="2" style={styles.specimenBox}>
                        <Badge variant="subtle" size="xs">
                          Heading Scale
                        </Badge>
                        <span {...stylex.props(styles.specimenDisplay)}>
                          Crafted for tactile clarity.
                        </span>
                        <Text render={<span />} size="xs" tone="muted">
                          Tracking -0.02em · Medium / Semibold
                        </Text>
                      </VStack>
                      <VStack gap="2" style={styles.specimenBox}>
                        <Badge variant="subtle" size="xs">
                          Interface Copy
                        </Badge>
                        <Text render={<span />} size="md">
                          Balanced optical readability across dense studio
                          inspectors, review threads, and release notes.
                        </Text>
                        <Text render={<span />} size="xs" tone="muted">
                          Line height 1.5 · Regular / Medium
                        </Text>
                      </VStack>
                    </Grid>
                  </Card.Body>
                </Card.Root>

                <Card.Root variant="outline" size="md">
                  <Card.Header>
                    <Card.Title style={styles.cardTitleReset}>
                      Export Guardrails
                    </Card.Title>
                    <Card.Description style={styles.cardDescReset}>
                      Automated checks enforced when publishing bundles
                    </Card.Description>
                  </Card.Header>
                  <Card.Body>
                    <VStack gap="4">
                      <HStack gap="4" justify="between">
                        <VStack gap="0.5">
                          <Text render={<span />} size="sm" weight="medium">
                            Auto-generate lossless WebP renditions
                          </Text>
                          <Text render={<span />} size="xs" tone="muted">
                            Produce optimized web exports alongside master TIFF
                            uploads.
                          </Text>
                        </VStack>
                        <Switch.Root size="md" palette={accentPalette}>
                          <Switch.Control
                            checked={autoWebp}
                            onCheckedChange={(checked) => {
                              setAutoWebp(checked);
                              queue.info(
                                `Lossless WebP renditions ${checked ? "enabled" : "disabled"}`,
                              );
                            }}
                          />
                        </Switch.Root>
                      </HStack>

                      <Separator />

                      <HStack gap="4" justify="between">
                        <VStack gap="0.5">
                          <Text render={<span />} size="sm" weight="medium">
                            Watermark external client proofs
                          </Text>
                          <Text render={<span />} size="xs" tone="muted">
                            Stamp recipient email and version number on
                            unapproved share links.
                          </Text>
                        </VStack>
                        <Switch.Root size="md" palette={accentPalette}>
                          <Switch.Control
                            checked={watermarkExternal}
                            onCheckedChange={(checked) => {
                              setWatermarkExternal(checked);
                              queue.info(
                                `Proof watermarking ${checked ? "enabled" : "disabled"}`,
                              );
                            }}
                          />
                        </Switch.Root>
                      </HStack>

                      <Separator />

                      <HStack gap="4" justify="between">
                        <VStack gap="0.5">
                          <Text render={<span />} size="sm" weight="medium">
                            Strict CMYK / Display-P3 profile gate
                          </Text>
                          <Text render={<span />} size="xs" tone="muted">
                            Block print bundle releases if an asset lacks an
                            embedded ICC profile.
                          </Text>
                        </VStack>
                        <Switch.Root size="md" palette={accentPalette}>
                          <Switch.Control
                            checked={strictColorProfile}
                            onCheckedChange={(checked) => {
                              setStrictColorProfile(checked);
                              queue.info(
                                `Color profile gate ${checked ? "enabled" : "disabled"}`,
                              );
                            }}
                          />
                        </Switch.Root>
                      </HStack>
                    </VStack>
                  </Card.Body>
                </Card.Root>
              </>
            ) : null}

            {activeRoute === "members" ? (
              <>
                <Card.Root variant="outline" size="md">
                  <Card.Header>
                    <Card.Title style={styles.cardTitleReset}>
                      Invite Collaborator
                    </Card.Title>
                    <Card.Description style={styles.cardDescReset}>
                      Add designers, art directors, or external reviewers to{" "}
                      {activeWorkspace.name}
                    </Card.Description>
                  </Card.Header>
                  <Card.Body>
                    <HStack
                      render={<form onSubmit={handleInviteMember} />}
                      gap="2"
                      wrap="wrap"
                    >
                      <div {...stylex.props(styles.inlineInput)}>
                        <Input
                          size="sm"
                          type="email"
                          placeholder="collaborator@looma.studio"
                          value={inviteEmail}
                          onChange={(event) =>
                            setInviteEmail(event.target.value)
                          }
                        />
                      </div>
                      <HStack gap="1.5" wrap="wrap">
                        {(["Editor", "Reviewer", "Admin"] as const).map(
                          (role) => (
                            <Button
                              key={role}
                              type="button"
                              variant={
                                inviteRole === role ? "solid" : "surface"
                              }
                              size="xs"
                              palette={
                                inviteRole === role ? accentPalette : undefined
                              }
                              onClick={() => setInviteRole(role)}
                            >
                              {role}
                            </Button>
                          ),
                        )}
                      </HStack>
                      <Button
                        type="submit"
                        variant="solid"
                        size="sm"
                        palette={accentPalette}
                      >
                        Send invite
                      </Button>
                    </HStack>
                  </Card.Body>
                </Card.Root>

                <Card.Root variant="outline" size="md">
                  <Card.Header>
                    <Card.Title style={styles.cardTitleReset}>
                      Studio Directory ({members.length})
                    </Card.Title>
                  </Card.Header>
                  <Card.Body>
                    <div {...stylex.props(styles.tableWrap)}>
                      <Table.Root variant="line" size="md">
                        <Table.Header>
                          <Table.Row>
                            <Table.ColumnHeader>Member</Table.ColumnHeader>
                            <Table.ColumnHeader>Role</Table.ColumnHeader>
                            <Table.ColumnHeader>Status</Table.ColumnHeader>
                            <Table.ColumnHeader>Activity</Table.ColumnHeader>
                            <Table.ColumnHeader>Action</Table.ColumnHeader>
                          </Table.Row>
                        </Table.Header>
                        <Table.Body>
                          {members.map((member) => (
                            <Table.Row key={member.id}>
                              <Table.Cell>
                                <HStack render={<span />} gap="2">
                                  <Avatar.Root
                                    size="sm"
                                    variant="subtle"
                                    palette={
                                      member.role === "Admin"
                                        ? accentPalette
                                        : undefined
                                    }
                                  >
                                    <Avatar.Fallback>
                                      {member.initials}
                                    </Avatar.Fallback>
                                  </Avatar.Root>
                                  <VStack render={<span />} gap="0.5">
                                    <Text
                                      render={<span />}
                                      size="sm"
                                      weight="medium"
                                    >
                                      {member.name}
                                    </Text>
                                    <Text
                                      render={<span />}
                                      size="xs"
                                      tone="muted"
                                    >
                                      {member.email}
                                    </Text>
                                  </VStack>
                                </HStack>
                              </Table.Cell>
                              <Table.Cell>
                                <Badge variant="subtle" size="xs">
                                  {member.role}
                                </Badge>
                              </Table.Cell>
                              <Table.Cell>
                                <Status.Root
                                  size="sm"
                                  palette={
                                    member.status === "active"
                                      ? greenPalette
                                      : amberPalette
                                  }
                                >
                                  <Status.Indicator />
                                  {member.status === "active"
                                    ? "Active"
                                    : "Pending invite"}
                                </Status.Root>
                              </Table.Cell>
                              <Table.Cell>
                                <Text render={<span />} size="xs" tone="muted">
                                  {member.lastActive}
                                </Text>
                              </Table.Cell>
                              <Table.Cell>
                                {member.status === "invited" ? (
                                  <Button
                                    variant="ghost"
                                    size="xs"
                                    onClick={() =>
                                      queue.info(
                                        `Resent invite to ${member.email}`,
                                      )
                                    }
                                  >
                                    Resend
                                  </Button>
                                ) : (
                                  <Button
                                    variant="ghost"
                                    size="xs"
                                    onClick={() =>
                                      queue.info(
                                        `Opened permissions for ${member.name}`,
                                      )
                                    }
                                  >
                                    Manage
                                  </Button>
                                )}
                              </Table.Cell>
                            </Table.Row>
                          ))}
                        </Table.Body>
                      </Table.Root>
                    </div>
                  </Card.Body>
                </Card.Root>
              </>
            ) : null}

            {activeRoute === "billing" ? (
              <>
                <Card.Root variant="outline" size="md">
                  <Card.Header style={styles.cardHeaderRow}>
                    <VStack gap="1">
                      <HStack gap="1.5" wrap="wrap">
                        <Card.Title style={styles.cardTitleReset}>
                          Studio Pro Plan
                        </Card.Title>
                        <Badge
                          variant="subtle"
                          size="xs"
                          palette={greenPalette}
                        >
                          Active
                        </Badge>
                      </HStack>
                      <Card.Description style={styles.cardDescReset}>
                        Renews on Dec 31, 2026 · Mastercard ending in 9104
                      </Card.Description>
                    </VStack>
                    <HStack align="baseline" gap="2">
                      <Text
                        render={<span />}
                        size="2xl"
                        weight="semibold"
                        style={styles.planPrice}
                      >
                        $89
                      </Text>
                      <Text render={<span />} size="xs" tone="muted">
                        / month
                      </Text>
                    </HStack>
                  </Card.Header>
                  <Card.Footer>
                    <Button
                      variant="solid"
                      size="sm"
                      palette={accentPalette}
                      onClick={() =>
                        queue.info("Agency tier comparison opened", {
                          description:
                            "Includes 10 TB vault storage, SSO, and unlimited client guest links.",
                        })
                      }
                    >
                      Upgrade to Agency
                    </Button>
                    <Button
                      variant="surface"
                      size="sm"
                      onClick={() =>
                        queue.info("Billing portal opened", {
                          description:
                            "Update cards, tax IDs, and invoice recipients.",
                        })
                      }
                    >
                      Update payment method
                    </Button>
                  </Card.Footer>
                </Card.Root>

                <Card.Root variant="outline" size="md">
                  <Card.Header>
                    <Card.Title style={styles.cardTitleReset}>
                      Monthly Storage &amp; Delivery Quotas
                    </Card.Title>
                    <Card.Description style={styles.cardDescReset}>
                      Cycle Nov 1 – Nov 30, 2026
                    </Card.Description>
                  </Card.Header>
                  <Card.Body>
                    <Grid gap="4" style={styles.quotaGrid}>
                      {BILLING_QUOTAS.map((quota) => (
                        <VStack key={quota.label} gap="2">
                          <HStack justify="between">
                            <Text render={<span />} size="sm" weight="medium">
                              {quota.label}
                            </Text>
                            <Text render={<span />} size="xs" tone="muted">
                              {quota.used} / {quota.limit}
                            </Text>
                          </HStack>
                          <Progress.Root
                            value={quota.percent}
                            variant="subtle"
                            size="sm"
                            shape="full"
                            palette={
                              quota.percent >= 80 ? amberPalette : accentPalette
                            }
                          >
                            <Progress.Track>
                              <Progress.Range />
                            </Progress.Track>
                          </Progress.Root>
                        </VStack>
                      ))}
                    </Grid>
                  </Card.Body>
                </Card.Root>

                <Card.Root variant="outline" size="md">
                  <Card.Header>
                    <Card.Title style={styles.cardTitleReset}>
                      Recent Invoices
                    </Card.Title>
                  </Card.Header>
                  <Card.Body>
                    <div {...stylex.props(styles.tableWrap)}>
                      <Table.Root variant="line" size="md">
                        <Table.Header>
                          <Table.Row>
                            <Table.ColumnHeader>Invoice</Table.ColumnHeader>
                            <Table.ColumnHeader>Period</Table.ColumnHeader>
                            <Table.ColumnHeader>Amount</Table.ColumnHeader>
                            <Table.ColumnHeader>Status</Table.ColumnHeader>
                            <Table.ColumnHeader>Receipt</Table.ColumnHeader>
                          </Table.Row>
                        </Table.Header>
                        <Table.Body>
                          {INVOICES.map((inv) => (
                            <Table.Row key={inv.id}>
                              <Table.Cell>
                                <Code size="xs">{inv.id}</Code>
                              </Table.Cell>
                              <Table.Cell>{inv.period}</Table.Cell>
                              <Table.Cell>{inv.amount}</Table.Cell>
                              <Table.Cell>
                                <Badge
                                  variant="subtle"
                                  size="xs"
                                  palette={greenPalette}
                                >
                                  {inv.status}
                                </Badge>
                              </Table.Cell>
                              <Table.Cell>
                                <Button
                                  variant="ghost"
                                  size="xs"
                                  onClick={() =>
                                    queue.success(`Downloaded ${inv.id}.pdf`)
                                  }
                                >
                                  Download PDF
                                </Button>
                              </Table.Cell>
                            </Table.Row>
                          ))}
                        </Table.Body>
                      </Table.Root>
                    </div>
                  </Card.Body>
                </Card.Root>
              </>
            ) : null}
          </VStack>
        </AppShell.Main>
      </AppShell.Content>

      <Drawer.Root
        open={mobileNavOpen}
        onOpenChange={setMobileNavOpen}
        placement="start"
        size="xs"
      >
        <Drawer.Backdrop />
        <Drawer.Content>
          <Drawer.Header>
            <HStack gap="2">{renderWorkspaceSwitcher(false)}</HStack>
            <Drawer.Close
              render={
                <IconButton
                  variant="ghost"
                  size="xs"
                  aria-label="Close navigation drawer"
                />
              }
            >
              <Icon
                size="sm"
                viewBox="0 0 16 16"
                fill="none"
                stroke="currentColor"
                strokeWidth="1.6"
                strokeLinecap="round"
                aria-hidden="true"
              >
                <path d="m4 4 8 8" />
                <path d="m12 4-8 8" />
              </Icon>
            </Drawer.Close>
          </Drawer.Header>
          <Separator />
          <Drawer.Body style={styles.drawerBody}>
            {renderSidebarNavigation(false)}
          </Drawer.Body>
          <Drawer.Footer style={styles.drawerFooter}>
            {renderUserFooterMenu(false)}
          </Drawer.Footer>
        </Drawer.Content>
      </Drawer.Root>

      <Dialog.Root
        open={searchOpen}
        onOpenChange={(next) => {
          setSearchOpen(next);
          if (!next) setSearchQuery("");
        }}
        size="md"
        placement="top"
      >
        <Dialog.Backdrop />
        <Dialog.Content>
          <Dialog.Header>
            <Dialog.Title>Jump to Route, Collection, or Action</Dialog.Title>
          </Dialog.Header>
          <Dialog.Body style={styles.dialogFormBody}>
            <Input
              size="md"
              placeholder="Search Looma Studio routes, workspaces, or pinned collections…"
              value={searchQuery}
              onChange={(event) => setSearchQuery(event.target.value)}
              autoFocus
            />
            <VStack gap="1" style={styles.paletteResults}>
              {paletteCommands.map((cmd) => (
                <button
                  key={cmd.id}
                  type="button"
                  onClick={() => {
                    cmd.run();
                    setSearchOpen(false);
                    setSearchQuery("");
                  }}
                  {...stylex.props(styles.paletteItem)}
                >
                  <HStack render={<span />} gap="2.5">
                    <Badge variant="subtle" size="xs">
                      {cmd.category}
                    </Badge>
                    <span>{cmd.label}</span>
                  </HStack>
                  {cmd.hint ? (
                    <Text render={<span />} size="xs" tone="muted">
                      {cmd.hint}
                    </Text>
                  ) : null}
                </button>
              ))}
              {paletteCommands.length === 0 ? (
                <Text
                  size="sm"
                  tone="muted"
                  align="center"
                  style={styles.emptyStateText}
                >
                  No matches for &ldquo;{searchQuery}&rdquo;.
                </Text>
              ) : null}
            </VStack>
          </Dialog.Body>
          <Dialog.Footer>
            <Button
              variant="ghost"
              size="sm"
              onClick={() => {
                setSearchOpen(false);
                setSearchQuery("");
              }}
            >
              Close
            </Button>
          </Dialog.Footer>
        </Dialog.Content>
      </Dialog.Root>

      <Dialog.Root
        open={newProjectOpen}
        onOpenChange={setNewProjectOpen}
        size="sm"
        placement="center"
      >
        <Dialog.Backdrop />
        <Dialog.Content>
          <Dialog.Header>
            <Dialog.Title>Create Studio Project</Dialog.Title>
          </Dialog.Header>
          <form onSubmit={handleCreateProject}>
            <Dialog.Body style={styles.dialogFormBody}>
              <VStack gap="1.5">
                <Text
                  render={<label htmlFor="looma-project-name" />}
                  variant="label"
                  size="sm"
                >
                  Project name
                </Text>
                <Input
                  id="looma-project-name"
                  size="md"
                  placeholder="e.g. Winter Capsule Film"
                  value={newProjectName}
                  onChange={(event) => setNewProjectName(event.target.value)}
                  autoFocus
                />
              </VStack>
              <VStack gap="1.5">
                <Text
                  render={<label htmlFor="looma-project-collection" />}
                  variant="label"
                  size="sm"
                >
                  Collection type
                </Text>
                <Input
                  id="looma-project-collection"
                  size="md"
                  placeholder="Editorial, Photography, Video, Print…"
                  value={newProjectCollection}
                  onChange={(event) =>
                    setNewProjectCollection(event.target.value)
                  }
                />
              </VStack>
            </Dialog.Body>
            <Dialog.Footer>
              <Button
                type="button"
                variant="ghost"
                size="sm"
                onClick={() => setNewProjectOpen(false)}
              >
                Cancel
              </Button>
              <Button
                type="submit"
                variant="solid"
                size="sm"
                palette={accentPalette}
              >
                Create &amp; pin
              </Button>
            </Dialog.Footer>
          </form>
        </Dialog.Content>
      </Dialog.Root>

      <AlertDialog.Root
        open={pendingDelete !== null}
        onOpenChange={(open) => {
          if (!open) setPendingDelete(null);
        }}
        size="sm"
      >
        <AlertDialog.Backdrop />
        <AlertDialog.Content>
          <AlertDialog.Header>
            <AlertDialog.Icon palette={redPalette}>
              <Icon
                size="md"
                viewBox="0 0 20 20"
                fill="none"
                stroke="currentColor"
                strokeWidth="1.6"
                strokeLinecap="round"
                strokeLinejoin="round"
                aria-hidden="true"
              >
                <path d="M10 3.25 17 16H3L10 3.25Z" />
                <path d="M10 8v3.5" />
                <path d="M10 14h.01" />
              </Icon>
            </AlertDialog.Icon>
            <AlertDialog.Title>
              Delete &ldquo;{pendingDelete?.name}&rdquo;?
            </AlertDialog.Title>
          </AlertDialog.Header>
          <AlertDialog.Body>
            <AlertDialog.Description>
              This removes the project from {activeWorkspace.name} and unpins it
              from the left sidebar rail. You can recreate it anytime in this
              demo.
            </AlertDialog.Description>
          </AlertDialog.Body>
          <AlertDialog.Footer>
            <AlertDialog.Cancel render={<Button variant="surface" size="sm" />}>
              Cancel
            </AlertDialog.Cancel>
            <Button
              variant="solid"
              size="sm"
              palette={redPalette}
              onClick={handleConfirmDelete}
            >
              Delete project
            </Button>
          </AlertDialog.Footer>
        </AlertDialog.Content>
      </AlertDialog.Root>

      <Toaster toaster={queue} />
    </AppShell.Root>
  );
}
```

Credit: Inspired by [Side Nav](https://astryx.atmeta.com/playground?template=shell-side-nav) from Astryx (MIT License · Copyright (c) 2026 Meta Platforms, Inc.)
